X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fsubscribed.php;h=160267838927b8f0ff47ab471fc52da6927292a2;hb=82c05d389ab0a0bb64a339d0cf3547d3c6ada3ae;hp=158e34f9d08cadd9c556823ed250b0677bf805a6;hpb=793d48dc9e1d73d871bf34d9f7c1da8916134d1b;p=quix0rs-gnu-social.git diff --git a/actions/subscribed.php b/actions/subscribed.php index 158e34f9d0..1602678389 100644 --- a/actions/subscribed.php +++ b/actions/subscribed.php @@ -1,18 +1,18 @@ . */ @@ -22,7 +22,7 @@ if (!defined('LACONICA')) { exit(1); } class SubscribedAction extends Action { # Who is subscribed to a given user? - + function handle($args) { parent::handle($args); $nickname = $this->arg('nickname'); @@ -34,65 +34,71 @@ class SubscribedAction extends Action { if (!$user) { $this->no_such_user(); } - + $page = $this->arg('page') || 1; + common_show_header($profile->nickname . ": " . _t('Subscribers')); $this->show_subscribed($profile, $page); + common_show_footer(); } function show_subscribed($profile, $page) { $subs = DB_DataObject::factory('subscription'); $subs->subscribed = $profile->id; - + # We ask for an extra one to know if we need to do another page - + $subs->limit((($page-1)*SUBSCRIPTIONS_PER_PAGE)+1, SUBSCRIPTIONS_PER_PAGE + 1); $subs_count = $subs->find(); - + common_element_start('div', 'subscriptions'); - + $idx = 0; - + while ($subs->fetch()) { $idx++; if ($idx % SUBSCRIPTIONS_PER_ROW == 1) { common_element_start('div', 'row'); } - common_element_start('a', array('title' => $subs->fullname || - $subs->nickname, + common_element_start('a', array('title' => ($subs->fullname) ? + $subs->fullname : + $subs->nickname, 'href' => $subs->profileurl, 'class' => 'subscription')); $avatar = $subs->getAvatar(AVATAR_STREAM_SIZE); common_element('img', array('src' => (($avatar) ? $avatar->url : DEFAULT_STREAM_AVATAR), 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, - 'class' => 'avatar stream')); + 'class' => 'avatar stream', + 'alt' => ($subs->fullname) ? + $subs->fullname : + $subs->nickname)); common_element_end('a'); # XXX: subscribe form here - + if ($idx % SUBSCRIPTIONS_PER_ROW == 0) { common_element_end('div'); } - + if ($idx == SUBSCRIPTIONS_PER_PAGE) { break; } } if ($page > 1) { - common_element('a', array('href' => + common_element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname, 'page' => $page - 1)), 'class' => 'prev'), _t('Previous')); } - + if ($subs_count > SUBSCRIPTIONS_PER_PAGE) { - common_element('a', array('href' => + common_element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname, 'page' => $page + 1)),