You are here

function ogactivity_page in Activity 6

Same name and namespace in other branches
  1. 5.4 contrib/ogactivity/ogactivity.module \ogactivity_page()

Menu callback for displaying site or user activity as full page.

1 string reference to 'ogactivity_page'
ogactivity_menu in contrib/ogactivity/ogactivity.module
Implementation of hook_menu().

File

contrib/ogactivity/ogactivity.module, line 146

Code

function ogactivity_page() {
  global $user;
  $result = db_query("\nSELECT \n  DISTINCT(og.uid) \nFROM \n  {og_uid} og \nINNER JOIN \n  {og_uid} og2 ON og.nid = og2.nid AND \n  og.uid != %d AND \n  og2.uid = %d \nINNER JOIN \n  {activity_targets} at ON og.uid = at.target_uid \nINNER JOIN \n  {activity} a ON at.aid = a.aid \nWHERE \n   at.target_role = 'author'", $user->uid, $user->uid);
  while ($row = db_fetch_object($result)) {
    $users[] = $row->uid;
  }
  $activities = array();
  if ($users) {
    $activities = activity_get_activity($users, NULL, variable_get('activity_page_pager', 20));
  }
  $table = theme('activity_table', $activities);
  return theme('activity_page', $activities, $table);
}