working version
[Anonymous-Twitter-Board.git] / index.php
blob0d0fa25fb1f1e53088951199f7076c4ec608ae73
1 <?php
2 error_reporting(0);
3 if(isset($_POST["page-style"]) && isset($_POST["display-style"])){
4 setcookie("page-style", $_POST["page-style"]);
5 setcookie("display-style", $_POST["display-style"]);
6 header("Location: http://boards.verniy.xyz/?thread=" . $_GET["thread"]);
9 require("class/board-level-database-connection.php");
10 require("class/board-functions.php");
12 <html>
13 <head>
14 <base href="boards.verniy.xyz">
15 <?php //echo'<link rel="stylesheet" type="text/css" href="rsc/board-style.css?'.time().'2" />' ?>
16 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
17 <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
18 <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
19 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
20 </head>
21 <body class="">
22 <?php BoardFunctions::buildNavBar(); ?>
23 <div id="top-settings" class="jumbotron pt-3">
24 <h1 class='display-4'>Anonymous Twitter Project</h1></li>
25 <h4 class=''><a href="https://twitter.com/Qazoku" class=''>Connecting Twitter Page: @Qazoku</a></h4>
29 <?php
30 echo"
31 <div class='card w-75 mt-5 ml-5'>
32 <div class='card-header '>
33 <button class='btn btn-link' data-toggle='collapse' data-target='#timerandsettings' aria-expanded='true' aria-controls='timerandsettings'>Settings</button>
34 </div>
35 <div id='timerandsettings' class='collapse show'>
36 <div class='card-body'>
37 <span><strong>Time Until Next Update: </strong> <span id='time'></span><br/>
38 <div id='style-settings'>
39 <form action='' method='post'>
40 <label>Catalog View: <input type='radio' name='display-style' value='catalog' checked=1>
41 </label> <label>List View: <input type='radio' name='display-style' value='list' " . ($_COOKIE["display-style"] == "list" ? "checked=1" : "") . "></label><br/>
42 <label>Embeded View: <input type='radio' name='page-style' value='embeded' checked=1></label>
43 <label>Native View: <input type='radio' name='page-style' value='native'" . ($_COOKIE["page-style"] == "native" ? "checked=1" : "") . "></label><br/>
44 <input type='submit'>
45 </form>
46 </div>
47 </span>
48 </div>
49 </div>
50 </div>
53 $connection = new BoardLevelDatabaseConnection();
54 $connection->deleteFromTable("SubmissionTicket", "IPAddress", $_SERVER["HTTP_X_REAL_IP"]);
57 if(isset($_GET["thread"]) && $_GET["thread"] !== ""){
58 echo "</div><div id='posts-container' >";
59 BoardFunctions::buildThread($_COOKIE["page-style"], $_COOKIE["display-style"], $_GET["thread"], $connection);
60 echo "</div>";
62 else{
63 echo "<div id='queue-form-container'>";
64 BoardFunctions::buildQueueForm($_COOKIE["page-style"], $_COOKIE["display-style"]);
65 echo "</div></div>";//top settings end
67 echo '
68 <script src="rsc/board-script.js?'. time() .'"></script>
69 <script src="rsc/form-script.js?'. time() .'"></script>'; //Build scripts
71 if($_COOKIE["display-style"] == "catalog"){
72 echo "<div id='posts-container' class='d-flex flex-wrap'>";
74 else{
75 echo "<div id='posts-container' class=''>";
77 //function builds all posts inside container
78 BoardFunctions::buildAllThreads($_COOKIE["page-style"], $_COOKIE["display-style"], $connection);
79 echo "</div>";
82 </body>
83 </html>