Code: Select all
Snitz To phpbb 2.0.21 Conversion
This script will attempt to convert and migrate your Snitz forum data into your phpbb installation. It's designed for phpbb 2.0.21 (phpbb) but should work on other versions.
Before beginning the migration you should have/meet the following pre-requisites:
A MySQL database containing your Snitz forums
A phpbb installation with empty forums, using a working MySQL database
Permissions to read and write data, as well as ALTER, CREATE TABLE and DROP TABLE in the phpbb database
Your phpbb site MUST BE shutdown - if anyone changes anything in the phpbb database (eg: registers a new account etc) this script will probably DESTROY your phpbb site
This script looks for a user called "SNITZ MIGRATION" and deletes all phpbb users with user IDs higher than it. This is an ease-of-use feature in case you have to rerun this script.
A backup of both your Snitz and phpbb forums - this converter MODIFIES YOUR SNITZ DATABASE to fix errors
Your phpbb installation must have no forums. If you are not sure how to do this, seek professional help! Important note: this conversion tool WILL WORK with existing phpbb users - the conversion finds the next free userid then migrates users beginning with that ID. The conversion tool also checks all Snitz users for the same username as existing phpbb users - if an identical username is found, the converter will delete the Snitz user and reassign all their posts to the phpbb user. This means you can merge Snitz and phpbb user databases. You CANNOT merge the forums for technical reasons - the phpbb forum tables must be EMPTY. When the migration is complete you will need to recheck your forum config, especially posting permissions.
This conversion will create a new table called "snitz2phpbb", or will DROP it if it already exists. If by some random fluke you use this table name already, you'd better stop right now. I pity the fool who run this script when they need that table! When the conversion is complete, this table contains a map of Snitz userid's to phpbb userid's.
Remember the license agreement: By using this script you agree not to support or participate in any activity on www.nukeforums.com, including registering for a user account or posting in the forums. This is an absolute condition of your use of this converter. If you do not agree with this condition, you must delete your migrated phpbb data and this script RIGHT NOW.
By agreeing NOT to support www.nukeforums.com you are taking a stand for acceptable behaviour the phpbb community - good manners and common decency is a basic expectation, not an added bonus. Thank you!
Want to know what that condition is all about and why you shouldn't visit nukeforums? Click here!
"; ?>
Got that? Good! Then let's begin...
Scroll to the bottom of the page to view all results and continue to the next step.
"; } echo "
--------------------------------------------------------------------------------
"; if(!isset($HTTP_GET_VARS["goforit"])) { echo "
Click here to begin!"; die(); } // The main conversion script begins here. Don't edit anything below // this line unless you know what you're doing. // ******************************************************************* // Utility functions // ******************************************************************* function snitz2bbcode($text, $bbcodeuid = -1, $postid = -1) { global $snitz_url, $phpbb_url; $snitzOrama = array("[:(!] ", "[^]", "[:D]", "[B)]", "[:I]", "[cat]", "[:o)]", "[8D]", "[xx(]", "[V]", "[8]", "[}:)]", "[:X]", "[?]", "[:(]", "[:O]", "[8)]", "[|)]", "[:)]", "[:P]", "[;)]"); $bbcode = array(":evil:", ":)", ":D", ":?", ":oops:", ":?:", ":mrgreen:", "8)", ":x", ":evil:", ":?:", ":twisted:", ":)", ":?:", ":(", ":shock:", ":|", ":o", ":)", ":p", ";)"); $newtext = str_replace($snitzOrama, $bbcode, $text); if($postid != -1 && !empty($snitz_url) && !empty($phpbb_url)) $newtext = str_replace($snitz_url, $phpbb_url, $newtext); if($bbcodeuid != -1) { $bbcode = array("[b:".$bbcodeuid."]", "[u:".$bbcodeuid."]", "[i:".$bbcodeuid."]", "[quote:".$bbcodeuid."]", "[code:".$bbcodeuid."]", "[img:".$bbcodeuid."]", "[url:".$bbcodeuid."]", "[/b:".$bbcodeuid."]", "[/u:".$bbcodeuid."]", "[/i:".$bbcodeuid."]", "[/quote:".$bbcodeuid."]", "[/code:".$bbcodeuid."]", "[/img:".$bbcodeuid."]", "[/url:".$bbcodeuid."]"); $snitzOrama = array("[b]", "[u]", "[i]", "[quote]", "[code]", "[img]", "[url]", "[/b]", "[/u]", "[/i]", "[/quote]", "
Code: Select all
", "[IMG]", "[URL]", "[/B]", "[/U]", "[/I]", "[/QUOTE]", "