AssassinGF
05-04-2001, 01:24 AM
Has anyone finished an IkonBoard to VBulletin converter?
Like many of the people that post on these forums i'm new to PHP. An older thread about an IkonBoard conversion started by Juan listed the following code as a start or as an example:
Here is the code that converts members from Ikonboard to phpBB, I am sure that someone with enough knowledge can modify it to work with Vbulletin.
The code is posted below:
<?php
/**
* Create a directory to work in. Chmod 777.
* Place this file in that directory.
* Copy your iKonBoard member cgi files into the working directory.
* Configure mysql variables below, as necessary
* Run this file.
* Nicola Asuni (www.technick.net) 11 march 2001
*
*/
?>
<html>
<head>
<title>iKonBoard 2 PhpBB (members)</title>
</head>
<body bgcolor="#FCD98F" text="#000000" link="#0000FF" vlink="#0000FF" alink="#FF0000">
<font face="Verdana, Arial"><div align="center"><b>iKonBoard 2 PhpBB (members)</b></div><p><font size="-1">
<?
$memberpath = getcwd();
//$memberpath = "/path/to/members";
$dbhost = "localhost";
$dbname = "phpbb"; //change this to correct value
$dbuser = "user"; //change this to correct value
$dbpass = "password"; //change this to correct value
// open directory, load member filenames into array
$handle = opendir($memberpath);
$a = 0;
while ($file = readdir($handle))
{
if((preg_match('||', $file)))
{
$members[$a] = $file;
echo "<br>file $a: $file";
$a++;
}
}
closedir($handle);
// count remaining elements of array
$i = count($members) - 1;
// insert data into phpBB mysql database
$db = mysql_connect("$dbhost", "$dbuser", "$dbpass") or
die("<P>Error: could not connect to the database. Using username $dbuser and password $dbpass.<BR>Please go back and try again.");
@mysql_select_db("$dbname", $db) or die ("<P>Error: Could not open database.");
// for each member, gather data for import
echo "<br>Processing $i members .";
while ( $i >= 0 ) {
$linetodecode = file($members[$i]);
$member = explode( "|", $linetodecode[0]);
$username = addslashes(trim($member[0]));
$user_password = md5(trim($member[1]));
$user_posts = trim($member[4]);
$user_email = trim($member[5]);
$user_viewemail = trim($member[6]);
$user_website = addslashes(trim($member[8]));
if (!strcmp($user_website,'http://')) {$user_website = "";}
$user_icq = trim($member[10]);
$user_from = addslashes(trim($member[11]));
$user_intrest = addslashes(trim($member[12]));
$user_regdate = gmdate("M d Y",trim($member[13]));
$user_sig = addslashes(trim($member[15]));
$user_theme = 1;
$user_lang = "english";
echo ".";
$user_id = $i+1;
$sql = "
replace into users
(user_id, username, user_password, user_email, user_viewemail, user_website, user_from, user_posts, user_intrest, user_regdate, user_sig, user_icq, user_theme, user_lang )
values
('$user_id', '$username', '$user_password', '$user_email', '$user_viewemail', '$user_website', '$user_from', '$user_posts', '$user_intrest', '$user_regdate', '$user_sig', '$user_icq', '$user_theme', '$user_lang' )
";
$result = mysql_query($sql, $db) or die("<P>Could not query the database! Check syntax! <br>Failed inserting $username ($members[$i])");
$i--;
}
echo "<P>Done Processing!";
exit;
?>
<p>
</body>
</html>
I hope someone can help me with this, but if not I understand. I'm sure this isn't a highly requested hack and not of very much importance compared to others. Any help is appreciated though.
Like many of the people that post on these forums i'm new to PHP. An older thread about an IkonBoard conversion started by Juan listed the following code as a start or as an example:
Here is the code that converts members from Ikonboard to phpBB, I am sure that someone with enough knowledge can modify it to work with Vbulletin.
The code is posted below:
<?php
/**
* Create a directory to work in. Chmod 777.
* Place this file in that directory.
* Copy your iKonBoard member cgi files into the working directory.
* Configure mysql variables below, as necessary
* Run this file.
* Nicola Asuni (www.technick.net) 11 march 2001
*
*/
?>
<html>
<head>
<title>iKonBoard 2 PhpBB (members)</title>
</head>
<body bgcolor="#FCD98F" text="#000000" link="#0000FF" vlink="#0000FF" alink="#FF0000">
<font face="Verdana, Arial"><div align="center"><b>iKonBoard 2 PhpBB (members)</b></div><p><font size="-1">
<?
$memberpath = getcwd();
//$memberpath = "/path/to/members";
$dbhost = "localhost";
$dbname = "phpbb"; //change this to correct value
$dbuser = "user"; //change this to correct value
$dbpass = "password"; //change this to correct value
// open directory, load member filenames into array
$handle = opendir($memberpath);
$a = 0;
while ($file = readdir($handle))
{
if((preg_match('||', $file)))
{
$members[$a] = $file;
echo "<br>file $a: $file";
$a++;
}
}
closedir($handle);
// count remaining elements of array
$i = count($members) - 1;
// insert data into phpBB mysql database
$db = mysql_connect("$dbhost", "$dbuser", "$dbpass") or
die("<P>Error: could not connect to the database. Using username $dbuser and password $dbpass.<BR>Please go back and try again.");
@mysql_select_db("$dbname", $db) or die ("<P>Error: Could not open database.");
// for each member, gather data for import
echo "<br>Processing $i members .";
while ( $i >= 0 ) {
$linetodecode = file($members[$i]);
$member = explode( "|", $linetodecode[0]);
$username = addslashes(trim($member[0]));
$user_password = md5(trim($member[1]));
$user_posts = trim($member[4]);
$user_email = trim($member[5]);
$user_viewemail = trim($member[6]);
$user_website = addslashes(trim($member[8]));
if (!strcmp($user_website,'http://')) {$user_website = "";}
$user_icq = trim($member[10]);
$user_from = addslashes(trim($member[11]));
$user_intrest = addslashes(trim($member[12]));
$user_regdate = gmdate("M d Y",trim($member[13]));
$user_sig = addslashes(trim($member[15]));
$user_theme = 1;
$user_lang = "english";
echo ".";
$user_id = $i+1;
$sql = "
replace into users
(user_id, username, user_password, user_email, user_viewemail, user_website, user_from, user_posts, user_intrest, user_regdate, user_sig, user_icq, user_theme, user_lang )
values
('$user_id', '$username', '$user_password', '$user_email', '$user_viewemail', '$user_website', '$user_from', '$user_posts', '$user_intrest', '$user_regdate', '$user_sig', '$user_icq', '$user_theme', '$user_lang' )
";
$result = mysql_query($sql, $db) or die("<P>Could not query the database! Check syntax! <br>Failed inserting $username ($members[$i])");
$i--;
}
echo "<P>Done Processing!";
exit;
?>
<p>
</body>
</html>
I hope someone can help me with this, but if not I understand. I'm sure this isn't a highly requested hack and not of very much importance compared to others. Any help is appreciated though.