'; if(($_COOKIE['rpgtoplist'] || $_SESSION['rpgtoplist']) && $email == $info['email']){ switch($_REQUEST['step']) { case 'html': if(($info['access'] > 1)) { if(!$_GET['id']) { $main = $main . ''; if($info['access'] == 2) { $sql = @mysql_query("SELECT * FROM `games` WHERE `ownerid` = '{$info['id']}'"); } elseif($info['access'] > 4) { $sql = @mysql_query("SELECT * FROM `games`"); } else { header('location: http://www.rpgtoplist.com'); } while($game = @mysql_fetch_array($sql)) { $main = $main . ''; } $main = $main . '
Get HTML - Choose game
' . $game['name'] . '
'; } else { $id = clean($_GET['id']); $sql = @mysql_query("SELECT * FROM `games` WHERE `id` = '$id'"); $num = mysql_num_rows($sql); $game = mysql_fetch_array($sql); if(($num == 0) || (($game['ownerid'] != $info['id']) && ($info['access'] < 5))) { header('location: http://www.rpgtoplist.com'); } else { $textlink = 'http://www.rpgtoplist.com/vote.php?id=' . $game['id']; if($game['incentives'] == 'enabled') { $textlink = $textlink . '&' . $game['var'] . '={VALUE}'; $example = 'You can disable them here.

Click here for an example incentive script'; } else { $example = 'You can enable them here.'; } $main = $main . '
HTML for ' . $game['name'] . '
Text Link
Example: Vote Here

Voting button
Example:

Incentives are ' . $game['incentives'] . '
' . $example . '
'; } } } else { header('location: http://www.rpgtoplist.com'); } break; case 'add': switch($_GET['add']) { case 'offer': if($info['access'] < 2) { header('location:http://www.rpgtoplist.com/?email=' . $email); } else { if($_GET['action'] == 'submit') { if(!$_POST['form'][0] ||!$_POST['form'][1] || !$_POST['form'][2]) { $error = 'Please fill in at least the 3 first fields.'; } else { $num = count($_POST['form']); for($i=0; $i<$num; $i++) { $form[$i] = clean($_POST['form'][$i]); } $gamez = mysql_query("SELECT `name`, `url` FROM `games` WHERE `id` = '$form[0]'"); $gamer = mysql_fetch_array($gamez); mysql_query("INSERT INTO `offers` (`author`, `gameid`, `gamename`, `url`, `promo`, `subject`,`body`) VALUES ('{$info['id']}', '$form[0]', '{$gamer['name']}', '{$gamer['url']}', '$form[3]', '$form[1]', '$form[2]')") or die(mysql_error()); $error = 'Your offer has been added.'; } } $main = $main . '' . $error . '
Submit offer
Choose game:
You offer:
Details:
Promo code:
'; } break; case 'news': if($info['access'] < 5) { header('location:http://www.rpgtoplist.com/?email=' . $email); } else { if(!$_GET['action']) { $main = $main . '
Add news item
Subject:
Body:
'; } elseif($_GET['action']=='submit') { @mysql_query("INSERT INTO `news` (subject,body) VALUES ('$_POST[subject]','$_POST[body]')") or die('You broke it...Idiot...'); $main = $main . '
Article submitted, click here to go back.
'; } } break; case 'review': if($info['access'] < 4) { header('location:http://www.rpgtoplist.com/?email=' . $email); } else { if(!$_GET['id']) { $main = $main . ''; $games = mysql_query("SELECT * FROM `games`"); while($game = mysql_fetch_array($games)) { $main = $main . ''; } $main = $main . '
Select game
' . $game['name'] . '
'; } else { if(!$_GET['action']) { $id = clean($_GET['id']); $reviews = mysql_query("SELECT * FROM `reviews` WHERE `authorid` = '{$info['id']}' && `gameid` = '$id'"); $ramount = mysql_num_rows($reviews); if(($ramount == 0) || $_GET['new'] == 'Y') { $main = '

Add review
AreaScore
Gameplay:
/25
Story:
/20
Graphics:
/10
Originality:
/10
Difficulty:
/10
Security:
/10
Support:
/10
Compatibility:
/5
'; } elseif($ramount == 1) { if($_GET['edit'] == 'Y') { $gameid = clean($_GET['id']); $reviews = mysql_query("SELECT * FROM `reviews` WHERE `authorid` = '{$info['id']}' AND `gameid` = '$gameid'"); $review = mysql_fetch_array($reviews); $main = '
Add review
Area
Score
Gameplay:
/25
Story:
/20
Graphics:
/10
Originality:
/10
Difficulty:
/10
Security:
/10
Support:
/10
Compatibility:
/5
'; } else { $main = '
Edit last review
Add new review
'; } } elseif($ramount > 1) { if(!$edit) { $main = ''; while($review = mysql_fetch_array($reviews)) { $main = $main . ''; } $main = $main . '
Choose review to edit:
Review from ' . date("d/m/y", $review['date']) . '
Add new review
'; } else { $id = clean($_GET['no']); $reviews = mysql_query("SELECT * FROM `reviews` WHERE `rid` = '$id'"); $review = mysql_fetch_array($reviews); $main = '
Add review
AreaScore
Gameplay:
/25
Story:
/20
Graphics:
/10
Originality:
/10
Difficulty:
/10
Security:
/10
Support:
/10
Compatibility:
/5
'; } } } elseif($_GET['action'] == 'submit') { $num = count($_POST['form']); $gameid = clean($_GET['id']); $time = time(); for($i=0; $i < $num; $i++) { $divider = array(0,2.5,0,2,0,1,0,1,0,1,0,1,0,1,0,0.5); $form[$i] = clean($_POST['form'][$i]); if(is_numeric($form[$i]) && ($form[$i] > 0 || $form[$i-1] != "")) { $overall += $form[$i]; $divide+= $divider[$i]; } } $overall /= $divide; if($_GET['review'] == 'new') { mysql_query("INSERT INTO `reviews` (`gameid`, `date`, `authorid`, `tester`, `storyline`, `storyrev`, `gameplay`, `gamerev`, `graphics`, `graphrev`, `originality`, `origrev`, `compatibility`, `comprev`, `difficulty`, `diffrev`, `security`, `secrev`, `support`, `suprev`, `overall`) VALUES ('$gameid', '$time', '{$info['id']}', '', '$form[3]', '$form[2]', '$form[1]' , '$form[0]', '$form[5]', '$form[4]', '$form[7]', '$form[6]', '$form[15]', '$form[14]', '$form[9]', '$form[8]', '$form[11]', '$form[10]', '$form[13]', '$form[12]', '$overall')") or die(mysql_error()); } else { $id = clean($_GET['no']); $sql = "UPDATE `reviews` SET `gameid` = '$gameid', `date` = '$time', `authorid` = '{$info['id']}', `storyline` = '$form[3]', `storyrev` = '$form[2]', `gameplay` = '$form[1]', `gamerev` = '$form[0]', `graphics` = '$form[5]', `graphrev` = '$form[4]', `originality` = '$form[7]', `origrev` = '$form[6]', `difficulty` = '$form[9]', `diffrev` = '$form[8]', `security` = '$form[11]', `secrev` = '$form[10]', `support` = '$form[13]', `suprev` = '$form[12]', `compatibility` = '$form[15]', `comprev` = '$form[14]', `overall` = '$overall' WHERE `id` = '$id'"; mysql_query($sql) or die(mysql_error()); } $main = '
Review Added/Updated
'; } } } break; } break; case 'edit': switch($_REQUEST['edit']) { /* case 'screenshots': if(($info['access'] > 1)) { if(!$_GET['id']) { $main = $main . ''; if($info['access'] == 2) { $sql = @mysql_query("SELECT * FROM `games` WHERE `ownerid` = '$info[id]'"); } elseif($info['access'] > 4) { $sql = @mysql_query("SELECT * FROM `games`"); } else { header('location: http://www.rpgtoplist.com'); } while($game = @mysql_fetch_array($sql)) { $main = $main . ''; } $main = $main . '
Incentives - Choose game
' . $game['name'] . '
'; } else { switch($_GET['add']) { case 'screenshot': if($_REQUEST['site'] && is_numeric($_REQUEST['site'])) { switch($_GET['action']) { case 'submit': if($_FILES['banner']['tmp_name'] || $_POST['banner']) { if($_FILES['banner']['name']) { $ban = $_FILES['banner']['tmp_name']; $ban2 = $_FILES['banner']['name']; } else { $ban = clean($_POST['banner']); $ban2 = clean($_POST['banner']); } $filext = explode('.', $ban2); $i = count($filext) - 1; $filext[$i] = strtolower($filext[$i]); if($filext[$i] == 'png' || $filext[$i] == 'jpg' || $filext[$i] == 'gif') { switch($filext[$i]) { case 'png': $image = imagecreatefrompng($ban); break; case 'jpg': $image = imagecreatefromjpeg($ban); break; case 'gif': $image = imagecreatefromgif($ban); break; } if(imagesx($image) > 0 && imagesy($image) > 0) { $banner = imagecreatetruecolor(468, 60); imagecopyresized($banner, $image, 0 , 0, 0, 0, 468, 60, imagesx($image), imagesy($image)); $site = clean($_POST['site']); $dir = opendir($bannerpath); $num = 0; while($files = readdir($dir)) { $file = explode('-', $files); if($file[0] == $site) { $num ++; } } $num++; imagepng($banner, $bannerpath . $site . '-' . $num . '.png'); imagedestroy($image); imagedestroy($banner); mysql_query("INSERT INTO `banners` (`site`, `number`) VALUES ('$site', '$num')"); email('RPG Top List ', 'billing@lotdhosting.com', 'banner added', '', ''); $main = $main . '
Added banner successfully. Click here to go back.
'; } } } break; case 'new': $main = $main . '
'; break; case 'import': $main = $main . '
URL (http://):
'; break; default: $main = $main . '
Upload new banner
Import already uploaded banner
'; break; } } break; } break;*/ case 'newsletter': if($info['newsletter'] == 'Y') { $checked1 = 'checked="checked"'; $checked2 = ''; } else { $checked1 = ''; $checked2 = 'checked="checked"'; } if($_POST['action'] == 'submit') { $form = clean($_POST['form']); @mysql_query("UPDATE `accounts` SET `newsletter` = '$form' WHERE `id` = '$info[id]'") or die (mysql_error()); $error = 'Your settings have been updated.'; if($form == 'Y') { $checked1 = 'checked="checked"'; $checked2 = ''; } else { $checked1 = ''; $checked2 = 'checked="checked"'; } } $main = $main . '
' . $error . '
Newsletter settings
Receive newletter Yes
No
View old newsletters
'; break; case 'password': if ($_POST['action'] == 'submit') { $num = count($_POST['form']); $error = 'Errors:'; for($i = 1; $i <= $num; $i++) { if(!$_POST['form'][$i]) { $error = $error . ' Missing Field' . $i . '.'; } else { $form[$i] = clean($_POST['form'][$i]); } } $form[3] = sha1(strrev(md5($form[3]))); if( $form[1] != $form[2] ) { $error = $error . ' New passwords do not match.'; } elseif( $form[3] != $info['password']) { $error = $error . ' Your old password is incorrect.'; } else { $form[1] = sha1(strrev(md5(clean($form[1])))); @mysql_query("UPDATE `accounts` SET `password` = '$form[1]' WHERE `id` = '$info[id]'") or die (mysql_error()); $error= 'Your password has been changed.'; } $errors = $main . '' . $error . ''; } $main = $main . '
' . $errors . '
Change password
New password:
Verify password:
Old password:
'; break; case 'profile': if($_POST['action'] != 'update') { $name = explode(' ', $info['name']); $main = $main . '
'; if($info['access']>1) { $main = $main . ''; } $main = $main . '
Edit profile:
First name:
Last name:
Company:
'; } else { $num = count($_POST['form']); for($i = 0; $i < $num; $i++) { $form[$i] = clean($_POST['form'][$i]); } if(!$form[1] || !$form[2]) { header('location: http://www.rpgtoplist.com/account.php?step=edit&edit=profile&email=' . $email); } else { @mysql_query("UPDATE `accounts` SET `name` = '$form[1] $form[2]', `company` = $form[3]"); $main = $main . '
Your profile has been updated. Click here to go back.
'; } } break; case 'email': if($_REQUEST['action'] == 'verify') { $num = count($_POST['form']); for($i = 0; $i < $num; $i++) { $form[$i] = clean($_POST['form'][$i]); if(!$form[i]) { header('location: http://www.rpgtoplist.com/account.php?step=edit&edit=email&email=' . $email); } } if($form[4] != $info['confirmcode']) { $main = $main . '
Your confirmation code was invalid. Please make sure it belongs to your current email. Click here to try again.
'; } else { $code = "abcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456789"; for ($i = 0; $i <= 50; $i++) { $num = mt_rand(1,95); $tmp = substr($code, $num, 1); $confirmcode = $confirmcode . $tmp; } require_once("Mail.php"); require_once("Mail/mime.php"); $from = 'RPG Top List '; $to = $form[2]; $message = new Mail_Mime("\n"); $message -> setTxtBody(''); $subject = 'RPG Top List email confirmation'; $host = "mail.lotdhosting.com"; $username = "no-reply@rpgtoplist.com"; $password = "7890a3c"; $mailer= 'PHP/' . phpversion(); $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject, 'X-Mailer' => $mailer); $body = $message->get(); $headers = $message ->headers($headers); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("

" . $mail->getMessage() . "

"); } $main = $main . '
An email has been sent to your new email containing your new confirmation code. Click here to continue.
'; } } elseif($_REQUEST['action'] == 'confirm') { $main = $main . '
'; } else { $main = $main . '
Change email:
Old email:
New email:
Password:
Confirm Code:
'; } break; case 'incentives': if(($info['access'] > 1)) { if(!$_GET['id']) { $main = $main . ''; if($info['access'] == 2) { $sql = @mysql_query("SELECT * FROM `games` WHERE `ownerid` = '$info[id]'"); } elseif($info['access'] > 4) { $sql = @mysql_query("SELECT * FROM `games`"); } else { header('location: http://www.rpgtoplist.com'); } while($game = @mysql_fetch_array($sql)) { $main = $main . ''; } $main = $main . '
Incentives - Choose game
' . $game['name'] . '
'; } else { $sql = @mysql_query("SELECT * FROM `games` WHERE `id` = '{$_GET['id']}'"); $game = @mysql_fetch_array($sql); if($info['access'] < 4) { if($game['ownerid'] != $info['id']) { header('location: http://www.rpgtoplist.com'); } } if($_POST['form']) { for($i = 1; $i <= 6; $i++) { $form[$i] = clean($_POST['form'][$i]); } if($form[6] == TRUE) { $enabled = 'enabled'; } else { $enabled = 'disabled'; } mysql_query("UPDATE `games` SET `var` = '$form[1]', `value` = '$form[2]', `returnurl` = '$form[3]', `submit` = '$form[4]', `button` = '$form[5]', `incentives`='$enabled' WHERE `id` = '{$game['id']}'") or die(mysql_error()); $error = 'Settings updated.'; } $sql = @mysql_query("SELECT * FROM `games` WHERE `id` = '{$_GET['id']}'"); $game = @mysql_fetch_array($sql); if($game['incentives'] == 'enabled') { $checked = "checked=checked"; } if($game['submit'] == 'image') { $checked1 = ''; $checked2 = 'checked="checked"'; } else { $checked2 = ''; $checked1 = 'checked="checked"'; } $main = $main . '
' . $error . '
Incentives
Variable name (no $ and not id or email):
Return URL (http://):
Use Submit button
Use image
Image url (http://) or text:
Enable incentives:
Click here to get your html code and an example incentive script
'; } } break; case 'games': if($info['access'] > 1) { if(!$_GET['id']) { $main = $main . ''; if($info['access'] == 2) { $sql = @mysql_query("SELECT * FROM `games` WHERE `ownerid` = '$info[id]'"); } elseif($info['access'] > 2) { $sql = @mysql_query("SELECT * FROM `games`"); } else { header('location: http://www.rpgtoplist.com'); } while($game = @mysql_fetch_array($sql)) { $main = $main . ''; } $main = $main . '
Your games
' . $game['name'] . '
(Add Game)
'; } elseif($_GET['id'] == 'new') { if($_GET['error'] == 'missing') { $error = 'Please fill in all fields.'; } if($_GET['new'] == 'game') { $num = count($_POST['form']); for($i = 0; $i < $num; $i++) { if(!$_POST['form'][$i]) { header('location: http://www.rpgtoplist.com/account.php?email=' . $email . '&step=edit&edit=games&id=new&error=missing'); } else { $form[$i] = clean($_POST['form'][$i]); } } $address = clean($form[1]); if($form[12] == 0 || !is_numeric($form[12])) { $cost = 'Free'; } else { $cost = '$' . $form[12] . ' ' . $form[13]; } @mysql_query("INSERT INTO `games` (`name`,`url`,`email`,`category`,`players`,`description`,`shortdesc`,`client`,`interface`,`plugin`,`prizes`,`status`,`cost`,`platform`,`owner`,`ownerid`,`dateadded`) VALUES ('$form[0]','$address','$form[2]','$form[3]','$form[4]','$form[5]','$form[6]','$form[7]','$form[8]','$form[9]','$form[10]','$form[11]','$cost','$form[14]', '{$info['user']}','{$info['id']}','$time')") or die(mysql_error()); $error = 'Your game has been added. Please go check your listing for errors.'; } $main = $main . '' . $error . '
Please fill in your game\'s details below
Game name:
Web address:
Contact email:
Category:
# Players:
Description:
Short version:
Client:
Interface:
Plugin:
Prizes:
Status:
Cost:$
Platform:
'; } else { if($_GET['action'] == 'submit') { $num = count($_POST['form']); for($i = 0; $i < $num; $i++) { if(!$_POST['form'][$i]) { header('location: http://www.rpgtoplist.com/account.php?email=' . $email . '&step=edit&edit=games&id=' . $_GET['id'] . '&error=missing'); } else { $form[$i] = clean($_POST['form'][$i]); } } $address = clean($form[1]); if($form[12] == 0 || !is_numeric($form[12])) { $cost = 'Free'; } else { $cost = '$' . $form[12] . ' ' . $form[13]; } mysql_query("UPDATE `games` SET `name` = '$form[0]', `url` = '$address', `email` = '$form[2]', `category` = '$form[3]', `players` = '$form[4]', `description` = '$form[5]', `shortdesc` = '$form[6]', `client` = '$form[7]', `interface` = '$form[8]', `plugin` = '$form[9]', `prizes` = '$form[10]', `status` = '$form[11]', `cost` = '$cost', `platform` = '$form[14]' WHERE `id` = '{$_GET['id']}'") or die(mysql_error()); $error = 'Your game has been edited. Please check below for errors.'; } $id = clean($_GET['id']); $games = mysql_query("SELECT * FROM `games` WHERE `id` = '$id' AND `ownerid` = '{$info['id']}'"); $game = mysql_fetch_array($games); $cost = explode(' ', $game['cost']); switch($game['category']) { case 'RPG': $i=1; break; case 'Pet': $i=2; break; case 'Strategy': $i=3; break; case 'Sports': $i=4; break; case 'Other': $i=5; break; default: break; } switch($game['players']) { case 'Single': $j=1; break; case 'Multiplayer': $j=2; break; case 'Massively Multiplayer': $j=3; break; default: break; } switch($game['client']) { case 'Web Browser': $k=1; break; case 'Application': $k=2; break; case 'SSH/Telnet': $k=3; break; case 'Other': $k=4; break; default: break; } switch($game['interface']) { case 'Text-based': $l=1; break; case '2D': $l=2; break; case '3D': $l=3; break; default: break; } switch($game['plugin']) { case 'None': $m=1; break; case 'Flash': $m=2; break; case 'Shockwave': $m=3; break; case 'Java': $m=4; break; case 'ActiveX': $m=5; break; case 'Other': $m=6; break; default: break; } switch($game['prizes']) { case 'No': $n=1; break; case 'Yes': $n=2; break; default: break; } switch($game['status']) { case 'Alpha': $o=1; break; case 'Beta': $o=2; break; case 'Complete': $o=3; break; default: break; } switch($game['cost']) { case 'Monthly': $p=1; break; case 'Quarterly': $p=2; break; case 'Semi-annually': $p=3; break; case 'Annually': $p=4; break; case 'One-time Fee': $p=5; break; default: break; } switch($game['platform']) { case 'Any': $q=1; break; case 'Windows': $q=2; break; case 'Linux': $q=3; break; case 'Macintosh': $q=4; break; case 'Mobile': $q=5; break; case 'Other': $q=6; break; default: break; } $selected1[$i] = 'selected="selected"'; $selected2[$j] = 'selected="selected"'; $selected3[$k] = 'selected="selected"'; $selected4[$l] = 'selected="selected"'; $selected5[$m] = 'selected="selected"'; $selected6[$n] = 'selected="selected"'; $selected7[$o] = 'selected="selected"'; $selected8[$p] = 'selected="selected"'; $selected9[$q] = 'selected="selected"'; $main = $main . '' . $error . '
Edit your game\'s details below
Game name:
Web address (http://):
Contact email:
Category:
# Players:
Description:
Short version:
Client:
Interface:
Plugin:
Prizes:
Status:
Cost:$
Platform:
'; } } break; default: break; } break; default: if(($_COOKIE['rpgtoplist'] || $_SESSION['rpgtoplist']) && $email){ $main = $main . ''; if($info['access'] > 1){ $main = $main . ' '; } if($info['access'] > 2){ $main = $main . ''; } $main = $main . '
' . ucfirst($info['type']) . ' Panel
Edit profile
Change password
Change email
Newsletter settings
Manage games
Manage incentives
Get HTML and example code
Review games
'; } else { header('location: http://www.rpgtoplist.com/'); } break; } } else { $main = $main . '
RPG Top List
You will be able to choose between 2 types of accounts:
Developer account
  • Add your game to the directory for extra traffic
  • Use our incentives system to get more votes and thus get even more traffic
  • When you get into the top 3 you will get free advertising
  • Option to join our banner exchange which is displayed in our header on all pages
  • Access to the developer boards where you can get help and read useful articles about
    • Management
    • Marketing
    • Graphic design
    • Programming
    • and more!
  • Get your game reviewed with optional advice on how to raise your scores and thus improve your games
  • Add offers to get more players to sign up to your game
Player account
Access to all the latest news, offers and game previews/testing sessions!
Please register here.
'; } include('footer.php'); ?>