website

Code for the bare sturcture of concealed.world.
git clone git://git.concealed.world/website
Log | Files | Refs | README | LICENSE

commit 803637317aa1aa849ebda6e1941717b9db866f08
parent 60f098ae0647b404e78af44be530970de5812d83
Author: Nixx <nixx@firemail.cc>
Date:   Sun, 11 Apr 2021 23:35:57 +0100

Major code cleanup, allow clearnet and tor to serve from the same directory

Diffstat:
AArchive/_index.php | 9+++++++++
DGeneral/_index.php | 9---------
DGeneral/example.php | 11-----------
DMedia/Art/_index.php | 10----------
DMedia/Cinema/_index.php | 10----------
DMedia/Games/_index.php | 10----------
DMedia/Music/_index.php | 10----------
MMedia/_index.php | 4+---
MNews/_index.php | 6+++---
ANews/example.php | 7+++++++
DOther/sitesilike.php | 14--------------
DPrivacy/_index.php | 10----------
DProjects/_index.php | 10----------
MREADME | 20++------------------
DScripting/_index.php | 10----------
DSoftware/_index.php | 9---------
ATechnology/_index.php | 9+++++++++
Dabout.php | 15---------------
Dcontact.php | 15---------------
Afavicon.ico | 0
Mhome.php | 2+-
Mincludes/archive.php | 2+-
Mincludes/article-start.php | 5++---
Mincludes/aside.php | 45+++++++++++++++++++++++++++++----------------
Mincludes/bg.php | 9++++-----
Mincludes/blogpanel.php | 18+++++++++---------
Mincludes/default-start.php | 42++++++++++++++++++++----------------------
Mincludes/homepanel.php | 44+++++++++++++++++++++-----------------------
Mincludes/listing-content.php | 7++-----
Mincludes/seemore.php | 3++-
Mincludes/start.php | 4++--
Dincludes/subdirs.php | 31-------------------------------
Dother.php | 16----------------
Drss.xml | 18------------------
Mstyles/default.css | 15+--------------
35 files changed, 125 insertions(+), 334 deletions(-)

diff --git a/Archive/_index.php b/Archive/_index.php @@ -0,0 +1,9 @@ +<?php +$root="../"; +$title="Archive"; +$tags="blog, archived posts"; +$message=$title; +$submessage="Historic, unmaintained posts which don't meet whatever standard I have."; + +require $root."includes/formatindex.php"; +?> diff --git a/General/_index.php b/General/_index.php @@ -1,9 +0,0 @@ -<?php -$root="../"; -$title="Unassorted Blogs"; -$tags="blog"; -$message=$title; -$submessage="Unassorted whatever-doesn't-go-wherever-else."; - -require $root."includes/formatindex.php"; -?> diff --git a/General/example.php b/General/example.php @@ -1,11 +0,0 @@ -<?php include $root."includes/seemore.php"; echo '<a href="'.$seemorepath.'"><h1>Example Article</h1></a>'; # Article Title - Generates article link on listings it appears in - title must be within <h1> tag for Search to correctly identify it, and <h1>s are not used elsewhere - can be automated with 'mkarticle' ?> - -<!-- The rest of the article can be whatever you want, plain HTML or using PHP, see the default.css stylesheet or inspect the live website for formatting ideas. --> -<p>Text text text text</p> - -<h2>More text</h2> - -<p>Text text text text text</p> - -<!-- formats date, can be automated with 'mkarticle' --> -<p class="datetext">2000.01.01</p> diff --git a/Media/Art/_index.php b/Media/Art/_index.php @@ -1,10 +0,0 @@ -<?php -$root="../../"; -$title="Art"; -$tags="blog,media,art"; - -$message=$title; -$submessage="Visual media."; - -require $root."includes/formatindex.php"; -?> diff --git a/Media/Cinema/_index.php b/Media/Cinema/_index.php @@ -1,10 +0,0 @@ -<?php -$root="../../"; -$title="Cinema"; -$tags="blog,media,cinema,anime,television"; - -$message=$title; -$submessage="Films, series, anime, anything else on the screen."; - -require $root."includes/formatindex.php"; -?> diff --git a/Media/Games/_index.php b/Media/Games/_index.php @@ -1,10 +0,0 @@ -<?php -$root="../../"; -$title="Games"; -$tags="blog,media,games"; - -$message=$title; -$submessage="Interactive media."; - -require $root."includes/formatindex.php"; -?> diff --git a/Media/Music/_index.php b/Media/Music/_index.php @@ -1,10 +0,0 @@ -<?php -$root="../../"; -$title="Music"; -$tags="blog,media,music"; - -$message=$title; -$submessage="An influx of listening material."; - -require $root."includes/formatindex.php"; -?> diff --git a/Media/_index.php b/Media/_index.php @@ -1,9 +1,7 @@ <?php $root="../"; $title="Media"; -$tags="blog,media"; -$scanfiles=array("./Art/", "./Cinema/", "./Games/", "./Music"); - +$tags="blog, media, art, games, cinema, anime, manga, music"; $message=$title; $submessage=""; diff --git a/News/_index.php b/News/_index.php @@ -1,9 +1,9 @@ <?php $root="../"; -$title="Website News"; -$tags="blog,website,news"; +$title="News"; +$tags="blog, site news"; $message=$title; -$submessage="Anything new of note I'm doing with the website."; +$submessage=""; require $root."includes/formatindex.php"; ?> diff --git a/News/example.php b/News/example.php @@ -0,0 +1,7 @@ +<?php include $root.'includes/seemore.php'; echo '<a href="'.$seemorepath.'"><h1>Example</h1></a>'; # Article Title ?> + +<h2>Dummy text</h2> + +<p>More dummy text</p> + +<p class="datetext">2021.01.01</p> diff --git a/Other/sitesilike.php b/Other/sitesilike.php @@ -1,14 +0,0 @@ -<?php -$root="../"; -$title="Sites I Like"; -$tags="external"; -require $root."includes/article-start.php"; -?> - - <h1><a href>Example Page</a></h1> - - <ul> - <li class="asidesubitem"><a target="_blank" class="extlink" href="/"> - Example Link - </ul> -<?php require $root."includes/article-end.php"; ?> diff --git a/Privacy/_index.php b/Privacy/_index.php @@ -1,10 +0,0 @@ -<?php -$root="../"; -$title="Privacy"; -$tags="blog,privacy,online privacy"; - -$message=$title; -$submessage="My rants."; - -require $root."includes/formatindex.php"; -?> diff --git a/Projects/_index.php b/Projects/_index.php @@ -1,10 +0,0 @@ -<?php -$root="../"; -$title="Projects"; -$tags="blog,projects,software projects"; - -$message=$title; -$submessage="Anything I'm working on in the long or short-term."; - -require $root."includes/formatindex.php"; -?> diff --git a/README b/README @@ -1,19 +1,3 @@ -WEBSITE -======= +This includes the PHP code providing the functionality of the concealed.world website. It isn't intended seriously as a piece of standalone software, but it can serve as a reference point, or proof that the server-side code does nothing malicious. -This is the code for the concealed.world website. - -If you're interested in what is being used for git.concealed.world, see stagit - <https://git.codemadness.org/stagit/file/README.html>. - -This includes the necessary PHP code to recreate the functionality of the concealed.world website. When dropped into a web server directory capable of running PHP, you should see something similar to the website. Everything but the image files (*.jpg, *.png, *.gif) are free to modify and redistribute as you wish. The image files are freely distributed with the repository to reproduce the "look and feel" of the site, but if you re-use them publicly without making modifications, some form of credit would be appreciated. - -This does not include the articles I have posted on my site, nor the images belonging to articles written. An example article is included to illustrate how the software works. The "Sites I Like" "Other" page has been left as an example. Along with this, I have left home.php, about.php, contact.php, and other.php - the policy with images also applies here, credit if you don't modify. - -I don't really expect people to seriously use this beyond a curiosity or as a reference, so expect messy code, a few broken links on the non-generated example pages, and a few unused components. The site "works" fine for me, so I'm not going to invest a lot of time making it less messy. - -Adding an article -================= - -An example article is included at General/example.php. You can drop an article into one of the directories as a *.php file to have it displayed in that listing - although you'll need to format the heading in the same manner as example.php for the link to appear correctly. - -I'll let the rest of the site's functionality self-document. +The repository only provides the minimum necessary to replicate the functionality, and the "look and feel" of the website. This does not include the content of articles or assets associated with them, unless otherwise stated they are my own. There will be broken links. The code is free to redistribute. Image files are also free to redistribute, but credit would be appreciated. diff --git a/Scripting/_index.php b/Scripting/_index.php @@ -1,10 +0,0 @@ -<?php -$root="../"; -$title="Scripting"; -$tags="blog,software,scripting"; - -$message=$title; -$submessage="I write scripts."; - -require $root."includes/formatindex.php"; -?> diff --git a/Software/_index.php b/Software/_index.php @@ -1,9 +0,0 @@ -<?php -$root="../"; -$title="Software"; -$tags="blog, software, computer programs"; -$message=$title; -$submessage="Code I'm a fan of."; - -require $root."includes/formatindex.php"; -?> diff --git a/Technology/_index.php b/Technology/_index.php @@ -0,0 +1,9 @@ +<?php +$root="../"; +$title="Technology"; +$tags="blog, software, scripting, programming, digital privacy, linux"; +$message=$title; +$submessage=""; + +require $root."includes/formatindex.php"; +?> diff --git a/about.php b/about.php @@ -1,15 +0,0 @@ -<?php -$root=""; -$title="About"; -$tags="about"; -require "includes/default-start.php"; -?> - -<div class="article article-headerless"> -<a href=""><h1>About</h1></a> - -<h3>Example text</h3> - -<p>Example text</p> - -<?php require "includes/default-end.php"; ?> diff --git a/contact.php b/contact.php @@ -1,15 +0,0 @@ -<?php -$root=""; -$title="Contact"; -$tags="contact"; -require "includes/default-start.php"; -?> - -<div class="article article-headerless"> -<a href=""><h1>Contact</h1></a> - -<h3>Example text</h3> - -<p>Example text</p> - -<?php require "includes/default-end.php"; ?> diff --git a/favicon.ico b/favicon.ico Binary files differ. diff --git a/home.php b/home.php @@ -2,7 +2,7 @@ $root=""; $title="Home"; $tags="home"; - $scanfiles=array("./Media/", "./Media/Art/", "./Media/Cinema/", "./Media/Games/", "./Media/Music/", "./News/", "./Privacy/", "./Projects/", "./Scripting/", "./Software/", "./General/"); + $scanfiles=array("./Media/", "./News/", "./Technology/"); require $root."includes/default-start.php"; require $root."includes/seemore.php"; require $root."includes/listing-content.php"; diff --git a/includes/archive.php b/includes/archive.php @@ -13,7 +13,7 @@ function archiveLink () { } function archive ($includearr) { - $searches = explode(" ", trim($_GET['search'])); + $searches = isset($_GET['search']) ? explode(" ", trim($_GET['search'])) : null; echo '<div class="archivespan">'; echo '<table class="centre">'; echo '<colgroup>'; diff --git a/includes/article-start.php b/includes/article-start.php @@ -10,7 +10,6 @@ echo '<body>'; require "".$root."includes/aside.php"; echo '</div>'; echo '<div class="content">'; - echo '<div class="hiddenfloatingtext"><!-- Fnord --><a href="https://qorg11.net/" target="_blank">&lt3</a></div>'; echo '<div class="section upperdirs">'; echo '<span class="homesubmessage"><b>'; $dirs=explode("/", $_SERVER['REQUEST_URI']); @@ -26,11 +25,11 @@ echo '<body>'; if ($dirlink == "Other") { $dirlink = ""; $indexfile = "other.php"; + echo '<a href="'.$newroot.$dirlink.$indexfile.'">'.$dirs[$i].'</a> '; } else { - $indexfile = '/'.$indexfile; + echo '<a href="'.$newroot.$dirlink."/".$indexfile.'">'.$dirs[$i].'</a> '; } - echo '<a href="'.$newroot.$dirlink.$indexfile.'">'.$dirs[$i].'</a> '; $newroot = "/$dirlink/"; $i++; diff --git a/includes/aside.php b/includes/aside.php @@ -4,6 +4,7 @@ if (!$root) { } else { $returnlink = $root; } +$host = explode('.', $_SERVER['HTTP_HOST']); $host = end($host); $indexfile = "_index.php"; $heads = array("head.gif", "head2.gif", "head3.gif", "head4.gif", "head5.gif", "head6.gif", "head7.gif", "head8.gif", "head9.gif"); $usehead = array_rand($heads); @@ -17,38 +18,50 @@ function asideLink ($linkname, $page, $root) { } } -function asideSubLink ($linkname, $root, $indexfile) { - $workingdir = end(explode('/', getcwd())); +function asideSubLink ($linkname, $root, $indexfile, $strike) { + $workingdirarr = explode('/', getcwd()); + $workingdir = end($workingdirarr); if ($workingdir == $linkname && !isset($_GET['post'])) { - echo '<li class="asidesubitem greyed">'.$linkname.'</li>'; + if ($strike == true) { + echo '<li class="asidesubitem greyed"><s>'.$linkname.'</s></li>'; + } else { + echo '<li class="asidesubitem greyed">'.$linkname.'</li>'; + } } else { - echo '<li class="asidesubitem"><a href="'.$root.$linkname.'/'.$indexfile.'">'.$linkname.'</a></li>'; + if ($strike == true) { + echo '<li class="asidesubitem"><s><a href="'.$root.$linkname.'/'.$indexfile.'">'.$linkname.'</a></s></li>'; + } else { + echo '<li class="asidesubitem"><a href="'.$root.$linkname.'/'.$indexfile.'">'.$linkname.'</a></li>'; + } } } echo '<div class="asidehomeimage centre"><a href="'.$root.'home.php"><img src="'.$root.'images/heads/'.$heads[$usehead].'" alt="Home" /></a></div>'; echo '<span class="asidehometext"><a href="'.$root.'home.php">Home</a></span>'; echo '<ul class="blogbox">'; - echo '<li class="coloureditalic centre">Blogs</li>'; - asideSubLink('General', $root, $indexfile); - asideSubLink('Media', $root, $indexfile); - asideSubLink('News', $root, $indexfile); - asideSubLink('Privacy', $root, $indexfile); - asideSubLink('Projects', $root, $indexfile); - asideSubLink('Scripting', $root, $indexfile); - asideSubLink('Software', $root, $indexfile); + echo '<li class="coloureditalic centre">Blogs<span></li>'; + asideSubLink('Media', $root, $indexfile, false); + asideSubLink('Technology', $root, $indexfile, false); + asideSubLink('News', $root, $indexfile, false); + asideSubLink('Archive', $root, $indexfile, true); echo '</ul>'; echo '<ul>'; + asideLink('Other Pages', 'other.php', $root); asideLink('About', 'about.php', $root); asideLink('Contact', 'contact.php', $root); - asideLink('Other', 'other.php', $root); echo '<li class="asideitem"><a href="'.$returnlink.'">Return</a></li>'; echo '</ul>'; echo '<div class="centre">'; echo '<a href="/rss.xml" target="_blank"><img class="asidebottomimage" src="'.$root.'images/rss.gif" alt="RSS" /></a>'; - echo '<a href="https://git.concealed.world" target="_blank"><img class="asidebottomimage" src="'.$root.'images/git.gif" alt="Git Server" /></a>'; - echo '<a href="http://kpzscgdqezpen5zpnc4gky5vx4r56thl5syq2x45j6hbjy5w7tjilwid.onion'.$_SERVER['REQUEST_URI'].'" target="_blank"><img class="asidebottomimage" src="'.$root.'images/tor.gif" alt="Browse Site on Tor" /></a>'; - echo '<a href="https://boards.concealed.world/" target="_blank"><img class="asidebottomimage" src="'.$root.'images/rainchan.gif" alt="Rainchan Imageboard" /></a>'; + if ($host == 'onion') { + echo '<a href="http://opxr3vfzliykjbkqf6uvvmagscsc77iyq5xe6dglnh63yip4b7zkhpqd.onion/" target="_blank"><img class="asidebottomimage" src="'.$root.'images/git.gif" alt="Git Server" /></a>'; + echo '<a href="http://fvmquvda235lwlvdec5nhdwtajlwitfwutsnhsxwcc5wzwzrgcsrc3qd.onion/" target="_blank"><img class="asidebottomimage" src="'.$root.'images/rainchan.gif" alt="Rainchan Imageboard" /></a>'; + echo '<a href="https://concealed.world'.$_SERVER['REQUEST_URI'].'" target="_blank"><img class="asidebottomimage" src="'.$root.'images/clearnet.gif" alt="Browse Site on Clearnet" /></a>'; + } else { + echo '<a href="https://git.concealed.world" target="_blank"><img class="asidebottomimage" src="'.$root.'images/git.gif" alt="Git Server" /></a>'; + echo '<a href="https://boards.concealed.world/" target="_blank"><img class="asidebottomimage" src="'.$root.'images/rainchan.gif" alt="Rainchan Imageboard" /></a>'; + echo '<a href="http://kpzscgdqezpen5zpnc4gky5vx4r56thl5syq2x45j6hbjy5w7tjilwid.onion'.$_SERVER['REQUEST_URI'].'" target="_blank"><img class="asidebottomimage" src="'.$root.'images/tor.gif" alt="Browse Site on Tor" /></a>'; + } echo '<br />Backups - <a href="http://ijpvh2wyevtm4pxcnducuzp5f6nisxpiczutk5v7ol6wi7ar62xk5lad.onion/" target="_blank">(Tor) </a>'; echo '<a href="http://caixzqwpnkxpx2nrf7tdajnctfsdpooq7wjxqmpcpwvjmvqhgmgq.b32.i2p/" target="_blank">(I2P)</a>'; echo '</div>'; diff --git a/includes/bg.php b/includes/bg.php @@ -1,5 +1,5 @@ <?php -if(is_null($root)){ // handling if you're looking at the literal bg.php page - it's not being loaded by another page +if(!isset($root)){ // handling if you're looking at the literal bg.php page - it's not being loaded by another page $root = "../"; } @@ -11,11 +11,10 @@ $name = $images[array_rand($images)]; $fp = fopen($dir . $name, 'rb'); // send the right headers -//header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1 -//header('Pragma: no-cache'); // HTTP 1.0 +header('Cache-Control: public'); // HTTP 1.1 +header('Pragma: cache'); // HTTP 1.0 header('Expires: 0'); // Proxies -header('Content-Type: ' . $fp['type']); -header('Content-Length: ' . $fp['bytes']); +header('Content-Type: image/gif'); // dump the picture and stop the script fpassthru($fp); diff --git a/includes/blogpanel.php b/includes/blogpanel.php @@ -1,13 +1,5 @@ <?php - if ($_GET['post'] != 'archive'){ - echo '<div class="section homesection centre">'; - echo '<a href="'.$indexfile.'">'; - echo '<span class="homemessage">'.$message.'</span>'; - echo '</a>'; - echo '<br />'; - echo '<span class="homesubmessage">'.$submessage.'</span>'; - echo '</div>'; - } else { + if (isset($_GET['post']) && $_GET['post'] == 'archive'){ $file = basename($_SERVER['PHP_SELF']); echo '<div class="section archivereturn centre">'; echo '<a href="'.$indexfile.'">'; @@ -15,5 +7,13 @@ echo '</a>'; echo '</div>'; include $root.'includes/archivesearchbar.php'; + } else { + echo '<div class="section homesection centre">'; + echo '<a href="'.$indexfile.'">'; + echo '<span class="homemessage">'.$message.'</span>'; + echo '</a>'; + echo '<br />'; + echo '<span class="homesubmessage">'.$submessage.'</span>'; + echo '</div>'; } ?> diff --git a/includes/default-start.php b/includes/default-start.php @@ -19,14 +19,14 @@ function getFileList($dir) { if(is_dir("{$dir}{$entry}")) { $retval[] = [ 'name' => "{$dir}{$entry}/", - //'type' => filetype("{$dir}{$entry}"), + 'type' => filetype("{$dir}{$entry}"), //'size' => 0, //'lastmod' => filemtime("{$dir}{$entry}") ]; } elseif(is_readable("{$dir}{$entry}")) { $retval[] = [ 'name' => "{$dir}{$entry}", - //'type' => mime_content_type("{$dir}{$entry}"), + 'type' => mime_content_type("{$dir}{$entry}"), //'size' => filesize("{$dir}{$entry}"), //'lastmod' => filemtime("{$dir}{$entry}") ]; @@ -38,30 +38,32 @@ function getFileList($dir) { } $inc = 0; -if (!isset($scanfiles)) { +if (!isset($scanfiles) && getcwd() != '/usr/share/nginx/html') { $scanfiles = array("./"); } -foreach ($scanfiles as $scan) { - $filearr = getFileList($scan); - foreach ($filearr as $file) { - if (!preg_match("/{$indexfile}/", $file['name']) && preg_match("/.php/", $file['name'])) { - $filedate = file_get_contents('./'.$file['name']); - $filedate = explode('<p class="datetext">', $filedate)[1]; - $filedate = explode('</p>', $filedate)[0]; - if ($filedate == '') { - $filedate = 0; +if (isset($scanfiles)){ + foreach ($scanfiles as $scan) { + $filearr = getFileList($scan); + foreach ($filearr as $file) { + if (!preg_match("/{$indexfile}/", $file['name']) && preg_match("/.php/", $file['name'])) { + $filedate = file_get_contents('./'.$file['name']); + $filedate = explode('<p class="datetext">', $filedate)[1]; + $filedate = explode('</p>', $filedate)[0]; + if ($filedate == '') { + $filedate = 0; + } + $includearr[$inc] = array($file['name'], $filedate); + $inc = $inc + 1; } - $includearr[$inc] = array($file['name'], $filedate); - $inc = $inc + 1; } } + + usort ($includearr, function($a, $b) { + return $b[1] <=> $a[1]; + }); } -usort ($includearr, function($a, $b) { - return $b[1] <=> $a[1]; -}); - require "".$root."includes/start.php"; echo '<body>'; echo '<div class="section openaside">'; @@ -73,13 +75,9 @@ echo '<body>'; require "".$root."includes/aside.php"; echo '</div>'; echo '<div class="content">'; - echo '<div class="hiddenfloatingtext"><!-- Fnord --><a href="https://qorg11.net/" target="_blank">&lt3</a></div>'; if (basename($_SERVER['PHP_SELF']) == "home.php") { require "homepanel.php"; } elseif (basename($_SERVER['PHP_SELF']) == "_index.php") { require "blogpanel.php"; - if ((sizeof($scanfiles) > 1 || $root == "../../") && $_GET['post'] != 'archive') { - require "subdirs.php"; - } } ?> diff --git a/includes/homepanel.php b/includes/homepanel.php @@ -1,27 +1,25 @@ <?php - if ($_GET['post'] != 'archive') { - if (!preg_match('/page/', $_SERVER['QUERY_STRING']) || $_SERVER['QUERY_STRING'] == 'page=1') { - $message = "Nixx's Blog"; - $submessages = array("Welcome to my Magical Realm.", - "Presently not Experiencing an Outage!", - "Banished to /dev/null.", - "The Internet is Serious Business."); - - $motd = array_rand($submessages); - echo '<div class="section homesection centre">'; - echo '<a href="'.$root.'home.php">'; - echo '<img class="homelargeimg" src="'.$root.'images/front.gif" alt="Welcome Image - Large" />'; - echo '<img class="homesmallimg" src="'.$root.'images/frontsmall.gif" alt="Welcome Image - Small" />'; - echo '<span class="homemessage">'.$message.'</span>'; - echo '</a>'; - echo '<br />'; - echo '<span class="homesubmessage">'.$submessages[$motd].'</span>'; - echo '</div>'; - echo '<div class="section centre popular">'; - echo '<p>Jump to <a href="/Other/populararticles.php">Popular Articles</a></p>'; - echo '</div>'; - } - } else { + if (!isset($_GET['post']) && (!isset($_GET['page']) || $_GET['page'] == 1)) { + $message = "Nixx's Blog"; + $submessages = array("Welcome to my Magical Realm.", + "Presently not Experiencing an Outage!", + "Banished to /dev/null.", + "The Internet is Serious Business."); + + $motd = array_rand($submessages); + echo '<div class="section homesection centre">'; + echo '<a href="'.$root.'home.php">'; + echo '<img class="homelargeimg" src="'.$root.'images/front.gif" alt="Welcome Image - Large" />'; + echo '<img class="homesmallimg" src="'.$root.'images/frontsmall.gif" alt="Welcome Image - Small" />'; + echo '<span class="homemessage">'.$message.'</span>'; + echo '</a>'; + echo '<br />'; + echo '<span class="homesubmessage">'.$submessages[$motd].'</span>'; + echo '</div>'; + echo '<div class="section centre popular">'; + echo '<p>Jump to <a href="/Other/populararticles.php">Popular Articles</a></p>'; + echo '</div>'; + } elseif (isset($_GET['post']) && $_GET['post'] == 'archive') { $file = basename($_SERVER['PHP_SELF']); echo '<div class="section archivereturn centre">'; echo '<a href="home.php">'; diff --git a/includes/listing-content.php b/includes/listing-content.php @@ -1,10 +1,7 @@ <?php $stype = 3; $displayarticles = 6; - $page = $_GET['page']; - if (!isset($page)) { - $page = 1; - } + $page = isset($_GET['page']) ? $_GET['page'] : 1; $incstart = $displayarticles * ($page - 1); $incend = ($displayarticles * $page) - 1; @@ -58,7 +55,7 @@ echo 'Looks like there\'s nothing here yet. <br /><span class="notgood">That\'s probably not good.</span>'; echo '<br /><span class="nothingreturn"><a href="../'.$indexfile.'">Return</a></span>'; echo '</div>'; - } elseif ($_GET['post'] == 'archive') { + } elseif (isset($_GET['post']) && $_GET['post'] == 'archive') { archive($includearr); } else { $incbanner = 0; diff --git a/includes/seemore.php b/includes/seemore.php @@ -1,5 +1,6 @@ <?php - if (!$_GET['post']) { + $seemorepath=""; + if (!isset($_GET['post'])) { $length = sizeof(get_included_files()); $prefix = explode("/includes", dirname(__FILE__))[0]; $seemorepath = explode($prefix, get_included_files()[$length - 1])[1]; diff --git a/includes/start.php b/includes/start.php @@ -2,7 +2,7 @@ include $root."includes/start-meta.php"; echo '<link rel="stylesheet" href="'.$root.'styles/default.css" />'; $usragent=$_SERVER['HTTP_USER_AGENT']; - if (!strpos($usragent, 'PaleMoon') !== false && $_COOKIE['scrollbar'] !== "true") { + if (!strpos($usragent, 'PaleMoon') !== false && (!isset($_COOKIE['scrollbar']) || $_COOKIE['scrollbar'] !== "true")) { echo '<link rel="stylesheet" href="'.$root.'styles/noscroll.css" />'; } else { echo '<link rel="stylesheet" href="'.$root.'styles/scroll.css" />'; @@ -10,7 +10,7 @@ echo '<link rel="stylesheet" href="'.$root.'styles/fonts.css" />'; echo '<link rel="stylesheet" href="'.$root.'styles/cursor.css" />'; echo '<meta property="og:url" content="'.(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http")."://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'" />'; - if ($_GET['post']) { + if (isset($_GET['post']) && $_GET['post'] != 'archive') { $ogtype = 'article'; $ogtitle = file_get_contents('./'.$_GET['post']); $ogtitle = explode('<h1>', $ogtitle)[1]; diff --git a/includes/subdirs.php b/includes/subdirs.php @@ -1,31 +0,0 @@ -<?php - echo '<div class="section subdirs centre">'; - echo '<span class="homesubmessage"><b>'; - if ($root == "../") { - foreach ($scanfiles as $link) { - $linkname = explode('/', $link)[1]; - echo '<a href="'.$link.$indexfile.'">'.$linkname.'</a> '; - } - } elseif ($root == "../../") { - $upperdirs = getFileList("../"); - # Subdirs to block - $blockarray = array(); - foreach ($upperdirs as $dir) { - if ($dir['type'] == "dir") { - $dirname = explode("/", $dir['name'])[1]; - $cwd = explode("/", getcwd()); - if ($cwd[sizeof($cwd) - 1] == $dirname) { - echo '<span class="greyed">'.$dirname.'</span> '; - # Blocking - } elseif (in_array($dirname, $blockarray)) { - echo ''; - } else { - echo '<a href="'.$dir['name'].$indexfile.'">'.$dirname.'</a> '; - } - } - } - echo '<br /><a href="../'.$indexfile.'">Return</a>'; - } - echo '</b></span>'; - echo '</div>'; -?> diff --git a/other.php b/other.php @@ -1,16 +0,0 @@ -<?php -$root=""; -$title="Other Pages"; -$tags="extras"; -require "includes/default-start.php"; -?> - -<div class="article article-headerless"> - <h1><a href>Other Pages</a></h1> - <li class="asideitem"><a href="/Other/sitesilike.php"> - Example Link - </a></li> - </ul> -</div> - -<?php require "includes/default-end.php"; ?> diff --git a/rss.xml b/rss.xml @@ -1,18 +0,0 @@ -<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> -<channel> -<title>Concealed World RSS</title> -<description> -Updates from concealed.world. -</description> -<language>en-gb</language> -<link>https://concealed.world/rss.xml</link> -<atom:link href="https://concealed.world/rss.xml" rel="self" type="application/rss+xml"/> -<image> -<title>Updates from concealed.world.</title> -<url>https://concealed.world/images/banner.gif</url> -<link>https://concealed.world/rss.xml</link> -</image> -<!-- begin RSS script --> -<!-- end RSS script --> -</channel> -</rss> diff --git a/styles/default.css b/styles/default.css @@ -279,12 +279,6 @@ input[type="submit" i] { display: none; } -.subdirs { - width: 40%; - margin-bottom: 20px; - bottom: 30px; -} - .upperdirs { width: 80%; height: var(--ver-upr); @@ -519,13 +513,6 @@ input[type="submit" i] { font-weight: bold; } -.hiddenfloatingtext { - position: fixed; - opacity: 0; - right: 10px; - z-index: 2; -} - @keyframes notgood { 0% { letter-spacing: 2px; @@ -560,7 +547,7 @@ input[type="submit" i] { } } -@media (max-height: 720px) { +@media (max-height: 640px) { .aside > .asidehomeimage { display: none; }