PDA

View Full Version : Report link starts thread in Mod's forum.


Joe
02-11-2003, 09:28 PM
Rather then have the report link send a thread to all moderators, how about make it start a thread in the Mod's forum? That would come in handy when talking about reported posts / problems. Moderators could also note of what was done.

Xenon
02-12-2003, 05:06 PM
hmm, really a nice idea :)

open report.php
find if ($DB_site->num_rows($moderators)==0) {
// get admins if no mods
$moderators=$DB_site->query("SELECT user.email FROM user,usergroup WHERE user.usergroupid=usergroup.usergroupid AND (usergroup.cancontrolpanel=1 OR usergroup.ismoderator=1)");
}

while ($moderator=$DB_site->fetch_array($moderators)) {
eval("\$message = \"".gettemplate("email_reportbadpost",1,0)."\";");
eval("\$subject = \"".gettemplate("emailsubject_reportbadpost",1,0)."\";");

mail ($moderator[email],$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
}

replace with:


eval("\$message = \"".gettemplate("email_reportbadpost",1,0)."\";");
eval("\$subject = \"".gettemplate("emailsubject_reportbadpost",1,0)."\";");

$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,postuserid,lastposter,dateline,iconid, visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','--Modforumid--','1','0','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".addslashes($bbuserinfo[username])."','".time()."','4','1','0')");
$threadid=$DB_site->insert_id();
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pa getext,allowsmilie,showsignature,ipaddress,iconid, visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','".addslashes($message)."',0,0,'$ipaddress',4,'1')");


think this should work, just insert the right id for --Modforumid-- ^^

Joe
02-12-2003, 05:16 PM
That starts a thread in the mod's forum, but does not include a title, or text about the report :)

Xenon
02-12-2003, 05:18 PM
sorry my fault, have corrected the mod above :)

Joe
02-12-2003, 05:19 PM
BTW, thanks for taking this on, i think its a great idea :)

Joe
02-12-2003, 05:22 PM
Yay, that worked, now off to edit some templates to make it look good :)

Thank you much, how about we move this to the completed hacks forum?

Xenon
02-12-2003, 05:30 PM
you're welcome :)

well, i'll make the instructions a bit clearer and release it :)
it's just the fast version, could be made in a nicer way also ;)

Joe
02-12-2003, 05:40 PM
Good deal, Here is the change i made for the templates:

In email_reportbadpost


$bbuserinfo[username] has reported this post:

[url ]http://www.yourURL.com/showthread.php?postid=$postid#post$post[postid][ /url]

This is the reason that the user gave:

$reason

----
Please reply to this thread on how the above was dealt with.


And in emailsubject_reportbadpost

Reported post in $thread[title]

Xenon
02-12-2003, 10:08 PM
thx :)

i think i'll release it tomorrow or friday...
have got som ideas which i have to test before releasing :)

Erwin
02-13-2003, 04:18 AM
Hey, I wrote the same hack in the thread by Overgrow when he released his create new thread in mod forum hack (he's done it) but which does not incorporate the email or PM bits.

I just used a similar piece of code to yours Xenon that uses the email templates as well. :)

Xenon
02-13-2003, 11:35 AM
oops, i got old then ;)

ok, less work :)

Erwin
02-13-2003, 06:40 PM
Maybe I should release it... but I didn't want to double up on Overgrow's hack, so I just posted mine in his thread... it was his idea in the first place. :)

Xenon
02-13-2003, 07:15 PM
good decision Erwin, why doublepost a hack.
further on this way and you'll become mod :p ;)

pic16f84
09-24-2003, 04:03 PM
Nice little hack,

also added

updateforumcount(MODS_FORUM_ID);

into report.php, so that the threads get updated

Erwin
10-10-2003, 12:15 AM
I've been running something like this that PMs, emails, and posts reports in my vB3. :) I will release it once vB3 goes RC.