SHARE
TWEET

Untitled

a guest Mar 20th, 2016 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include 'processerror.php';
  3. set_error_handler(logmyerror);
  4. session_start();
  5.  
  6. $page = $_SERVER['PHP_SELF'];
  7. $ip = $_SERVER['REMOTE_ADDR'];
  8. if(isset($_SESSION['User'])){
  9.     $usern = $_SESSION['User'];
  10. }else{
  11.     $usern = "";
  12. }
  13. logstats($page,$ip,$usern);
  14.  
  15. $host = "localhost";
  16. $user = "root";
  17. $pass = "09k6CcsGxBq7p";
  18. $db = "bulletinboard";
  19. ?>
  20. <!doctype html>
  21. <html>
  22. <head>
  23. <meta charset="utf-8">
  24. <link href='https://fonts.googleapis.com/css?family=Merriweather+Sans' rel='stylesheet' type='text/css'>
  25. <title>Untitled Document</title>
  26. <script type="text/javascript">
  27.  
  28. </script>
  29. <link rel="stylesheet" type="text/css" href="BB.css">
  30. </head>
  31.  
  32. <body style="font-family: 'Merriweather Sans', sans-serif;">
  33. <div class="Filler"> </div>
  34. <div class="Header">
  35.   <div class="Banner">
  36.     <a href = "kek.php"><div class="BannerImageArea"> </div></a>
  37.     <div class="BreadcrumbsNav"><center>Your Location : Home <?php if(isset($_GET['Thread'])){echo " > Thread".$_GET['Thread']."";}?></center></div>
  38.   </div>
  39.   <div class="UserArea">
  40.     <div class="InnerUserArea">
  41.       <?php
  42.  if(!isset($_SESSION['User'])){
  43.      echo"
  44.   <form action=\"ProcessLogin.php\" method=\"post\" enctype=\"multipart/form-data\">
  45. Username <br/>
  46.  <input type=\"text\" name=\"txtUsername\"><br/>
  47. <br/>
  48. Password <br/> <input type=\"password\" name=\"txtPassword\"><br/>
  49. <br/>
  50. <input type=\"submit\" value=\"Login\">
  51. </form>
  52. <br />
  53. <a href=\"Signup.php\">Signup</a>";
  54. if(isset($_SESSION['ICL'])){
  55.     echo "<p style=\"Color:Red; display:Inline;\">  ~Incorrect Login </p>";
  56.     unset($_SESSION['ICL']);
  57. }
  58.  }else{
  59.      echo "<img src=\"NoUserImage.png\" width=190px; height=190px; draggable=\"false\";>";
  60.  }
  61. ?>
  62.     </div>
  63.   </div>
  64. </div>
  65. <div class="Filler"></div>
  66. <div class="MainContainer">
  67.   <div class="Filler"></div>
  68.   <div class="TopMiddle">
  69.     <div class="RightMain">
  70.     <?php
  71.     if(isset($_SESSION['User'])){
  72.       echo "<div class=\"UserAreaInfo\">";
  73.       echo "<p style=\"margin-left:5px; display:inline;\">Name :</p>";
  74.       echo "<b style=\"margin-left:5px; font-size:20px;\">".$_SESSION['User']."</b></br>";
  75.       echo "<p style=\"margin-left:5px; display:inline;\">Total Comments :</p></br>";#
  76.       echo "<p style=\"margin-left:5px; display:inline;\">Total Threads :</p></br>";
  77.       echo "<p style=\"margin-left:5px; display:inline;\">Date created :</p></br>";
  78.       echo "<form style=\"margin-left:5px; display:inline;\"action=\"ProcessGotoEdit.php\"><input type=\"Submit\" value=\"Edit Password\"></form>";
  79.       echo "<form style=\"margin-left:5px;\"action=\"Logout.php\"><input type=\"Submit\" value=\"Logout\"></form>";
  80.       echo "</div>";
  81.     }
  82.     ?>
  83.     <?php
  84.     if($_SESSION['User'] == "Admin" || $_SESSION['User'] == "admin"){
  85.       echo "<a href=\"Errors.php\"><div class=\"Donate\"><br/><p style=\"text-align:center\">ErrorLog</p></div></a>";
  86.     }
  87.     echo "<a href=\"Webstats.php\"><div class=\"Webstats\"><br/><p style=\"text-align:center\">Webstats</p></div></a>";
  88.       ?>
  89.       <?php
  90.       if(isset($_SESSION['User'])){
  91.       echo "<div class=\"CurrentInfo\">";
  92.       echo "<a href=\"kek.php\">Home</a><br/>";
  93.       if(isset($_GET['Thread'])){
  94.           echo "<a href=\"kek.php?Thread=".$_GET['Thread']."\">"."Back to the top"."</a>";
  95.       }else{
  96.           echo "<a href=\"kek.php\">Back to the top</a>";
  97.       }
  98.       echo "<br/>
  99.       <a href=\"kek.php#Threads\">View all threads</a>";
  100.       echo "</div>";
  101.       }
  102.       ?>
  103.     </div>
  104.     <div class="LeftMain">
  105.       <div class="RecentThreads">
  106.       <?php
  107.       mysql_connect($host,$user,$pass) or die ("Couldn't Connect!");
  108. mysql_select_db($db) or die ("Couldn't find databse");
  109. $query = "SELECT * FROM `comments` ORDER BY 1 DESC LIMIT 0,5";
  110. $result = mysql_query($query);
  111. echo "<table width=825px style=\"margin-left:13px;\">";
  112. echo "<tr><td>Title</td><td>Post</td><td>User</td><td>Date</td></tr>";
  113. $countswap = 1;
  114. while($row = mysql_fetch_row($result)){
  115.     echo "<tr>";
  116.     echo "<td><a href=\"kek.php?Thread=".$row[5]."#First\">".$row[1]."</a></td>";
  117.     $query3 = "SELECT `Username`FROM `users` WHERE `ID` = '".$row[3]."'";
  118.       $result3 = mysql_query($query3);
  119.       $resultt = mysql_result($result3, 0);
  120.       echo "<td height=30px width=350px style=\"text-align:left\">".$row[2]."</td>";
  121.     echo "<td height=30px width=100px style=\"text-align:left\"><b>".$resultt."     "."</b></td>";
  122.     echo "<td height=30px width=150px>".$row[4]."</td>";
  123.     echo "</tr>";
  124. }
  125. echo "</table>";
  126.       ?>
  127.       </div>
  128.       <div class="Chatbox">
  129.       <?php
  130.       mysql_connect($host,$user,$pass) or die ("Couldn't Connect!");
  131.       mysql_select_db($db) or die ("Couldn't find databse");
  132.       $query = "SELECT * FROM `chat` ORDER BY 1 DESC LIMIT 0,20";
  133.       $result = mysql_query($query);
  134.       echo "<div class=\"ChatboxTable\"><center><table width=\"820px\">";
  135.       echo "<tr><td style=\"text-align:left\"><b>Name</b></td><td style=\"text-align:left\"><b>Message</b></td><td style=\"text-align:right\"><b>Time</b></td></tr>";
  136.     while($row = mysql_fetch_row($result)){
  137.       echo "<tr>";
  138.       $queryname = "SELECT `Username`FROM `users` WHERE `ID` = '".$row[1]."'";
  139.       $result2 = mysql_query($queryname);
  140.       $resultname = mysql_result($result2, 0);
  141.       echo "<td width=100px style=\"text-align:left\">".$resultname."</td>";
  142.       echo "<td style=\"text-align:left\">".$row[2]."</td>";
  143.       echo "<td style=\"text-align:right\">".$row[3]." "."</td>";
  144.       echo "</tr>";
  145.     }
  146.       echo "</table></center></div>";
  147.       if(isset($_SESSION['User'])){
  148.           echo "<form action=\"ProcessSendMessage.php\" method=\"post\" enctype=\"multipart/form-data\" style=\"margin-top:15px;\">
  149.           <input type=\"text\" size=\"95\" style=\"margin-left:10px;\" name=\"txtMessage\"><input type=\"submit\" value=\"Send Message\" style=\"margin-left:20px;\">
  150.           </form>";
  151.       }
  152.       ?>      
  153.       </div>
  154.       <?php
  155.       if(isset($_SESSION['User'])){
  156.         if(isset($_GET['Thread'])){
  157.           $_SESSION['VIEWTHREAD'] = $_GET['Thread'];
  158.           echo "<div class=\"MainContent\" style=\"Height:auto; font-family: 'Merriweather Sans', sans-serif;\">";
  159.           mysql_connect($host,$user,$pass);
  160.           mysql_select_db($db);
  161.           $query = "SELECT `ID`,`Title`,`Comment`,`UID`,`Date` FROM `comments` WHERE `Ref ID` ='".$_GET['Thread']."' ORDER BY 1";
  162.           $result = mysql_query($query);
  163.           $count = 1;
  164.           while($row = mysql_fetch_row($result)){
  165.               if($count ==1){
  166.                   echo "<div id=\"First\" class=\"Comment\" style=\"margin-top:15px;\">";
  167.                   echo "<b><p style=\"margin-left:15px;\">".$row[1]."</p></b>";
  168.                   $query2 = "SELECT `Username` FROM `users` WHERE ID = '".$row[3]."'";
  169.                   $result2 = mysql_query($query2);
  170.                   echo "<i><p style=\"margin-left:15px;\">".mysql_result($result2, 0)." "."</i>".$row[4]."</p>";
  171.                   echo "<p style=\"margin-left:15px;\">".$row[2]."</p>";
  172.                   echo "</div>";
  173.                   $count++;
  174.               }else{
  175.                   echo "<div class=\"Comment\" style=\"margin-top:15px; background-color:#C7C7C7;\">";
  176.                   $query2 = "SELECT `Username` FROM `users` WHERE ID = '".$row[3]."'";
  177.                   $result2 = mysql_query($query2);
  178.                   echo "<i><p style=\"margin-left:15px;\">".mysql_result($result2, 0)." "."</i>".$row[4]."</p>";
  179.                   echo "<p style=\"margin-left:15px;\">".$row[2]."</p>";
  180.                   echo "</div>";
  181.               }
  182.           }
  183.                   echo "<form action=\"ProcessPostComment.php\" method=\"post\" enctype=\"multipart/form-data\" style=\"margin-top:30px; margin-left:15px;\">
  184.           <textarea style=\"resize:none\" name=\"txtPost\" rows=\"6\" cols=\"114\">Your comment!</textarea>
  185.           <br/>
  186.           <br/>
  187.           <input type=\"Submit\" value=\"Post Comment\">
  188.           </form>";
  189.           echo "<div class=\"Threadfiller\" style=\"height:15px;\"></div>";
  190.          
  191.       }else{
  192.           echo "<div class=\"MainContent\" style=\"Height:auto; font-family: 'Merriweather Sans', sans-serif;\">";
  193.           echo "<p style=\"margin-left:30px; font-size:30px;\">Start a new thread</p>";
  194.           echo "<hr style=\"width: 790px;\" />";
  195.           echo "<form action=\"ProcessNewThread.php\" method=\"post\" enctype=\"multipart/form-data\" style=\"margin-top:15px; margin-left:30px;\">
  196.           <input value=\"Your title\" type=\"text\" name=\"txtTitle\" size=\"40\">
  197.           <br/>
  198.           <br/>
  199.           <textarea style=\"resize:none\" name=\"txtPost\" rows=\"6\" cols=\"110\">Your message here!</textarea>
  200.           <br/>
  201.           <br/>
  202.           <input type=\"submit\" value=\"Post Thread\">
  203.           </form>
  204.           <br/>
  205.           <br/>";
  206.           echo "<p id=\"Threads\" style=\"margin-left:30px; font-size:30px;\">Threads</p>";
  207.           echo "<hr style=\"width: 790px;\" />";
  208.           mysql_connect($host,$user,$pass);
  209.           mysql_select_db($db);
  210.           $query="SELECT `Title`,`Date`,`ID` FROM `Comments` WHERE `Ref ID` = `ID`";
  211.           $result = mysql_query($query);
  212.           while($row = mysql_fetch_row($result)){
  213.               echo "<a href=\"kek.php?Thread=".$row[2]."#First\"><table width=820px style=\"margin-left:30px;\"><tr><td width=150px;>".$row[1]."</td><td>".$row[0]."</td></tr></table></a>";
  214.           }
  215.           echo "<div class=\"Threadfiller\" style=\"height:15px;\"></div>";
  216.          
  217.          
  218.       }
  219.       }else{
  220.           echo "<div class=\"MainContent\" style=\"Height:auto; font-family: 'Merriweather Sans', sans-serif;\">";
  221.           echo "<p style=\"margin-left:30px; font-size:30px;\">Please login to view or create threads.</p>";
  222.       }
  223.       ?>
  224.       </div>
  225.     </div>
  226.   </div>
  227. </div>
  228. </body>
  229. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top