Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Improved Post Report System Details »»
Improved Post Report System
Version: 1.01, by boozehound boozehound is offline
Developer Last Online: Sep 2007 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 02-17-2005 Last Update: 02-25-2005 Installs: 29
DB Changes
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 02-19-2005, 04:04 PM
Delphiprogrammi Delphiprogrammi is offline
 
Join Date: Feb 2004
Location: Landen(Belgium)
Posts: 1,335
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #23  
Old 02-19-2005, 05:25 PM
shadiguy1 shadiguy1 is offline
 
Join Date: Jul 2004
Location: Delco,Pa
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #24  
Old 02-19-2005, 05:30 PM
boozehound's Avatar
boozehound boozehound is offline
 
Join Date: Feb 2005
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #25  
Old 02-19-2005, 06:28 PM
shadiguy1 shadiguy1 is offline
 
Join Date: Jul 2004
Location: Delco,Pa
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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");
Reply With Quote
  #26  
Old 02-20-2005, 05:08 AM
Diana Notacat's Avatar
Diana Notacat Diana Notacat is offline
 
Join Date: Dec 2003
Location: Arkansas
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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! :]
Reply With Quote
  #27  
Old 02-20-2005, 11:06 AM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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! :]
Reply With Quote
  #28  
Old 02-20-2005, 12:24 PM
boozehound's Avatar
boozehound boozehound is offline
 
Join Date: Feb 2005
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #29  
Old 02-20-2005, 03:23 PM
boozehound's Avatar
boozehound boozehound is offline
 
Join Date: Feb 2005
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 $
|| ####################################################################
\*======================================================================*/
?>
Reply With Quote
  #30  
Old 02-26-2005, 08:00 PM
Nickeh32 Nickeh32 is offline
 
Join Date: Feb 2005
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #31  
Old 02-26-2005, 08:04 PM
boozehound's Avatar
boozehound boozehound is offline
 
Join Date: Feb 2005
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04501 seconds
  • Memory Usage 2,341KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete