handle empty subscription list
darcs-hash:20080517192447-84dde-f8dc1f4befde5d7624887b13eb7f5730f693c72c.gz
This commit is contained in:
parent
726e8fdaf7
commit
30089235e0
@ -140,33 +140,36 @@ class ShowstreamAction extends StreamAction {
|
|||||||
|
|
||||||
# XXX: add a limit
|
# XXX: add a limit
|
||||||
$subs = $profile->getLink('id', 'subscription', 'subscriber');
|
$subs = $profile->getLink('id', 'subscription', 'subscriber');
|
||||||
|
|
||||||
common_element_start('div', 'subscriptions');
|
common_element_start('div', 'subscriptions');
|
||||||
|
|
||||||
$cnt = 0;
|
$cnt = 0;
|
||||||
|
|
||||||
while ($subs->fetch()) {
|
if ($subs) {
|
||||||
$cnt++;
|
while ($subs->fetch()) {
|
||||||
if ($cnt % SUBSCRIPTIONS_PER_ROW == 1) {
|
$cnt++;
|
||||||
common_element_start('div', 'row');
|
if ($cnt % SUBSCRIPTIONS_PER_ROW == 1) {
|
||||||
}
|
common_element_start('div', 'row');
|
||||||
|
}
|
||||||
|
|
||||||
common_element_start('a', array('title' => $subs->fullname ||
|
common_element_start('a', array('title' => $subs->fullname ||
|
||||||
$subs->nickname,
|
$subs->nickname,
|
||||||
'href' => $subs->profileurl,
|
'href' => $subs->profileurl,
|
||||||
'class' => 'subscription'));
|
'class' => 'subscription'));
|
||||||
$avatar = $subs->getAvatar(AVATAR_MINI_SIZE);
|
$avatar = $subs->getAvatar(AVATAR_MINI_SIZE);
|
||||||
common_element('img', array('src' => (($avatar) ? $avatar->url : DEFAULT_MINI_AVATAR),
|
common_element('img', array('src' => (($avatar) ? $avatar->url : DEFAULT_MINI_AVATAR),
|
||||||
'width' => AVATAR_MINI_SIZE,
|
'width' => AVATAR_MINI_SIZE,
|
||||||
'height' => AVATAR_MINI_SIZE,
|
'height' => AVATAR_MINI_SIZE,
|
||||||
'class' => 'avatar mini'));
|
'class' => 'avatar mini'));
|
||||||
common_element_end('a');
|
common_element_end('a');
|
||||||
|
|
||||||
if ($cnt % SUBSCRIPTIONS_PER_ROW == 0) {
|
if ($cnt % SUBSCRIPTIONS_PER_ROW == 0) {
|
||||||
common_element_end('div');
|
common_element_end('div');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cnt == SUBSCRIPTIONS) {
|
if ($cnt == SUBSCRIPTIONS) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user