'; if(isset($_COOKIE['rpgtoplist'])) { $active = $info['active']; } else { if(isset($_COOKIE['active'])) { $active = clean($_COOKIE['active']); } elseif(isset($_SESSION['active'])) { $active = clean($_SESSION['active']); } else { $active = $time; } } if(isset($_COOKIE['rpgtoplist'])) { @mysql_query("UPDATE `accounts` SET `active` = '$time' WHERE `email` = '$_GET[email]' AND `passcheck` = '$pass'")or die (mysql_error()); } elseif(isset($_COOKIE['active'])) { $_COOKIE['active'] = $time; } elseif(!isset($_COOKIE['active'])) { setcookie('active', $time, '0', '/', '', '0'); if(!isset($_COOKIE['active'])) { $_SESSION['active'] = $time; } } if($_GET['step']) { $step = clean($_GET['step']); } else { $step = clean($_POST['step']); } switch($step) { case 'view': switch($_GET['view']) { case 'post': if($_GET['post']) { $postid = clean($_GET['post']); } else { $postid = clean($_POST['post']); } if(!$postid) { header('location: http://www.rpgtoplist.com'); } else { $posts = @mysql_query("SELECT * FROM `posts` WHERE `id` = '$postid'") or die(mysql_error()); $post = @mysql_fetch_array($posts); $fora = @mysql_query("SELECT * FROM `fora` WHERE `id` = '$post[forum]'") or die(mysql_error()); $forum = @mysql_fetch_array($fora); $posters = @mysql_query("SELECT * FROM `accounts` WHERE `id` = '$post[poster]'") or die(mysql_error()); $poster = @mysql_fetch_array($posters); $replies = @mysql_query("SELECT * FROM `posts` WHERE `parent` = '$post[id]' ORDER BY `posted` DESC") or die(mysql_error()); $main = $main . '
    '; while($reply = @mysql_fetch_array($replies)) { $repposters = @mysql_query("SELECT * FROM `accounts` WHERE `id` = '$reply[poster]'") or die(mysql_error()); $repposter = @mysql_fetch_array($repposters); $reps = mysql_num_rows(mysql_query("SELECT * FROM `posts` WHERE `parent` = '{$reply['id']}'")); $main = $main . '
'; } $main = $main . '
Main => ' . $forum['name'] . ' => ' . $post['subject'] . '
' . $post['body'] . '
by ' . ucfirst($poster['type']) . ' ' . $poster['user'] . '
Replies:
SubjectPosterReplies
' . $reply['subject'] . 'by ' . ucfirst($repposter['type']) . ' ' . $repposter['user'] . '' . $reps . '
'; } break; case 'forum': if(!$_GET['forum']) { header('location: http://www.rpgtoplist.com'); } else { $for = clean($_GET['forum']); $fora = @mysql_query("SELECT `id`, `name`,`description` FROM `fora` WHERE `id` = '$for'"); $forum = @mysql_fetch_array($fora); $posts = @mysql_query("SELECT * FROM `posts` WHERE `forum` = '$for' AND `parent` = 0 ORDER BY `posted` DESC"); $main = $main . ''; while($post = @mysql_fetch_array($posts)) { $posters = @mysql_query("SELECT * FROM `accounts` WHERE `id` = '{$post['poster']}'"); $poster = @mysql_fetch_array($posters); $newposts = @mysql_num_rows(mysql_query("SELECT * FROM `posts` WHERE `posted` > '$active' AND `parent` = '$post[id]'")); $numposts = @mysql_num_rows(mysql_query("SELECT * FROM `posts` WHERE `parent` = '$post[id]'")); if($newposts > 0) { $subject = '' . $post['subject'] . ''; } else { $subject = $post['subject']; } if($poster['user']) { $posters = '' . $poster['user'] . ''; } else { $posters = 'guest'; } $main = $main . ''; } $main = $main . ''; } $main = $main . '
Main => ' . $forum['name'] . '
' . $forum['description'] . '
TopicPosterRepliesNew Replies
' . $subject . 'by ' . ucfirst($poster['type']) . ' ' . $posters . '' . $numposts . '' . $newposts . '
'; break; default: header('location: http://www.rpgtoplist.com'); break; } break; case 'post': if($_POST['action'] == 'submit') { if(($_POST['subject']) && ($_POST['subject'] != 'subject')) { if(!$info['id']){$info['id'] = 0;} $subject = clean($_POST['subject']); $body = clean($_POST['body']); $parent = clean($_POST['parent']); $forum = clean($_POST['forum']); @mysql_query("INSERT INTO `posts` (`poster`, `subject`, `body`, `posted`, `parent`, `forum`) VALUES ('$info[id]', '$subject', '$body', '$time', '$parent', '$forum') ") or die('System Failure'); if($_POST['parent']) { $url = $_SERVER['PHP_SELF'] . '?step=view&view=post&post=' . $_POST['parent'] . '&email=' . $email; } else { $url = $_SERVER['PHP_SELF'] . '?step=view&view=forum&forum=' . $_POST['forum'] . '&email=' . $email; } $main = $main . '
Your post has been submitted. Click here to go back.
'; } else { $main = $main . 'No spamming hombre'; } } else { $main = $main . '
Enter your message:
'; } break; default: $main = $main . ''; $category = @mysql_query("SELECT * FROM `fora` WHERE `type` = 'category' AND `access` <= '{$info['access']}' ORDER BY `order`") or die (mysql_error()); while($cat = @mysql_fetch_array($category)) { $main = $main . ''; $fora = @mysql_query("SELECT * FROM `fora` WHERE `type` = 'forum' AND `category` = '$cat[name]' AND `access` <= '{$info['access']}' ORDER BY `order`")or die (mysql_error()); while($forum = @mysql_fetch_array($fora)) { $p = @mysql_query("SELECT * FROM `posts` WHERE `forum` = '$forum[id]'"); $posts = @mysql_num_rows($p); $np = @mysql_query("SELECT * FROM `posts` WHERE `posted` > '$active' AND `forum` = '$forum[id]'"); $newposts = @mysql_num_rows($np); $main = $main . ''; } } $main = $main . '
Welcome to the RPG Top List Forum
Here you can discuss the latest games, the various aspects of game development and of course this site.
' . $cat['name'] . '
Forum
Posts
New Posts
' . $forum['name'] . '
' . $forum['description'] . '
' . $posts . '
' . $newposts . '
'; break; } include('footer.php'); ?>