Location: PHPKode > projects > AdaptBB > plugins/forum_converters.php
<?php
$protect = "yes";
$plugin_name = "Forum Converters";
$plugin_url = "admin.php?view=plugins&do=load&plugin=".strtolower(str_replace(" ", "_", $plugin_name));
$plugin_version = "1.0";
$url = strtolower(str_replace(" ", "_", $plugin_name)).".php";

$apage = basename($_SERVER['PHP_SELF']);
$siteurl = "http://".$_SERVER['HTTP_HOST'].str_replace($apage, "", $_SERVER['PHP_SELF']);
$url = $_GET['url'];

if ($_GET['check'] == "status") {
echo 1;
}

if ($module == "install_".$url) {
$tot = 0;
if (mysql_num_rows(mysql_query("SELECT * FROM ".$pre."plugins WHERE name = '".$plugin_name."'")) > 1) {
echo "<b>".$plugin_name."</b> Plugin already installed. <a href='admin.php?view=plugins&do=install'>Return</a>";
} else {
echo "Beginning to install the <b>".$plugin_name."</b> Plugin...<br /><br />";
$query1 = mysql_query("INSERT INTO ".$pre."plugins VALUES (null, '".$plugin_name."', '".$_GET['url']."', '".$plugin_version."', 'On')");
if ($query1 == TRUE) {
$tot = $tot + 1;
echo "`".$pre."plugins` MySQL data row Inserted? <font color='green'>True</font><br />";
} else {
echo "`".$pre."plugins` MySQL data row Inserted? <font color='red'>False</font><br />";
}
if ($tot == 1) {
echo "<br /><b>".$plugin_name."</b> Plugin installed <font color='green'>Sucessfully!</font>. <a href='".$plugin_url."'>".$plugin_name." Plugin</a>";
} else {
echo "<br /><b>".$plugin_name."</b> Plugin installed <font color='red'>Un-Sucessfully!</font>. Please check mysql settings and if need be, please submit a <a href='admin.php?view=support'>support ticket</a>.";
}
}
}

if ($module == "uninstall_".$url) {
$tot = 0;
if (mysql_num_rows(mysql_query("SELECT * FROM ".$pre."plugins WHERE name = '".$plugin_name."'")) > 1) {
echo "<b>".$plugin_name."</b> Plugin already un-installed, or not yet installed. <a href='admin.php?view=plugins&do=install'>Return</a>";
} else {
echo "Beginning to un-install the <b>".$plugin_name."</b> Plugin...<br /><br />";
$query1 = mysql_query("DELETE FROM ".$pre."plugins WHERE name = '".$plugin_name."'");
if ($query1 == TRUE) {
$tot = $tot + 1;
echo "`".$pre."plugins` MySQL data row Deleted? <font color='green'>True</font><br />";
} else {
echo "`".$pre."plugins` MySQL data row Deleted? <font color='red'>False</font><br />";
}
if ($tot == 1) {
echo "<br /><b>".$plugin_name."</b> Plugin un-installed <font color='green'>Sucessfully!</font>. <a href='admin.php?view=plugins'>Plugins</a>";
echo $data;
} else {
echo "<br /><b>".$plugin_name."</b> Plugin un-installed <font color='red'>Un-Sucessfully!</font>. Please check mysql settings and if need be, please submit a <a href='admin.php?view=support'>support ticket</a>.";
echo $data;
}
}
}

if (basename($_SERVER['PHP_SELF']) == "admin.php") {
if ($module == "") {
echo "<b>Directory</b>&nbsp;&nbsp;-&nbsp;&nbsp;<a href='admin.php?view=plugins'>Plugins</a> / <a href='".$plugin_url."'>".$plugin_name." Plugin</a><br /><br /><br />";

echo "<table cellpadding='5' cellspacing='0' border='0' width='90%' align='center' style='border: 2px solid #dddddd'><tr style='background:url(".$siteurl."inc/images/topbg.jpg) repeat-x;'><td><b>Forum</b></td><td><b>Version</b></td><td><b>Website</b></td></tr>";

$array = array("AdaptBB Beta|http://www.adaptbb.com" => "1.0", "OneCMS Forums|http://www.insanevisions.com/forums" => "2.5", "phpBB|http://www.phpbb.com" => "3.0.x");
$i = 0;
while (list($r, $v) = each ($array)) {
$ex = explode("|", $r);
if (($i % 2) === 0) {
echo "<tr class='light'>";
} else {
echo "<tr class='dark'>";
}
echo "<td><a href='".$plugin_url."&module=".strtolower(str_replace(" ", "_", $ex[0]))."'>".$ex[0]."</a></td><td>".$v."</td><td><a href='".$ex[1]."' target='new'>".check_domain($ex[1])."</a></td></tr>";
$i = $i + 1;
}
echo "</table>";
}

if ($module == "adaptbb_beta") {
echo "<b>Directory</b>&nbsp;&nbsp;-&nbsp;&nbsp;<a href='admin.php?view=plugins'>Plugins</a> / <a href='".$plugin_url."'>".$plugin_name." Plugin</a><br /><br /><br />";

echo "<form action='".$plugin_url."&module=adaptbb_beta2' method='post'><table cellpadding='5' cellspacing='0' border='0' width='90%' align='center' style='border: 2px solid #dddddd'><tr style='background:url(".$siteurl."inc/images/topbg.jpg) repeat-x;'><td><b>Forum Convert</b></td><td></td></tr>";

echo "<tr><td><b>AdaptBB Beta DB Prefix</b></td><td><input type='text' name='old_pre' class='input' value='forum_'></td></tr><tr><td><input type='submit' value='Convert' class='input' onclick='return confirmProceed();'></td></tr></table></form>";
}

if ($module == "adaptbb_beta2") {
echo "<b>Directory</b>&nbsp;&nbsp;-&nbsp;&nbsp;<a href='admin.php?view=plugins'>Plugins</a> / <a href='".$plugin_url."'>".$plugin_name." Plugin</a><br /><br /><br />";

echo "<table cellpadding='5' cellspacing='0' border='0' width='90%' align='center' style='border: 2px solid #dddddd'><tr style='background:url(".$siteurl."inc/images/topbg.jpg) repeat-x;'><td><b>Forum Convert</b></td><td><b>Status</b></td></tr>";

if ($_POST['old_pre']) {
$fpre = $_POST['old_pre'];
if (mysql_num_rows(mysql_query("SELECT * FROM ".$fpre."posts")) > 0) {

unset($sql, $r, $diff);$num = 0;$tot = 0;
$sql = mysql_query("SELECT * FROM ".$fpre."attachments ORDER BY `id` ASC");
while($r = mysql_fetch_array($sql)) {
if (mysql_query("INSERT INTO ".$pre."attachments VALUES (".$r[id].", '".$r[filename]."', '".$r[filetype]."', '".$r[size]."', '".$r[username]."', '".$r[pid]."', ".time().")") == TRUE) {
$num = $num + 1;
}
$tot = $tot + 1;
}
if ($num == $tot) {
echo "<tr><td>`".$num."` Attachments transferred successfully</td><td><font color='blue'>Successful</font></td></tr>";
} else {
$diff = $tot - $num;
echo "<tr><td>`".$num."` Attachments transferred successfully, `".$diff."` un-successful</td><td><font color='red'>Failed</font></td></tr>";
}

unset($sql, $r, $diff);$num = 0;$tot = 0;
$sql = mysql_query("SELECT * FROM ".$fpre."forums ORDER BY `type` ASC");
while($r = mysql_fetch_array($sql)) {
unset($cat, $post, $topic, $ex, $cat1, $cat);
if ($r[type] == "forum") {
$cat = mysql_fetch_row(mysql_query("SELECT id FROM ".$pre."forums WHERE name = '".$r[cat]."'"));
} elseif ($r[type] == "sub") {
$ex = explode("||", $r[name]);

$cat1 = mysql_fetch_row(mysql_query("SELECT name FROM ".$fpre."forums WHERE id = '".$ex[1]."'"));
$cat = mysql_fetch_row(mysql_query("SELECT id FROM ".$pre."forums WHERE name = '".$cat1[0]."'"));
$r[name] = $ex[0];
}
$post = mysql_num_rows(mysql_query("SELECT * FROM ".$fpre."posts WHERE fid = '".$r[id]."' AND type = 'post'"));
$topic = mysql_num_rows(mysql_query("SELECT * FROM ".$fpre."posts WHERE fid = '".$r[id]."' AND type != 'post'"));

if ($r[type] == "cat") {
$type = "section";
} else {
$type = "forum";
}

$sql2 = mysql_query("SELECT * FROM ".$pre."groups ORDER BY `name` ASC");
while($r2 = mysql_fetch_array($sql2)) {
$var2 = "";
if ($r2[level] < 3 && $r[maccess]) {
mysql_query("INSERT INTO ".$pre."permissions VALUES (null, '".$r2[name]."', '".$r[name]."', '1|1|1')");
} elseif ($r2[level] > 2 && $r[maccess]) {
mysql_query("INSERT INTO ".$pre."permissions VALUES (null, '".$r2[name]."', '".$r[name]."', '|||')");
} elseif (!$r[maccess]) {
if ($r2[level] < 3) {
$var2 = "1";
}
mysql_query("INSERT INTO ".$pre."permissions VALUES (null, '".$r2[name]."', '".$r[name]."', '1|1|".$var2."')");
}
}

if (mysql_query("INSERT INTO ".$pre."forums VALUES (null, '".$r[name]."', '".addslashes($r[des])."', '".$type."', '".$cat[0]."', '".$r[ord]."', '".$r[locked]."', '', 0, '', '".$r[prequire]."', 0, ".time().", '".$post."', '".$topic."')") == TRUE) {
$num = $num + 1;
}
$tot = $tot + 1;
}
if ($num == $tot) {
echo "<tr><td>`".$num."` Forums transferred successfully</td><td><font color='blue'>Successful</font></td></tr>";
} else {
$diff = $tot - $num;
echo "<tr><td>`".$num."` Forums transferred successfully, `".$diff."` un-successful</td><td><font color='red'>Failed</font></td></tr>";
}

unset($sql, $r, $diff);$num = 0;$tot = 0;
$sql = mysql_query("SELECT * FROM ".$fpre."fskins ORDER BY `id` ASC");
while($r = mysql_fetch_array($sql)) {
unset($adata, $bdata);
if ($r[name] == "default") {
$r[name] = "default2";
}
$adata[] = "{bgcolor1}";
$adata[] = "{bgcolor2}";
$adata[] = "{bgcolor3}";
$adata[] = "{bordercolor}";
$adata[] = "{signature}";
$adata[] = "{rankimage}";
$adata[] = "{poster_avatar}";
$adata[] = "{post}";
$adata[] = "{online_tag}";
$adata[] = "{poster_posts}";
$adata[] = "{poster_joindate}";
$adata[] = "{messengers}";
$adata[] = "{info}";
$adata[] = "{replies}";
$adata[] = "{lpost}";
$adata[] = "{ltopic}";
$adata[] = "{online}";
$adata[] = "{users-online}";
$adata[] = "{lmember}";
$adata[] = "{newtopic}";
$adata[] = "{sortby}<br>{submit}";
$adata[] = "{pages}";
$adata[] = "<b>Total Staff:</b> {staff}<br>";
$adata[] = "{forumname}";
$adata[] = "{topicname}";
$adata[] = "{quote}";
$adata[] = "{endquote}";

$bdata[] = $r[fbgcolor1];
$bdata[] = $r[fbgcolor2];
$bdata[] = $r[fbgcolor3];
$bdata[] = $r[fbcolor1];
$bdata[] = "{user_signature}";
$bdata[] = "{rank_image}";
$bdata[] = "<img src=\'{user_avatar}\'>";
$bdata[] = "{message}";
$bdata[] = "{user_online_tag}";
$bdata[] = "{poster_post_num}";
$bdata[] = "{poster_join_date}";
$bdata[] = "{reputation}";
$bdata[] = "{reply_post} {quick_reply_post} {edit_post} {delete_post}";
$bdata[] = "{posts}";
$bdata[] = "{lastpost}";
$bdata[] = "{lasttopic}";
$bdata[] = "{users_online}";
$bdata[] = "There is {users} user(s) and {guests} guests online.";
$bdata[] = "{lastmember}";
$bdata[] = "{new_topic}";
$bdata[] = "{sortby}";
$bdata[] = "{page_list}";
$bdata[] = "";
$bdata[] = "{name}";
$bdata[] = "{topic_name}";
$bdata[] = "[quote]";
$bdata[] = "[/quote]";

$r[homeheader] = str_replace($adata, $bdata, $r[homeheader]);
$r[homefooter] = str_replace($adata, $bdata, $r[homefooter]);
$r[flist] = str_replace($adata, $bdata, $r[flist]);
$r[clist] = str_replace($adata, $bdata, $r[clist]);
$r[subforum] = str_replace($adata, $bdata, $r[subforum]);
$r[forumheader] = str_replace($adata, $bdata, $r[forumheader]);
$r[forumfooter] = str_replace($adata, $bdata, $r[forumfooter]);
$r[topicheader] = str_replace($adata, $bdata, $r[topicheader]);
$r[topicfooter] = str_replace($adata, $bdata, $r[topicfooter]);
$r[tlist] = str_replace($adata, $bdata, $r[tlist]);
$r[post] = str_replace($adata, $bdata, $r[post]);

if (mysql_query("INSERT INTO ".$pre."skins VALUES (null, '".$r[name]."', '".$r[name]."', 'skin', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'header', '".$r[name]."', '".$r['header']."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'footer', '".$r[name]."', '".$r['footer']."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'forum_index_header', '".$r[name]."', '".$r['homeheader']."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'forum_index_footer', '".$r[name]."', '".$r['homefooter']."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'forum_index_forumlist', '".$r[name]."', '".str_replace("{name}", "{link}", $r['flist'])."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'forum_index_catlist', '".$r[name]."', '".$r['clist']."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'forum_view_subforum_header', '".$r[name]."', '".$r['subforum']."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'forum_view_subforum_footer', '".$r[name]."', '</table>', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'forum_view_header', '".$r[name]."', '".$r['forumheader']."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'forum_view_footer', '".$r[name]."', '".$r['forumfooter']."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'topic_header', '".$r[name]."', '".$r['topicheader']."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'topic_footer', '".$r[name]."', '".$r['topicfooter']."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'forum_view_topiclist', '".$r[name]."', '".str_replace("{posts}", "{replies}",$r['tlist'])."', ".time().")") == TRUE && mysql_query("INSERT INTO ".$pre."skins VALUES (null, 'topic_view_post', '".$r[name]."', '".$r['post']."', ".time().")") == TRUE) {
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"profile\", \"".$r[name]."\", \"<title>{username}\'s Profile - {sitename}</title>
<table cellspacing='0' cellpadding='2' border='0' align='center' width='100%'><tr><td align=\'center\'><b><a href=\'mailto:{email}\'>{username}</a></b><br><img src=\'{user_avatar}\' style=\'border: 1px solid black\'><br>{level}</td><td align=\'left\'><table cellspacing='0' cellpadding='3' border='0' align='center'><tr><td><b>Name</b></td><td>{user_name}</td></tr><tr><tr><td><b>Birthday</b></td><td>{user_birthday_month} {user_birthday_day}, {user_birthday_year}</td></tr><tr><td><b>Website</b></td><td><a href=\'{user_website}\' target=\'popup\'>{user_website}</a></td></tr><td><b>AIM</b></td><td><a href=\'aim:goim?screenname={user_aim}&message=Hello+Are+you+there?\'>{user_aim}</a></td></tr><tr><td><b>MSN</b></td><td>{user_aim}</td></tr><tr><td><b>YIM</b></td><td><a href=\'http://edit.yahoo.com/config/send_webmesg?.target={user_yahoo}&.src=pg\'>{user_yahoo}</a></td></tr><tr><td><b>ICQ</b></td><td><a href=\'http://www.icq.com/whitepages/cmd.php?uin={user_icq}&action=message\'>{user_icq}</a></td></tr><tr><td><b>Google Talk</b></td><td>{user_gtalk}</td></tr></table></td></tr></table><table><tr><td align=\'right\'>{latest_posts}</td></tr></table><br><br><center>{edit_profile}</center>\", \"".time()."\")");
$temp = '"{form_start}
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Edit Post</b></font></td><td align=\"right\"><b>Forum -</b> {forum}</td></tr>

<tr class=\'light\'><td><b>Subject</b></td><td>{subject_input}</td></tr>
<tr class=\'dark\'><td><b>Message</b></td><td>{message_input}</td></tr></table><br />

<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Advanced</b></font></td><td></td></tr>
<tr class=\'dark\'><td><b>Attachment(s)</b></td><td>{attachments}</td></tr>
<tr class=\'light\'><td><b>Polls</b></td><td>{polls}</td></tr>
<tr class=\'dark\'><td></td><td>{submit}</td></tr></table>
{form_end}"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"edit_post\", \"".$r[name]."\", $temp, \"".time()."\")");
$temp = '"{form_start}
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Delete</b></font></td><td align=\"right\"><b>Forum -</b> {forum}</td></tr>

<tr class=\'dark\'><td></td><td>{submit}</td></tr></table>
{form_end}"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"delete_post\", \"".$r[name]."\", $temp, \"".time()."\")");
$temp = '"{form_start}
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Quick Reply</b></font></td><td></td></tr>

<tr class=\'light\'><td><b>Subject</b></td><td>{subject_input}</td></tr>
<tr class=\'dark\'><td><b>Message</b></td><td>{message_input}</td></tr>
<tr class=\'light\'><td></td><td>{submit}</td></tr></table>
{form_end}"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"quick_reply\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"login\", \"".$r[name]."\", \"{form_start}
<table><tr><td>Username:</td><td>{username_input}</td></tr><tr><td>Password:</td><td>{password_input}</td></tr>{captcha}<tr><td><td>{submit}</td></tr></table>
{form_end}\", \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"register\", \"".$r[name]."\", \"{form_start}
<table>
<tr><td>Username:</td><td>{username_input}</td></tr>
<tr><td>Password:</td><td>{password_input}</td></tr>
<tr><td>E-Mail:</td><td>{email_input}</td></tr>
{captcha}<tr><td><td>{submit}</td></tr></table>
{form_end}\", \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"offline\", \"".$r[name]."\", \"We are currently offline at the moment due to repairs and will be back online shortly.\", \"".time()."\")");
$temp = '"{form_start}
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>New Topic</b></font></td><td align=\"right\"><b>Forum -</b> {forum}</td></tr>

<tr class=\'light\'><td><b>Subject</b></td><td>{subject_input}</td></tr>
<tr class=\'dark\'><td><b>Message</b></td><td>{message_input}</td></tr></table><br />

<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Advanced</b></font></td><td></td></tr>
<tr class=\'light\'><td><b>Topic Type</b></td><td>{topic_type}</td></tr>
<tr class=\'dark\'><td><b>Attachment(s)</b></td><td>{attachments}</td></tr>
<tr class=\'light\'><td><b>Polls</b></td><td>{polls}</td></tr>
<tr class=\'dark\'><td></td><td>{submit}</td></tr></table>
{form_end}"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"new_topic\", \"".$r[name]."\", $temp, \"".time()."\")");
$temp = '"{form_start}
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>New Post</b></font></td><td align=\"right\"><b>Forum -</b> {forum}</td></tr>

<tr class=\'light\'><td><b>Subject</b></td><td>{subject_input}</td></tr>
<tr class=\'dark\'><td><b>Message</b></td><td>{message_input}</td></tr></table><br />

<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Advanced</b></font></td><td></td></tr>
<tr class=\'dark\'><td><b>Attachment(s)</b></td><td>{attachments}</td></tr>
<tr class=\'dark\'><td></td><td>{submit}</td></tr></table>
{form_end}"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"post_reply\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"forum_view_subforum_list\", \"".$r[name]."\", \"<tr><td>{icon}</td><td align='left'><font size='4'>{link}</font><br />{description}</td><td>{topics}</td><td>{posts}</td><td>{lastpost}</td></tr>\", \"".time()."\")");
$temp = '"{form_start}
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Report Post</b></font></td><td align=\"right\"><b>Forum -</b> {forum}</td></tr>

<tr class=\'light\'><td><b>Post</b></td><td>{link}</td></tr>
<tr class=\'dark\'><td><b>Message</b></td><td>{message}</td></tr><tr><td></td><td>{submit}</td></tr></table>
{form_end}"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"report_post\", \"".$r[name]."\", $temp, \"".time()."\")");
$temp = '"{form_start}
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Move Topic</b></font></td><td align=\"right\"><b>Forum -</b> {forum}</td></tr>

<tr class=\'light\'><td><b>Move</b></td><td>{forum_select}</td></tr>
<tr class=\'dark\'><td></td><td>{submit}</td></tr></table>
{form_end}"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"move_topic\", \"".$r[name]."\", $temp, \"".time()."\")");
$temp = '"<table width=\"90%\" align=\"center\" cellpadding=\"5\"><tr><td valign=\"top\">

<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'100%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><b>Control Panel</b></td></tr>
<tr><td class=\'light\'>{links}</td></tr></table>

</td><td valign=\"top\">

<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'100%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><b>Private Messages</b> - {folder}</td></tr>
<tr><td align=\"center\" class=\"light\"><b>{folder}</b> - {messages_num} messages with a total of {max_messages} permitted. ({messages_percent})<br />{folder_dropdown}</td></tr></table><br>

<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'100%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td align=\'center\'><b>Icon</b></td><td><b>Subject</b></td><td align=\'center\' style=\'padding-right:10px\'><b>Options</b></td></tr>"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"messages_header\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"messages_footer\", \"".$r[name]."\", \"</table>

</td></tr></table>\", \"".time()."\")");
$temp = '"<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'100%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td valign=\"top\" align=\"center\" width=\"150\" style=\"border-right: 1px solid #dddddd\"><i>{date}</i><br><br><font size=\"3\"><b><u>{username}</u></b></font><br>{rank_image}<font size=\"1\"><br><br><img src=\"{user_avatar}\"><br><br>

<table cellpadding=\'3\' cellspacing=\'5\' border=\'0\'><tr bgcolor=\"#DDDDDD\"><td><b>Joined:</b> {poster_join_date}</td></tr><tr><td><b>Posts:</b> {poster_post_num}</td></tr><tr><td><b>Online Tag:</b> {user_online_tag}</td></tr><tr><td style=\"padding-top:5px\">{user_aim} {user_msn} {user_gtalk}</td></tr></table>

<br><br>User is <b>{poster_status}</b></td>

<td style=\"padding-left:10pxborder-left:1px solid #dddddd\" valign=\"top\">

<table cellpadding=\'0\' cellspacing=\'0\' border=\'0\' width=\'100%\'><tr><td> {icon} <b>{subject}</b></td><td align=\"right\">{reply} {forward} {delete}</td></tr></table><br><br clear=\'all\'>
{message}
<br><br>
<center><hr color=\"#CCCCCC\" width=\"90%\"></center><br><p>
{user_signature}
</p></td></tr></table><br clear=\"all\">"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"message_view\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"messages_list\", \"".$r[name]."\", \"<tr{class}><td align=\'center\'>{icon}</td><td>{subject}<br />From: {sender} @ {date}</td><td align=\'center\' style=\'padding-right:10px\'>{options}</td></tr>\", \"".time()."\")");
$temp = '"<table width=\"90%\" align=\"center\" cellpadding=\"5\"><tr><td valign=\"top\">

<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'100%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><b>Control Panel</b></td></tr>
<tr><td class=\'light\'>{links}</td></tr></table>

</td><td valign=\"top\">

<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'100%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><b>Private Messages</b> - {folder}</td></tr>
<tr><td align=\"center\" class=\"light\"><b>{folder}</b> - {messages_num} messages with a total of {max_messages} permitted. ({messages_percent})<br />{folder_dropdown}</td></tr></table><br>"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"message_view_header\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"message_view_footer\", \"".$r[name]."\", \"</td></tr></table>\", \"".time()."\")");
$temp = '"{form_start}
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'100%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Send Message</b></font></td><td> </td></tr>
<tr class=\'light\'><td><b>Recipient(s)</b></td><td>{receivers_input}</td></tr>
<tr class=\'dark\'><td><b>Subject</b></td><td>{subject_input}</td></tr>
<tr class=\'light\'><td><b>Message</b></td><td>{message_input}</td></tr>
<tr class=\'dark\'><td></td><td>{submit}</td></tr></table>
{form_end}"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"message_send\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"online_list\", \"".$r[name]."\", \"<tr class=\'light\'><td><i>#{num}</i></td><td>{username}</td><td>{last_activity}</td><td>{location}</td><td>{join_date}</td></tr>\", \"".time()."\")");
$temp = '"<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td></td><td><b>Who\'s Online?</b></td><td align=\"right\"><b>{users_online}</b> member(s) and <b>{guests_online}</b> guest(s) online</td></tr>

<tr bgcolor=\'#dddddd\'><td></td><td>Username</td><td>Last Activity</td><td>Location</td><td>Join Date</td></tr>"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"online_header\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"realtime_list\", \"".$r[name]."\", \"<div>
<div>
{tr}<td><span class=\'ctr\'>{type}</span></td><td>{link}</td><td><span class=\'content\'>{message}</span></td><td>{forum}</td><td>{poster}</td><td>{stats}</td><td>{date}</td></tr>
</div>
</div>\", \"".time()."\")");
$temp = '"<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><b>Real Time</b></td><td align=\"right\"><b>{stop} {play}</b></td></tr></table><table>"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"realtime_header\", \"".$r[name]."\", $temp, \"".time()."\")");
$temp = '"<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><b>Search</b> - {results} results for \"{search}\"</td><td></td><td></td><td></td></tr>"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"search_results_header\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"search_results_footer\", \"".$r[name]."\", \"</table>\", \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"search_results_list\", \"".$r[name]."\", \"<tr class=\'light\'><td>{link}<br>{message}</td><td>{username}</td><td>{forum}</td><td>{date}</td></tr>\", \"".time()."\")");
$temp = '"{form_start}
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>New Reply</b></font></td><td align=\"right\"><b>Forum -</b> {forum}</td></tr>

<tr class=\'light\'><td><b>Subject</b></td><td>{subject_input}</td></tr>
<tr class=\'dark\'><td><b>Message</b></td><td>{message_input}</td></tr></table><br />

<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Advanced</b></font></td><td></td></tr>
<tr class=\'light\'><td><b>Attachment(s)</b></td><td>{attachments}</td></tr>
<tr class=\'dark\'><td></td><td>{submit}</td></tr></table>
{form_end}"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"new_reply\", \"".$r[name]."\", $temp, \"".time()."\")");
$temp = '"<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'100%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td align=\'center\'><b>Username</b></td><td align=\'center\'><b>Join Date</b></td><td><b>Group</b></td><td><b>Rank</b></td><td align=\'center\'><b>Posts</b></td><td align=\'center\'><b>Last Visit</b></td></tr>"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"memberslist_header\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"memberslist_footer\", \"".$r[name]."\", \"</table><br clear=\'all\'>\", \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"memberslist_list\", \"".$r[name]."\", \"<tr{class}><td align=\'center\'>{username}</td><td align=\'center\'>{join_date}</td><td>{group}</td><td>{rank}</td><td align=\'center\'>{posts}</td><td align=\'center\'>{last_visit}</td></tr>\", \"".time()."\")");
$temp = '"<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><h4>IP</h4></td><td></td><td></td><td></td><td></td></tr>
<tr class=\'light\'><td><img src=\'<?php echo $siteurl; ?>templates/".$r[name]."/images/stats.png\'></td><td align=\'left\'>{ip}</td><td>{ip_info}</td><td>{country_flag}</td><td>{options}</td></tr></table>"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"ip_info\", \"".$r[name]."\", $temp, \"".time()."\")");
$temp = '"<table cellpadding=\'3\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><b>Poll</b></td><td></td></tr><tr><td>

<table cellpadding=\'2\' cellspacing=\'1\' border=\'0\' align=\'center\' width=\'20%\'><tr><td><b>{question}</b></td></tr></table>

<table cellpadding=\'2\' cellspacing=\'1\' border=\'0\' align=\'center\' width=\'20%\'><tr><td>
{options}
<tr><td><a href=\"poll-results/\">Results</a></td><td>{submit}</td></tr></table>

</td></tr></table>"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"poll_vote\", \"".$r[name]."\", $temp, \"".time()."\")");
$temp = '"<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><b>Poll</b></td><td></td></tr><tr><td>


<table cellpadding=\'2\' cellspacing=\'1\' border=\'0\' align=\'center\' width=\'20%\'><tr><td><b>{question}</b></td></tr></table>

<table cellpadding=\'2\' cellspacing=\'1\' border=\'0\' align=\'center\' width=\'20%\'><tr><td>
{options}
<tr><td><b>Votes:</b> {vote_total}</td></tr></table>

</td></tr></table>"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"poll_results\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"poll_options\", \"".$r[name]."\", \"<tr><td>{name}</td><td>{data}</td></tr>\", \"".time()."\")");
$temp = '"{form_start}
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><font size=\"4\"><b>Give Reputation</b></font></td><td align=\"right\"><b>Forum -</b> {forum}</td></tr>

<tr class=\'light\'><td><b>Post</b></td><td>{link}</td></tr>
<tr class=\'dark\'><td><b>User</b></td><td>{user}</td></tr>
<tr class=\'light\'><td><b>Rep Type</b></td><td>{options}</td></tr>
<tr class=\'dark\'><td><b>Comment</b></td><td>{message}</td></tr><tr><td></td><td>{submit}</td></tr></table>
{form_end}"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"give_reputation_form\", \"".$r[name]."\", $temp, \"".time()."\")");
$temp = '"<center><h2>{user}\'s Reputation</h2></center>
<table cellpadding=\'5\' cellspacing=\'0\' border=\'0\' width=\'90%\' align=\'center\' style=\'border: 2px solid #dddddd\'><tr style=\'background:url(<?php echo $siteurl; ?>inc/images/topbg.jpg) repeat-x;\'><td><b>From</b></td><td><b>Topic</b></td><td><b>Comment</b></td><td><b>Type</b></td><td><b>Date</b></td></tr>"';
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"reputation_view_header\", \"".$r[name]."\", $temp, \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"reputation_view_footer\", \"".$r[name]."\", \"<tr><td><b>Reputation:</b> {reputation_total}</td><td></td></tr></table>\", \"".time()."\")");
mysql_query("INSERT INTO ".$pre."skins VALUES (null, \"reputation_view_list\", \"".$r[name]."\", \"<tr{class}><td>{user}</td><td>{date}</td><td>{post_link}</td><td>{message}</td><td>{type}</td></tr>\", \"".time()."\")");
$num = $num + 1;
}
$tot = $tot + 1;
}
if ($num == $tot) {
echo "<tr><td>`".$num."` Skins transferred successfully</td><td><font color='blue'>Successful</font></td></tr>";
} else {
$diff = $tot - $num;
echo "<tr><td>`".$num."` Skins transferred successfully, `".$diff."` un-successful</td><td><font color='red'>Failed</font></td></tr>";
}

unset($sql, $r, $diff);$num = 0;$tot = 0;
$sql = mysql_query("SELECT * FROM ".$fpre."pm ORDER BY `id` ASC");
while($r = mysql_fetch_array($sql)) {
if ($r[who]) {
$user1 = mysql_fetch_row(mysql_query("SELECT id FROM ".$preu."users WHERE username = '".$r[who]."'"));
}
if ($r[jo]) {
$user2 = mysql_fetch_row(mysql_query("SELECT id FROM ".$preu."users WHERE username = '".$r[jo]."'"));
}
if ($user[1] > 0 && $user[2] > 0 OR 1 == 1) {
if (mysql_query("INSERT INTO ".$pre."pm VALUES (null, ".$r[viewed].", '".$r[subject]."', '".addslashes($r[message])."', '".$user1[0]."', '".$user2[0]."', '".$r[date]."', '".$r[box]."')") == TRUE) {
$num = $num + 1;
}
$tot = $tot + 1;
}
}
if ($num == $tot) {
echo "<tr><td>`".$num."` Messages transferred successfully</td><td><font color='blue'>Successful</font></td></tr>";
} else {
$diff = $tot - $num;
echo "<tr><td>`".$num."` Messages transferred successfully, `".$diff."` un-successful</td><td><font color='red'>Failed</font></td></tr>";
}

if (1 == 2) {
unset($sql, $r, $diff);$num = 0;$tot = 0;
$sql = mysql_query("SELECT * FROM ".$preu."users ORDER BY `id` ASC");
while($r = mysql_fetch_array($sql)) {
if (mysql_query("INSERT INTO ".$pre."users VALUES (null, ".$r[username].", '".$r[password]."', '".$r[email]."', '".$r[level]."', '".$r[rank]."', '".$r[logged]."', '".$r[date]."', 'yes', 'yes')") == TRUE) {
$num = $num + 1;
}
$tot = $tot + 1;
}
if ($num == $tot) {
echo "<tr><td>`".$num."` Users transferred successfully</td><td><font color='blue'>Successful</font></td></tr>";
} else {
$diff = $tot - $num;
echo "<tr><td>`".$num."` Users transferred successfully, `".$diff."` un-successful</td><td><font color='red'>Failed</font></td></tr>";
}
}

unset($sql, $r, $diff);$num = 0;$tot = 0;
$sql = mysql_query("SELECT * FROM ".$fpre."posts ORDER BY `tid` ASC, `id` ASC");
while($r = mysql_fetch_array($sql)) {
if ($r[lock] == "yes") {
$lock = "yes";
}
if ($r[type] != "post") {
$count = mysql_num_rows(mysql_query("SELECT * FROM ".$fpre."posts WHERE tid = '".$r[id]."'"));
}
$uid1 = mysql_fetch_row(mysql_query("SELECT username FROM ".$preu."users WHERE id = '".$r[uid]."'"));
$uid = mysql_fetch_row(mysql_query("SELECT id FROM ".$pre."users WHERE username = '".$uid1[0]."'"));
if (!$uid[0] or $uid[0] == 0) {
$uid[0] = $r[uid];
}

$fid1 = mysql_fetch_row(mysql_query("SELECT name FROM ".$fpre."forums WHERE id = '".$r[fid]."'"));
$fid = mysql_fetch_row(mysql_query("SELECT id FROM ".$pre."forums WHERE name = '".$fid1[0]."'"));

if ($r[type] == "post") {
$tid = mysql_fetch_row(mysql_query("SELECT id FROM ".$pre."posts WHERE post_type != 'post' ORDER BY `id` DESC LIMIT 1"));
}
if (mysql_query("INSERT INTO ".$pre."posts VALUES (null, '".$fid[0]."', '".$tid[0]."', '".$uid[0]."', '".$r[type]."', '".$r[subject]."', '".$r[message]."', '', '".$lock."', '".$r[ip]."', '".$r[stats]."', '0|0', '".$r[date]."', '".$r[lpostdate]."', ".$count.")") == TRUE) {
$num = $num + 1;
}
if ($r[type] != "post") {
$tid = mysql_fetch_row(mysql_query("SELECT id FROM ".$pre."posts WHERE post_type != 'post' ORDER BY `id` DESC LIMIT 1"));
mysql_query("UPDATE ".$pre."posts SET topic_id = '".$tid[0]."' WHERE id = '".$tid[0]."'");
}
$tot = $tot + 1;
}
if ($num == $tot) {
echo "<tr><td>`".$num."` Posts transferred successfully</td><td><font color='blue'>Successful</font></td></tr>";
} else {
$diff = $tot - $num;
echo "<tr><td>`".$num."` Posts transferred successfully, `".$diff."` un-successful</td><td><font color='red'>Failed</font></td></tr>";
}

} else {
echo "<tr><td>Incorrect prefix entered</td><td><font color='red'>Failed</font></td></tr>";
}
}
echo "</table>";
}




}

if (basename($_SERVER['PHP_SELF']) == "index.php") {
if ($module == strtolower(str_replace(" ", "_", $plugin_name))) {
echo 1;
}
}
?>
Return current item: AdaptBB