commit 985cbbb45bfa7dc6bd8ef65bfd12f44c39d297a2
parent c4b06ee643908a1d4fbdcae440deb7a050fd1741
Author: Nixx <nixx@firemail.cc>
Date: Thu, 10 Dec 2020 20:27:06 +0000
Cleaning up some bad code while moving to an onion
Diffstat:
4 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/includes/article-start.php b/includes/article-start.php
@@ -12,27 +12,25 @@ echo '<body>';
echo '<div class="content">';
echo '<div class="section upperdirs centre">';
echo '<span class="homesubmessage"><b>';
- $dirs = explode("/usr/share/nginx/html/", getcwd())[1];
- $dirs = explode("/", $dirs);
- echo '<a href="'.$root.'home.php">Home</a>';
+ $dirs=explode("/", $_SERVER['REQUEST_URI']);
+
+ echo '<a href="'.$root.'home.php">Home</a> ';
+
+ $i = 1;
$newroot = $root;
- $i = 0;
- foreach ($dirs as $di) {
- if ($i < sizeof($dirs)) {
- echo ' > ';
- }
- $i++;
- # Start handling for using top bar on Other pages
- $diname = $di;
- $newrootname = $newroot;
- if ($di == "Other") {
- $newrootname = "";
- $di = "";
+ while ($i < sizeof($dirs) - 1){
+ echo '> ';
+ $dirlink = $dirs[$i];
+
+ if ($dirlink == "Other") {
+ $dirlink = "";
$indexfile = "other.php";
}
- echo '<a href="'.$newrootname.$di.'/'.$indexfile.'">'.$diname.'</a> ';
- # End handling
- $newroot = substr($newroot, 0, -3);
+
+ echo '<a href="'.$newroot.$dirlink.'/'.$indexfile.'">'.$dirs[$i].'</a> ';
+ $newroot = "/$dirlink/";
+
+ $i++;
}
echo '</b></span>';
echo '</div>';
diff --git a/includes/aside.php b/includes/aside.php
@@ -18,7 +18,7 @@ function asideLink ($linkname, $page, $root) {
}
function asideSubLink ($linkname, $root, $indexfile) {
- $workingdir = explode('/usr/share/nginx/html/', getcwd())[1];
+ $workingdir = end(explode('/', getcwd()));
if ($workingdir == $linkname && !isset($_GET['post'])) {
echo '<li class="asidesubitem greyed">'.$linkname.'</li>';
} else {
diff --git a/includes/seemore.php b/includes/seemore.php
@@ -1,7 +1,8 @@
<?php
if (!$_GET['post']) {
$length = sizeof(get_included_files());
- $seemorepath = explode('/usr/share/nginx/html', get_included_files()[$length - 1])[1];
+ $prefix = explode("/includes", dirname(__FILE__))[0];
+ $seemorepath = explode($prefix, get_included_files()[$length - 1])[1];
$patharr = explode('/', $seemorepath);
$patharr[sizeof($patharr) - 1] = $indexfile . '?post=' . $patharr[sizeof($patharr) - 1];
$finalpath = implode('/', $patharr);
diff --git a/styles/default.css b/styles/default.css
@@ -552,6 +552,10 @@ input[type="submit" i] {
max-height: calc(var(--ver) - var(--ver-upr) - 108px);
}
+ .article-headerless {
+ max-height: calc(var(--ver) - var(--ver-upr) - 50px) !important;
+ }
+
body {
margin: 3em 8px 8px 8px;
}