Convert Bellabuffs to Enthusiast

Firstly, thank you Jem for creating BellaBuffs! This tutorial will help you import members of a fanlisting powered by BellaBuffs, to a fanlisting being created in Enthusiast. This will be helpful if you are adopting a fanlisting and need to make the conversion.

In Enthusiast, set up your fanlisting. You don’t need to put the URL in yet. All you need to take note of when you set it up is the database table. This name – whatever you type in – is what you’ll need to remember. For this tutorial let us assume you are making a fanlisting on computers, and the table name is computers.

Copy the following code into a text editor. This was provided by Jem.

<?php
$file = "members.txt";
function fixEmail($email) {
    $email = str_replace('DOTTY', '.', $email);
    $email = str_replace('ATTIE', '@', $email);
    $email = str_replace('DASHY', '-', $email);
    $email = str_replace('SCORE', '_', $email);
    return $email;
}
$members = file($file);
$end = count($members);
$i = 0;
while ($i < $end) {
    list($name,$email,$dispemail,$url,$country,$fave) = preg_split("/,(?! )/",$members[$i]); 
    if ($dispemail == "yes") $showemail = 1;
    else $showemail = 0;
    echo "INSERT INTO `fanlisting` (`email`, `name`, `country`, `url`, `pending`, `showemail`, `showurl`) VALUES ('".fixEmail($email)."', '".$name."', '".$country."', '".$url."', 0, '".$showemail."', 1);
\n"; $i++; } ?>

Save this file as convert.php. Upload convert.php and members.txt to your website. It can be anywhere, but to keep things easy, just pop them in the same directory as your fanlisting.

Load convert.php – for example, yoursite.com/fanlisting/convert.php. In your browser, you should see the entire list of members converted.

Copy and paste this into a text editor, then perform a “find and replace”. Replace all instances of fanlisting with the name of the table of the fanlisting you are importing – in this case, computers.

After this, save the file as “members.sql”. You may need to include the quotes to be sure it saves as a .sql file.

Now log into your cPanel. Click on ‘phpMyAdmin’ under ‘Databases’. A new window should open. On the left panel, select your database that you use for Enthusiast. When the page loads, look on the left for the database table computers. Click on “Import”:

import SQL

There should be a button labelled “Browse” for you to locate a file on your computer. Click this button, and locate the members.sql file you created earlier. Under “format of imported file”, SQL should be selected. You shouldn’t have to change this.

Hit ‘Go’. After this, all the members should be imported successfully and when you view your fanlisting in Enthusiast, you should see all the members there.