X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshowstream.php;h=d9637c377520da50621b0780c6395405ceaac8d9;hb=4aedce6864eb27a0c37b3dcae22fee0aa16ae537;hp=2fc5184c38ece9ae707d4899aa4af06be29e8b74;hpb=ad7aa68a9917c9b53c8974f9002699a8efab54ee;p=quix0rs-gnu-social.git diff --git a/actions/showstream.php b/actions/showstream.php index 2fc5184c38..d9637c3775 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -113,27 +113,26 @@ class ShowstreamAction extends StreamAction { function show_personal($profile) { $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - if ($avatar) { - common_element_start('div', array('id' => 'profile_avatar')); - common_element('img', array('src' => $avatar->url, - 'class' => 'avatar profile', - 'width' => AVATAR_PROFILE_SIZE, - 'height' => AVATAR_PROFILE_SIZE, - 'alt' => $profile->nickname)); - $cur = common_current_user(); - if ($cur) { - if ($cur->id != $profile->id) { - if ($cur->isSubscribed($profile)) { - $this->show_unsubscribe_form($profile); - } else { - $this->show_subscribe_form($profile); - } + common_element_start('div', array('id' => 'profile_avatar')); + common_element('img', array('src' => ($avatar) ? $avatar->url : common_default_avatar(AVATAR_PROFILE_SIZE), + 'class' => 'avatar profile', + 'width' => AVATAR_PROFILE_SIZE, + 'height' => AVATAR_PROFILE_SIZE, + 'alt' => $profile->nickname)); + $cur = common_current_user(); + if ($cur) { + if ($cur->id != $profile->id) { + if ($cur->isSubscribed($profile)) { + $this->show_unsubscribe_form($profile); + } else { + $this->show_subscribe_form($profile); } - } else { - $this->show_remote_subscribe_form($profile); } - common_element_end('div'); + } else { + $this->show_remote_subscribe_form($profile); } + common_element_end('div'); + common_element_start('div', array('id' => 'profile_information')); if ($profile->fullname) { @@ -165,7 +164,7 @@ class ShowstreamAction extends StreamAction { 'type' => 'hidden', 'value' => $profile->nickname)); common_element('input', array('type' => 'submit', - 'class' => 'button', + 'class' => 'submit', 'value' => _t('Subscribe'))); common_element_end('form'); } @@ -183,7 +182,7 @@ class ShowstreamAction extends StreamAction { 'id' => 'submit', 'name' => 'submit', 'value' => _t('Subscribe'), - 'class' => 'button')); + 'class' => 'submit')); common_element_end('form'); } @@ -195,7 +194,7 @@ class ShowstreamAction extends StreamAction { 'type' => 'hidden', 'value' => $profile->nickname)); common_element('input', array('type' => 'submit', - 'class' => 'button', + 'class' => 'submit', 'value' => _t('Unsubscribe'))); common_element_end('form'); } @@ -205,7 +204,8 @@ class ShowstreamAction extends StreamAction { $subs = DB_DataObject::factory('subscription'); $subs->subscriber = $profile->id; - + $subs->orderBy('created DESC'); + # We ask for an extra one to know if we need to do another page $subs->limit(0, SUBSCRIPTIONS + 1); @@ -290,7 +290,7 @@ class ShowstreamAction extends StreamAction { common_element_end('dt'); common_element('dd', 'subscriptions', $subs_count); common_element_start('dt', 'subscribers'); - common_element('a', array('href' => common_local_url('subscribed', + common_element('a', array('href' => common_local_url('subscribers', array('nickname' => $profile->nickname))), _t('Subscribers')); common_element_end('dt');