3 * Laconica, the distributed open-source microblogging tool
5 * List a user's subscribers
9 * LICENCE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * @author Evan Prodromou <evan@controlyourself.ca>
25 * @author Sarven Capadisli <csarven@controlyourself.ca>
26 * @copyright 2008-2009 Control Yourself, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://laconi.ca/
31 if (!defined('LACONICA')) {
36 * List a user's subscribers
40 * @author Evan Prodromou <evan@controlyourself.ca>
41 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
42 * @link http://laconi.ca/
45 class SubscribersAction extends GalleryAction
49 if ($this->page == 1) {
50 return sprintf(_('%s subscribers'), $this->user->nickname);
52 return sprintf(_('%s subscribers, page %d'),
53 $this->user->nickname,
58 function showPageNotice()
60 $user =& common_current_user();
61 if ($user && ($user->id == $this->profile->id)) {
62 $this->element('p', null,
63 _('These are the people who listen to '.
66 $this->element('p', null,
67 sprintf(_('These are the people who '.
68 'listen to %s\'s notices.'),
69 $this->profile->nickname));
73 function showContent()
75 $offset = ($this->page-1) * PROFILES_PER_PAGE;
76 $limit = PROFILES_PER_PAGE + 1;
79 $subscribers = $this->user->getTaggedSubscribers($this->tag, $offset, $limit);
81 $subscribers = $this->user->getSubscribers($offset, $limit);
85 $subscribers_list = new SubscribersList($subscribers, $this->user, $this);
86 $subscribers_list->show();
91 $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
92 $this->page, 'subscribers',
93 array('nickname' => $this->user->nickname));
97 class SubscribersList extends ProfileList
99 function showOwnerControls($profile)
101 $bf = new BlockForm($this->out, $profile,
102 array('action' => 'subscribers',
103 'nickname' => $this->owner->nickname));
107 function isReadOnly()