You are here

function theme_activity_feed in Activity 5

Same name and namespace in other branches
  1. 5.2 activity.module \theme_activity_feed()
1 theme call to theme_activity_feed()
activity_feed in ./activity.module
menu callback to return a feed of a signed in user's activity page

File

./activity.module, line 337
Activity module: Allow users to see their friends' activity on the site.

Code

function theme_activity_feed($buddy_activity) {
  global $base_url;
  $channel = array(
    'version' => '2.0',
    'title' => variable_get('site_name', 'drupal') . ' - ' . variable_get('site_slogan', ''),
    'link' => $base_url,
    'description' => variable_get('site_mission', ''),
    'language' => $GLOBALS['locale'],
  );
  arsort($buddy_activity);
  if (!empty($buddy_activity)) {
    foreach ($buddy_activity as $ba) {
      $item_title = $ba->module;
      $item_tokens = unserialize($ba->tokens);
      $link = l($item_tokens['node-title'], 'node/' . $item_tokens['node-id']);
      $item_text = activity_token_replace($ba);
      $items .= format_rss_item($item->title, $link, $item_text);
    }
  }
  $output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
  $output .= "<rss version=\"" . $channel["version"] . "\" xml:base=\"" . $base_url . "\">\n";
  $output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language']);
  $output .= "</rss>\n";
  return $output;
}