Page 1 of 1

"MCP info on index" MOD into the Portal

Posted: 31. January 2009 22:24
by DutchToxophilite
Your Portal Version: 1.0.2
Your phpBB Type: Standard phpBB3
MODs installed: Yes
Your knowledge: Advanced Knowledge
Boardlink: http://www.handboogforum.nl

What have you done before the problem was there?
Nothing, question. No issue.

What have you already tryed to solve the problem?
Searching trough this board, and trough phpbb.com

Description and Message
Hi

I have installed the "MCP info on index" MOD.
And me and the Moderators really quiet heavily on it. The reason for this is, that I enabled the "block first posts" feature. To be sure no spammers can spam my board.

But as a result of the NEWS showing the latest posts on the portal, we now tend to forget to go to the board index frequently, thus missing these warnings.

I now want to incorporate the "MCP info on index" MOD into the portal, but my php writing skills are poorly, so I have not a sure clue where to start.

Please advise/help.

thanx.

grtz,
Twan

Re: Can the "MCP info on index" MOD be incorp. into the Portal?

Posted: 31. January 2009 23:23
by Kevin
Original Mod MCP info on index by Derky
Open portal.php

search:

Code: Select all

// output page 
add before:

Code: Select all

// 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)
            );
        }
    }    
} 

prosilver
open root/styles/prosilver/template/portal/portal_body.html

search:

Code: Select all

<!-- INCLUDE overall_header.html --> 
add after:

Code: Select all

<!-- 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 --> 

subsilver2

open root/styles/subsilver2/template/portal/portal_body.html
search:

Code: Select all

<!-- INCLUDE overall_header.html --> 
add after:

Code: Select all

<!-- 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 --> 
Edited topic title and moved to "Released Blocks"

Re: "MCP info on index" MOD into the Portal

Posted: 31. January 2009 23:31
by DutchToxophilite
Hi Kevin.

Your Nicks at phpbb.com and phpbb.de are more realistic.

YOU are a true SAINT (and that coming from an atheist!!) ;)

grtz,
Twan

Re: "MCP info on index" MOD into the Portal

Posted: 31. January 2009 23:43
by DutchToxophilite
Worked like a charm.

One small remark......

The text to search for contains some blankspaces before and after the "to search" text. Which prefends them to be found automaticcaly.....

Just a small tip for the other users who want to install this.

grtz,
Twan

Re: "MCP info on index" MOD into the Portal

Posted: 1. February 2009 01:30
by Kevin
Thanks, corrected.

Re: "MCP info on index" MOD into the Portal

Posted: 2. February 2009 15:27
by JeRicHoOL
Wo kann ich die Modifikation downloaden? Der Link hier funktioniert nicht.
Würde nämlich auch gerne so einen Block haben mit den MCP Infos im Portal.

Re: "MCP info on index" MOD into the Portal

Posted: 2. February 2009 15:43
by DutchToxophilite
Hi JeRicHoOL

I can read German, but my writing is terrible, so I will keep it in English.

This is one of the official released MODs from phpbb.com

When the site will be up and running again I will post a link to it. (If I don't forget)

grtz,
Twan

Re: Can the "MCP info on index" MOD be incorp. into the Portal?

Posted: 2. February 2009 16:09
by Christian_N
Kevin wrote:Original Mod MCP info on index by Derky
Und ich kann Englisch lesen aber nicht gut schreiben. :lol:
Selbst wenn es vergessen solltest, der Link hat Kevin bereits genannt. :D

Sobald phpBB.com wieder Online ist kannst es dir dort runterladen.
Alternative suche mal auf phpBB.de oder bei Google vllt. gibts auch eine Alternativ-Download :roll:

Gruß Chris

Re: "MCP info on index" MOD into the Portal

Posted: 2. February 2009 16:33
by Kevin
Äh, Moment:
JeRicHoOL wrote:Wo kann ich die Modifikation downloaden? Der Link hier funktioniert nicht.
Würde nämlich auch gerne so einen Block haben mit den MCP Infos im Portal.
Da brauchst du nix runter laden, den Code für das Portal habe ich oben gepostet. :?

Re: "MCP info on index" MOD into the Portal

Posted: 2. February 2009 22:15
by JeRicHoOL
I did the changes above and nothing on my portal changed. There is no new block. :? Is there a mod I need to install for that block?

Re: "MCP info on index" MOD into the Portal

Posted: 2. February 2009 22:24
by Kevin
JeRicHoOL wrote:I did the changes above and nothing on my portal changed. There is no new block. :?
Already purged your board cache?
And please note: the block will only appear, if at least on post is reported for the admins / moderators. To test it, just report a post. ;)

Re: "MCP info on index" MOD into the Portal

Posted: 3. February 2009 00:17
by JeRicHoOL
Ok I have done this and then I got some kind of information line.

http://i107.photobucket.com/albums/m287 ... 030009.gif

Is it correctly how it is?

Re: "MCP info on index" MOD into the Portal

Posted: 3. February 2009 07:51
by DutchToxophilite
That's would it would look like (I guess, as I see it in ProSilver). But the bar gives the same information.

grtz,
Twan