X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Freplies.php;h=cca43023097c2f11ff5806cf629488cd88831bd9;hb=131292472c4bca7e99ee821ae62853f36f4c7bef;hp=d7ed440e9237d0a32fd814eb1dd99269ad6393f9;hpb=92f095f589b3fc4ab40f72f873d6a7a189b63a96;p=quix0rs-gnu-social.git diff --git a/actions/replies.php b/actions/replies.php index d7ed440e92..cca4302309 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -1,6 +1,6 @@ . * * @category Personal - * @package Laconica - * @author Evan Prodromou - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,15 +39,16 @@ require_once INSTALLDIR.'/lib/feedlist.php'; * List of replies * * @category Personal - * @package Laconica - * @author Evan Prodromou + * @package StatusNet + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class RepliesAction extends OwnerDesignAction { var $page = null; + var $notice; /** * Prepare the object @@ -84,6 +85,13 @@ class RepliesAction extends OwnerDesignAction common_set_returnto($this->selfUrl()); + $this->notice = $this->user->getReplies(($this->page-1) * NOTICES_PER_PAGE, + NOTICES_PER_PAGE + 1); + + if($this->page > 1 && $this->notice->N == 0){ + $this->serverError(_('No such page'),$code=404); + } + return true; } @@ -159,10 +167,7 @@ class RepliesAction extends OwnerDesignAction function showContent() { - $notice = $this->user->getReplies(($this->page-1) * NOTICES_PER_PAGE, - NOTICES_PER_PAGE + 1); - - $nl = new NoticeList($notice, $this); + $nl = new NoticeList($this->notice, $this); $cnt = $nl->show(); if (0 === $cnt) { @@ -187,7 +192,9 @@ class RepliesAction extends OwnerDesignAction } } else { - $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname); + $message .= sprintf(_('Why not [register an account](%%%%action.%s%%%%) and then nudge %s or post a notice to his or her attention.'), + (!common_config('site','openidonly')) ? 'register' : 'openidlogin', + $this->user->nickname); } $this->elementStart('div', 'guide');