X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fprofilelist.php;h=b010fb724921028a04e36661471b8932bd7102b8;hb=119d0f7dbab40f30170ba263de78d7e9cea984db;hp=ae875ac011a9d6843720a0a76bb6438aa668a5de;hpb=45dc24689df85b63eaa13173cd9a111b4a5cf237;p=quix0rs-gnu-social.git diff --git a/lib/profilelist.php b/lib/profilelist.php index ae875ac011..b010fb7249 100644 --- a/lib/profilelist.php +++ b/lib/profilelist.php @@ -86,21 +86,16 @@ class ProfileList extends Widget function showProfiles() { - $log = strtolower(get_class($this)) == 'subscriberslist' && $this->owner->nickname == 'petercook'; $cnt = 0; - if ($log) common_log(LOG_INFO, "subbug: starting with {$this->profile->N}"); while ($this->profile->fetch()) { $cnt++; if($cnt > PROFILES_PER_PAGE) { - if ($log) common_log(LOG_INFO, "subbug: breaking at $cnt"); break; } - if ($log) common_log(LOG_INFO, "subbug: showing at $cnt"); $pli = $this->newListItem($this->profile); $pli->show(); } - if ($log) common_log(LOG_INFO, "subbug: ended at $cnt"); return $cnt; } @@ -186,9 +181,8 @@ class ProfileListItem extends Widget function showAvatar() { $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE); - $this->out->elementStart('a', array('href' => $this->profile->profileurl, - 'class' => 'url entry-title', - 'rel' => 'contact')); + $aAttrs = $this->linkAttributes(); + $this->out->elementStart('a', $aAttrs); $this->out->element('img', array('src' => ($avatar) ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_STREAM_SIZE), 'class' => 'photo avatar', 'width' => AVATAR_STREAM_SIZE, @@ -196,6 +190,7 @@ class ProfileListItem extends Widget 'alt' => ($this->profile->fullname) ? $this->profile->fullname : $this->profile->nickname)); + $this->out->text(' '); $hasFN = (!empty($this->profile->fullname)) ? 'nickname' : 'fn nickname'; $this->out->elementStart('span', $hasFN); $this->out->raw($this->highlight($this->profile->nickname)); @@ -206,6 +201,7 @@ class ProfileListItem extends Widget function showFullName() { if (!empty($this->profile->fullname)) { + $this->out->text(' '); $this->out->elementStart('span', 'fn'); $this->out->raw($this->highlight($this->profile->fullname)); $this->out->elementEnd('span'); @@ -215,7 +211,8 @@ class ProfileListItem extends Widget function showLocation() { if (!empty($this->profile->location)) { - $this->out->elementStart('span', 'location'); + $this->out->text(' '); + $this->out->elementStart('span', 'label'); $this->out->raw($this->highlight($this->profile->location)); $this->out->elementEnd('span'); } @@ -224,8 +221,9 @@ class ProfileListItem extends Widget function showHomepage() { if (!empty($this->profile->homepage)) { - $this->out->elementStart('a', array('href' => $this->profile->homepage, - 'class' => 'url')); + $this->out->text(' '); + $aAttrs = $this->homepageAttributes(); + $this->out->elementStart('a', $aAttrs); $this->out->raw($this->highlight($this->profile->homepage)); $this->out->elementEnd('a'); } @@ -274,10 +272,9 @@ class ProfileListItem extends Widget $usf = new UnsubscribeForm($this->out, $this->profile); $usf->show(); } else { - // Is it a local user? can't remote sub from a list - // XXX: make that possible! - $other = User::staticGet('id', $this->profile->id); - if (!empty($other)) { + // We can't initiate sub for a remote OMB profile. + $remote = Remote_profile::staticGet('id', $this->profile->id); + if (empty($remote)) { $sf = new SubscribeForm($this->out, $this->profile); $sf->show(); } @@ -301,4 +298,17 @@ class ProfileListItem extends Widget { return htmlspecialchars($text); } + + function linkAttributes() + { + return array('href' => $this->profile->profileurl, + 'class' => 'url entry-title', + 'rel' => 'contact'); + } + + function homepageAttributes() + { + return array('href' => $this->profile->homepage, + 'class' => 'url'); + } }