Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $host = "localhost";
- $user = "root";
- $pass = "09k6CcsGxBq7p";
- $db = "bulletinboard";
- ?>
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <link href='https://fonts.googleapis.com/css?family=Merriweather+Sans' rel='stylesheet' type='text/css'>
- <title>Untitled Document</title>
- <script type="text/javascript">
- </script>
- <link rel="stylesheet" type="text/css" href="BB.css">
- </head>
- <body style="font-family: 'Merriweather Sans', sans-serif;">
- <div class="Filler"> </div>
- <div class="Header">
- <div class="Banner">
- <a href = "kek.php"><div class="BannerImageArea"> </div></a>
- <div class="BreadcrumbsNav"> </div>
- </div>
- <div class="UserArea">
- <div class="InnerUserArea">
- <?php
- if(!isset($_SESSION['User'])){
- echo"
- <form action=\"ProcessLogin.php\" method=\"post\" enctype=\"multipart/form-data\">
- Username <br/>
- <input type=\"text\" name=\"txtUsername\"><br/>
- <br/>
- Password <br/> <input type=\"password\" name=\"txtPassword\"><br/>
- <br/>
- <input type=\"submit\" value=\"Login\">
- </form>
- <br />
- <a href=\"Signup.php\">Signup</a>";
- if(isset($_SESSION['ICL'])){
- echo "<p style=\"Color:Red; display:Inline;\"> ~Incorrect Login </p>";
- unset($_SESSION['ICL']);
- }
- }else{
- echo "<img src=\"NoUserImage.png\" width=190px; height=190px; draggable=\"false\";>";
- }
- ?>
- </div>
- </div>
- </div>
- <div class="Filler"></div>
- <div class="MainContainer">
- <div class="Filler"></div>
- <div class="TopMiddle">
- <div class="RightMain">
- <?php
- if(isset($_SESSION['User'])){
- echo "<div class=\"UserAreaInfo\">";
- echo "<p style=\"margin-left:5px; display:inline;\">Name :</p>";
- echo "<b style=\"margin-left:5px; font-size:20px;\">".$_SESSION['User']."</b></br>";
- echo "<p style=\"margin-left:5px; display:inline;\">Total Comments :</p></br>";#
- echo "<p style=\"margin-left:5px; display:inline;\">Total Threads :</p></br>";
- echo "<p style=\"margin-left:5px; display:inline;\">Date created :</p></br>";
- echo "<form style=\"margin-left:5px; display:inline;\"action=\"ProcessGotoEdit.php\"><input type=\"Submit\" value=\"Edit Password\"></form>";
- echo "<form style=\"margin-left:5px;\"action=\"Logout.php\"><input type=\"Submit\" value=\"Logout\"></form>";
- echo "</div>";
- }
- ?>
- <div <?php if(!isset($_SESSION['User'])){echo"style=\"margin-top:0px;\"";} ?> class="Donate"> </div>
- <div class="Webstats"> </div>
- <div class="CurrentInfo"> </div>
- </div>
- <div class="LeftMain">
- <div class="RecentThreads">
- <?php
- mysql_connect($host,$user,$pass) or die ("Couldn't Connect!");
- mysql_select_db($db) or die ("Couldn't find databse");
- $query = "SELECT * FROM `comments` ORDER BY 1 DESC LIMIT 0,5";
- $result = mysql_query($query);
- echo "<table width=860px style=\"margin-left:13px;\">";
- while($row = mysql_fetch_row($result)){
- echo "<tr>";
- echo "<a href=\"kek.php?Thread=".$row[5]."\"><td>".$row[1]."</td></a>";
- $query3 = "SELECT `Username`FROM `users` WHERE `ID` = '".$row[3]."'";
- $result3 = mysql_query($query3);
- $resultt = mysql_result($result3, 0);
- echo "<td height=35px width=350px style=\"text-align:left\">".$row[2]."</td>";
- echo "<td height=35px width=100px style=\"text-align:right\"><b>".$resultt." "."</b></td>";
- echo "<td height=35px width=150px>".$row[4]."</td>";
- echo "</tr>";
- }
- echo "</table>";
- ?>
- </div>
- <div class="Chatbox">
- <?php
- mysql_connect($host,$user,$pass) or die ("Couldn't Connect!");
- mysql_select_db($db) or die ("Couldn't find databse");
- $query = "SELECT * FROM `chat` ORDER BY 1 DESC LIMIT 0,20";
- $result = mysql_query($query);
- echo "<div class=\"ChatboxTable\"><center><table width=\"820px\">";
- 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>";
- while($row = mysql_fetch_row($result)){
- echo "<tr>";
- $queryname = "SELECT `Username`FROM `users` WHERE `ID` = '".$row[1]."'";
- $result2 = mysql_query($queryname);
- $resultname = mysql_result($result2, 0);
- echo "<td width=100px style=\"text-align:left\">".$resultname."</td>";
- echo "<td style=\"text-align:left\">".$row[2]."</td>";
- echo "<td style=\"text-align:right\">".$row[3]." "."</td>";
- echo "</tr>";
- }
- echo "</table></center></div>";
- if(isset($_SESSION['User'])){
- echo "<form action=\"ProcessSendMessage.php\" method=\"post\" enctype=\"multipart/form-data\" style=\"margin-top:15px;\">
- <input type=\"text\" size=\"95\" style=\"margin-left:10px;\" name=\"txtMessage\"><input type=\"submit\" value=\"Send Message\" style=\"margin-left:20px;\">
- </form>";
- }
- ?>
- </div>
- <?php
- if(isset($_SESSION['User'])){
- if(isset($_GET['Thread'])){
- $_SESSION['VIEWTHREAD'] = $_GET['Thread'];
- echo "<div class=\"MainContent\" style=\"Height:auto; font-family: 'Merriweather Sans', sans-serif;\">";
- mysql_connect($host,$user,$pass);
- mysql_select_db($db);
- $query = "SELECT `ID`,`Title`,`Comment`,`UID`,`Date` FROM `comments` WHERE `Ref ID` ='".$_GET['Thread']."' ORDER BY 1";
- $result = mysql_query($query);
- $count = 1;
- while($row = mysql_fetch_row($result)){
- if($count ==1){
- echo "<div id=\"First\" class=\"Comment\" style=\"margin-top:15px;\">";
- echo "<b><p style=\"margin-left:15px;\">".$row[1]."</p></b>";
- $query2 = "SELECT `Username` FROM `users` WHERE ID = '".$row[3]."'";
- $result2 = mysql_query($query2);
- echo "<i><p style=\"margin-left:15px;\">".mysql_result($result2, 0)." "."</i>".$row[4]."</p>";
- echo "<p style=\"margin-left:15px;\">".$row[2]."</p>";
- echo "</div>";
- $count++;
- }else{
- echo "<div class=\"Comment\" style=\"margin-top:15px; background-color:#C7C7C7;\">";
- $query2 = "SELECT `Username` FROM `users` WHERE ID = '".$row[3]."'";
- $result2 = mysql_query($query2);
- echo "<i><p style=\"margin-left:15px;\">".mysql_result($result2, 0)." "."</i>".$row[4]."</p>";
- echo "<p style=\"margin-left:15px;\">".$row[2]."</p>";
- echo "</div>";
- }
- }
- echo "<form action=\"ProcessPostComment.php\" method=\"post\" enctype=\"multipart/form-data\" style=\"margin-top:30px; margin-left:15px;\">
- <textarea style=\"resize:none\" name=\"txtPost\" rows=\"6\" cols=\"114\">Your comment!</textarea>
- <br/>
- <br/>
- <input type=\"Submit\" value=\"Post Comment\">
- </form>";
- echo "<div class=\"Threadfiller\" style=\"height:15px;\"></div>";
- }else{
- echo "<div class=\"MainContent\" style=\"Height:auto; font-family: 'Merriweather Sans', sans-serif;\">";
- echo "<p style=\"margin-left:30px; font-size:30px;\">Start a new thread</p>";
- echo "<hr style=\"width: 790px;\" />";
- echo "<form action=\"ProcessNewThread.php\" method=\"post\" enctype=\"multipart/form-data\" style=\"margin-top:15px; margin-left:30px;\">
- <input value=\"Your title\" type=\"text\" name=\"txtTitle\" size=\"40\">
- <br/>
- <br/>
- <textarea style=\"resize:none\" name=\"txtPost\" rows=\"6\" cols=\"110\">Your message here!</textarea>
- <br/>
- <br/>
- <input type=\"submit\" value=\"Post Thread\">
- </form>
- <br/>
- <br/>";
- echo "<p style=\"margin-left:30px; font-size:30px;\">Threads</p>";
- echo "<hr style=\"width: 790px;\" />";
- mysql_connect($host,$user,$pass);
- mysql_select_db($db);
- $query="SELECT `Title`,`Date`,`ID` FROM `Comments` WHERE `Ref ID` = `ID`";
- $result = mysql_query($query);
- while($row = mysql_fetch_row($result)){
- 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>";
- }
- echo "<div class=\"Threadfiller\" style=\"height:15px;\"></div>";
- }
- }else{
- echo "<div class=\"MainContent\" style=\"Height:auto; font-family: 'Merriweather Sans', sans-serif;\">";
- echo "<p style=\"margin-left:30px; font-size:30px;\">Please login to view or create threads.</p>";
- }
- ?>
- </div>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement