Convert Enthusiast to Bellabuffs

Firstly, thank you Jem for creating BellaBuffs! This tutorial is based off one that Jem wrote, and she also supplied the script.

<?php
require_once('config.php');

function breakEmail($email) {
	$email = str_replace('.', 'DOTTY', $email);
	$email = str_replace('@', 'ATTIE', $email);
	$email = str_replace('-', 'DASHY', $email);
	$email = str_replace('_', 'SCORE', $email);

	return $email;
}

// PLEASE CUSTOMISE THE TWO VARIABLES BELOW

$favefield = ""; // the name of ONE favourite field from your fanlisting - if
$tablename = ""; // the name of the fanlisting database table

// STOP CUSTOMISING NOW!

$q = mysql_query("SELECT * FROM `$tablename`", $db_link);

while($r = mysql_fetch_array($q, MYSQL_ASSOC)) {
	if ($r['showemail'] == "1") {
		$hide = "yes";
	} else {
		$hide = "no";
	}

	echo "{$r['name']}," . breakEmail(str_replace('(', '', str_replace(')', '', $r['email']))) . ",{$hide},{$r['url']},{$r['country']},".str_replace(',', '|', $r[$favefield])."
\n"; } error_reporting(0); ?>

There are two variables to edit above. The favefield, if you have one, and tablename, which should be specified in your Enthusiast admin.

Save this file as convert.php. Upload convert.php to your the same directory as your fanlisting.

Load convert.php – for example, yoursite.com/fanlisting/convert.php. If all goes well you should see a lot of information.

Copy and paste this into a text editor, and save as members.txt somewhere on your computer.

Download and configure Bellabuffs as you would normally. When everything is uploaded, you will need to overwrite the empty members.txt with the file you have just saved.

If successful, the member count should now appear as the same number as originally on your Enthusiast installation.