外掛作者:Kevin
外掛描述:整合 MCP_info_on_index 到 Board3_Portal
外掛版本:無
外掛下載:無
資料來源:http://www.board3.de/viewtopic.php?p=10473#p10473
修改前提:
您的論壇已經安裝好下列兩個外掛, 且運作正常:
Board3 Portal
MCP info on index
修改方法:
開啟
portal.php
找到
代碼: 選擇全部
// output page
代碼: 選擇全部
// Show amount of reported and queue posts for authenticated users
if ($auth->acl_getf_global('m_report') || $auth->acl_getf_global('m_approve'))
{
if (!function_exists('get_forum_list'))
{
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
}
$user->add_lang('mcp');
// Reported posts
$forum_list = get_forum_list('m_report');
if (!empty($forum_list))
{
$sql = 'SELECT COUNT(r.report_id) AS total
FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p
WHERE r.post_id = p.post_id
AND r.report_closed = 0
AND ' . $db->sql_in_set('forum_id', $forum_list);
$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);
if ($total)
{
$template->assign_vars(array(
'L_REPORTS_TOTAL' => ($total == 1) ? $user->lang['REPORT_TOTAL'] : sprintf($user->lang['REPORTS_TOTAL'], $total),
'U_MCP_REPORTS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports'),
'S_HAS_REPORTS' => true)
);
}
}
// Posts in queue
$forum_list = get_forum_list('m_approve');
if (!empty($forum_list))
{
$sql = 'SELECT COUNT(post_id) AS total
FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
AND post_approved = 0';
$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);
if ($total)
{
$template->assign_vars(array(
'L_UNAPPROVED_TOTAL' => ($total == 1) ? $user->lang['UNAPPROVED_POST_TOTAL'] : sprintf($user->lang['UNAPPROVED_POSTS_TOTAL'], $total),
'U_MCP_QUEUE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue'),
'S_HAS_UNAPPROVED_POSTS' => true)
);
}
}
}
styles/prosilver/template/portal/portal_body.html
找到
代碼: 選擇全部
<!-- INCLUDE overall_header.html -->
代碼: 選擇全部
<!-- IF S_HAS_REPORTS or S_HAS_UNAPPROVED_POSTS -->
<div id="message" class="rules">
<div class="inner"><span class="corners-top"><span></span></span>
<strong>{L_INFORMATION}:</strong>
<!-- IF S_HAS_REPORTS --><a href="{U_MCP_REPORTS}">{L_REPORTS_TOTAL}</a><!-- ENDIF -->
<!-- IF S_HAS_REPORTS and S_HAS_UNAPPROVED_POSTS --> • <!-- ENDIF -->
<!-- IF S_HAS_UNAPPROVED_POSTS --><a href="{U_MCP_QUEUE}">{L_UNAPPROVED_TOTAL}</a><!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
styles/subsilver2/template/portal/portal_body.html
找到
代碼: 選擇全部
<!-- INCLUDE overall_header.html -->
代碼: 選擇全部
<!-- IF S_HAS_REPORTS or S_HAS_UNAPPROVED_POSTS -->
<div class="forumrules">
<h3>{L_INFORMATION}</h3><br />
<!-- IF S_HAS_REPORTS --><a href="{U_MCP_REPORTS}">{L_REPORTS_TOTAL}</a><!-- ENDIF -->
<!-- IF S_HAS_REPORTS and S_HAS_UNAPPROVED_POSTS --> • <!-- ENDIF -->
<!-- IF S_HAS_UNAPPROVED_POSTS --><a href="{U_MCP_QUEUE}">{L_UNAPPROVED_TOTAL}</a><!-- ENDIF -->
</div>
<br clear="all" />
<!-- ENDIF -->