#!/usr/bin/perl # soif changed this line for unix #*----------------------------------------*# # iB2 Version 2.1.x => IBF 1.0 # Members Convertor # # Written & Maintained by Stewart Campbell # s.campbell@ibforums.com # # This script is not to be distributed # without written permission of the author. # #*----------------------------------------*# ## SOIF modifications ############################### # This version has been edited and modified by soif to easely install it on unix hosts. # no warranty or support is provided by soif! # soif modifications are ALL commented and can be found by searching 'soif' in the code # # soif modifications include: # - correct path to perl for unix hosts # - fixed $user/$pass typos ;-) # - added .gif to all inported avatars (vatoloco suggestion) # - clean member's websites = "http://" to "" # - start first id at 10 (instead of 2) # - clean signature code # - NULL value corrected to '' # - disable post for 'banned' members and affect them to the $banned_group # remember to chmod this script to 755 ##################################################### $banned_group=3; ## banned members will be moved to this group. leave 3 if you dont want to change them # Basic Setup - NOT UserEditable use CGI; use CGI::Carp qw(fatalsToBrowser); use DBI; use Digest::MD5 qw(md5 md5_hex); my $q = new CGI; # End Basic Setup # USER DEFINABLE ELEMENTS # iB2 Elements # soif notes: keep the trailing '/' in this path /// $ib2dir = "/home/path/to/ikonboard/"; # Where your ikon.lib file resides $ib2version = "219"; # Version of iB2. Enter without .'s. Eg: # 2.1.7 = 217, 2.1.8 = 218 etc $limit = "200"; # Number of members to convert at a time, default is 200 # ADVANCED ONLY $fileformat = "default"; # Unless you have been given Specific instructions on how to use these, # DO NOT ALTER ANYTHING IN THE ADVANCED SECTION ABOVE! # IBF DataBase Elements $db = "database"; # Name of the Database IBF Is Using $host = "localhost"; # Host, normally localhost $username = "user"; # Username for the DB $password = "pass"; # Password for the DB $port = ""; # Port, if different from default $ibfprefix = "ibf_"; # IBF Prefix $adminsname = "admin"; # Admins Name on your IBF, so it doesnt get overwritten # END USER DEFINABLE ELEMENTS my $details = "DBI:mysql:dbname=$db"; $details .= ":$host" if $host; $details .= ":$port" if $port; # soif ## change $user --> $username and $pass --> $password ///////////////////////////////////// my $ibf = DBI->connect($details, $username, $password) or die "$DBI::errstr"; $members = $ibfprefix.members; if ($q->param('a') eq "dynamic") { &do_dynamic; } elsif ($q->param('a') eq "static") { &do_static; } elsif ($q->param('a') eq "members") { &do_members; } # elsif ($q->param('a') eq "categories") { # &do_categories; # } elsif ($q->param('a') eq "finished") { &convert_done; } else { &do_frames; } #------------------------------------------------------------------------- # soif - fn copied from ikonboardlib ######### sub ikoncode { my $post = shift; $post =~ s/\
/
/isg;
$post =~ s|\[\[|\{\{|g;
$post =~ s|\]\]|\}\}|g;
$post =~ s|\n\[|\[|g;
$post =~ s|\]\n|\]|g;
$post =~ s|
|
|g;
$post =~ s|\[hr\]\n|\
$1<\/font>
$2<\/font>
<\/blockquote>$3<\/font>
<\/blockquote>/isg; $post =~ s/\[quote\]\s*(.*?)\s*\[\/quote\]/
$1
<\/blockquote><\/font>/isg; $post =~ s/\[url\](\S+?)\[\/url\]/$1<\/a>/isg; $post =~ s/\[url=http:\/\/(\S+?)\]//isg; $post =~ s/\[url=(\S+?)\]//isg; $post =~ s/\[\/url\]/<\/a>/isg; $post =~ s/\ http:\/\/(\S+?)\ / http\:\/\/$1<\/a> /isg; $post =~ s/
http:\/\/(\S+?)\ /
http\:\/\/$1<\/a> /isg; $post =~ s/^http:\/\/(\S+?)\ /http\:\/\/$1<\/a> /isg; $post =~ s/\ www.(\S+?)\ / http\:\/\/www.$1<\/a> /isg; $post =~ s/
www.(\S+?)\ /
http\:\/\/www.$1<\/a> /isg; $post =~ s/^www.(\S+?)\ /http\:\/\/www.$1<\/a> /isg; $post =~ s/\[b\]//isg; $post =~ s/\[\/b\]/<\/b>/isg; $post =~ s/\[i\]//isg; $post =~ s/\[\/i\]/<\/i>/isg; $post =~ s/\[size=\s*(.*?)\s*\]\s*(.*?)\s*\[\/size\]/$2<\/font>/isg; $post =~ s/\[font=\s*(.*?)\s*\]\s*(.*?)\s*\[\/font\]/$2<\/font>/isg; $post =~ s/\[u\]//isg; $post =~ s/\[br\]/
/isg; $post =~ s/\[\/u\]/<\/u>/isg; $post =~ s/\[img\](.+?)\[\/img\]//isg; $post =~ s/\[color=(\S+?)\]//isg; $post =~ s/\[\/color\]/<\/font>/isg; $post =~ s/\\http:\/\/(\S+)/http:\/\/$1<\/a>/isg; $post =~ s/\[list\]/
/isg; $post =~ s/\[\*\]/
- /isg; $post =~ s/\[\/list\]/<\/ul>/isg; $post =~ s/\[code\](.+?)\[\/code\]/
code:<\/font>$1<\/pre><\/font>
<\/blockquote>/isg; $post =~ s/\\(\S+?)\@(\S+)/$1\@$2<\/a>/ig; $post =~ s/\[email=(\S+?)\]//isg; $post =~ s/\[\/email\]/<\/a>/isg; $post =~ s|\{\{|\[|g; $post =~ s|\}\}|\]|g; return $post; } # end routine sub convert_done { print $q->header(); info_screen("Conversion Complete!", "All Members Have Been Converted! There is no need for your members to convert their account, this has been done automatically. A Full Convertor will be available shortly, watch InvisionBoard.com for News!"); } sub do_frames { { print $q->header(); print "Ikonboard 2 to Invision Board Convertor "; exit(); } sub do_dynamic { print $q->header(); # Check we have entered a valid Admin name $std = $ibf->prepare("SELECT id FROM $members WHERE name=?"); $std->execute($adminsname); unless ($std->rows) { print "ERROR!
An account by the name of $adminsname cannot be found, please edit the script and check the case of the name entered."; exit(); } &info_screen("We're ready to go!", "Connected to mySQL Server: $host - Using Database: $dbTo continue, simply click the link below
Proceed >>" ); } sub do_static { print $q->header(); &print_top; print " Welcome! "; &print_bottom("",""); } sub print_bottom { ($copy, $no_exit) = @_; if ($copy eq "") { print "
Welcome to the Ikonboard 2 to Invision Board Convertor
Before you continue, have you configured this script? If you have not, open it up in your favourite text editor, and edit the values at the top of the script.
(The instructions are contained at the top of the script also).
Remember, that running this convertor will remove all your current Invision Board Forums, Posts and Topics.© 2002 Invision Board (www.invisionboard.com)