X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpeopletag.php;h=7287cfbf995aa0bf08d29df44cde7627ff59f87b;hb=53650c7a5e8f2a27f8d0d02367bda8934f59c0e6;hp=6dbbc926161c87b9c31b5b9d9d51d2764965fc9f;hpb=ec6a38a62786c85e8ee30c5726ea81f82465b39d;p=quix0rs-gnu-social.git diff --git a/actions/peopletag.php b/actions/peopletag.php index 6dbbc92616..7287cfbf99 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -32,8 +32,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/lib/profilelist.php'; - /** * This class outputs a paginated list of profiles self-tagged with a given tag * @@ -67,7 +65,7 @@ class PeopletagAction extends Action $this->tag = $this->trimmed('tag'); if (!common_valid_profile_tag($this->tag)) { - $this->clientError(sprintf(_('Not a valid people tag: %s'), + $this->clientError(sprintf(_('Not a valid people tag: %s.'), $this->tag)); return; } @@ -124,8 +122,8 @@ class PeopletagAction extends Action $profile->query(sprintf($qry, $this->tag, $lim)); - $pl = new ProfileList($profile, $this); - $cnt = $pl->show(); + $ptl = new PeopleTagList($profile, $this); // pass the ammunition + $cnt = $ptl->show(); $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE, @@ -141,8 +139,42 @@ class PeopletagAction extends Action */ function title() { - return sprintf(_('Users self-tagged with %s - page %d'), + return sprintf(_('Users self-tagged with %1$s - page %2$d'), $this->tag, $this->page); } } + +class PeopleTagList extends ProfileList +{ + function newListItem($profile) + { + return new PeopleTagListItem($profile, $this->action); + } +} + +class PeopleTagListItem extends ProfileListItem +{ + function linkAttributes() + { + $aAttrs = parent::linkAttributes(); + + if (common_config('nofollow', 'peopletag')) { + $aAttrs['rel'] .= ' nofollow'; + } + + return $aAttrs; + } + + function homepageAttributes() + { + $aAttrs = parent::linkAttributes(); + + if (common_config('nofollow', 'peopletag')) { + $aAttrs['rel'] = 'nofollow'; + } + + return $aAttrs; + } +} +