- 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
This commit is contained in:
Meik Sievertsen 2006-05-28 19:15:24 +00:00
parent ebf4f4ec8e
commit 19a36ed364
12 changed files with 95 additions and 84 deletions

View file

@ -348,7 +348,7 @@ class ...
<a name="code"></a><h1>2. Code Layout/Guidelines</h1> <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> <a name="namingvars"></a><b>2.i. Variable/Function Naming</b>
<br /><br /> <br /><br />
@ -691,6 +691,7 @@ switch ($mode)
} }
</pre></blockquote> </pre></blockquote>
</div> </div>
<a href="#top">Top</a> <a href="#top">Top</a>
<br /><br /> <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> <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> <h3>General function usage: </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>
<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> </div>
<a href="#top">Top</a> <a href="#top">Top</a>
@ -1158,33 +1170,12 @@ markup
<a name="changes"></a><h1>5. Guidelines Changelog</h1> <a name="changes"></a><h1>5. Guidelines Changelog</h1>
<div class="paragraph"> <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> <h2>Revision 1.5</h2>
<ul class="menu"> <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> </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> </div>
<a href="#top">Top</a> <a href="#top">Top</a>

View file

@ -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' '!([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( '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( 'COLOR' => array(
'!([a-z]+|#[0-9abcdef]+)!i' => '$1' '!([a-z]+|#[0-9abcdef]+)!i' => '$1'

View file

@ -107,11 +107,6 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
{ {
$topic_title = ''; $topic_title = '';
if ($auth->acl_get('m_approve', $row['forum_id']))
{
$row['topic_replies'] = $row['topic_replies_real'];
}
if ($row['topic_status'] == ITEM_LOCKED) if ($row['topic_status'] == ITEM_LOCKED)
{ {
$folder_img = 'folder_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_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( $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", '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, '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_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", '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']) : '', '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' => (!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_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'] : '', '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_TYPE' => $topic_type,
'TOPIC_TITLE' => $topic_title, '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']), 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
'TOPIC_ID' => $row['topic_id'], 'TOPIC_ID' => $row['topic_id'],
'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? 'checked="checked" ' : '', '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_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $row['forum_id'])) ? true : false,
'S_TOPIC_UNAPPROVED'=> ($row['topic_approved']) ? false : true) 'S_TOPIC_UNAPPROVED' => $topic_unapproved,
'S_POSTS_UNAPPROVED' => $posts_unapproved)
); );
} }
unset($topic_rows); unset($topic_rows);

View file

@ -312,7 +312,7 @@ function mcp_post_details($id, $mode, $action)
*/ */
function change_poster(&$post_info, $userdata) function change_poster(&$post_info, $userdata)
{ {
global $auth, $db; global $auth, $db, $config;
if (empty($userdata) || $userdata['user_id'] == $post_info['user_id']) 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 // 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 // Renew post info
$post_info = get_post_data(array($post_id)); $post_info = get_post_data(array($post_id));
@ -394,7 +397,7 @@ function change_poster(&$post_info, $userdata)
$post_info = $post_info[$post_id]; $post_info = $post_info[$post_id];
// Now add log entry // 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);
} }
?> ?>

View file

@ -800,7 +800,8 @@ function compose_pm($id, $mode, $action)
'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']), '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",
) )
); );

View file

@ -312,6 +312,7 @@ $lang = array_merge($lang, array(
'POST_STICKY' => 'Sticky', 'POST_STICKY' => 'Sticky',
'POSTED' => 'Posted', 'POSTED' => 'Posted',
'POSTS' => 'Posts', '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_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_DAY' => '%.2f posts per day',
'POST_DETAILS' => 'Post details', 'POST_DETAILS' => 'Post details',

View file

@ -86,6 +86,7 @@ $lang = array_merge($lang, array(
'AVATAR_CATEGORY' => 'Category', 'AVATAR_CATEGORY' => 'Category',
'AVATAR_EXPLAIN' => 'Maximum dimensions; width %1$d pixels, height %2$d pixels, filesize %3$dkB.', 'AVATAR_EXPLAIN' => 'Maximum dimensions; width %1$d pixels, height %2$d pixels, filesize %3$dkB.',
'AVATAR_GALLERY' => 'Local gallery', 'AVATAR_GALLERY' => 'Local gallery',
'AVATAR_GENERAL_UPLOAD_ERROR' => 'Could not upload avatar to %s',
'AVATAR_PAGE' => 'Page', 'AVATAR_PAGE' => 'Page',
'BACK_TO_DRAFTS' => 'Back to saved drafts', 'BACK_TO_DRAFTS' => 'Back to saved drafts',

View file

@ -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; $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( $tpl_ary = array(
'TOPIC_AUTHOR' => topic_topic_author($row), 'TOPIC_AUTHOR' => topic_topic_author($row),
'FIRST_POST_TIME' => $user->format_date($row['topic_time']), 'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
@ -634,6 +638,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', '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'] : '', '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_GLOBAL' => (!$forum_id) ? true : false,
'S_TOPIC_TYPE' => $row['topic_type'], 'S_TOPIC_TYPE' => $row['topic_type'],
@ -641,13 +646,14 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'S_UNREAD_TOPIC' => $unread_topic, 'S_UNREAD_TOPIC' => $unread_topic,
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $forum_id)) ? true : false, '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' => $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_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_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_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 else

View file

@ -23,13 +23,14 @@
<!-- IF topicrow.S_SELECT_TOPIC --> <!-- IF topicrow.S_SELECT_TOPIC -->
<span class="genmed">[ <a href="{topicrow.U_SELECT_TOPIC}">{L_SELECT}</a> ]&nbsp;</span> <span class="genmed">[ <a href="{topicrow.U_SELECT_TOPIC}">{L_SELECT}</a> ]&nbsp;</span>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_UNAPPROVED --> <p class="topictitle">{topicrow.NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a>
<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 --> <!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED --> <!-- IF topicrow.S_TOPIC_REPORTED -->
<a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp; <a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;
<!-- ENDIF --> <!-- 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>
<td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</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> <td class="row1" width="120" align="center"><p class="topicdetails">{topicrow.LAST_POST_TIME}</p></td>

View file

@ -36,8 +36,8 @@
<td class="row1"> <td class="row1">
<!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF --> <!-- 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> {topicrow.ATTACH_ICON_IMG} <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a>
<!-- IF searchresults.S_TOPIC_UNAPPROVED --> <!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED -->
<a href="{searchresults.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a>&nbsp; <a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a>&nbsp;
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF searchresults.S_TOPIC_REPORTED --> <!-- IF searchresults.S_TOPIC_REPORTED -->
<a href="{searchresults.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp; <a href="{searchresults.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;

View file

@ -42,7 +42,7 @@
<td class="row1"> <td class="row1">
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF --> <!-- 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> {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; <a href="{topicrow.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a>&nbsp;
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED --> <!-- IF topicrow.S_TOPIC_REPORTED -->
@ -162,8 +162,8 @@
<td class="row1"> <td class="row1">
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF --> <!-- 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> {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; <a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED --> <!-- IF topicrow.S_TOPIC_REPORTED -->
<a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp; <a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;

View file

@ -473,6 +473,10 @@ if (sizeof($topic_list))
// Generate all the URIs ... // 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"; $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 // Send vars to template
$template->assign_block_vars('topicrow', array( $template->assign_block_vars('topicrow', array(
'FORUM_ID' => $forum_id, '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_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'] : '', '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_TYPE' => $row['topic_type'], 'S_TOPIC_TYPE' => $row['topic_type'],
'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false, 'S_USER_POSTED' => (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
'S_UNREAD_TOPIC' => $unread_topic, 'S_UNREAD_TOPIC' => $unread_topic,
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $forum_id)) ? true : false, '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_HAS_POLL' => ($row['poll_start']) ? true : false,
'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false, 'S_POST_ANNOUNCE' => ($row['topic_type'] == POST_ANNOUNCE) ? true : false,
'S_POST_GLOBAL' => ($row['topic_type'] == POST_GLOBAL) ? 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_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_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_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) 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)
); );