We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit d3d5942a authored by Evan Prodromou's avatar Evan Prodromou

change arguments to Notice::publicStream

darcs-hash:20080928132747-5ed1f-9e9b6d8b91f855758ca4b269418f6d5d6e4a2ae0.gz
parent 3544fca9
...@@ -60,7 +60,8 @@ class PublicAction extends StreamAction { ...@@ -60,7 +60,8 @@ class PublicAction extends StreamAction {
function show_notices($page) { function show_notices($page) {
$cnt = 0; $cnt = 0;
$notice = Notice::publicStream($page); $notice = Notice::publicStream(($page-1)*NOTICES_PER_PAGE,
NOTICES_PER_PAGE + 1);
if ($notice) { if ($notice) {
common_element_start('ul', array('id' => 'notices')); common_element_start('ul', array('id' => 'notices'));
......
...@@ -290,7 +290,7 @@ class Notice extends Memcached_DataObject ...@@ -290,7 +290,7 @@ class Notice extends Memcached_DataObject
return $wrapper; return $wrapper;
} }
function publicStream($page) { function publicStream($offset=0, $limit=20) {
$qry = 'SELECT * FROM notice '; $qry = 'SELECT * FROM notice ';
...@@ -300,7 +300,7 @@ class Notice extends Memcached_DataObject ...@@ -300,7 +300,7 @@ class Notice extends Memcached_DataObject
return Notice::getStream($qry, return Notice::getStream($qry,
'public', 'public',
($page-1)*NOTICES_PER_PAGE, $offset, $limit);
NOTICES_PER_PAGE + 1); );
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment