Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 2001
Posts: 77
JJS
Offline
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 77
If not is there any way to change one? Thanks in advance for the help.

[:"purple"] Athenalink's Talkback Forums [/]


Sponsored Links
Joined: May 2001
Posts: 77
JJS
Offline
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 77
So shall I take the silence as a no???

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
It hasn't even gone a day yet, give us some time will ya! ;]

Actually, I wrote an answer to this right after you wrote your post, but threadsdev hasn't been working properly since.

Here's what I wrote:

This is a bit tricky, but it is possible. This seems to work, but please make a backup of your database before running any of these queries.

When a user gets rated, the rate given is added to all other ratings given, and a counter is increased by one. The number of stars are calculated by dividing the total ratings by the number of times the user has been rated, and this number is also stored in the database.

So if you want to remove one users' rating, you first need to read how many stars that user gave to the user, which can be done with this SQL query:

code:

SELECT R_Rating
FROM w3t_Ratings
WHERE R_What = 'RatedUser'
AND R_Rater = 'RatingUser'
AND R_Type = 'u'



Now you can do this query, which removes the vote and recalculates the number of stars:

code:

UPDATE w3t_Users
SET U_Rating = U_Rating - ***INSERT_NUMBER_FROM_LAST_QUERY_HERE***,
U_Rates = U_Rates - 1,
U_RealRating = U_Rating / U_Rates
WHERE U_Username = 'RatedUser'



You can also remove the rating from the ratings table, but I don't think it's necessary, with this query:

code:

DELETE FROM w3t_Ratings
WHERE R_What = 'RatedUser'
AND R_Rater = 'RatingUser'
AND R_Type = 'u'



If you just want to set the number of stars to something else, you will also have to set U_Rating and U_Rates to something which can be properly calculated into the number of stars you want. Otherwise the number of stars will be screwed up when someone rates the user again. To set the number of stars to three, you could use the following query, which doesn't take into consideration any of the earlier ratings:

code:

UPDATE w3t_Users
SET U_Rating = 3,
U_Rates = 1,
U_RealRating = '3'
WHERE U_Username = 'RatedUser'



DISCLAIMER: I haven't gone through the ratings scripts thoroughly, but I'm quite sure that this is how it works.

Joined: May 2001
Posts: 77
JJS
Offline
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 77
Gardner...

Thanks. I didn't mean to seem impatient but I know the gurus around here jump on questions right away so when the thread went 14 hours without a hit I figured it was a stumper.

Don't know if I feel up to trying the fix since it's a bit more complicated than what I was hoping for.

Apprecaite the assistance however.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Are you just wanting to change how many stars someone has....

This will "cheat" and do that for ya.
It's useful if you (the admin) ends up with a low rating and you want to set yourself back to 5 stars.

Run this SQL Command from Admin menu:

UPDATE w3t_Users
SET U_Rating = "50",
U_Rates = "10",
U_RealRating = "5"
WHERE U_UserName = "Josh"


That gives "Josh" 5 stars. (50 divided by 10 = 5)
You can play with the numbers however ya wish. Ever notice scream has 6 stars here.


Last edited by JoshPet; 11/16/2002 3:04 AM.
Sponsored Links
Joined: May 2001
Posts: 77
JJS
Offline
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 77
Thank, Mister Josh...

A "See Spot, See Spot Run" sql command I can handle just fine.

You da man!!

Joined: May 2001
Posts: 77
JJS
Offline
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 77
Josh my good man,

Is their a similar simple SQL command to change the rating on a thread?

I have a contemptuous member running around rating all the threads one star.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Sure....

First... find out the post number. The easiest way is when you hold your mouse over the link to the thread on the postlist page.... look in the URL for Number=32529 (or some number)


Then do this:

UPDATE w3t_Posts
SET B_Rating = "50",
B_Rates = "10",
B_RealRating = "5"
WHERE B_Number = "32529"


Same thing... substitue the post number where I have 32529.
Works the same way.... that would give it 10 total rates of 5 each... and thus 5 stars.

Joined: May 2001
Posts: 77
JJS
Offline
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 77
Thanks Josh!


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)