Advertisement
Guest User

Untitled

a guest
Feb 8th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.66 KB | None | 0 0
  1. <?php
  2.  
  3. require_once("session.php");
  4.  
  5. require_once("class.user.php");
  6. $auth_user = new USER();
  7.  
  8. $user_id = $_SESSION['user_session'];
  9.  
  10. $stmt = $auth_user->runQuery("SELECT * FROM users WHERE user_id=:user_id");
  11. $stmt->execute(array(":user_id"=>$user_id));
  12.  
  13. $userRow=$stmt->fetch(PDO::FETCH_ASSOC);
  14. ?>
  15. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  16. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" id="www-roblox-com">
  17. <head><title>
  18. zahhblox
  19. </title><link id="ctl00_Imports" rel="stylesheet" type="text/css" href="/includes/css/AllCSS.css"/>
  20. <link rel="stylesheet" href="/includes/css/forumdef.css" type="text/css"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta http-equiv="Content-Language" content="en-us"/></head>
  21. <body>
  22.  
  23. <div id="Container">
  24. <div id="Header">
  25. <div id="Banner">
  26. <div id="Options">
  27. <div id="Authentication">
  28. <span>Logged in as <a href="/profile.php?id=<?php print($userRow['user_id']); ?>"><?php print($userRow['user_name']); ?></a> | <a href="/logout.php">Logout</a></span>
  29. </div>
  30. <div id="Settings"></div>
  31. </div>
  32.  
  33. <div id="Logo">
  34. <a id="ctl00_rbxImage_Logo" title="ROBLOX" href="https://zahhblox.xyz" style="display:inline-block;cursor:pointer;"><img src="/includes/img/roblox_logo.png" border="0" alt="ROBLOX" blankurl="http://t6.roblox.com:80/blank-224x59.gif"/></a>
  35. </div>
  36.  
  37.  
  38.  
  39. <div id="Alerts">
  40. <table style="width:100%;height:100%">
  41. <tr>
  42. <td valign="middle">
  43. <div id="AlertSpace">
  44. <div id="RobuxAlert">
  45. <a id="ctl00_rbxAlerts_RobuxAlertIconHyperLink" class="RobuxAlertIcon" href="#"><img src="http://besterestbloxerest.cf/assets/images/robux.png" style="border-width:0px;" /></a>&nbsp;
  46. <a id="ctl00_rbxAlerts_RobuxAlertCaptionHyperLink" class="RobuxAlertCaption" href="#"><?php print($userRow['robux']); ?> ROBUX</a>
  47. </div>
  48. </div>
  49. </td>
  50. </tr>
  51. </table>
  52. </div>
  53.  
  54. </div>
  55.  
  56.  
  57. <div class="Navigation">
  58. <span><a id="ctl00_Menu_hlMyRoblox" class="MenuItem" href="/profile.php?id=<?php print($userRow['user_id']); ?>">My ROBLOX</a></span>
  59. <span class="Separator">&nbsp;|&nbsp;</span>
  60. <span><a id="ctl00_Menu_hlGames" class="MenuItem" href="/games.php">Games</a></span>
  61. <span class="Separator">&nbsp;|&nbsp;</span>
  62. <span><a id="ctl00_Menu_hlCatalog" class="MenuItem" href="/catalog.php">Catalog</a></span>
  63. <span class="Separator">&nbsp;|&nbsp;</span>
  64. <span><a id="ctl00_Menu_hlBrowse" class="MenuItem" href="/users.php">People</a></span>
  65. <span class="Separator">&nbsp;|&nbsp;</span>
  66. <span><a id="ctl00_Menu_hlForum" class="MenuItem" href="/forum.php">Forum</a></span>
  67. <span class="Separator">&nbsp;|&nbsp;</span>
  68. <span><a id="ctl00_Menu_hlForum" class="MenuItem" href="/settings.php">Settings</a></span>
  69. </div>
  70. </div>
  71. <?php
  72. if(empty($_GET["id"])) {
  73. header("Location: https://zahhblox.xyz/forum.php");
  74. exit;
  75. }
  76. $id = $_GET["id"];
  77. $page = (int)$_GET["page"];
  78. if(empty($_GET['page'])) {
  79. header('Location: https://zahhblox.xyz/topic.php?id='.$id.'&page=1');
  80. }
  81. $stmte = $auth_user->runQuery("SELECT * FROM `topics` WHERE `id` = :id");
  82. $stmte->execute(array(":id"=>$id));
  83. if ($stmte->rowCount() == 0) {
  84. echo '<center>This topic doesn\'t exist!</center>';
  85. exit();
  86. }
  87. $stmtf = $auth_user->runQuery("SELECT * FROM `threads` WHERE `topic` = :id ORDER BY `lastupdated` DESC");
  88. $stmtf->execute(array(":id"=>$id))
  89. ?>
  90. <div id="Body">
  91.  
  92. <table width="100%" cellspacing="0" cellpadding="0" border="0">
  93. <tr>
  94. <td>
  95. </td>
  96. </tr>
  97. <tr valign="bottom">
  98. <td>
  99. <table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
  100. <tr valign="top">
  101. <!-- left column -->
  102. <td>&nbsp; &nbsp; &nbsp;</td>
  103. <!-- center column -->
  104. <td id="ctl00_cphRoblox_CenterColumn" width="95%" class="CenterColumn">
  105. <br>
  106. <span id="ctl00_cphRoblox_ThreadView1">
  107. <table cellpadding="0" width="100%">
  108. <tr>
  109. <td colspan="2" align="left"><span id="ctl00_cphRoblox_ThreadView1_ctl00_Whereami1" name="Whereami1">
  110.  
  111. <span id="ctl00_cphRoblox_ThreadView1_ctl00_Whereami1_ctl00_MenuScript"></span></span></td>
  112. </tr>
  113. <tr>
  114. <td>
  115. &nbsp;
  116. </td>
  117. </tr>
  118. <tr>
  119. <td valign="bottom" align="left"><a id="ctl00_cphRoblox_ThreadView1_ctl00_NewThreadLinkTop" href="/newpost.php?id=<?php print($_GET["id"]); ?>"><img id="ctl00_cphRoblox_ThreadView1_ctl00_NewThreadImageTop" src="/includes/img/newtopic.gif" border="0"/></a></td>
  120. </tr>
  121. <tr>
  122. <td valign="top" colspan="2"><table id="ctl00_cphRoblox_ThreadView1_ctl00_ThreadList" class="tableBorder" cellspacing="1" cellpadding="3" border="0" width="100%">
  123. <tr>
  124. <th class="tableHeaderText" align="left" colspan="2" height="25">&nbsp;Thread&nbsp;</th><th class="tableHeaderText" align="center" nowrap="nowrap">&nbsp;Started By&nbsp;</th><th class="tableHeaderText" align="center">&nbsp;Replies&nbsp;</th><th class="tableHeaderText" align="center">&nbsp;Views&nbsp;</th><th class="tableHeaderText" align="center" nowrap="nowrap">&nbsp;Last Post&nbsp;</th>
  125. </tr><?php
  126. $host = "localhost";
  127. $db_name = "zahhblox_db";
  128. $username = "zahhblox";
  129. $password = "1234567890?!1010";
  130. try{
  131. $dbcon = new PDO("mysql:host=".$host. ";dbname=".$db_name, $username, $password);
  132. $dbcon->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
  133. $dbcon->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
  134. }catch (exception $e){
  135. echo 'We could not connect to the database. Please try again shortly as we sent a team of potatoes to fix this issue.';
  136. exit;
  137. }
  138. $results = ($page - 1) * 10;
  139. $stmt = $dbcon->prepare("SELECT * FROM threads WHERE `topic` = :id ORDER BY `lastupdated` DESC LIMIT $results, 20");
  140. $stmt->execute(array(":id"=>$id));
  141. $stmt2 = $dbcon->prepare("SELECT * FROM threads");
  142. $stmt2->execute();
  143. $totalpages = ceil($stmt2->rowCount()/10);
  144. if ($stmt->rowCount() == 0) {
  145. echo 'Nothing found.';
  146. }
  147. foreach ($stmt as $thread) {
  148. $namestr = strip_tags($thread['name']);
  149. $bodystr = strip_tags($thread['body']);
  150. $profile = $auth_user->runQuery("SELECT * FROM `users` WHERE `user_id` = :id");
  151. $profile->execute(array(":id"=>$thread['uid']));
  152. $presult = $profile->fetch(PDO::FETCH_ASSOC);
  153. $lpost = $auth_user->runQuery("SELECT * FROM `users` WHERE `user_id` = :id");
  154. $lpost->execute(array(":id"=>$thread['lastposter']));
  155. $lresult = $lpost->fetch(PDO::FETCH_ASSOC);
  156. echo '<tr>
  157. <td class="forumRow" align="center" valign="middle" width="25"></td><td class="forumRow" height="25"><a class="linkSmallBold" href="/thread.php?id='; print($thread['id']); echo '">'; print($namestr); echo '</a></td><td class="forumRowHighlight" align="left" width="100">&nbsp;<a class="linkSmall" href="/profile.php?id='; print($presult['user_id']); echo '">'; print($presult['user_name']); echo '</a></td><td class="forumRowHighlight" align="center" width="50"><span class="normalTextSmaller">'; print($thread['replies']); echo '</span></td><td class="forumRowHighlight" align="center" width="50"><span class="normalTextSmaller">'; print($thread['views']); echo '</span></td><td class="forumRowHighlight" align="center" width="140" nowrap="nowrap">by&nbsp;<a class="linkSmall" href="/profile.php?id='; print($lresult['user_id']); echo '">'; print($lresult['user_name']); echo '</a><a href="/web/20080722032542/http://www.roblox.com:80/Forum/ShowPost.aspx?PostID=1905779#1905779"></a></td>
  158. </tr>';
  159. }
  160. ?>
  161. <td class="forumHeaderBackgroundAlternate" colspan="6">&nbsp;</td>
  162. </tr>
  163. </table><span id="ctl00_cphRoblox_ThreadView1_ctl00_Pager"><table cellspacing="0" cellpadding="0" border="0" width="100%">
  164. <tr>
  165. <td><span class="normalTextSmallBold">Page <?php echo $page; ?> of <?php echo $totalpages; ?></span></td><td align="right"><?php if($page +1 > $totalpages) { exit; } ?> <b><?php echo $page; ?></b> <a href="/topic.php?id=<?php echo $id; ?>&page=<?php echo $page + 1; ?>"><?php echo $page + 1; ?></a> <a href="/topic.php?id=<?php echo $id; ?>&page=<?php echo $page + 2; ?>"><?php echo $page + 2; ?></a></td>
  166. </tr>
  167. </table></span></td>
  168. </tr>
  169. <tr>
  170. <td colspan="2">
  171. &nbsp;
  172. </td>
  173. </tr>
  174. <tr>
  175.  
  176. <td class="CenterColumn">&nbsp;&nbsp;&nbsp;</td>
  177. <!-- right margin -->
  178. <td class="RightColumn">&nbsp;&nbsp;&nbsp;</td>
  179.  
  180. </tr>
  181. </table>
  182. </td>
  183. </tr>
  184. </table>
  185.  
  186. </div>
  187. </body>
  188. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement