Here it goes:
In postings.php, add this code:
PHP Code:
// ############################### start unrate thread ###############################
if ($action=="unrate") {
$threadid=verifyid("thread",$threadid);
$threadinfo=getthreadinfo($threadid);
if (!$threadinfo[visible]) {
$idname="thread";
eval("standarderror(\"".gettemplate("error_invalidid")."\");");
}
if (!ismoderator($threadinfo[forumid],"canmanagethreads")) {
show_nopermission();
}
if ($s!=$session['dbsessionhash']) {
$newurl = replacesession($scriptpath);
eval("standarderror(\"".gettemplate("error_invalidsession")."\");");
}
$threadinfo[notes]= "Thread unrated by $bbuserinfo[username] on ".vbdate($dateformat." ".$timeformat,time()).". $threadinfo[notes]";
$DB_site->query("UPDATE thread SET votetotal=0,votenum=0,notes='".addslashes($threadinfo[notes])."' WHERE threadid='$threadid'");
$DB_site->query("DELETE FROM threadrate WHERE threadid='$threadid'");
eval("standardredirect(\"".gettemplate("redirect_unrated")."\",\"showthread.php?s=$session[sessionhash]&threadid=$threadid\");");
}
right before
(end of file)
Now add a template named redirect_unrated and put this in:
Quote:
The ratings for this thread have been successfully deleted. You are now being taken to the thread.
|
Now edit your showthread_adminoptions template and add this:
Code:
<option value="unrate">Unrate Thread</option>
right before
And you're done!
Should I release this?