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


All times are GMT. The time now is 06:26 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.01214 seconds
  • Memory Usage 1,760KB
  • 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
  • (8)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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