Update README.md
[bans.verniy.xyz.git] / pages.php
blobcf9ff99deacb7c622f9c81437f41f78b58a6c88c
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <base href="http://bans.verniy.xyz"/>
5 <title>Simple 4Chan Ban Log - Paged View</title>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7 <meta name="viewport" content="width=device-width, initial-scale=0.8">
8 <script type="text/javascript" src = "/Scripts/TableFunctions.js?5"></script>
9 <script></script>
10 <link href="/Scripts/IndexStyle.css" rel="stylesheet" type="text/css"></style>
11 </head>
12 <body itemscope="" itemtype="http://schema.org/DataCatalog">
13 <?php
14 echo "
15 <div>
16 <meta itemprop='url' content=\"/pages?file=" . $_GET['file'] . "\"/>
17 <a href = '/listings'>Back to Home Listings</a>
20 $ledger = fopen("4Chan_Bans_Log-Ledger.txt", "r");
21 $entry_count = fgets($ledger);
22 $file_count = fgets($ledger);
23 fclose($ledger);
26 $low = ($_GET["file"] - 1);
27 if($low < 1) $low = 1;
29 $high = ($_GET["file"]) + 1;
30 if($high > $file_count + 1) $high = $file_count + 1;
32 $file_no = $file_count - $_GET["file"] + 1;
34 $file_contents = file_get_contents("Logs/4Chan_Bans_Log-Reverse_Chrono-" . $file_no .".json");
35 if($file_no == $file_count)$file_contents[strpos($file_contents, ',', strlen($file_contents) - 5)] = ']';
36 $file_contents = json_decode($file_contents, true);
38 echo "<table id='pageTable'>";
39 $offset = 6;
40 $file_get = $_GET["file"] - $offset;
41 if($file_get < 0) $file_get = 0;
43 $font_size = "18px";
44 for($i = $file_get ; $i < $file_count + 1 ; $i++){
45 if($i == $_GET["file"] - 1) echo "<td><a style='font-size:$font_size;color:red' href='/pages?file=" . ($i + 1) ."'>". ($i + 1) . "</a></td>";
46 else if((ceil(($file_count + 1) / 2) + $file_get) < $file_count - 2 && $i == 10 + $file_get){
47 echo "<td><a style='font-size:$font_size;' href='/pages?file=" . (ceil(($file_count + 1) / 2) + $file_get) ."'>". (ceil(($file_count + 1) / 2) + $file_get) . "</a></td>";
49 else if($i == $file_count){
50 echo "<td><a style='font-size:$font_size;' href='/pages?file=" . ($i + 1) ."'>". ($i + 1) . "</a></td>";
52 else if($i == 11 + $file_get || $i == 9 + $file_get){
53 echo "<td style='font-size:$font_size'>...</td>";
55 else if($i < 11 + $file_get){
56 echo "<td><a style='font-size:$font_size;' href='/pages?file=" . ($i + 1) ."'>". ($i + 1) . "</a></td>";
59 echo "</table> </div>";
61 echo "
62 <div>
63 <h2 itemprop='name'>V's 4Chan Ban Log - Pages</h2>
64 <meta itemprop='description' content='An easy to read log of 4chan's ban page for both the ban evader and the innocent alike. Contains information what 4chan moderators ban by archiving the 4chan ban page at 4chan.org/bans. Updated every 15 minutes to stay up to date. Common bans such as GR15, GR5 etc. from every board(/a/, /pol/, /e/, /h/)'>
65 <meta itemprop='keywords' content='4chan,bans,logger,shitposter,GR3,ban evasion,/a/,/c/,/h/,/d/,/e/'>
66 <meta itemprop='version' content='Jan-03' id='versionInfo'/>
68 <p>
69 Currently reading page <strong>". ($_GET["file"]) ."</strong> of <em>" . ($file_count + 1) ."</em>.<br>
70 Total entries: $entry_count
71 </p>
72 </div>";
73 echo "<a href='/index'>View the Dynamic Listings</a><br/>";
75 echo "<div itemprop='dataset' itemscope='' itemtype='http://schema.org/DataSet'>
76 <a href = 'pages?file=" . $low . "' itemprop='url'>Previous</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href = 'pages?file=" . $high ."' itemprop='url'>Next</a><br/>
77 <meta itemprop='measurementTechnique' content='Page Logging'>
78 <meta itemprop='sameAs' content='" . "Logs/4Chan_Bans_Log-Reverse_Chrono-$file_no.json" . "'>
79 <meta itemprop='version' content='" . $file_no . "' id='versionInfo'/>
80 <table id='bansTable'>
81 <tbody>
84 echo "<meta itemprop='variableMeasured' content='Board'>";
85 echo "<meta itemprop='variableMeasured' content='Name'>";
86 echo "<meta itemprop='variableMeasured' content='Comment'>";
87 echo "<meta itemprop='variableMeasured' content='Action'>";
88 echo "<meta itemprop='variableMeasured' content='Duration'>";
89 echo "<meta itemprop='variableMeasured' content='Reason'>";
90 echo "<meta itemprop='variableMeasured' content='Time'>";
92 $useragent=$_SERVER['HTTP_USER_AGENT'];
93 $is_mobile;
94 if(strpos($useragent, "Mobile") !== false) $is_mobile = true;
96 if($is_mobile){
97 $font_size = 'font-size:12px';
98 foreach(array_reverse($file_contents) as $line){
99 echo "<tr>";
100 if($line["board"] == "s4s") echo "<td>[" . $line["board"] ."]</td>";
101 else echo "<td style = \"font-size:8px\">/" . $line["board"] ."/</td>";
102 //echo "<td style = \"max-width:150px;$font_size\">" . $line["name"] ."</td>";
103 //echo "<td style = \"max-width:100px;$font_size\">" . $line["trip"] ."</td>";
104 echo "<td style = \"max-width:500px;$font_size\">" . $line["com"] ."</td>";
105 echo "<td style='$font_size'>" . $line["action"] ."</td>";
106 //echo "<td style='$font_size'>" . $line["length"] ."</td>";
107 //echo "<td style='$font_size'>" . $line["reason"] ."</td>";
108 //echo "<td style='$font_size'>" . $line["now"] ."</td>";
109 echo "</tr>";
112 else{
113 foreach(array_reverse($file_contents) as $line){
114 echo "<tr>";
115 if($line["board"] == "s4s") echo "<td>[" . $line["board"] ."]</td>";
116 else echo "<td>/" . $line["board"] ."/</td>";
117 echo "<td style = \"max-width:150px\">" . $line["name"] ."</td>";
118 echo "<td style = \"max-width:100px\">" . $line["trip"] ."</td>";
119 echo "<td style = \"max-width:800px\">" . $line["com"] ."</td>";
120 echo "<td>" . $line["action"] ."</td>";
121 echo "<td>" . $line["length"] ."</td>";
122 echo "<td>" . $line["reason"] ."</td>";
123 echo "<td>" . $line["now"] ."</td>";
124 echo "</tr>";
129 echo "</tbody></table></div>";
132 <div itemprop="about" >
134 <span itemprop="accountablePerson">Verniy 2017</span>: Last Updated <span itemprop="dateModified">03/1/2018</span><br/>
135 <meta itemprop="author" content="ECHibiki">
136 Metadata & CSS<br/>
137 Inquiries to be sent to the gmail account of ECVerniy
138 </p>
139 </div>
140 </body>
141 </html>