PDA

View Full Version : Who Rated This Thread / Delete Who Rated


paul41598
12-02-2006, 10:00 PM
Who Rated This Thread / Delete Who Rated


Credits to Developer (https://vborg.vbsupport.ru/member.php?u=111455) for this hack, as he is the original creator.
His original hack located here (https://vborg.vbsupport.ru/showthread.php?t=109540). More notably called "Who Rated This Thread"


What I did with this hack, is I extended the functionality of it. Normally when a user rates a thread, you never know who rated it. With Developers original hack, you can find out who rated each thread and what they rated it at.

The difference that I put into it, is now you can actually delete individual user ratings! No more needing to go into phpmyadmin and running queries. The best part about this hack is it actually alters all tables necessary so that when you delete a users rating, the thread rating average changes properly with it!!




This is now a premium (http://chugger.homeip.net/myhacks/) hack only, available through myself

MorrisMcD
12-03-2006, 12:12 AM
can anyone see this or just admins?

paul41598
12-03-2006, 12:59 AM
anyone u set the permissions for.
Look for this part in the "whorate" template

<if condition="in_array($bbuserinfo[usergroupid], array(5,6,7))">

Probably best if you just set it for admins. I havnt wrote my hack yet so that the delete permissions are only for admins. Just thought about that....

MorrisMcD
12-03-2006, 01:49 AM
anyone u set the permissions for.
Look for this part in the "whorate" template

<if condition="in_array($bbuserinfo[usergroupid], array(5,6,7))">

Probably best if you just set it for admins. I havnt wrote my hack yet so that the delete permissions are only for admins. Just thought about that....

Cool.. Simple enough.. Yea.. Even if deleting was not an option, I like the ratings to stay anonymous... Except to me of course.. :)

So in my template edit, I just made it

<if condition="in_array($bbuserinfo[usergroupid], array(6))">

Thanks for the response.. :Clicks Install:

projectego
12-03-2006, 07:25 AM
Thanks for sharing. :)

HeloHi
01-24-2007, 03:41 AM
Thanks, works great!

edit: wait... after testing:

I have a rouge member who decided to rate every thread 1. After I installed this, and deleted his rating from one thread, he no longer appears on any of the other rating lists, but his rating of 1 is still there on every thread except the one that I deleted. Anyone have any idea why this would only work once per member, then not show the member's rating on any other threads after the first deletion?

Also I am running 3.6.4, could that be the reason?

jazde86
03-17-2007, 05:41 PM
Any chance to show that on FORUMDISPLAY?

Muellmann
04-09-2007, 12:05 AM
$vbulletin->db->query_write("
DELETE FROM " . TABLE_PREFIX . "threadrate
WHERE userid = '" . $_REQUEST['userid'] . "'
");


I had to uninstall it again.
As you see on the query in your product it deletes
all ratings of an user on all threads :eek:
You forgot to add the threadid in the WHERE-clause of the query.

chikkoo
04-21-2007, 02:21 PM
ooh..my bad luck, this Mod is "Not supported".
Wish it is a supported one.
I don't install not supported mods.

richTV
06-28-2007, 07:53 AM
$vbulletin->db->query_write("
DELETE FROM " . TABLE_PREFIX . "threadrate
WHERE userid = '" . $_REQUEST['userid'] . "'
");


I had to uninstall it again.
As you see on the query in your product it deletes
all ratings of an user on all threads :eek:
You forgot to add the threadid in the WHERE-clause of the query.

my board could really use this add-on.

has what Muellmann posted been fixed?

is this add-on you are sharing different than that premium one you are selling, Paul?

*Clicks Install for later use*

tnx, Rich. :)

btw, we are using 3.6.7PL1

richTV
07-20-2007, 05:04 AM
$vbulletin->db->query_write("
DELETE FROM " . TABLE_PREFIX . "threadrate
WHERE userid = '" . $_REQUEST['userid'] . "'
");


Hi.

i could really use this add-on if the threadid could be added so that it doesn't delete all ratings by a user

i'm not a programmer so i was wondering if someone could be so kind as to tell me if it would look like this? [my additioin is in red]....


$vbulletin->db->query_write("
DELETE FROM " . TABLE_PREFIX . "threadrate
WHERE userid = '" . $_REQUEST['userid'] . "' AND threadid = '" . $_REQUEST['threadid'] . "'
");


:):):)

Carlos2
07-20-2007, 11:15 AM
Good work ;)

Muellmann
07-24-2007, 01:06 AM
Your red code addition looks correctly richTV.
However the ' ' are for both values not necessary. :rolleyes:

Carlos2
07-24-2007, 07:58 AM
I install Vborg thread ratings and this plugins seems to doesnt work now. Anybody knows why?

richTV
07-25-2007, 02:27 AM
Your red code addition looks correctly richTV.
However the ' ' are for both values not necessary. :rolleyes:

ok, many tnx in looking into this. :)

richTV
12-29-2007, 06:31 AM
hey guys, using MS Sharepoint Designer, i incorporated Muellmann's edit [thanks!] into an updated xml and it's working fine in vB 3.6.8 PL1

this will do as Paul described but it won't delete ALL of that member's ratings from ALL threads....only that particular thread.

if u already installed it, then just overwrite the product with this one.

many thanks to Paul for sharing this useful addon. :)

and apologies if this was wrong of me to share here.

richTV
09-24-2008, 02:43 AM
currently using it in vB3.7.3 :)

i didn't like how it looked:

87255

so i changed it to look like this:

87256

Full Install Notes:

upload delete.gif to your images/misc and then install xml [above post]

In SHOWTHREAD template,

Find:

</head>


BEFORE IT ADD:

<script language="JavaScript">
<!--//BEGIN Script

function new_window(url) {

link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menuba r=0,scrollbars=1,resizable=1,width=500,height=250, left=180,top=180");

}
//END Script-->
</script>

Find:

<td class="thead">$vbphrase[rate_this_thread]<a name="goto_threadrating"></a>

After it add:

<if condition="in_array($bbuserinfo[usergroupid], array(5,6,7))"><a href="#" onclick="javascript:new_window('misc.php?do=whorate&threadid=$threadinfo[threadid]')"><center><b><font color=red>$vbphrase[devel_whorate_who]?</font></b></center></a></if>

Find:

<td class="thead">$vbphrase[rate_this_thread]<a name="goto_threadrating"></a>

change to:

<td class="thead"><center>$vbphrase[rate_this_thread]</center><a name="goto_threadrating"></a>

cheers and many thanks again to Paul. :)