X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpeopletag.php;h=2adc24ea66f43b2157eb7398955dd96e2837d850;hb=27ef3b1d905cdf8f47b47293a757624dda88fdc7;hp=bf15e1e2e65ff52ba57c60355ff373a748e3835b;hpb=ae883ceb9b4689f6c1dd3aecdc4a844eda7d179a;p=quix0rs-gnu-social.git diff --git a/actions/peopletag.php b/actions/peopletag.php index bf15e1e2e6..2adc24ea66 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -28,12 +28,10 @@ * @link http://status.net/ */ -if (!defined('LACONICA')) { +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 * @@ -46,7 +44,6 @@ require_once INSTALLDIR.'/lib/profilelist.php'; * * @see Action */ - class PeopletagAction extends Action { @@ -67,7 +64,9 @@ 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'), + // TRANS: Client error displayed when trying to tag a profile with an invalid tag. + // TRANS: %s is the invalid tag. + $this->clientError(sprintf(_('Not a valid people tag: %s.'), $this->tag)); return; } @@ -124,8 +123,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 +140,42 @@ class PeopletagAction extends Action */ function title() { - return sprintf(_('Users self-tagged with %s - page %d'), + // TRANS: Page title for users with a certain self-tag. + // TRANS: %1$s is the tag, %2$s is the page number. + 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; + } }