rossco_2005
07-29-2005, 10:00 PM
THIS MOD IS NOT SUPPORTED ANYMORE
This hack is a rerelease of Sebastian's report system mod found here: https://vborg.vbsupport.ru/showthread.php?t=59927
But it's been changed a bit.
There is no warning system in my mod, I added a "report fulfilled" system to it, and i removed the emailing mods so all it does is PM them.
What is it?
This mod replaces the vbulletin report system with a new system featuring the folowing features:
The report post form has been redone to have user selectable "reason" for reporting, as well as an "other" box where they can type the reason
Reports are then PMed instead of emailed to mods and/or admins
vBulletin keeps the status of the report through the database...when a mod fulfills the report's request they can then change the report's status to "true"
The status of the report is show in the private message
Installation
File Edits
Open report.php.
Find:
$forumperms = fetch_permissions($threadinfo['forumid']);
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
print_no_permission();
}
if (!$threadinfo['threadid'] OR !$postinfo['visible'] OR !$threadinfo['visible'] OR !$postinfo['postid'] OR $threadinfo['isdeleted'] OR $postinfo['isdeleted'])
{
eval(standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink'])));
}
Replace with:
if ($_GET['do'] != 'fulfilled' and $_GET['do'] != 'notfulfilled' and $_GET['do'] != 'img')
{
$forumperms = fetch_permissions($threadinfo['forumid']);
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
print_no_permission();
}
if (!$threadinfo['threadid'] OR !$postinfo['visible'] OR !$threadinfo['visible'] OR !$postinfo['postid'] OR $threadinfo['isdeleted'] OR $postinfo['isdeleted'])
{
eval(standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink'])));
}
}
Find:
// draw nav bar
Above it add:
// Report System Mod
$sendto = array();
$tostring = array();
// / Report System Mod
Find:
'reason' => TYPE_STR,
Replace with:
// Report System Mod
'other' => TYPE_STR,
// / Report System Mod
Find:
if ($vbulletin->GPC['reason'] == '')
{
eval(standard_error(fetch_error('noreason')));
}
Replace with:
if ($reason == '' and $other != '')
{
$reason = $other;
}
elseif ($reason == '' and $other == '')
{
eval(standard_error(fetch_error('noreason')));
}
In 2 places Find:
$moderators = $db->query_read("
SELECT DISTINCT user.email, user.languageid
Replace with:
$moderators = $db->query_read("
SELECT DISTINCT user.email, user.languageid, user.userid, user.username
In 2 places Find:
while ($moderator = $db->fetch_array($moderators))
{
$mods[] = $moderator;
Replace with:
while ($moderator = $db->fetch_array($moderators))
{
$mods[] = $moderator;
// Report System Mod
$tostring["$moderator[userid]"] = $moderator['username'];
$sendto["$moderator[userid]"] = $moderator['userid'];
// / Report System Mod
Find:
foreach ($mods AS $index => $moderator)
{
if (!empty($moderator['email']))
{
$email_langid = ($moderator['languageid'] > 0 ? $moderator['languageid'] : $vbulletin->options['languageid']);
($hook = vBulletinHook::fetch_hook('report_send_email')) ? eval($hook) : false;
eval(fetch_email_phrases('reportbadpost', $email_langid));
vbmail($moderator['email'], $subject, $message, true);
}
}
Replace with:
// Report System Mod
$db->query("
INSERT INTO " . TABLE_PREFIX . "`reportfulfilled`
(status) VALUES ('false')
");
$id = $db->insert_id();
eval('$message = "' . fetch_template('report_msg') . '";');
$db->query("
INSERT INTO " . TABLE_PREFIX . " `pmtext`
(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature, allowsmilie)
VALUES
($vbphrase[fromuserid], '$vbphrase[fromusername]', 'Reported Post by " . $vbulletin->userinfo['username'] . "', '" . addslashes($message) . "', '" . addslashes(serialize($tostring)) . "', 0, " . time() . ", 0, 1)");
$pmtextid = $db->insert_id();
foreach ($mods AS $index => $moderator)
{
$db -> query("
INSERT INTO " . TABLE_PREFIX . "`pm`
(pmtextid, userid)
VALUES
($pmtextid, $moderator[userid])
");
$db -> query("
UPDATE " . TABLE_PREFIX . "`user` SET
pmtotal=pmtotal+1,
pmunread=pmunread+1
WHERE userid=$moderator[userid]
");
}
// / Report System Mod
Templates
Replace the template Reportbadpost with this code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions - $vbphrase[report_bad_post]</title>
$headinclude
</head>
<body>
$header
$navbar
<form action="report.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]" />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"
align="center">
<tr>
<td class="tcat" align="$stylevar[right]">
<span style="float:$stylevar[left]">$vbphrase[report_bad_post]</span>
<span class="smallfont"><strong>$vbphrase[forum]</strong>: <a href="forumdisplay.php?$session[sessionurl]f=$foruminfo[forumid]">$foruminfo[title]</a></span>
</td>
</tr>
<tr>
<td class="panelsurround" align="center">
<div class="panel">$usernamecode
<div style="width:640px" align="left">
<fieldset class="fieldset">
<legend>Reason</legend>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td><input type="radio" name="reason" value="offensive language" /></td>
<td width="96%"><b>offensive language</b></td>
</tr>
<tr>
<td><input type="radio" name="reason" value="blatant trolling" /></td>
<td width="96%"><b>blatant trolling</b></td>
</tr>
<tr>
<td><input type="radio" name="reason" value="harassing another user" /></td>
<td width="96%"><b>harassing another user</b></td>
</tr>
<tr>
<td><input type="radio" name="reason" value="illegal warez / crack sites" /></td>
<td width="96%"><b>illegal warez / crack sites</b></td>
</tr>
<tr>
<td><input type="radio" name="reason" value="repeating and or advertising" /></td>
<td width="96%"><b>repeating and or advertising</b></td>
</tr>
<tr>
<td><input type="radio" name="reason" value="pornographic material" /></td>
<td width="96%"><b>pornographic material</b></td>
</tr>
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Other?</legend>
<div style="padding:3px">
<textarea name="other" rows="6" cols="$textareacols" wrap="virtual"></textarea>
</fieldset>
</div>
</div>
<div style="margin-top:6px">
<input type="hidden" name="p" value="$postid" />
<input type="hidden" name="do" value="sendemail" />
<input type="hidden" name="url" value="$url" />
<input type="submit" class="button" value="$vbphrase[send_report]" accesskey="s" />
</div>
</td>
</tr>
</table>
</form>
$footer
</body>
</html>
Then create a new template called report_msg with the following code:
/member.php?u=$bbuserinfo[userid]]$bbuserinfo[username] ($vboptionspost:
? /showpost.php?p=$postinfo[postid]&postcount=$postinfo[postid]]$threadinfo[title] ($vboptionsThread:
? /showthread.php?p=$postinfo[postid]]$threadinfo[title] ($vboptions $reason
Fulfilled Status: $vboptions[bburl]/report.php?id=$id&do=img
Change Status to: /report.php?do=fulfilled&id=$id]true ($vboptionsDB Query
Run this query from either PHPmyadmin or in vbulletin to add the reportfulfilled table:
CREATE TABLE `reportfulfilled` (
`id` int(10) NOT NULL auto_increment,
`status` varchar(10) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
Other
Create a new bbcode called PHP Images, where the tag is "phpimg" and description can be whatever you want, with this code:
<img src="{param}" alt="" border="" />
Create a new member on your forum called "Reporter" or whatever you'd like. He does not have to have any special privileges or anything.
Now just import the included file "Report System Mod.xml" in the product manager to add the phrases and plugins automatically.
[b]Configuration
Edit the phrases "fromuserid" and "fromusername" to the username and userid of the reporter member you created in the installation.
You can change what images are used to 'report fulfilled' and 'report not fulfilled' in the plugin added.
If you want a "false" link for the fulfill status.. (set it back to not fulfilled) replace this in report_msg:
/report.php?do=fulfilled&id=$id]true ($vboptions[bburl)
with this:
/report.php?do=fulfilled&id=$id]true ($vboptions[bburl) | /report.php?do=notfulfilled&id=$id]false ($vboptions[bburl)
That should be all, enjoy!
This hack is a rerelease of Sebastian's report system mod found here: https://vborg.vbsupport.ru/showthread.php?t=59927
But it's been changed a bit.
There is no warning system in my mod, I added a "report fulfilled" system to it, and i removed the emailing mods so all it does is PM them.
What is it?
This mod replaces the vbulletin report system with a new system featuring the folowing features:
The report post form has been redone to have user selectable "reason" for reporting, as well as an "other" box where they can type the reason
Reports are then PMed instead of emailed to mods and/or admins
vBulletin keeps the status of the report through the database...when a mod fulfills the report's request they can then change the report's status to "true"
The status of the report is show in the private message
Installation
File Edits
Open report.php.
Find:
$forumperms = fetch_permissions($threadinfo['forumid']);
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
print_no_permission();
}
if (!$threadinfo['threadid'] OR !$postinfo['visible'] OR !$threadinfo['visible'] OR !$postinfo['postid'] OR $threadinfo['isdeleted'] OR $postinfo['isdeleted'])
{
eval(standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink'])));
}
Replace with:
if ($_GET['do'] != 'fulfilled' and $_GET['do'] != 'notfulfilled' and $_GET['do'] != 'img')
{
$forumperms = fetch_permissions($threadinfo['forumid']);
if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
{
print_no_permission();
}
if (!$threadinfo['threadid'] OR !$postinfo['visible'] OR !$threadinfo['visible'] OR !$postinfo['postid'] OR $threadinfo['isdeleted'] OR $postinfo['isdeleted'])
{
eval(standard_error(fetch_error('invalidid', $vbphrase['post'], $vbulletin->options['contactuslink'])));
}
}
Find:
// draw nav bar
Above it add:
// Report System Mod
$sendto = array();
$tostring = array();
// / Report System Mod
Find:
'reason' => TYPE_STR,
Replace with:
// Report System Mod
'other' => TYPE_STR,
// / Report System Mod
Find:
if ($vbulletin->GPC['reason'] == '')
{
eval(standard_error(fetch_error('noreason')));
}
Replace with:
if ($reason == '' and $other != '')
{
$reason = $other;
}
elseif ($reason == '' and $other == '')
{
eval(standard_error(fetch_error('noreason')));
}
In 2 places Find:
$moderators = $db->query_read("
SELECT DISTINCT user.email, user.languageid
Replace with:
$moderators = $db->query_read("
SELECT DISTINCT user.email, user.languageid, user.userid, user.username
In 2 places Find:
while ($moderator = $db->fetch_array($moderators))
{
$mods[] = $moderator;
Replace with:
while ($moderator = $db->fetch_array($moderators))
{
$mods[] = $moderator;
// Report System Mod
$tostring["$moderator[userid]"] = $moderator['username'];
$sendto["$moderator[userid]"] = $moderator['userid'];
// / Report System Mod
Find:
foreach ($mods AS $index => $moderator)
{
if (!empty($moderator['email']))
{
$email_langid = ($moderator['languageid'] > 0 ? $moderator['languageid'] : $vbulletin->options['languageid']);
($hook = vBulletinHook::fetch_hook('report_send_email')) ? eval($hook) : false;
eval(fetch_email_phrases('reportbadpost', $email_langid));
vbmail($moderator['email'], $subject, $message, true);
}
}
Replace with:
// Report System Mod
$db->query("
INSERT INTO " . TABLE_PREFIX . "`reportfulfilled`
(status) VALUES ('false')
");
$id = $db->insert_id();
eval('$message = "' . fetch_template('report_msg') . '";');
$db->query("
INSERT INTO " . TABLE_PREFIX . " `pmtext`
(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature, allowsmilie)
VALUES
($vbphrase[fromuserid], '$vbphrase[fromusername]', 'Reported Post by " . $vbulletin->userinfo['username'] . "', '" . addslashes($message) . "', '" . addslashes(serialize($tostring)) . "', 0, " . time() . ", 0, 1)");
$pmtextid = $db->insert_id();
foreach ($mods AS $index => $moderator)
{
$db -> query("
INSERT INTO " . TABLE_PREFIX . "`pm`
(pmtextid, userid)
VALUES
($pmtextid, $moderator[userid])
");
$db -> query("
UPDATE " . TABLE_PREFIX . "`user` SET
pmtotal=pmtotal+1,
pmunread=pmunread+1
WHERE userid=$moderator[userid]
");
}
// / Report System Mod
Templates
Replace the template Reportbadpost with this code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions - $vbphrase[report_bad_post]</title>
$headinclude
</head>
<body>
$header
$navbar
<form action="report.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]" />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"
align="center">
<tr>
<td class="tcat" align="$stylevar[right]">
<span style="float:$stylevar[left]">$vbphrase[report_bad_post]</span>
<span class="smallfont"><strong>$vbphrase[forum]</strong>: <a href="forumdisplay.php?$session[sessionurl]f=$foruminfo[forumid]">$foruminfo[title]</a></span>
</td>
</tr>
<tr>
<td class="panelsurround" align="center">
<div class="panel">$usernamecode
<div style="width:640px" align="left">
<fieldset class="fieldset">
<legend>Reason</legend>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td><input type="radio" name="reason" value="offensive language" /></td>
<td width="96%"><b>offensive language</b></td>
</tr>
<tr>
<td><input type="radio" name="reason" value="blatant trolling" /></td>
<td width="96%"><b>blatant trolling</b></td>
</tr>
<tr>
<td><input type="radio" name="reason" value="harassing another user" /></td>
<td width="96%"><b>harassing another user</b></td>
</tr>
<tr>
<td><input type="radio" name="reason" value="illegal warez / crack sites" /></td>
<td width="96%"><b>illegal warez / crack sites</b></td>
</tr>
<tr>
<td><input type="radio" name="reason" value="repeating and or advertising" /></td>
<td width="96%"><b>repeating and or advertising</b></td>
</tr>
<tr>
<td><input type="radio" name="reason" value="pornographic material" /></td>
<td width="96%"><b>pornographic material</b></td>
</tr>
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Other?</legend>
<div style="padding:3px">
<textarea name="other" rows="6" cols="$textareacols" wrap="virtual"></textarea>
</fieldset>
</div>
</div>
<div style="margin-top:6px">
<input type="hidden" name="p" value="$postid" />
<input type="hidden" name="do" value="sendemail" />
<input type="hidden" name="url" value="$url" />
<input type="submit" class="button" value="$vbphrase[send_report]" accesskey="s" />
</div>
</td>
</tr>
</table>
</form>
$footer
</body>
</html>
Then create a new template called report_msg with the following code:
/member.php?u=$bbuserinfo[userid]]$bbuserinfo[username] ($vboptionspost:
? /showpost.php?p=$postinfo[postid]&postcount=$postinfo[postid]]$threadinfo[title] ($vboptionsThread:
? /showthread.php?p=$postinfo[postid]]$threadinfo[title] ($vboptions $reason
Fulfilled Status: $vboptions[bburl]/report.php?id=$id&do=img
Change Status to: /report.php?do=fulfilled&id=$id]true ($vboptionsDB Query
Run this query from either PHPmyadmin or in vbulletin to add the reportfulfilled table:
CREATE TABLE `reportfulfilled` (
`id` int(10) NOT NULL auto_increment,
`status` varchar(10) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
Other
Create a new bbcode called PHP Images, where the tag is "phpimg" and description can be whatever you want, with this code:
<img src="{param}" alt="" border="" />
Create a new member on your forum called "Reporter" or whatever you'd like. He does not have to have any special privileges or anything.
Now just import the included file "Report System Mod.xml" in the product manager to add the phrases and plugins automatically.
[b]Configuration
Edit the phrases "fromuserid" and "fromusername" to the username and userid of the reporter member you created in the installation.
You can change what images are used to 'report fulfilled' and 'report not fulfilled' in the plugin added.
If you want a "false" link for the fulfill status.. (set it back to not fulfilled) replace this in report_msg:
/report.php?do=fulfilled&id=$id]true ($vboptions[bburl)
with this:
/report.php?do=fulfilled&id=$id]true ($vboptions[bburl) | /report.php?do=notfulfilled&id=$id]false ($vboptions[bburl)
That should be all, enjoy!