Advertisement
Guest User

olliephp

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