vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Improved Post Report System (https://vborg.vbsupport.ru/showthread.php?t=76582)

boozehound 02-17-2005 10:00 PM

Improved Post Report System
 
This hack will place post reports into modcp, and enable moderators to give feedback to users via a page that users can see which includes all of their own post reports.

Post reports have three possible statuses: open, pending or closed.

When a post report is made, the report is put into a page in modcp called 'outstanding reports', and has a status of 'open'. There is a new option in admincp which governs whether or not the post report emails are sent to moderators; so if this is switched on, the emails are still sent.

Moderators can then see who reported the post and the time at which it was reported, and the comment given by the user. There are also links to the post itself, the thread the post is on, the forum the thread is in, the user who posted the post and the user who reported the post.

The user page can be linked anywhere you choose; I have included instructions for linking it on the quicklinks menu.

This system can be switched on or off from admincp. When off, the behaviour of post reports is as normal.

I've also included an optional scheduled task which will remove post reports from the system than are older than an age specified in days in admincp.

Moderators can then update the status of the report, and add a comment. The user who reported the post can then see these changes reflected in their page - it will show the name of the moderator dealing with the report, the comment (if any) left by the moderator, and the time at which the report was last updated.

When a moderator sets the status of a report to 'closed', it is moved to another page in modcp called 'closed post reports'. Post reports that are in the pending state are still kept in the 'outstanding post reports' page.

This hack has been tested on 3.0.3, 3.0.4, 3.0.5 and 3.0.6, and can be seen in action on The Student Room where it has been up and running since 18th January 2005.

Screenshots:

1) What the user sees
2) A closed report in modcp
3) The admincp settings
4) An open report and the modcp menu items

Updated 26th Feb 2005: installer now calls build_language so there is no need to rebuild the phrase cache manually.

wwesn1 02-18-2005 07:42 PM

I am getting this error....

Code:

Invalid SQL:
                SELECT
                vb3_postreport.*,
                vb3_user.username modname,
                vb3_user2.username reporter,
                vb3_post.username postername,
                vb3_post.userid posterid,
                vb3_thread.title,
                vb3_thread.threadid,
                vb3_forum.title forumtitle,
                vb3_forum.forumid
                FROM vb3_postreport AS postreport
                LEFT JOIN vb3_user AS user ON (postreport.modid = user.userid)
                LEFT JOIN vb3_user AS user2 ON (postreport.userid = user2.userid)
                LEFT JOIN vb3_post AS post ON (postreport.postid = post.postid)
                LEFT JOIN vb3_thread AS thread ON (post.threadid = thread.threadid)
                LEFT JOIN vb3_forum AS forum ON (thread.forumid = forum.forumid)
                WHERE postreport.status < 2
                ORDER BY dateline DESC
                LIMIT 0, 25
       
mysql error: Unknown table 'vb3_postreport'

and yes I have a table called vb3_postreport

wwesn1 02-18-2005 07:46 PM

nvm, figured it out. If anyone else has a table prefix for their vbulletin you'll need to open modcp/postreport.php and change....

Code:

$searchquery = "
                SELECT
                " . TABLE_PREFIX . "postreport.*,
                " . TABLE_PREFIX . "user.username modname,
                " . TABLE_PREFIX . "user2.username reporter,
                " . TABLE_PREFIX . "post.username postername,
                " . TABLE_PREFIX . "post.userid posterid,
                " . TABLE_PREFIX . "thread.title,
                " . TABLE_PREFIX . "thread.threadid,
                " . TABLE_PREFIX . "forum.title forumtitle,
                " . TABLE_PREFIX . "forum.forumid
                FROM " . TABLE_PREFIX . "postreport AS postreport
                LEFT JOIN " . TABLE_PREFIX . "user AS user ON (postreport.modid = user.userid)
                LEFT JOIN " . TABLE_PREFIX . "user AS user2 ON (postreport.userid = user2.userid)
                LEFT JOIN " . TABLE_PREFIX . "post AS post ON (postreport.postid = post.postid)
                LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid)
                LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (thread.forumid = forum.forumid)
                WHERE postreport.status < 2
                ORDER BY dateline DESC
                LIMIT $page_start, $reports_per_page
        ";

TO

Code:

$searchquery = "
                SELECT
                postreport.*,
                user.username modname,
                user2.username reporter,
                post.username postername,
                post.userid posterid,
                thread.title,
                thread.threadid,
                forum.title forumtitle,
                forum.forumid
                FROM " . TABLE_PREFIX . "postreport AS postreport
                LEFT JOIN " . TABLE_PREFIX . "user AS user ON (postreport.modid = user.userid)
                LEFT JOIN " . TABLE_PREFIX . "user AS user2 ON (postreport.userid = user2.userid)
                LEFT JOIN " . TABLE_PREFIX . "post AS post ON (postreport.postid = post.postid)
                LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid)
                LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (thread.forumid = forum.forumid)
                WHERE postreport.status < 2
                ORDER BY dateline DESC
                LIMIT $page_start, $reports_per_page
        ";

That seemed to do the trick for me.

boozehound 02-18-2005 07:47 PM

Quote:

Originally Posted by wwesn1
I am getting this error....
...
and yes I have a table called vb3_postreport

It was a missing TABLE_PREFIX, my apologies. I've updated it.

wwesn1 02-18-2005 07:48 PM

and there would appear to be two instances of this to change in the file

wwesn1 02-18-2005 07:52 PM

sorry the above error I had was in modcp/postreport.php

did you put the missing TABLE_PREFIX in the root/postreports.php

which would fix this error I had

Code:

Invalid SQL:
        SELECT COUNT(p.reportid) AS reportcount
        FROM postreport p WHERE p.userid = 41

mysql error: Table 'wrestle_wrestle.postreport' doesn't exist


wwesn1 02-18-2005 07:55 PM

and I had to remove more " . TABLE_PREFIX . " from the root/postreports.php file in the same place as I listed above a few posts. Don't ask me why?

But anyhow it works for me now :)

Thanks

boozehound 02-18-2005 07:55 PM

Quote:

Originally Posted by wwesn1
sorry the above error I had was in modcp/postreport.php

did you put the missing TABLE_PREFIX in the root/postreports.php

which would fix this error I had

Code:

Invalid SQL:
        SELECT COUNT(p.reportid) AS reportcount
        FROM postreport p WHERE p.userid = 41

mysql error: Table 'wrestle_wrestle.postreport' doesn't exist


Both files should be ok now.

Delphiprogrammi 02-18-2005 09:01 PM

hi people,

i'm getting this error

Code:

Database error in vBulletin 3.0.6:

Invalid SQL:
        SELECT
        vb3_postreport.*,
        vb3_user.username modname,
        vb3_post.username postername,
        vb3_post.userid posterid,
        vb3_thread.title, thread.threadid
        FROM vb3_postreport AS postreport
        LEFT JOIN vb3_user AS user ON (postreport.modid = user.userid)
        LEFT JOIN vb3_post AS post ON (postreport.postid = post.postid)
        LEFT JOIN vb3_thread AS thread ON (post.threadid = thread.threadid)
        WHERE vb3_postreport.userid = 1
        ORDER BY postreport.dateline DESC
        LIMIT 0, 25

mysql error: Unknown table 'vb3_postreport'

mysql error number: 1051

Date: Saturday 19th of February 2005 12:20:54 AM
Script: http://**********/postreports.php
Referer:
Username: ************
IP Address: ************

still that table is there ....

my /modcp/postreports.php works fine

wwesn1 02-18-2005 09:06 PM

did you read my posts?

Change The

Code:

                " . TABLE_PREFIX . "postreport.*,
                " . TABLE_PREFIX . "user.username modname,
                " . TABLE_PREFIX . "user2.username reporter,
                " . TABLE_PREFIX . "post.username postername,
                " . TABLE_PREFIX . "post.userid posterid,
                " . TABLE_PREFIX . "thread.title,
                " . TABLE_PREFIX . "thread.threadid,
                " . TABLE_PREFIX . "forum.title forumtitle,
                " . TABLE_PREFIX . "forum.forumid

TO

Code:

                postreport.*,
                user.username modname,
                user2.username reporter,
                post.username postername,
                post.userid posterid,
                thread.title,
                thread.threadid,
                forum.title forumtitle,
                forum.forumid

That will work untill he fixes it

Delphiprogrammi 02-18-2005 09:20 PM

Quote:

Originally Posted by wwesn1
did you read my posts?

Change The

Code:

                " . TABLE_PREFIX . "postreport.*,
                " . TABLE_PREFIX . "user.username modname,
                " . TABLE_PREFIX . "user2.username reporter,
                " . TABLE_PREFIX . "post.username postername,
                " . TABLE_PREFIX . "post.userid posterid,
                " . TABLE_PREFIX . "thread.title,
                " . TABLE_PREFIX . "thread.threadid,
                " . TABLE_PREFIX . "forum.title forumtitle,
                " . TABLE_PREFIX . "forum.forumid

TO

Code:

                postreport.*,
                user.username modname,
                user2.username reporter,
                post.username postername,
                post.userid posterid,
                thread.title,
                thread.threadid,
                forum.title forumtitle,
                forum.forumid

That will work untill he fixes it

yeah i did read your posts but i'm getting anothr error as you had php code that's causing the error ...

PHP Code:

$postreports $DB_site->query("
    SELECT
    " 
TABLE_PREFIX "postreport.*,
    " 
TABLE_PREFIX "user.username modname,
    " 
TABLE_PREFIX "post.username postername,
    " 
TABLE_PREFIX "post.userid posterid,
    " 
TABLE_PREFIX "thread.title, thread.threadid
    FROM " 
TABLE_PREFIX "postreport AS postreport
    LEFT JOIN " 
TABLE_PREFIX "user AS user ON (postreport.modid = user.userid)
    LEFT JOIN " 
TABLE_PREFIX "post AS post ON (postreport.postid = post.postid)
    LEFT JOIN " 
TABLE_PREFIX "thread AS thread ON (post.threadid = thread.threadid)
    WHERE " 
TABLE_PREFIX ."postreport.userid = $userid
    ORDER BY postreport.dateline DESC
    LIMIT 
$page_start$reports_per_page
"
); 

:confused:

wwesn1 02-18-2005 09:25 PM

yes, for some reason those first four " . TABLE_PREFIX . " were messing things up. Unless he missed something somewhere that would make it work

boozehound 02-18-2005 09:54 PM

Ok, the problems with the TABLE_PREFIXes... I've updated the files in the zip to work correctly with table prefixes, and also switched the SQL queries for an installer. The installer should add the correct table prefix to the new table.

There is a possibility that if you just ran the queries as they were, on a system that uses table prefixes, you could still have a problem. But you should be able to fix that by removing " . TABLE_PREFIX . " from the FROM clause of the queries.

trackpads 02-18-2005 10:00 PM

Wow, this hack looks great! I am going to install it tonight! Great work!!!!

Delphiprogrammi 02-18-2005 10:03 PM

yeag that seems to be solved now thanks for fixing that ;)

boozehound 02-18-2005 10:07 PM

Quote:

Originally Posted by Delphiprogrammi
yeag that seems to be solved now thanks for fixing that ;)

Sorry for any problems you had! Neither the forum it's been installed on for a while nor my test forum use table prefixes, so it was never tested in that way (til now). And there I was thinking gratuitous use of " . TABLE_PREFIX . " would make it ok ;)

Freezerator 02-19-2005 07:59 AM

Wow, this is how post report should have been!
Installing!

Freezerator 02-19-2005 08:22 AM

Works like a charm.

One question or suggestion: Can there be that when a mod looks @ the postreport pages, that he sees al reports, and not the ones from himself? Or somewhere a counter so they can easy see there are open post reports waiting.

boozehound 02-19-2005 08:56 AM

Quote:

Originally Posted by Freezerator
One question or suggestion: Can there be that when a mod looks @ the postreport pages, that he sees al reports, and not the ones from himself?

I suppose so but couldn't they just look in modcp for the same information?

Quote:

Originally Posted by Freezerator
Or somewhere a counter so they can easy see there are open post reports waiting.

Hopefully in a future release :)

Delphiprogrammi 02-19-2005 10:10 AM

hi,

ok dumb question but i'm gonna ask anyhow :D i logged in with my normal user account i use for testing stuff like this and i reported a post.I receive an e-mail with stuff "post reported" but that table remains empty ? also in /modcp/ there's nothing there it says no posts have been reported :s what am i doing here

Delphiprogrammi 02-19-2005 04:04 PM

hi,

nevermind i figured it out it works ok now i did something wrong while editing report.php up and running

[high]* Delphiprogrammi clcks install
[/high]

i will add this hack to my list ;)

shadiguy1 02-19-2005 05:25 PM

any chance u can add it in the admincp as well so i dont have to use the modcp lol on my site and my mods can use it on the modcp. Most appreciated if you can do this for me thanks in advance ,. Awsome hack Thanks again.

boozehound 02-19-2005 05:30 PM

Quote:

Originally Posted by shadiguy1
any chance u can add it in the admincp as well so i dont have to use the modcp lol on my site and my mods can use it on the modcp. Most appreciated if you can do this for me thanks in advance ,. Awsome hack Thanks again.

You could just put the modcp/postreports.php file into the admincp directory, and edit admincp/index.php to add the links to the two pages, which would still be postreports.php?do=closed and postreports.php?do=list. The hack will work just the same way, as it does not rely on that file being anywhere specific.

shadiguy1 02-19-2005 06:28 PM

to add this to AdminCp Do these edits. And Copy postreports.php from modcp over to admincp folder

Find in This: /admincp/index.php

Find This Code:

construct_nav_group($vbphrase['users']);

Below This Add:

construct_nav_option($vbphrase['postreports_new'], "postreports.php?do=list");
construct_nav_option($vbphrase['postreports_closed'], "postreports.php?do=closed");
construct_nav_group($vbphrase['postreports'], '<hr />', "$df");

Diana Notacat 02-20-2005 05:08 AM

Will this work along with Erwin's vB Report Manager or will there be a future versions where you can have a report note sent to Mod's Forum or PMs? I rather like this mod for letting user's know they're being heard but I like using the other so staff can discuss reported threads if needed! :]

The Realist 02-20-2005 11:06 AM

I would like to know this as well.

Quote:

Originally Posted by Diana Notacat
Will this work along with Erwin's vB Report Manager or will there be a future versions where you can have a report note sent to Mod's Forum or PMs? I rather like this mod for letting user's know they're being heard but I like using the other so staff can discuss reported threads if needed! :]


boozehound 02-20-2005 12:24 PM

Quote:

Originally Posted by Diana Notacat
Will this work along with Erwin's vB Report Manager or will there be a future versions where you can have a report note sent to Mod's Forum or PMs? I rather like this mod for letting user's know they're being heard but I like using the other so staff can discuss reported threads if needed! :]

I haven't installed that hack but from looking at the code for it the two should be able to coexist perfectly happily. I'll figure out the changes to report.php need to get these two working together and post it up here, for those that don't fancy figuring it out themselves :)

boozehound 02-20-2005 03:23 PM

Ok, assuming you've first installed the other hack, go about installing this one as normal, except when you come to the part that says:

Code:

find:

        if ($reason == '')
        {
                eval(print_standard_error('error_noreason'));
        }
       
add afterwards:

        if ($vboptions['postreports_enabled'])
        {
                require_once('./includes/functions.php');
       
                $userid = $bbuserinfo['userid'];
                $DB_site->query("INSERT INTO " . TABLE_PREFIX . "postreport
                        (postid, userid, reporttext, status, dateline)
                        VALUES
                        ($postid,
                        $userid,
                        '". addslashes(htmlspecialchars_uni($reason)) . "',
                        0,
                        " . TIMENOW . "
                        )");
        }
       
        if (!$vboptions['postreports_enabled'] || ($vboptions['postreports_enabled'] && $vboptions['postreports_alsoemail']))
        {
       
find:

        vbmail_end();
       
add afterwards:

        }

instead 'add afterwards' the following code only:
Code:


        if ($vboptions['postreports_enabled'])
        {
                require_once('./includes/functions.php');
       
                $userid = $bbuserinfo['userid'];
                $DB_site->query("INSERT INTO " . TABLE_PREFIX . "postreport
                        (postid, userid, reporttext, status, dateline)
                        VALUES
                        ($postid,
                        $userid,
                        '". addslashes(htmlspecialchars_uni($reason)) . "',
                        0,
                        " . TIMENOW . "
                        )");
        }

The two systems should then work in tandem, and the email setting of my hack is ignored and the email settings of the other hack is used.

My report.php with both hacks installed if I've not explained it very well:

Code:

<?php
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 3.0.7 - Licence Number <edited>
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000?2005 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'report');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array('messaging');

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array(
        'newpost_usernamecode',
        'reportbadpost'
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// Erwin's Report Hack
require_once('./includes/functions_bbcodeparse.php');
require_once('./includes/functions_newpost.php');
// Erwin's Report Hack

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

//check usergroup of user to see if they can use this
if (!$bbuserinfo['userid'])
{
        print_no_permission();
}

/*
if (!$vboptions['enableemail'])
{
        eval(print_standard_error('error_emaildisabled'));
}
*/
if (!$vboptions['enableemail'] && ($vboptions['postreports_enabled'] && $vboptions['postreports_alsoemail']))
{
        eval(print_standard_error('error_emaildisabled'));
}

if (empty($_REQUEST['do']))
{
        $_REQUEST['do'] = 'report';
}

$forumperms = fetch_permissions($threadinfo['forumid']);
if (!($forumperms & CANVIEW))
{
        print_no_permission();
}

if ($threadinfo['isdeleted'] OR $postinfo['isdeleted'])
{
        $idname = $vbphrase['post'];
        eval(print_standard_error('error_invalidid'));
}

// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

if ($_REQUEST['do'] == 'report')
{
        $postid = verify_id('post', $_REQUEST['postid'] );

        /*if ($postinfo['userid'] == $bbuserinfo['userid'])
        {
                eval(print_standard_error('error_cantreportself'));
        }*/

        // draw nav bar
        $navbits = array();
        $parentlist = array_reverse(explode(',', $foruminfo['parentlist']));
        foreach ($parentlist AS $forumID)
        {
                $forumTitle = $forumcache["$forumID"]['title'];
                $navbits["forumdisplay.php?$session[sessionurl]f=$forumID"] = $forumTitle;
        }
        $navbits["showthread.php?$session[sessionurl]p=$postid"] = $threadinfo['title'];
        $navbits[''] = $vbphrase['report_bad_post'];
        $navbits = construct_navbits($navbits);

        require_once('./includes/functions_editor.php');
        $textareacols = fetch_textarea_width();
        eval('$usernamecode = "' . fetch_template('newpost_usernamecode') . '";');

        eval('$navbar = "' . fetch_template('navbar') . '";');
        eval('print_output("' . fetch_template('reportbadpost') . '");');

}

if ($_POST['do'] == 'sendemail')
{
        $postid = verify_id('post', $_REQUEST['postid'] );

        globalize($_POST , array('reason' => STR));

        if ($reason == '')
        {
                eval(print_standard_error('error_noreason'));
        }

        if ($vboptions['postreports_enabled'])
        {
                require_once('./includes/functions.php');
       
                $userid = $bbuserinfo['userid'];
                $DB_site->query("INSERT INTO " . TABLE_PREFIX . "postreport
                        (postid, userid, reporttext, status, dateline)
                        VALUES
                        ($postid,
                        $userid,
                        '". addslashes(htmlspecialchars_uni($reason)) . "',
                        0,
                        " . TIMENOW . "
                        )");
        }
       
/*
        $moderators = $DB_site->query("
                SELECT DISTINCT user.email
                FROM " . TABLE_PREFIX . "moderator AS moderator," . TABLE_PREFIX . "user AS user
                WHERE user.userid = moderator.userid
                        AND moderator.forumid IN ($foruminfo[parentlist])
        ");
*/
// Erwin's Report Hack
    $moderators = $DB_site->query("
        SELECT DISTINCT user.email, user.userid
        FROM " . TABLE_PREFIX . "moderator AS moderator," . TABLE_PREFIX . "user AS user
        WHERE user.userid = moderator.userid
            AND moderator.forumid IN ($foruminfo[parentlist])
    ");
// Erwin's Report Hack

        $mods = array();

        while ($moderator = $DB_site->fetch_array($moderators))
        {
                $mods[] = $moderator;
        }

        $threadinfo['title'] = unhtmlspecialchars($threadinfo['title']);
        $postinfo['title'] = unhtmlspecialchars($postinfo['title']);
/*
        if (empty($mods) OR $foruminfo['options'] & $_FORUMOPTIONS['warnall'])
        {
                // get admins if no mods or if this forum notifies all
                $moderators = $DB_site->query("
                        SELECT user.email, user.languageid
                        FROM " . TABLE_PREFIX . "user AS user
                        INNER JOIN " . TABLE_PREFIX . "usergroup AS usergroup USING (usergroupid)
                        WHERE usergroup.adminpermissions <> 0
                ");

                while ($moderator = $DB_site->fetch_array($moderators))
                {
                        $mods[] = $moderator;
                }
        }
*/
// Erwin's Report Hack
if (empty($mods) OR $foruminfo['options'] & $_FORUMOPTIONS['warnall'])
{
// get admins if no mods or if this forum notifies all
$moderators = $DB_site->query("
SELECT user.email, user.languageid, user.userid
FROM " . TABLE_PREFIX . "user AS user
INNER JOIN " . TABLE_PREFIX . "usergroup AS usergroup USING (usergroupid)
WHERE usergroup.adminpermissions <> 0
");

while ($moderator = $DB_site->fetch_array($moderators))
{
$mods[] = $moderator;
}
}

// Erwin's Report Hack
// Erwin's Report Hack
if ($vboptions['vbreportthread'] == '1') {
$forumid = $vboptions['vbreportforum'];
$today = vbdate('m-d-Y', TIMENOW, false, false);
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "thread(title, lastpost, forumid, open, replycount,
postusername, postuserid, lastposter, dateline, iconid, visible, attach)
VALUES
('$today REPORT: " . addslashes($foruminfo['title']) . " - " . addslashes($postinfo['username']) . "', " . TIMENOW . ", $forumid,
1, 0, '" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
'" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 0, 1,
0)
");
$thread['threadid'] = $DB_site->insert_id();
eval(fetch_email_phrases('reportbadpost'));
$message = convert_url_to_bbcode($message);
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "post
(threadid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, iconid, visible)
VALUES
($thread[threadid], '$today REPORT: " . addslashes($foruminfo['title']) . " - " . addslashes($postinfo['username']) . "',
'" . addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " . TIMENOW . ",
'" . addslashes($message) . "', 1, 1,
0, 1)
");
$post['postid'] = $DB_site->insert_id();
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET firstpostid = $post[postid]
WHERE threadid = $thread[threadid]
");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "forum
SET replycount = replycount + 1,
threadcount = threadcount + 1,
lastpost = " . TIMENOW . ",
lastposter = '" . addslashes($bbuserinfo['username']) . " - " . addslashes($postinfo['username']) . "',
lastthread = '$today REPORT: " . addslashes($foruminfo['title']) . "',
lastthreadid = $thread[threadid]
WHERE forumid = $forumid
");
}
if ($vboptions['vbreportpm'] == '1') {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature)\nVALUES\n\t($bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', '$today REPORT: " . addslashes($foruminfo['title']) . " - " . addslashes($postinfo['username']) . "', '".addslashes(htmlspecialchars($message))."', '" . addslashes(serialize($tostring)) . "', 0, " . TIMENOW . ", 1)");

$pmtextid = $DB_site->insert_id();
}

// Erwin's Report Hack


        vbmail_start();
/*
        foreach ($mods AS $index => $moderator)
        {
                if (!empty($moderator['email']))
                {
                        eval(fetch_email_phrases('reportbadpost', $moderator['languageid']));
                        vbmail($moderator['email'], $subject, $message);
                }
        }
*/

// Erwin's Report Hack
foreach ($mods AS $index => $moderator)
{
if (!empty($moderator['email']))
{
eval(fetch_email_phrases('reportbadpost', $moderator['languageid']));
if ($vboptions['vbreportemail'] == '1') {
vbmail($moderator['email'], $subject, $message);
}

if ($vboptions['vbreportpm'] == '1') {
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "pm (pmtextid, userid, messageread) VALUES ($pmtextid, $moderator[userid], 0)");
$DB_site->shutdown_query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1 WHERE userid = $moderator[userid]");
}
}
}
// Erwin's Report Hack

        vbmail_end();

        eval(print_standard_redirect('redirect_reportthanks'));
}

/*======================================================================*\
|| ####################################################################
|| # Downloaded: 08:35, Sun Feb 20th 2005
|| # CVS: $RCSfile: report.php,v $ - $Revision: 1.47 $
|| ####################################################################
\*======================================================================*/
?>


Nickeh32 02-26-2005 08:00 PM

I installed this mod, well i tried. Followed everything correctly but they links arent showing up in modcp, the tables around them are their but no links!

Is it something i've done wrong, can someone help thanks!

boozehound 02-26-2005 08:04 PM

Quote:

Originally Posted by Nickeh32
I installed this mod, well i tried. Followed everything correctly but they links arent showing up in modcp, the tables around them are their but no links!

Is it something i've done wrong, can someone help thanks!

Did you refresh the phrase cache by editing a phrase through admincp? That's the only thing I can really think of.

I really should have put a call to build_language in the installer, but I didn't know about it at the time.

Nickeh32 02-26-2005 08:09 PM

Ok, thanks for that it works.
Nice mod it will help with my forum alot ;)

boozehound 02-26-2005 08:12 PM

Quote:

Originally Posted by Nickeh32
I'm a begginer when it comes to vb, care explaining were that is?

Admincp -> language & phrases -> phrase manager.
Edit any phrase, and save it without changing anything.

Nickeh32 02-26-2005 08:56 PM

I have a question, i've put postreport.php in the usercp but when i open it it deosn't have the usercp links at the side, i was wondering if someone could help, thanks!

boozehound 02-26-2005 09:04 PM

Quote:

Originally Posted by Nickeh32
I have a question, i've put postreport.php in the usercp but when i open it it deosn't have the usercp links at the side, i was wondering if someone could help, thanks!

To do that you could change the postreports template to:

Code:

$pagenav

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">

<thead>
        <tr>
                <td class="tcat" colspan="9">
                        $vbphrase[postreports_yourpostreports]
                </td>
        </tr>
</thead>

<tbody>

        <tr>
                <td class="thead">$vbphrase[postreports_postnumber]</td>
                <td class="thead">$vbphrase[postreports_postedby]</td>
                <td class="thead">$vbphrase[postreports_onthread]</td>
                <td class="thead">$vbphrase[postreports_yourcomment]</td>
                <td class="thead">$vbphrase[postreports_timestamp]</td>
                <td class="thead">$vbphrase[postreports_status]</td>
                <td class="thead">$vbphrase[postreports_moderator]</td>
                <td class="thead">$vbphrase[postreports_comment]</td>
                <td class="thead">$vbphrase[postreports_updated]</td>
        </tr>
        $postreportbits
        <tr>
                <td colspan="9" class="tfoot">&nbsp;
                </td>
        </tr>       
</tbody>
</table>

Then in postreports.php change
Code:

eval('print_output("' . fetch_template('postreports') . '");');
eval('$footer = "' . fetch_template('footer') . '";');
echo $footer;

to
Code:

eval('$HTML = "' . fetch_template('postreports') . '";');
eval('print_output("' . fetch_template('USERCP_SHELL') . '");');


Nickeh32 02-26-2005 09:14 PM

Wow, thankyou.

You made my day, thanks!

Another problem (i know i fuss, but it's needed :p)

The user cp link in reportpost.php have no class for the td their in, their just white!

trackpads 02-27-2005 01:57 AM

For some reason the reports are not making it into the database. I dont have prefix's and I am using your report.php from the post above since I use Erwins hack aswell. His is still functioning but the reportpost table is empty.

Any ideas?

Thanks!

-Jason

trackpads 02-27-2005 02:01 AM

Ok, never mind :) :) figured it out!

trackpads 02-27-2005 02:17 AM

Ok, drats. Got most of it working. The only problem is that when a user goes to their postreports.php it is just the headers, no reports that they submitted.

Any ideas?

Thanks again,

-Jason

trackpads 02-27-2005 02:22 AM

Ah ok, spelled the bits template wrong... dorh.... :)

Moncal 03-04-2005 11:26 PM

Good job pig. I think I will install this some time soon, just for the fun of it considering that no one on my forum ever reports posts.


All times are GMT. The time now is 05:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01775 seconds
  • Memory Usage 1,960KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (16)bbcode_code_printable
  • (1)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete