diff options
author | Andreas Fischer <bantu@phpbb.com> | 2009-12-17 00:55:55 +0000 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2009-12-17 00:55:55 +0000 |
commit | 437c66e8c818becb7a04c5b224f6c060aa55459e (patch) | |
tree | 0210ff6e68a3a38443c38c467338c10300cc35fd /phpBB/feed.php | |
parent | 4e4915252971aa3270044ce793d9e5af2417df67 (diff) | |
download | forums-437c66e8c818becb7a04c5b224f6c060aa55459e.tar forums-437c66e8c818becb7a04c5b224f6c060aa55459e.tar.gz forums-437c66e8c818becb7a04c5b224f6c060aa55459e.tar.bz2 forums-437c66e8c818becb7a04c5b224f6c060aa55459e.tar.xz forums-437c66e8c818becb7a04c5b224f6c060aa55459e.zip |
#54275 - Let's use a method for that. Also return ->lang['GUEST'] instead of ['username'].
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10347 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/feed.php')
-rw-r--r-- | phpBB/feed.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/phpBB/feed.php b/phpBB/feed.php index 5043c89572..a5ffbf3412 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -632,6 +632,22 @@ class phpbb_feed_base return (!$row) ? false : $row; } } + + function user_viewprofile($row) + { + global $phpEx, $user; + + $author_id = (int) $row[$this->get('author_id')]; + + if ($author_id == ANONYMOUS) + { + // Since we cannot link to a profile, we just return GUEST + // instead of $row['username'] + return $user->lang['GUEST']; + } + + return '<a href="' . feed_append_sid('/memberlist.' . $phpEx, 'mode=viewprofile&u=' . $author_id) . '">' . $row[$this->get('creator')] . '</a>'; + } } /** @@ -882,9 +898,7 @@ class phpbb_feed extends phpbb_feed_base { global $user; - $user_link = ($row['user_id'] != ANONYMOUS) ? '<a href="' . feed_append_sid('/memberlist.' . $phpEx, 'mode=viewprofile&u=' . $row['user_id']) . '">' . $row['username'] . '</a>' : $row['username']; - - $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $user_link + $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) . ' ' . $this->separator_stats . ' ' . $user->format_date($row['post_time']) . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies'] . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views']; @@ -1058,9 +1072,7 @@ class phpbb_feed_news extends phpbb_feed_base { global $user; - $user_link = ($row[$this->get('author_id')] != ANONYMOUS) ? '<a href="' . feed_append_sid('/memberlist.' . $phpEx, 'mode=viewprofile&u=' . $row[$this->get('author_id')]) . '">' . $row[$this->get('creator')] . '</a>' : $row[$this->get('creator')]; - - $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $user_link + $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) . ' ' . $this->separator_stats . ' ' . $user->format_date($row['topic_time']) . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies'] . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views']; @@ -1149,9 +1161,7 @@ class phpbb_feed_topics extends phpbb_feed_base { global $user; - $user_link = ($row[$this->get('author_id')] != ANONYMOUS) ? '<a href="' . feed_append_sid('/memberlist.' . $phpEx, 'mode=viewprofile&u=' . $row[$this->get('author_id')]) . '">' . $row[$this->get('creator')] . '</a>' : $row[$this->get('creator')]; - - $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $user_link + $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) . ' ' . $this->separator_stats . ' ' . $user->format_date($row['topic_time']) . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies'] . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views']; |