Shepski
07-24-2002, 12:04 AM
hi,
i am determined to move over to vb but i HAVE to get my posts and members over from my XMB forum 1st. I am using someones vb to butcher until he decides what he will do with it to try and get the convertor working.
i have got the members and forums import working, i can get the threads and posts in but i have 2 problems.
1.) although the threads appear in the forums and the posts are there aswell the 1st post (ie new topic) is missing eg fred posts a new topic called test with some text in the main body, harry then replies. when i import them into vb it misses off freds post but the thread is there so it only displays harrys and anyone elses replies.
2.) the rest of the replies are all showing as This person is on your Ignore List. To view this post click [here]
please pleaes please can someone help. here is my code so far:
<?
$host = "localhost";
$dbname = "name";
$dbuser = "user";
$dbpasswd = "password";
mysql_pconnect($host, $dbuser, $dbpasswd) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
// Start by converting the members
echo "<b><u>Converting Members...Please Wait!</u></b><br>";
$res=mysql_query("select * from dvd_members");
while($do=mysql_fetch_array($res)){
$password = md5($do[password]);
if ($do[status]=="Administrator"){
$usergroupid = "6";
} else if ($do[status]=="Moderator"){
$usergroupid = "7";
} else {
$usergroupid = "2";
}
mysql_query("INSERT INTO user VALUES('', '$usergroupid', '$do[username]', '$password', '$do[email]', '1', '', '0', '$do[site]', '', '', '', '$do[sig]', '1', '1', '0', '', '0', '$do[regdate]', '1', '-1', '$do[lastvisit]', '1027429374', '0', '$do[postnum]', '0', '1', '', '', '', '1', '0', '0', '0', '15', '0000-00-00', '-1', '1', '', '0', '1', '0')");
}
echo "Members Conversion Complete!<br><br>";
// Finished the Members
// Importing Forums
// This bit is VERY tilty as XMB has a strange fid setup. Import the forums
// then login to the vb admin and re-aarange the forums and categories as required.
// Make sure all the forums are there.
echo "<b><u>Importing Forums...Please Wait!</u></b><br>";
$res=mysql_query("select * from dvd_forums");
while($do=mysql_fetch_array($res)){
mysql_query("INSERT INTO forum VALUES('$do[fid]', 0, '$do[name]', '$do[description]', '1', '$do[displayorder]', '$do[posts]', '$do[lastpost]', '', '$do[threads]', 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, -1, '1,-1', 0, 1, 0)");
}
echo "Forum Import Complete!<br><br>";
// Finished Forum Import
//Import the Threads
echo "<b><u>Importing Threads...Please Wait!</u></b><br>";
$res=mysql_query("select * from dvd_threads");
while($do=mysql_fetch_array($res)){
$find=mysql_query("select * from user where username='$do[author]'");
while($doh=mysql_fetch_array($find)){
mysql_query("INSERT INTO thread VALUES('$do[tid]', '$do[subject]', '$do[lastpost]', '$do[fid]', 0, 1, '$do[replies]', '$do[author]', '$doh[userid]', '$do[lastpost]', '$do[dateline]', '$do[views]', 0, '', 1, '$do[topped]', 0, 0, 0)");
}
}
echo "Thread Import Complete!<br><br>";
//Importing Posts
echo "<b><u>Importing Posts...Please Wait!</u></b><br>";
$res=mysql_query("select * from dvd_posts");
while($do=mysql_fetch_array($res)){
$find=mysql_query("select * from user where username='$do[author]'");
while($doh=mysql_fetch_array($find)){
// echo "'$do[pid]', '$do[tid]', '$do[author]', '$doh[userid]', 0, 1, '$do[replies]', '$do[author]', '$doh[userid]', '', '$do[dateline]', 0, '$do[message]', 1, 1, '$do[useip]', 0, 1, '',''";
mysql_query("INSERT INTO post VALUES('$do[pid]', '$do[tid]', '$do[author]', '$doh[userid]', '', '$do[dateline]', 0, '$do[message]', 1, 1, '$do[useip]', 0, 1, '','')");
}
}
echo "Post Import Complete!";
?>
the tables for xmb r as follows:
members:
CREATE TABLE dvd_members (
uid smallint(6) NOT NULL auto_increment,
username varchar(25) NOT NULL default '',
password varchar(18) NOT NULL default '',
regdate bigint(30) NOT NULL default '0',
postnum smallint(6) NOT NULL default '0',
email varchar(60) default NULL,
site varchar(75) default NULL,
aim varchar(40) default NULL,
status varchar(35) NOT NULL default '',
location varchar(50) default NULL,
bio text,
sig text,
showemail varchar(15) NOT NULL default '',
timeoffset int(5) NOT NULL default '0',
icq varchar(30) NOT NULL default '',
avatar varchar(90) default NULL,
yahoo varchar(40) NOT NULL default '',
customstatus varchar(100) NOT NULL default '',
theme varchar(30) NOT NULL default '',
bday varchar(50) default NULL,
langfile varchar(40) NOT NULL default '',
tpp smallint(6) NOT NULL default '0',
ppp smallint(6) NOT NULL default '0',
newsletter char(3) NOT NULL default '',
regip varchar(40) NOT NULL default '',
timeformat int(5) NOT NULL default '0',
msn varchar(40) NOT NULL default '',
dateformat varchar(10) NOT NULL default '',
ignoreu2u text,
lastvisit bigint(30) default NULL,
PRIMARY KEY (uid)
) TYPE=MyISAM;
threads
CREATE TABLE dvd_threads (
tid smallint(6) NOT NULL auto_increment,
fid smallint(6) NOT NULL default '0',
subject varchar(100) NOT NULL default '',
lastpost varchar(30) NOT NULL default '',
views int(100) NOT NULL default '0',
replies int(100) NOT NULL default '0',
author varchar(40) NOT NULL default '',
message text NOT NULL,
dateline bigint(30) NOT NULL default '0',
icon varchar(50) default NULL,
usesig varchar(15) NOT NULL default '',
closed varchar(15) NOT NULL default '',
topped smallint(6) NOT NULL default '0',
useip varchar(40) NOT NULL default '',
bbcodeoff varchar(15) NOT NULL default '',
smileyoff varchar(15) NOT NULL default '',
emailnotify varchar(15) NOT NULL default '',
PRIMARY KEY (tid)
) TYPE=MyISAM;
posts
CREATE TABLE dvd_posts (
fid smallint(6) NOT NULL default '0',
tid smallint(6) NOT NULL default '0',
pid smallint(8) NOT NULL auto_increment,
author varchar(40) NOT NULL default '',
message text NOT NULL,
dateline bigint(30) NOT NULL default '0',
icon varchar(50) default NULL,
usesig varchar(15) NOT NULL default '',
useip varchar(40) NOT NULL default '',
bbcodeoff varchar(15) NOT NULL default '',
smileyoff varchar(15) NOT NULL default '',
emailnotify varchar(15) NOT NULL default '',
PRIMARY KEY (pid)
) TYPE=MyISAM;
I cant think of anything else to include to help solve the riddles.
thanks
simon
i am determined to move over to vb but i HAVE to get my posts and members over from my XMB forum 1st. I am using someones vb to butcher until he decides what he will do with it to try and get the convertor working.
i have got the members and forums import working, i can get the threads and posts in but i have 2 problems.
1.) although the threads appear in the forums and the posts are there aswell the 1st post (ie new topic) is missing eg fred posts a new topic called test with some text in the main body, harry then replies. when i import them into vb it misses off freds post but the thread is there so it only displays harrys and anyone elses replies.
2.) the rest of the replies are all showing as This person is on your Ignore List. To view this post click [here]
please pleaes please can someone help. here is my code so far:
<?
$host = "localhost";
$dbname = "name";
$dbuser = "user";
$dbpasswd = "password";
mysql_pconnect($host, $dbuser, $dbpasswd) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
// Start by converting the members
echo "<b><u>Converting Members...Please Wait!</u></b><br>";
$res=mysql_query("select * from dvd_members");
while($do=mysql_fetch_array($res)){
$password = md5($do[password]);
if ($do[status]=="Administrator"){
$usergroupid = "6";
} else if ($do[status]=="Moderator"){
$usergroupid = "7";
} else {
$usergroupid = "2";
}
mysql_query("INSERT INTO user VALUES('', '$usergroupid', '$do[username]', '$password', '$do[email]', '1', '', '0', '$do[site]', '', '', '', '$do[sig]', '1', '1', '0', '', '0', '$do[regdate]', '1', '-1', '$do[lastvisit]', '1027429374', '0', '$do[postnum]', '0', '1', '', '', '', '1', '0', '0', '0', '15', '0000-00-00', '-1', '1', '', '0', '1', '0')");
}
echo "Members Conversion Complete!<br><br>";
// Finished the Members
// Importing Forums
// This bit is VERY tilty as XMB has a strange fid setup. Import the forums
// then login to the vb admin and re-aarange the forums and categories as required.
// Make sure all the forums are there.
echo "<b><u>Importing Forums...Please Wait!</u></b><br>";
$res=mysql_query("select * from dvd_forums");
while($do=mysql_fetch_array($res)){
mysql_query("INSERT INTO forum VALUES('$do[fid]', 0, '$do[name]', '$do[description]', '1', '$do[displayorder]', '$do[posts]', '$do[lastpost]', '', '$do[threads]', 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, -1, '1,-1', 0, 1, 0)");
}
echo "Forum Import Complete!<br><br>";
// Finished Forum Import
//Import the Threads
echo "<b><u>Importing Threads...Please Wait!</u></b><br>";
$res=mysql_query("select * from dvd_threads");
while($do=mysql_fetch_array($res)){
$find=mysql_query("select * from user where username='$do[author]'");
while($doh=mysql_fetch_array($find)){
mysql_query("INSERT INTO thread VALUES('$do[tid]', '$do[subject]', '$do[lastpost]', '$do[fid]', 0, 1, '$do[replies]', '$do[author]', '$doh[userid]', '$do[lastpost]', '$do[dateline]', '$do[views]', 0, '', 1, '$do[topped]', 0, 0, 0)");
}
}
echo "Thread Import Complete!<br><br>";
//Importing Posts
echo "<b><u>Importing Posts...Please Wait!</u></b><br>";
$res=mysql_query("select * from dvd_posts");
while($do=mysql_fetch_array($res)){
$find=mysql_query("select * from user where username='$do[author]'");
while($doh=mysql_fetch_array($find)){
// echo "'$do[pid]', '$do[tid]', '$do[author]', '$doh[userid]', 0, 1, '$do[replies]', '$do[author]', '$doh[userid]', '', '$do[dateline]', 0, '$do[message]', 1, 1, '$do[useip]', 0, 1, '',''";
mysql_query("INSERT INTO post VALUES('$do[pid]', '$do[tid]', '$do[author]', '$doh[userid]', '', '$do[dateline]', 0, '$do[message]', 1, 1, '$do[useip]', 0, 1, '','')");
}
}
echo "Post Import Complete!";
?>
the tables for xmb r as follows:
members:
CREATE TABLE dvd_members (
uid smallint(6) NOT NULL auto_increment,
username varchar(25) NOT NULL default '',
password varchar(18) NOT NULL default '',
regdate bigint(30) NOT NULL default '0',
postnum smallint(6) NOT NULL default '0',
email varchar(60) default NULL,
site varchar(75) default NULL,
aim varchar(40) default NULL,
status varchar(35) NOT NULL default '',
location varchar(50) default NULL,
bio text,
sig text,
showemail varchar(15) NOT NULL default '',
timeoffset int(5) NOT NULL default '0',
icq varchar(30) NOT NULL default '',
avatar varchar(90) default NULL,
yahoo varchar(40) NOT NULL default '',
customstatus varchar(100) NOT NULL default '',
theme varchar(30) NOT NULL default '',
bday varchar(50) default NULL,
langfile varchar(40) NOT NULL default '',
tpp smallint(6) NOT NULL default '0',
ppp smallint(6) NOT NULL default '0',
newsletter char(3) NOT NULL default '',
regip varchar(40) NOT NULL default '',
timeformat int(5) NOT NULL default '0',
msn varchar(40) NOT NULL default '',
dateformat varchar(10) NOT NULL default '',
ignoreu2u text,
lastvisit bigint(30) default NULL,
PRIMARY KEY (uid)
) TYPE=MyISAM;
threads
CREATE TABLE dvd_threads (
tid smallint(6) NOT NULL auto_increment,
fid smallint(6) NOT NULL default '0',
subject varchar(100) NOT NULL default '',
lastpost varchar(30) NOT NULL default '',
views int(100) NOT NULL default '0',
replies int(100) NOT NULL default '0',
author varchar(40) NOT NULL default '',
message text NOT NULL,
dateline bigint(30) NOT NULL default '0',
icon varchar(50) default NULL,
usesig varchar(15) NOT NULL default '',
closed varchar(15) NOT NULL default '',
topped smallint(6) NOT NULL default '0',
useip varchar(40) NOT NULL default '',
bbcodeoff varchar(15) NOT NULL default '',
smileyoff varchar(15) NOT NULL default '',
emailnotify varchar(15) NOT NULL default '',
PRIMARY KEY (tid)
) TYPE=MyISAM;
posts
CREATE TABLE dvd_posts (
fid smallint(6) NOT NULL default '0',
tid smallint(6) NOT NULL default '0',
pid smallint(8) NOT NULL auto_increment,
author varchar(40) NOT NULL default '',
message text NOT NULL,
dateline bigint(30) NOT NULL default '0',
icon varchar(50) default NULL,
usesig varchar(15) NOT NULL default '',
useip varchar(40) NOT NULL default '',
bbcodeoff varchar(15) NOT NULL default '',
smileyoff varchar(15) NOT NULL default '',
emailnotify varchar(15) NOT NULL default '',
PRIMARY KEY (pid)
) TYPE=MyISAM;
I cant think of anything else to include to help solve the riddles.
thanks
simon