summaryrefslogtreecommitdiff
path: root/actions/all.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-08 22:16:04 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-08 22:16:04 -0400
commitf0a30cc89ddf82e3c774800d24f0ea3664065d9c (patch)
tree13053422786e83ab57a55e63879e5ceb07d9ecfd /actions/all.php
parent2df28057cdd5c54fb4f754f5c2222154efe2ad5b (diff)
read-only stuff
darcs-hash:20080509021604-84dde-f785fc09dd435fc12741b3a75184e2425721d03d.gz
Diffstat (limited to 'actions/all.php')
-rw-r--r--actions/all.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/actions/all.php b/actions/all.php
new file mode 100644
index 000000000..fa1be8c96
--- /dev/null
+++ b/actions/all.php
@@ -0,0 +1,32 @@
+<?php
+
+class AllAction extends ShowstreamAction {
+
+ // XXX: push this up to a common function.
+
+ function show_notices($profile) {
+
+ $notice = DB_DataObject::factory('notice');
+
+ # XXX: chokety and bad
+
+ $notice->whereAdd('EXISTS (SELECT subscribed from subscription where subscriber = {$profile->id})', 'OR');
+ $notice->whereAdd('profile_id = {$profile->id}', 'OR');
+
+ $notice->orderBy('created DESC');
+
+ $page = $this->arg('page') || 1;
+
+ $notice->limit((($page-1)*NOTICES_PER_PAGE) + 1, NOTICES_PER_PAGE);
+
+ $notice->find();
+
+ common_start_element('div', 'notices');
+
+ while ($notice->fetch()) {
+ $this->show_notice($notice);
+ }
+
+ common_end_element('div');
+ }
+}