Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-24-2011, 09:39 AM
Zylantex Zylantex is offline
 
Join Date: Sep 2009
Location: France
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Change "Thanks" into Rep Points - Can it be done?

I am considering changing from a "Thanks" based merit system to the standard Reputation points system.

The thing is, I don't want users to loose their current perceived status.
Is there any way to translate thanks into rep points to start users off with their current standing?
Reply With Quote
  #2  
Old 03-24-2011, 03:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If I recall, the thanks mod has it's own tables. So you would need to write a query to transfer all those 'points' to 'rep' points and also transfer any other necessary information from the thanks table to the reputation table. You are going to have to get a good understanding of his tables. So, I'd suggest getting into your database and seeing what is what in the Thanks tables and then doing the same in the Reputation tables.
Reply With Quote
  #3  
Old 03-25-2011, 05:43 AM
Zylantex Zylantex is offline
 
Join Date: Sep 2009
Location: France
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Lynnne. We started work on that last night but we are not MYSQL experts by any means. We have managed to fill all fields except one. We can't figure out how to do it.

This is what we have so far using a temporary reputation table named rep_final. Once we have the last bit. transferring the records from rep_final to the permanent reputation table is straight forward.

Code:
INSERT INTO rep_final (whoadded, dateline, postid)
  SELECT userid, date, postid       
  FROM post_thanks;
UPDATE rep_final SET reputation = "1";
UPDATE rep_final SET reason = "Thanked Post";
The final field userid is obtained by reading the field postid in table post_thanks then finding the postid record in table posts and selecting the field userid from that record. This value should the be written as the userid field in rep_final.

I don't know how to write that query. If anyone could help me with it would be really great. Thanks.

--------------- Added 25 Mar 2011 at 15:15 ---------------

We figured it out finally. We also found out how to restore an emptied table from a backup, but that is another story. :erm:

If anybody is interested this is the final code. Please don't be tempted to do this unless you have some basic experience.

First we turned off the Post Thanks hack and the Reputation System via the AdminCP. Next using phpAdmin we emptied the reputation table. Then we ran this code.

Code:
INSERT INTO reputation (whoadded, dateline, postid)
SELECT userid, date, postid       
FROM post_thanks;

UPDATE reputation SET reputation = "1";

UPDATE reputation SET reason = "Thanked Post";

UPDATE reputation, post
SET reputation.userid = post.userid
WHERE post.postid = reputation.postid;
When it was finished we turned the Rep system back on and ran the update reputation counter in the AdminCP->Maintenance. Job done.


Thanks again for your help Lynne.
Reply With Quote
  #4  
Old 03-25-2011, 03:14 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you got that sorted.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:50 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03757 seconds
  • Memory Usage 2,189KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete