X-Git-Url: https://git.mxchange.org/?p=quix0rs-gnu-social.git;a=blobdiff_plain;f=lib%2Fnoticestreamaction.php;fp=lib%2Fnoticestreamaction.php;h=fb592915a7cd3ac9defdbbc7ba519021b3e04a5a;hp=0000000000000000000000000000000000000000;hb=4160a3fb730113f3d712bd777884c4b0482f6df1;hpb=abd90bbdf562614755802885dfb5673645df8575 diff --git a/lib/noticestreamaction.php b/lib/noticestreamaction.php new file mode 100644 index 0000000000..fb592915a7 --- /dev/null +++ b/lib/noticestreamaction.php @@ -0,0 +1,39 @@ +doPreparation() gives us + $this->doStreamPreparation(); + + // fetch the actual stream stuff + try { + $stream = $this->getStream(); + $this->notice = $stream->getNotices(($this->page-1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); + } catch (PrivateStreamException $e) { + $this->notice = new Notice(); + $this->notice->whereAdd('FALSE'); + } + + if ($this->page > 1 && $this->notice->N == 0) { + // TRANS: Client error when page not found (404). + $this->clientError(_('No such page.'), 404); + } + + return true; + } + + protected function doStreamPreparation() + { + // pass by default + } + + // this fetches the NoticeStream + abstract public function getStream(); +}