diff options
author | Nils Adermann <naderman@naderman.de> | 2010-04-04 15:29:45 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-04-04 15:29:45 +0200 |
commit | 1af1a96501b1413aa79b84670122a8761bb933c5 (patch) | |
tree | fab5dbace8ffbbad2f600219e94d36dde3d45608 | |
parent | feb3987802e560bd9e9be9aaadb2df377b96d47b (diff) | |
parent | 19c7ea3c16ceb616cfea4c1c4a160bd36c6a713b (diff) | |
download | forums-1af1a96501b1413aa79b84670122a8761bb933c5.tar forums-1af1a96501b1413aa79b84670122a8761bb933c5.tar.gz forums-1af1a96501b1413aa79b84670122a8761bb933c5.tar.bz2 forums-1af1a96501b1413aa79b84670122a8761bb933c5.tar.xz forums-1af1a96501b1413aa79b84670122a8761bb933c5.zip |
Merge branch 'feature/nickvergessen/unapproved-posts-in-feed' into develop-olympus
* feature/nickvergessen/unapproved-posts-in-feed:
[feature/unapproved-posts-in-feed] Little changelog correction
[feature/unapproved-posts-in-feed] Increase performance of is_moderator_approve_forum() as per bantu
[feature/unapproved-posts-in-feed] View note for moderators on unapproved posts/topics with unapproved posts in ATOM Feed
Conflicts:
phpBB/docs/CHANGELOG.html
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
-rw-r--r-- | phpBB/feed.php | 38 |
2 files changed, 30 insertions, 9 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 93a2bb0fd6..680235c5f5 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -114,6 +114,7 @@ <li>[Fix] Fix dead link in MCP on reports for global announcements in prosilver. (Bug #9512)</li> <li>[Feature] Support for Microsoft's Native SQL Server Driver for PHP (Bug #57055 - Patch by Chris Pucci at Microsoft)</li> <li>[Feature] The memcache acm plugin now supports multiple memcache servers.</li> + <li>[Feature] Show note for moderators on unapproved posts/topics with unapproved posts in ATOM Feed (Bug #9511)</li> </ul> <a name="v307"></a><h3>1.i. Changes since 3.0.7</h3> diff --git a/phpBB/feed.php b/phpBB/feed.php index 4e286ca9b9..88c30c5d4f 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -541,6 +541,24 @@ class phpbb_feed_base return $forum_ids; } + function is_moderator_approve_forum($forum_id) + { + static $forum_ids; + + if (!isset($forum_ids)) + { + $forum_ids = array_flip($this->get_moderator_approve_forums()); + } + + if (!$forum_id) + { + // Global announcement, your a moderator in any forum than it's okay. + return (!empty($forum_ids)) ? true : false; + } + + return (isset($forum_ids[$forum_id])) ? true : false; + } + function get_excluded_forums() { global $db, $cache; @@ -677,7 +695,8 @@ class phpbb_feed_post_base extends phpbb_feed_base if ($config['feed_item_statistics']) { $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->format_date($row['post_time']) + . (($this->is_moderator_approve_forum($row['forum_id']) && !$row['post_approved']) ? ' ' . $this->separator_stats . ' ' . $user->lang['POST_UNAPPROVED'] : ''); } } } @@ -719,8 +738,9 @@ class phpbb_feed_topic_base extends phpbb_feed_base { $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) . ' ' . $this->separator_stats . ' ' . $user->format_date($row[$this->get('date')]) - . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies'] - . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views']; + . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . (($this->is_moderator_approve_forum($row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies']) + . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views'] + . (($this->is_moderator_approve_forum($row['forum_id']) && ($row['topic_replies_real'] != $row['topic_replies'])) ? ' ' . $this->separator_stats . ' ' . $user->lang['POSTS_UNAPPROVED'] : ''); } } } @@ -780,7 +800,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base // Get the actual data $this->sql = array( 'SELECT' => 'f.forum_id, f.forum_name, ' . - 'p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . + 'p.post_id, p.topic_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . 'u.username, u.user_id', 'FROM' => array( USERS_TABLE => 'u', @@ -912,7 +932,7 @@ class phpbb_feed_forum extends phpbb_feed_post_base } $this->sql = array( - 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . + 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . 'u.username, u.user_id', 'FROM' => array( POSTS_TABLE => 'p', @@ -1077,7 +1097,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base global $auth, $db; $this->sql = array( - 'SELECT' => 'p.post_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . + 'SELECT' => 'p.post_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . 'u.username, u.user_id', 'FROM' => array( POSTS_TABLE => 'p', @@ -1241,7 +1261,7 @@ class phpbb_feed_news extends phpbb_feed_topic_base $this->sql = array( 'SELECT' => 'f.forum_id, f.forum_name, - t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time, + t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_time, p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url', 'FROM' => array( TOPICS_TABLE => 't', @@ -1314,7 +1334,7 @@ class phpbb_feed_topics extends phpbb_feed_topic_base $this->sql = array( 'SELECT' => 'f.forum_id, f.forum_name, - t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time, + t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_time, p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url', 'FROM' => array( TOPICS_TABLE => 't', @@ -1412,7 +1432,7 @@ class phpbb_feed_topics_active extends phpbb_feed_topic_base $this->sql = array( 'SELECT' => 'f.forum_id, f.forum_name, - t.topic_id, t.topic_title, t.topic_replies, t.topic_views, + t.topic_id, t.topic_title, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time, p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url', 'FROM' => array( |