aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2009-12-17 00:55:55 +0000
committerAndreas Fischer <bantu@phpbb.com>2009-12-17 00:55:55 +0000
commit437c66e8c818becb7a04c5b224f6c060aa55459e (patch)
tree0210ff6e68a3a38443c38c467338c10300cc35fd /phpBB/feed.php
parentUse correct limit config parameter in the News feed. (diff)
downloadphpbb-437c66e8c818becb7a04c5b224f6c060aa55459e.tar.gz
phpbb-437c66e8c818becb7a04c5b224f6c060aa55459e.tar.bz2
phpbb-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.php28
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&amp;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&amp;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&amp;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&amp;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'];