bitweaver
Wiki
wiki Home
List Pages
wiki Books
Orphan Pages
wiki Rankings
Photos
List Galleries
Forums
Browse forums
Files
List Galleries
Categories
List Categories
Sign In
Message Boards
»
07. Support - 3rd party apps
Newest
Oldest
Threaded
5
10
20
50
100
All
Messages
phpBB users import?
Post Reply
kszys
Joined: 07 Sep 2005
phpBB users import?
Posted:08 Sep 2005 (09:46 UTC)
kszys
Joined: 07 Sep 2005
Posted:14 Sep 2005 (16:19 UTC)
spiderr
Joined: 08 Feb 2004
Posted:19 Sep 2005 (03:54 UTC)
kszys
Joined: 07 Sep 2005
Posted:19 Sep 2005 (15:45 UTC)
MtnViewJohn
Joined: 06 Mar 2006
Posted:07 Apr 2006 (02:38 UTC)
Dj Gilcrease
Joined: 07 Jun 2006
Posted:08 Jun 2006 (06:45 UTC)
Dj Gilcrease
Joined: 07 Jun 2006
Posted:08 Jun 2006 (06:51 UTC)
Post Reply
Page 1 of 1
1
Post
Title
Login
If you are already registered, please enter your login credentials.
Your Name
Anonymous Post
Content Format
Tiki Wiki Syntax
Allow HTML
{quote format_guid="bbcode" comment_id="7632" user="Digitalxero"}Here is a script that will do this for you. What you need to do; 1) Have a functional phpBB install 2) Install bitweaver into the same Database 3) save this file someware in the root of your phpBB install and call it via a web browser 4) Copy your existing config.php file from your phpBB install to the phpBB directory of your bitweaver install 5) Be happy your done! [code:1:924d9a602a] <?php define('IN_PHPBB', true); define('IS_INDEX', 1); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); // // End session management // //Set what templet file to use $page_title = 'Welcome '.$userdata['username']; $template->set_filenames(array( 'portal_body' => 'generic.tpl') ); include($phpbb_root_path.'includes/page_header.'.$phpEx); //Delete the current users in bitweaver $sql = "TRUNCATE TABLE `{YOU NEED TO EDIT THIS}_users_users`"; if(!($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not clear users table', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); //Delete the registered users from the bitweaver DB $sql = "DELETE FROM {YOU NEED TO EDIT THIS}_users_groups_map WHERE group_id = 3"; if(!($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not clear group map table', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); $sql = "SELECT * FROM ". USERS_TABLE; if(!($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could fetch phpBB users', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrowset($result); $db->sql_freeresult($result); $maxUID = -1; for($i=0;$i<count($row);$i++) { $maxUID = ($row[$i]['user_id'] > $maxUID) ? $row[$i]['user_id']: $maxUID; $sql = "INSERT INTO {YOU NEED TO EDIT THIS}_users_users(user_id, login, real_name, email, hash, registration_date) VALUES('". $row[$i]['user_id'] ."', '". $row[$i]['username'] ."', '". $row[$i]['username'] ."', '". $row[$i]['user_email'] ."', '". $row[$i]['user_password'] ."', '". $row[$i]['user_regdate'] ."')"; if(!($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could insert phpBB user', '', __LINE__, __FILE__, $sql); } echo 'Installed User: '. $row[$i]['username'] .'<br>'; $db->sql_freeresult($result); if($row[$i]['user_id'] != -1) { $sql = "INSERT INTO {YOU NEED TO EDIT THIS}_users_groups_map(user_id, group_id) VALUES('". $row[$i]['user_id'] ."', 3)"; if(!($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could update the group map', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); } } //Update the Max UserID $sql = "UPDATE {YOU NEED TO EDIT THIS}_users_users_user_id_seq SET id = $maxUID"; if(!($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not update the user_id_seq table', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); //Create the missing tables and fields from phpBB 2.0.15 $sql = "ALTER TABLE ". SESSIONS_TABLE ." ADD `session_admin` TINYINT( 2 ) NOT NULL"; if(!($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not update the user_id_seq table', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); $sql = "CREATE TABLE ". $table_prefix ."_sessions_keys ( `key_id` varchar(32) NOT NULL default '0', `user_id` mediumint(8) NOT NULL default '0', `last_ip` varchar(8) NOT NULL default '0', `last_login` int(11) NOT NULL default '0', PRIMARY KEY (`key_id`,`user_id`), KEY `last_login` (`last_login`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1"; if(!($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not update the user_id_seq table', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); include($phpbb_root_path.'includes/page_tail.'.$phpEx); ?>[/code:1:924d9a602a]{/quote}
Recent Page Changes
welcome to bitweaver.org
Bitweaver Overview
ReleaseTwo Schema Changelog 2006
PressReleaseOne
Spider's Web
Press Release Two
BitcommercePackage
InfiniBand vs Ethernet Performance
InfiniBand for Dummies
Show More…