3 class AllAction extends ShowstreamAction {
5 // XXX: push this up to a common function.
7 function show_notices($profile) {
9 $notice = DB_DataObject::factory('notice');
11 # XXX: chokety and bad
13 $notice->whereAdd('EXISTS (SELECT subscribed from subscription where subscriber = {$profile->id})', 'OR');
14 $notice->whereAdd('profile_id = {$profile->id}', 'OR');
16 $notice->orderBy('created DESC');
18 $page = $this->arg('page') || 1;
20 $notice->limit((($page-1)*NOTICES_PER_PAGE) + 1, NOTICES_PER_PAGE);
24 common_start_element('div', 'notices');
26 while ($notice->fetch()) {
27 $this->show_notice($notice);
30 common_end_element('div');