PDA

View Full Version : un-rate threads


TurboFC3S
09-17-2001, 08:16 PM
How about an admin option to remove the ratings from a thread. Probably the best way to do it would be this. If you're logged in as a Moderator/Admin, it would detect that and give you an extra admin option "UnRate Thread" at the bottom of the thread - in the Admin Options. Maybe the option "Change/UnRate Thread" where a Mod/Admin could change the rating to anything desired, or remove the rating completely.

We use thread ratings to archive threads on my board, and by un-rating them we could keep from archiving the stuff that's worthless.

Admin
09-18-2001, 06:42 AM
Not hard at all, I'll do this for you.

Admin
09-18-2001, 07:23 AM
Here it goes:
In postings.php, add this 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:
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:
<option value="unrate">Unrate Thread</option>
right before
</select>

And you're done! :)

Should I release this? :confused:

TurboFC3S
09-18-2001, 11:21 AM
Wow! The change that you have single-handedly caused on this board has been amazing. You're a great asset to the community.

I think this hack along with the one you did for me earlier would be a great combo for people looking for new ways to archive threads. Here's the other hack - http://www.vbulletin.com/forum/showthread.php?s=&threadid=20544

Thanks again Chev

Admin
09-18-2001, 11:41 AM
*cough* Chen. ;)

No problem, this -was- a great idea. :)

TurboFC3S
09-19-2001, 01:37 AM
These two hacks go together perfectly! It makes my life much easier ... as long as people use the rating system, good threads get archived and the rest gets pruned.

shadowbreed
09-19-2001, 02:32 AM
Just my opinion but i think you should release both of these hacks

TygerTyger
09-12-2006, 09:14 AM
Ultra-bump! Does anyone know how to thread unratings for 3.6?