vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Wbb to VB, half way done (https://vborg.vbsupport.ru/showthread.php?t=47337)

pawel 01-03-2003 07:06 PM

Wbb to VB, half way done
 
Hi,
I am almost done writing a wbb to VB converter but I ran into some trouble. First, when you post a new thread, register, or reply it gives you a database error but it performs the action. Second, all the users appear as guests but I think that's because I didn't add them to the activation table. For now those are the 2 biggest problems. Here is the script:
PHP Code:

<?

mysql_connect("localhost", "xxx", "xxx");
$db_wbb = xxx;

mysql_select_db("$db_wbb")
or die("Could not select database");
print "Connected successfully<br><br>impoting...<br>";

//$result = mysql_query("SELECT userid, groupid, username, userpassword, useremail, userhp, usericq, aim, yim, signatur, statusextra, regdate, posts FROM bb1_user_table");

// User Import

$result = mysql_query("SELECT userid, groupid, username, userpassword, useremail, userhp, usericq, aim, yim, signatur, statusextra, regdate, userposts FROM bb1_user_table");


while ($row = mysql_fetch_array($result))
{
$password = $row["userpassword"];

$usergroup = $row["groupid"];

if($usergroup == 1) // admin
{
$usergroup = 6;
}
else if($usergroup == 3) // std user
{
$usergroup = 2;
}
else if($usergroup == 2) // Moderator
{
$usergroup = 7;
}


else {
$usergroup = 3;
}

$userid = $row["userid"];

if($userid == 1)
{
$userid = 2;
}

$username = $row["username"];
$email = $row["useremail"];
$posts = $row["posts"];
$joindate = $row["regdate"];
$lastvisit = $row["lastvisit"];
$lastactivity = $row["lastactivity"];
$signature = $row["signatur"];
$icq = $row["usericq"];
$aim = $row["aim"];
$yim = $row["yim"];
$homepage = $row["userhp"];
$usertitle = $row["usertitle"];

//stucture
//$result = mysql_query("SELECT userid, usergroupid, username, password, email, homepage, icq, aim, yahoo, signature, usertitle, joindate, posts FROM user");


// mysql_query("INSERT into bb1_user_table VALUES ('$userid', '$username', '$password', '$email', '$email', '$posts', '$usergroup', '', '$joindate', '$lastvisit', '$lastactivity', '1', '$signature', '$icq', '$aim', '$yim', '$homepage', '', '0', '0', '0', '', '', '$usertitle', '0', '', '0', '1', '1', '0', '0', '0', '0', '0', '1', '0', '1', '0')");
//mysql_query("INSERT into user VALUES ('$userid', '$username', '$password', '$email', '$email', '$posts', '$usergroup', '', '$joindate', '$lastvisit', '$lastactivity', '1', '$signature', '$icq', '$aim', '$yim', '$homepage', '', '0', '0', '0', '', '', '$usertitle', '0', '', '0', '1', '1', '0', '0', '0', '0', '0', '1', '0', '1', '0')");


mysql_query("INSERT into user VALUES ('$userid', '$usergroup', '$username' ,'$password', '$email', '1', '', '0', '$homepage', '$icq', '$aim', ' $yim', '$signature', '1', '1', '0', 'User', '0', '$joindate', '1', '-1', '$lastvisit', '$lastactivity', '', '$posts', '0', '0', '', '', '', '1', '1', '1', '1', '15', '0000-00-00', '-1', '1', '', '0', '0', '0')");
}
echo "imported users";


//Import Boards


$result = mysql_query("SELECT boardid, boardparentid, boardname, boardpassword, descriptiontext, threads, posts, lastposttime, lastpostid, sort, isboard, invisible, style_set FROM bb1_boards");


while ($row = mysql_fetch_array($result))
{

$boardid = $row["boardid"];
$boardparentid = $row["boardparentid"];
$boardname = $row["boardname"];
$boardpassword = $row["boardpassword"];
$descriptiontext = $row["descriptiontext"];
$threads = $row["threads"];
$posts = $row["posts"];
$lastposttime = $row["lastposttime"];
$lastpostid = $row["lastpostid"];
$sort = $row["sort"];
$isboard = $row["isboard"];
$invisible = $row["invisible"];
$homepage = $row["style_set"];

if ($isboard == 0) {
    $allowposting = 0;
    $cancontainthreads = 0;
    $daysprune = 0;

}
else {
    $allowposting = 1;
    $cancontainthreads = 1;
    $daysprune = 1;
}

if ($boardparentid == 0) {
    $boardparentid1 = -1;
}

else {
    $boardparentid1 = $row["boardparentid"];
}


echo "importing $boardname";
mysql_query("INSERT into forum VALUES ('$boardid', '1', '$boardname' ,'$descriptiontext', '1', '1', '$posts', '$lastposttime', 'unknown', '$threads', '$allowposting', '$cancontainthreads', '$daysprune', '', '', '0', '0', '1', '1', '0', '1', '1', '$boardparentid1', '', '1', '1', '0')");
echo "...done <br>";
}
echo "imported boards";


//import threads
$result = mysql_query("SELECT boardparentid, starttime, threadid, threadname, authorid, author, lastposterid, replies, views, timelastreply, important FROM bb1_threads");


while ($row = mysql_fetch_array($result))
{

$boardparentid = $row["boardparentid"];
$starttime = $row["starttime"];
$threadid = $row["threadid"];
$threadname = $row["threadname"];
$authorid = $row["authorid"];
$author = $row["author"];
$lastposterid = $row["lastposterid"];
$replies = $row["replies"];
$views = $row["views"];
$timelastreply = $row["timelastreply"];
$important = $row["important"];



echo "importing $threadname";
mysql_query("INSERT into thread VALUES ('$threadid',
'$threadname',
'$timelastreply',
'$boardparentid',
'0',
'1',
'$replies',
'$author',
'$authorid',
'unknown',
'$starttime',
'$views',
'0',
'',
'1',
'$important',
'0',
'0',
'0')")
or die(mysql_error());


echo "...done <br>";
}
echo "<b>imported threads</b>";


//import posts
$result = mysql_query("SELECT boardparentid, threadparentid, postid, userid, posttime, edittime, editorid, posttopic, message, posticon, ip FROM bb1_posts");


while ($row = mysql_fetch_array($result))
{

$boardparentid = $row["boardparentid"];
$threadparentid = $row["threadparentid"];
$postid = $row["postid"];
$userid = $row["userid"];
$posttime = $row["posttime"];
$edittime = $row["edittime"];
$editorid = $row["editorid"];
$posttopic = $row["posttopic"];
$message = $row["message"];
$posticon = $row["posticon"];
$ip = $row["ip"];

$result1 = mysql_query("SELECT username FROM bb1_user_table WHERE userid='$userid'");

        while ($row1 = mysql_fetch_array($result1))
                {

                    $username = $row1["username"];
            }

echo "importing $posttopic";
mysql_query("INSERT into post VALUES ('$postid',
'$threadparentid',
'$username',
'$userid',
'$posttopic',
'$posttime',
'',
'$message',
'1',
'1',
'$ip',
'0',
'1',
'$editorid',
'$edittime')")
or die(mysql_error());


echo "...done <br>";
}
echo "<b>imported Posts</b>";

mysql_close();
?>

Any help would be appreciated.
Thank You,
Paul

pawel 01-03-2003 09:42 PM

Somebody please help. If I don't get this done I will lose over 5,500 posts.
Thanks,
Paul

NTLDR 01-03-2003 09:50 PM

There no need to bump threads just because nobody as responeded in a few hours.

pawel 01-03-2003 09:57 PM

I know, I'm sorry, I'm becoming desperate. I will pay someone $50 to fix the above script.
Thank You,
Paul

pawel 05-23-2003 02:51 PM

I just remembered this post. If anyone needs this I got it working. The code is still a little messy so I will have to clean it up a bit, let me know if anyone is interested in it.
Paul

Morpheus84 07-05-2003 12:33 PM

Is it an wBB 2.1 to vBulletin Converter ?

And if its, is it an wbb 2.0.x to vb3 or wbb 2.1 to vb 2.3.0 converter ?


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01105 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete