View Single Post
  #171  
Old 11-22-2005, 02:08 AM
Arto Arto is offline
 
Join Date: Sep 2005
Location: By the beach
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I recently converted a phpBB forum to vBulletin and at the same time migrated members' medals from phpBB's Medal System Mod v2.1.0 by ycl6 to YAAS v2.0.5. As the SQL table schemas for both award mods are very similar, this was fairly painless and can be accomplished through executing a few simple SQL statements. What follows is a quick how-to which hopefully will be useful for others looking to avoid manually importing the medals

First off, it is presupposed that you've imported your phpBB forum's data to vB using Jelsoft's ImpEx, that the import session is still active (that is, the importuserid field needs to exist in vB's user table) and that you've installed YAAS. Additionally, the queries are written for a situation where phpBB and vB share the same database, phpBB with the table prefix phpbb_ and vB without a table prefix; adjust to your specific setup where necessary.

The SQL queries can be executed from vB's admin panel (if you have the permissions), phpMyAdmin or the MySQL command-line client. (Needless to say, if you don't know understand what the SQL statements do, or are unable to adapt them to your specific situation, don't execute them!)

To begin, the following SQL statement will convert all medals from phpBB to YAAS, preserving the same row identifiers (which means you may get clashes unless you first delete the included example award in YAAS):

Quote:
INSERT INTO award SELECT medal_id AS award_id, -1 AS award_cat_id, medal_name AS award_name, medal_description AS award_desc, medal_image AS award_icon_url, medal_image AS award_img_url, 1 AS award_icon_url FROM phpbb_medal;
Note that the awards are imported as un-categorized; you will need to manually assign them to an award category in YAAS's admin panel before they'll show up in vB's front end.

Next, you need to copy all the medal/award images from phpBB's medals/ directory to the images/medals/ directory under your vB installation. The image paths also need to be corrected in the database, which can be done with the following two SQL statements (replace the URL http://www.yourforumsite.com/forum/ with your vB forum's base URL):

Quote:
UPDATE award SET award_icon_url = CONCAT('http://www.yourforumsite.com/forum/images/', award_icon_url);
UPDATE award SET award_img_url = CONCAT('http://www.yourforumsite.com/forum/images/', award_img_url);
Finally, the following SQL statement will import all issued awards to YAAS, mapping from the phpBB user to the correct vB member through the aforementioned importuserid field:

Quote:
INSERT INTO award_user SELECT m.issue_id, m.medal_id AS award_id, u.userid AS userid, m.issue_reason, m.issue_time FROM phpbb_medal_user m LEFT JOIN user u ON m.user_id = u.importuserid;
That's all, folks Though I migrated from the Medal System Mod v2.1.0, the instructions will likely work for newer versions as well (and could be enhanced to import award categories as well, which were introduced in the Medal System Mod v2.2.0).
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01167 seconds
  • Memory Usage 1,780KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete