1 頁 (共 1 頁)

[轉貼] 整合 MCP_info_on_index 到 Board3_Portal

發表於 : 2009-02-08 12:23
心靈捕手
外掛名稱:整合 MCP_info_on_index 到 Board3_Portal
外掛作者: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 --> &bull; <!-- 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 --> &bull; <!-- ENDIF -->
        <!-- IF S_HAS_UNAPPROVED_POSTS --><a href="{U_MCP_QUEUE}">{L_UNAPPROVED_TOTAL}</a><!-- ENDIF -->
    </div>

    <br clear="all" />
    <!-- ENDIF --> 
清除論壇快取.

Re: [轉貼] 整合 MCP_info_on_index 到 Board3_Portal

發表於 : 2010-09-21 22:55
心靈捕手
如果您的 MCP_info_on_index 外掛已升級到 1.0.3 版,
那麼請參考該外掛的底下檔案,修改上頭相關的檔案。
  • mcp_info_on_index_1_0_3\contrib\update_1.0.2_to_1.0.3.xml

Re: [轉貼] 整合 MCP_info_on_index 到 Board3_Portal

發表於 : 2013-03-27 15:38
心靈捕手
這個修改方法仍然適用 Board3 Portal 2.0.1 版。