Please realize that I am extremely busy and probably won't be able to support this much. I do plan to integrate something more robust into vBulletin so you no longer need to come here to gain this functionality. Perhaps you can bug feldon23 for support? The 3.0/3.5 code differences are easy enough to understand when you compare the two.
Save this as ezimport.php and place it in your admincp directory. Also note that it has no Admincp permission checking so buyer beware.
PHP Code:
<? /*************************************************************************** * ezboard import member converter 3.0b2 * Originally By Jason "DarkReaper" Rodzik * Special Thanks to Firefly and Stallion * Updated to vBulletin 3.0.x by Feldon * Updated to vBulletin 3.5.x by Freddie, pester Feldon for support * * http://www.unrealtournament.org/forums * * Support for this hack at: * http://vbulletin.com/forum/showthread.php?t=31443 *******************************************************************************/
// ######################## SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS ####################### define('THIS_SCRIPT', 'ezimport');
// #################### PRE-CACHE TEMPLATES AND DATA ###################### $phrasegroups = array(); $specialtemplates = array(); $globaltemplates = array(); $actiontemplates = array();
echo '<table cellpadding="4" cellspacing="0" border="0" align="center" width="90%" class="tborder"><tr><td class="alt1" style="padding-left: 20px; padding-top: 20px;">'; if (!empty($vbulletin->GPC['oldusername']) AND !empty($vbulletin->GPC['newusername'])) { if (!($getuser = $db->query_first("SELECT userid FROM " . TABLE_PREFIX . "user WHERE username='" . $db->escape_string($vbulletin->GPC['newusername']) . "'"))) { echo "<b>You have entered an invalid vBulletin username!</b><br />\n"; echo "There is no user by the name of <b>" . $vbulletin->GPC['newusername'] . "</b> registered on this forum.<br><br>\n"; } else { // get hold of his/her posts and update threads echo "Associating vB user <b>" . $vbulletin->GPC['newusername'] . " (#" . $getuser['userid'] . ")</b> with their EZBoard posts under username <b>" . $vbulletin->GPC['oldusername'] . "</b>..."; $db->query_write(" UPDATE " . TABLE_PREFIX . "post SET userid = $getuser[userid], username = '" . $db->escape_string($vbulletin->GPC['newusername']) . "' WHERE username = '" . $db->escape_string($vbulletin->GPC['oldusername']) . "' "); $db->query_write(" UPDATE " . TABLE_PREFIX . "thread SET postuserid = $getuser[userid], postusername = '" . $db->escape_string($vbulletin->GPC['newusername']) . "' WHERE postusername = '" . $db->escape_string($vbulletin->GPC['oldusername']) . "' "); $db->query_write(" UPDATE " . TABLE_PREFIX . "thread SET lastposter = '" . $db->escape_string($vbulletin->GPC['newusername']) . "' WHERE lastposter = '" . $db->escape_string($vbulletin->GPC['oldusername']) . "' "); $db->query_write(" UPDATE " . TABLE_PREFIX . "forum SET lastposter = '" . $db->escape_string($vbulletin->GPC['newusername']) . "' WHERE lastposter = '" . $db->escape_string($vbulletin->GPC['oldusername']) . "' "); echo "<b>Done!</b><br /><br />\n";
// Update post counts if (!($totalposts = $db->query_first("SELECT COUNT(postid) AS posts FROM " . TABLE_PREFIX . "post WHERE userid = $getuser[userid]"))) { // some versions of mysql like to return nothing if there are no matching rows when they should return 0 $totalposts['posts'] = 0; } $db->query_write("UPDATE " . TABLE_PREFIX . "user SET posts = $totalposts[posts] WHERE userid = $getuser[userid]"); echo "New post count is <b>" . $totalposts['posts'] . "</b><br />\n";
echo "You should now update your member titles.<br /><br />\n"; } } else { echo "<b>You have not entered a vBulletin username!</b><br />\n"; echo "Please enter new and old usernames and then click Update!<br />\n"; } echo '</td></tr></table>'; }
woow thankyou alot this is very usefull hack.. i have convert my board from IPB and i have alot of User that is deleted and showing as guest .. i think this hack going to help me as alot
wow, thank you. I asked on vbulletin.com how to do this and never got a response. I have all the old posts from ezboard just sitting in their own locked forum just waiting for this.
wow, thank you. I asked on vbulletin.com how to do this and never got a response. I have all the old posts from ezboard just sitting in their own locked forum just waiting for this.