aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-05-28 19:15:24 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-05-28 19:15:24 +0000
commit19a36ed364ffdc4da784a253baa8aa2a8ac6845a (patch)
treea355181dc26b47abb2c34228fe32a92fd40df28d /phpBB
parentebf4f4ec8e787153e16cc6cec6fc5fefadc97107 (diff)
downloadforums-19a36ed364ffdc4da784a253baa8aa2a8ac6845a.tar
forums-19a36ed364ffdc4da784a253baa8aa2a8ac6845a.tar.gz
forums-19a36ed364ffdc4da784a253baa8aa2a8ac6845a.tar.bz2
forums-19a36ed364ffdc4da784a253baa8aa2a8ac6845a.tar.xz
forums-19a36ed364ffdc4da784a253baa8aa2a8ac6845a.zip
- adjusted coding guidelines
- fixed custom bbcode {TEXT} token - added unapproved item/info for unapproved posts in a topic git-svn-id: file:///svn/phpbb/trunk@5982 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/docs/coding-guidelines.html43
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php2
-rw-r--r--phpBB/includes/mcp/mcp_forum.php19
-rw-r--r--phpBB/includes/mcp/mcp_post.php7
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php3
-rw-r--r--phpBB/language/en/common.php1
-rw-r--r--phpBB/language/en/ucp.php59
-rw-r--r--phpBB/search.php18
-rw-r--r--phpBB/styles/subSilver/template/mcp_forum.html7
-rw-r--r--phpBB/styles/subSilver/template/search_results.html4
-rw-r--r--phpBB/styles/subSilver/template/viewforum_body.html6
-rw-r--r--phpBB/viewforum.php10
12 files changed, 95 insertions, 84 deletions
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 803d88ebc2..3f15f22a55 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -348,7 +348,7 @@ class ...
<a name="code"></a><h1>2. Code Layout/Guidelines</h1>
- <p>Please note that these Guidelines also applies to js code.</p>
+ <p>Please note that these Guidelines also applies to javascript code.</p>
<a name="namingvars"></a><b>2.i. Variable/Function Naming</b>
<br /><br />
@@ -691,6 +691,7 @@ switch ($mode)
}
</pre></blockquote>
+
</div>
<a href="#top">Top</a>
<br /><br />
@@ -892,10 +893,21 @@ trigger_error('NO_FORUM');
<p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended.</p>
- <h3>General Functions: </h3>
- <p>Use <code>sizeof</code> instead of <code>count</code>, this is just a general preference and guideline and has no other benefit than to be consistent.</p>
+ <h3>General function usage: </h3>
- <p>Use <code>strpos</code> instead of <code>strstr</code>.</p>
+ <p>Some of these functions are only chosen over others because of a personal preference and are having no other benefit than to be consistant over the code.</p>
+
+ <ul>
+ <li>
+ <p>Use <code>sizeof</code> instead of <code>count</code></p>
+ </li>
+ <li>
+ <p>Use <code>strpos</code> instead of <code>strstr</code></p>
+ </li>
+ <li>
+ <p>Use <code>else if</code> instead of <code>elseif</code></p>
+ </li>
+ </ul>
</div>
<a href="#top">Top</a>
@@ -1158,33 +1170,12 @@ markup
<a name="changes"></a><h1>5. Guidelines Changelog</h1>
<div class="paragraph">
-<h2>Revision 1.7</h2>
-
-<ul class="menu">
- <li>Updated <a href="#locations">1.iii. File Locations</a> to reflect recent updates</li>
- <li>Added paragraph about switch statements to <a href="#codelayout">2.ii. Code Layout</a></li>
- <li>Updated <a href="#sql">2.iii. SQL/SQL Layout</a></li>
- <li>Added paragraph about url formatting to <a href="#general">2.v. General Guidelines</a></li>
-</ul>
-
-<h2>Revision 1.6</h2>
-
-<ul class="menu">
- <li>Added more information to Tabs vs. Spaces paragraph</li>
-</ul>
-
<h2>Revision 1.5</h2>
<ul class="menu">
- <li>$user->start now $user->session_begin</li>
+ <li>Changed General function usage paragraph in <a href="#general">2.v. General Guidelines</a></li>
</ul>
-<h2>Revision 1.3</h2>
-
-<ul class="menu">
- <li>Updated Section 1.iii. - dbal layout</li>
- <li>Extended Section 2.v. - usage of request_var()</li>
-</ul>
</div>
<a href="#top">Top</a>
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 4586a58fe8..4f7f4b191b 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -233,7 +233,7 @@ class acp_bbcodes
'!([a-z0-9]+[a-z0-9\-\._]*@(?:(?:[0-9]{1,3}\.){3,5}[0-9]{1,3}|[a-z0-9]+[a-z0-9\-\._]*\.[a-z]+))!i' => '$1'
),
'TEXT' => array(
- '!(.*?)!es' => "str_replace('\\\"', '&quot;', str_replace('\\'', '&#39;', '\$1'))"
+ '!(.*?)!es' => "str_replace(\"\\r\\n\",\"\\n\", str_replace('\\\"', '\"', str_replace('\\'', '&#39;', trim('\$1'))))"
),
'COLOR' => array(
'!([a-z]+|#[0-9abcdef]+)!i' => '$1'
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 0d07f3f0f6..994784e2ac 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -107,11 +107,6 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
{
$topic_title = '';
- if ($auth->acl_get('m_approve', $row['forum_id']))
- {
- $row['topic_replies'] = $row['topic_replies_real'];
- }
-
if ($row['topic_status'] == ITEM_LOCKED)
{
$folder_img = 'folder_locked';
@@ -165,12 +160,16 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$topic_title = censor_text($row['topic_title']);
+ $topic_unapproved = (!$row['topic_approved'] && $auth->acl_gets('m_approve', $row['forum_id'])) ? true : false;
+ $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_gets('m_approve', $row['forum_id'])) ? true : false;
+ $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&amp;i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&amp;t=' . $row['topic_id'] : '';
+
$template->assign_block_vars('topicrow', array(
'U_VIEW_TOPIC' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=$id&amp;f=$forum_id&amp;t={$row['topic_id']}&amp;mode=topic_view",
'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false,
'U_SELECT_TOPIC' => $url . "&amp;i=$id&amp;mode=topic_view&amp;action=merge&amp;to_topic_id=" . $row['topic_id'] . $selected_ids,
- 'U_MCP_QUEUE' => $url . '&amp;i=queue&amp;mode=approve_details&amp;t=' . $row['topic_id'],
+ 'U_MCP_QUEUE' => $u_mcp_queue,
'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx$SID&amp;i=main&amp;mode=topic_view&amp;t={$row['topic_id']}&amp;action=reports",
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
@@ -179,16 +178,18 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
+ 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
'TOPIC_TYPE' => $topic_type,
'TOPIC_TITLE' => $topic_title,
- 'REPLIES' => $row['topic_replies'],
+ 'REPLIES' => ($auth->acl_get('m_approve', $row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'],
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
'TOPIC_ID' => $row['topic_id'],
'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? 'checked="checked" ' : '',
- 'S_TOPIC_REPORTED' => ($row['topic_reported']) ? true : false,
- 'S_TOPIC_UNAPPROVED'=> ($row['topic_approved']) ? false : true)
+ 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $row['forum_id'])) ? true : false,
+ 'S_TOPIC_UNAPPROVED' => $topic_unapproved,
+ 'S_POSTS_UNAPPROVED' => $posts_unapproved)
);
}
unset($topic_rows);
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index 106af1e2ed..f2fef8af6e 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -312,7 +312,7 @@ function mcp_post_details($id, $mode, $action)
*/
function change_poster(&$post_info, $userdata)
{
- global $auth, $db;
+ global $auth, $db, $config;
if (empty($userdata) || $userdata['user_id'] == $post_info['user_id'])
{
@@ -383,6 +383,9 @@ function change_poster(&$post_info, $userdata)
// Do not change the poster_id within the attachments table, since they were still posted by the original user
+ $from_username = $post_info['username'];
+ $to_username = $userdata['username'];
+
// Renew post info
$post_info = get_post_data(array($post_id));
@@ -394,7 +397,7 @@ function change_poster(&$post_info, $userdata)
$post_info = $post_info[$post_id];
// Now add log entry
- add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $post_info['username'], $userdata['username']);
+ add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username);
}
?> \ No newline at end of file
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 9a33405725..715a41b8cf 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -800,7 +800,8 @@ function compose_pm($id, $mode, $action)
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']),
- 'U_PROGRESS_BAR' => "{$phpbb_root_path}posting.$phpEx$SID&f=0&mode=popup", // do NOT replace & with &amp; here
+ 'U_PROGRESS_BAR' => "{$phpbb_root_path}posting.$phpEx$SID&amp;f=0&amp;mode=popup",
+ 'UA_PROGRESS_BAR' => "{$phpbb_root_path}posting.$phpEx$SID&f=0&mode=popup",
)
);
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 00c1383a92..5f8af917d9 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -312,6 +312,7 @@ $lang = array_merge($lang, array(
'POST_STICKY' => 'Sticky',
'POSTED' => 'Posted',
'POSTS' => 'Posts',
+ 'POSTS_UNAPPROVED' => 'At least one post in this topic has not been approved',
'POST_BY_FOE' => 'This post was made by <b>%1$s</b> who is currently on your ignore list. To display this post click %2$sHERE%3$s.',
'POST_DAY' => '%.2f posts per day',
'POST_DETAILS' => 'Post details',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 9d1f1ce2c5..8f092ea00b 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -58,35 +58,36 @@ $lang = array_merge($lang, array(
// Common language entries
$lang = array_merge($lang, array(
- 'ACCOUNT_ACTIVE' => 'Your account has now been activated. Thank you for registering',
- 'ACCOUNT_ACTIVE_ADMIN' => 'The account has now been activated',
- 'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your username and password',
- 'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.',
- 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Please check your email for further information',
- 'ACCOUNT_INACTIVE_ADMIN' => 'Your account has been created. However, this forum requires account activation by the administrator. An email has been sent to them and you will be informed when your account has been activated',
- 'ACTIVATION_EMAIL_SENT' => 'The activation email has been sent to your email address',
- 'ADD' => 'Add',
- 'ADD_BCC' => 'Add [Bcc]',
- 'ADD_FOES' => 'Add new foes',
- 'ADD_FOES_EXPLAIN' => 'You may enter several usernames each on a different line',
- 'ADD_FOLDER' => 'Add folder',
- 'ADD_FRIENDS' => 'Add new friends',
- 'ADD_FRIENDS_EXPLAIN' => 'You may enter several usernames each on a different line',
- 'ADD_NEW_RULE' => 'Add new Rule',
- 'ADD_RULE' => 'Add Rule',
- 'ADD_TO' => 'Add [To]',
- 'ADMIN_EMAIL' => 'Administrators can email me information',
- 'AGREE' => 'I agree to these terms',
- 'ALLOW_PM' => 'Allow users to send you private messages',
- 'ALLOW_PM_EXPLAIN' => 'Note that admins and moderators will always be able to send you messages.',
- 'ALREADY_ACTIVATED' => 'You have already activated your account',
- 'ATTACHMENTS_EXPLAIN' => 'This is a list of attachements you have made in posts to this forum.',
- 'ATTACHMENTS_DELETED' => 'Attachments successfully deleted',
- 'ATTACHMENT_DELETED' => 'Attachment successfully deleted',
- 'AVATAR_CATEGORY' => 'Category',
- 'AVATAR_EXPLAIN' => 'Maximum dimensions; width %1$d pixels, height %2$d pixels, filesize %3$dkB.',
- 'AVATAR_GALLERY' => 'Local gallery',
- 'AVATAR_PAGE' => 'Page',
+ 'ACCOUNT_ACTIVE' => 'Your account has now been activated. Thank you for registering',
+ 'ACCOUNT_ACTIVE_ADMIN' => 'The account has now been activated',
+ 'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your username and password',
+ 'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.',
+ 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Please check your email for further information',
+ 'ACCOUNT_INACTIVE_ADMIN' => 'Your account has been created. However, this forum requires account activation by the administrator. An email has been sent to them and you will be informed when your account has been activated',
+ 'ACTIVATION_EMAIL_SENT' => 'The activation email has been sent to your email address',
+ 'ADD' => 'Add',
+ 'ADD_BCC' => 'Add [Bcc]',
+ 'ADD_FOES' => 'Add new foes',
+ 'ADD_FOES_EXPLAIN' => 'You may enter several usernames each on a different line',
+ 'ADD_FOLDER' => 'Add folder',
+ 'ADD_FRIENDS' => 'Add new friends',
+ 'ADD_FRIENDS_EXPLAIN' => 'You may enter several usernames each on a different line',
+ 'ADD_NEW_RULE' => 'Add new Rule',
+ 'ADD_RULE' => 'Add Rule',
+ 'ADD_TO' => 'Add [To]',
+ 'ADMIN_EMAIL' => 'Administrators can email me information',
+ 'AGREE' => 'I agree to these terms',
+ 'ALLOW_PM' => 'Allow users to send you private messages',
+ 'ALLOW_PM_EXPLAIN' => 'Note that admins and moderators will always be able to send you messages.',
+ 'ALREADY_ACTIVATED' => 'You have already activated your account',
+ 'ATTACHMENTS_EXPLAIN' => 'This is a list of attachements you have made in posts to this forum.',
+ 'ATTACHMENTS_DELETED' => 'Attachments successfully deleted',
+ 'ATTACHMENT_DELETED' => 'Attachment successfully deleted',
+ 'AVATAR_CATEGORY' => 'Category',
+ 'AVATAR_EXPLAIN' => 'Maximum dimensions; width %1$d pixels, height %2$d pixels, filesize %3$dkB.',
+ 'AVATAR_GALLERY' => 'Local gallery',
+ 'AVATAR_GENERAL_UPLOAD_ERROR' => 'Could not upload avatar to %s',
+ 'AVATAR_PAGE' => 'Page',
'BACK_TO_DRAFTS' => 'Back to saved drafts',
'BACK_TO_LOGIN' => 'Back to login screen',
diff --git a/phpBB/search.php b/phpBB/search.php
index 5e5c9573c0..ae0513239e 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -618,6 +618,10 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$unread_topic = (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false;
+ $topic_unapproved = (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false;
+ $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false;
+ $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&amp;i=queue&amp;mode=" . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$result_topic_id" : '';
+
$tpl_ary = array(
'TOPIC_AUTHOR' => topic_topic_author($row),
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
@@ -627,13 +631,14 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'PAGINATION' => topic_generate_pagination($replies, $view_topic_url),
'TOPIC_TYPE' => $topic_type,
- 'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
- 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
+ 'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'),
+ 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
- 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
+ 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
- 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
'S_TOPIC_GLOBAL' => (!$forum_id) ? true : false,
'S_TOPIC_TYPE' => $row['topic_type'],
@@ -641,13 +646,14 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'S_UNREAD_TOPIC' => $unread_topic,
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $forum_id)) ? true : false,
- 'S_TOPIC_UNAPPROVED' => (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false,
+ 'S_TOPIC_UNAPPROVED' => $topic_unapproved,
+ 'S_POSTS_UNAPPROVED' => $posts_unapproved,
'U_LAST_POST' => $view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['topic_last_poster_id']}" : '',
'U_NEWEST_POST' => $view_topic_url . '&amp;view=unread#unread',
'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&amp;i=reports&amp;mode=reports&amp;t=$result_topic_id",
- 'U_MCP_QUEUE' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&amp;i=queue&amp;mode=approve_details&amp;t=$result_topic_id"
+ 'U_MCP_QUEUE' => $u_mcp_queue,
);
}
else
diff --git a/phpBB/styles/subSilver/template/mcp_forum.html b/phpBB/styles/subSilver/template/mcp_forum.html
index 9d15fc04d1..debd05866c 100644
--- a/phpBB/styles/subSilver/template/mcp_forum.html
+++ b/phpBB/styles/subSilver/template/mcp_forum.html
@@ -23,13 +23,14 @@
<!-- IF topicrow.S_SELECT_TOPIC -->
<span class="genmed">[ <a href="{topicrow.U_SELECT_TOPIC}">{L_SELECT}</a> ]&nbsp;</span>
<!-- ENDIF -->
- <!-- IF topicrow.S_TOPIC_UNAPPROVED -->
- <a href="{topicrow.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a>&nbsp;
+ <p class="topictitle">{topicrow.NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a>
+ <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
+ <a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
<!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED -->
<a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;
<!-- ENDIF -->
- <p class="topictitle">{topicrow.NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p>
+ </p>
</td>
<td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>
<td class="row1" width="120" align="center"><p class="topicdetails">{topicrow.LAST_POST_TIME}</p></td>
diff --git a/phpBB/styles/subSilver/template/search_results.html b/phpBB/styles/subSilver/template/search_results.html
index 04a6056591..48215b6325 100644
--- a/phpBB/styles/subSilver/template/search_results.html
+++ b/phpBB/styles/subSilver/template/search_results.html
@@ -36,8 +36,8 @@
<td class="row1">
<!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF -->
{topicrow.ATTACH_ICON_IMG} <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a>
- <!-- IF searchresults.S_TOPIC_UNAPPROVED -->
- <a href="{searchresults.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a>&nbsp;
+ <!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED -->
+ <a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a>&nbsp;
<!-- ENDIF -->
<!-- IF searchresults.S_TOPIC_REPORTED -->
<a href="{searchresults.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;
diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html
index 0f4180ed02..3c8a6417db 100644
--- a/phpBB/styles/subSilver/template/viewforum_body.html
+++ b/phpBB/styles/subSilver/template/viewforum_body.html
@@ -42,7 +42,7 @@
<td class="row1">
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF -->
{topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
- <!-- IF topicrow.S_TOPIC_UNAPPROVED -->
+ <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
<a href="{topicrow.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a>&nbsp;
<!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED -->
@@ -162,8 +162,8 @@
<td class="row1">
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF -->
{topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
- <!-- IF topicrow.S_TOPIC_UNAPPROVED -->
- <a href="{topicrow.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a>&nbsp;
+ <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
+ <a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
<!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED -->
<a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index fa8f636e9a..23fd6ab727 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -473,6 +473,10 @@ if (sizeof($topic_list))
// Generate all the URIs ...
$view_topic_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&amp;t=$topic_id";
+ $topic_unapproved = (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false;
+ $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false;
+ $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&amp;i=queue&amp;mode=" . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$topic_id" : '';
+
// Send vars to template
$template->assign_block_vars('topicrow', array(
'FORUM_ID' => $forum_id,
@@ -494,12 +498,14 @@ if (sizeof($topic_list))
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
+ 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic,
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $forum_id)) ? true : false,
- 'S_TOPIC_UNAPPROVED' => (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false,
+ 'S_TOPIC_UNAPPROVED' => $topic_unapproved,
+ 'S_POSTS_UNAPPROVED' => $posts_unapproved,
'S_HAS_POLL' => ($row['poll_start']) ? true : false,
'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false,
'S_POST_GLOBAL' => ($row['topic_type'] == POST_GLOBAL) ? true : false,
@@ -511,7 +517,7 @@ if (sizeof($topic_list))
'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['topic_last_poster_id']}" : '',
'U_VIEW_TOPIC' => $view_topic_url,
'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&amp;i=reports&amp;mode=reports&amp;t=$topic_id",
- 'U_MCP_QUEUE' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&amp;i=queue&amp;mode=approve_details&amp;t=$topic_id",
+ 'U_MCP_QUEUE' => $u_mcp_queue,
'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)
);