X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ffavorited.php;h=150b67b0b09451f752d226486031de07852e32b7;hb=5b0809f4a3619e8123b486f7e910913dc4e10086;hp=27da25435b7921c8dc3972cfa88382838a475a12;hpb=5385692ff37e619de29e3c811a01c1a62414dd6f;p=quix0rs-gnu-social.git diff --git a/actions/favorited.php b/actions/favorited.php index 27da25435b..150b67b0b0 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -1,6 +1,6 @@ . * * @category Public - * @package Laconica - * @author Zach Copley - * @author Evan Prodromou - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Zach Copley + * @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); } @@ -42,11 +42,11 @@ require_once INSTALLDIR.'/lib/noticelist.php'; * is measured by * * @category Personal - * @package Laconica - * @author Zach Copley - * @author Evan Prodromou + * @package StatusNet + * @author Zach Copley + * @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 FavoritedAction extends Action @@ -85,7 +85,7 @@ class FavoritedAction extends Action * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } @@ -104,9 +104,9 @@ class FavoritedAction extends Action { parent::prepare($args); $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; - + common_set_returnto($this->selfUrl()); - + return true; } @@ -143,13 +143,10 @@ class FavoritedAction extends Action $this->elementStart('div', 'instructions'); $this->raw($output); $this->elementEnd('div'); + } - $favorite = new Fave; - - if ($favorite->count()) { - return; - } - + function showEmptyList() + { $message = _('Favorite notices appear on this page but no one has favorited one yet.') . ' '; if (common_logged_in()) { @@ -197,7 +194,7 @@ class FavoritedAction extends Action $qry = 'SELECT notice.*, '. $weightexpr . ' as weight ' . 'FROM notice JOIN fave ON notice.id = fave.notice_id ' . - 'GROUP BY id,profile_id,uri,content,rendered,url,created,notice.modified,reply_to,is_local,source ' . + 'GROUP BY id,profile_id,uri,content,rendered,url,created,notice.modified,reply_to,is_local,source,notice.conversation ' . 'ORDER BY weight DESC'; $offset = ($this->page - 1) * NOTICES_PER_PAGE; @@ -217,6 +214,10 @@ class FavoritedAction extends Action $cnt = $nl->show(); + if ($cnt == 0) { + $this->showEmptyList(); + } + $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'favorited'); }