Legacy Rep Conversion

Status
Not open for further replies.

Morrus

Customer
All looking good and working well. Thank you!

I have a couple of things I'd like to do. I'm basically replacing the existing rep system with this, and would like to maintain existing scores. I've set 1 like = 1 rep in the settings, and prevented anybody from using rep. That should replace it from now on just fine.

1) What query would I run to copy existing rep totals over to existing like totals?

2) What query would I run to copy existing post reps over to liked posts, so the "most liked" table shows stuff previously repped and now liked? Did that even make sense? (I can imagine that might need the post table, in which case it ain't happening, but just in case it doesn't).
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
There's no support for importing reputation into Likes, I'll change this to a Feature Request so one can be written, though :)
 
I wasn't so much thinking of updating the product as just running a one-off query in PHPMYADMIN to copy the data over.
 
Try this:
Code:
INSERT INTO dbtech_thanks_entry 
	(varname, userid, contenttype, contentid, dateline, receiveduserid)
SELECT 
	IF(reputation < 0, 'dislikes', IF(reputation = 0, 'thanks', 'likes')) AS varname, 
	whoadded AS userid, 
	'post' AS contenttype, 
	postid AS contentid, 
	dateline, userid AS receiveduserid 
FROM reputation

This will make it so negative rep becomes Dislike, neutral rep becomes Thanks, and positive rep becomes Like

Remember to add your table prefix, if you use one

Afterwards, run the "Recalculate", "Rebuild Statistics" and "Rebuild Button Click Cache" maintenance actions in that order.
 
Status
Not open for further replies.
Back
Top