You are here

function _spaces_calendar_feed_links in Spaces 5.2

Same name and namespace in other branches
  1. 5 spaces_calendar/spaces_calendar.module \_spaces_calendar_feed_links()

Helper function to display feed links in calendar view footers

File

spaces_calendar/spaces_calendar.module, line 236

Code

function _spaces_calendar_feed_links() {
  $links = array();
  $space = spaces_get_space();
  $feedtype = variable_get('spaces_calendar_feed_nodetype', '');
  if ($space && $feedtype) {
    $results = db_query("SELECT nr.title, n.nid\n      FROM {node} n\n        LEFT JOIN {node_revisions} nr ON n.vid = nr.vid\n        JOIN {og_ancestry} og ON n.nid = og.nid\n      WHERE n.type = '%s'\n        AND n.status = 1\n        AND og.group_nid = %d\n      ORDER BY nr.title ASC", $feedtype, $space->sid);
    while ($feed = db_fetch_object($results)) {
      $crayon = theme('crayon', $feed->nid);
      $links[] = array(
        'title' => "<span class='crayon-marker crayon-{$crayon}'></span> " . $feed->title,
        'html' => true,
      );
    }
  }
  return $links;
}