website

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

commit f4b646fbf083f0d4a8fde465232a3b389c5fb808
parent eb6bbffc3fc4c6702707d784afce7294e10fd58d
Author: Nixx <nixx@firemail.cc>
Date:   Wed,  5 Aug 2020 23:59:08 +0100

Fix dysfunctional search facility, and minor fixes

Diffstat:
MMedia/Anime/_index.php | 4++--
MMedia/Art/_index.php | 4++--
MMedia/Games/_index.php | 4++--
MMedia/Music/_index.php | 4++--
Mincludes/archive.php | 10+++++++---
Mincludes/archivesearchbar.php | 3++-
Mincludes/listing-content.php | 4++--
7 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/Media/Anime/_index.php b/Media/Anime/_index.php @@ -6,7 +6,7 @@ $tags="blog,media,anime"; $message=$title; $submessage="I watch a lot of anime."; -if (isset($_GET['post']) == 1) { +if (isset($_GET['post']) == 1 && $_GET['post'] != 'archive') { require $root."includes/article-start.php"; require $_GET['post']; } else { @@ -17,7 +17,7 @@ if (isset($_GET['post']) == 1) { ?> <?php -if (isset($_GET['post']) == 1) { +if (isset($_GET['post']) == 1 && $_GET['post'] != 'archive') { require $root."includes/article-end.php"; } else { require $root."includes/default-end.php"; diff --git a/Media/Art/_index.php b/Media/Art/_index.php @@ -6,7 +6,7 @@ $tags="blog,media,art"; $message=$title; $submessage="Visual media."; -if (isset($_GET['post']) == 1) { +if (isset($_GET['post']) == 1 && $_GET['post'] != 'archive') { require $root."includes/article-start.php"; require $_GET['post']; } else { @@ -17,7 +17,7 @@ if (isset($_GET['post']) == 1) { ?> <?php -if (isset($_GET['post']) == 1) { +if (isset($_GET['post']) == 1 && $_GET['post'] != 'archive') { require $root."includes/article-end.php"; } else { require $root."includes/default-end.php"; diff --git a/Media/Games/_index.php b/Media/Games/_index.php @@ -6,7 +6,7 @@ $tags="blog,media,games"; $message=$title; $submessage="Interactive media."; -if (isset($_GET['post']) == 1) { +if (isset($_GET['post']) == 1 && $_GET['post'] != 'archive') { require $root."includes/article-start.php"; require $_GET['post']; } else { @@ -17,7 +17,7 @@ if (isset($_GET['post']) == 1) { ?> <?php -if (isset($_GET['post']) == 1) { +if (isset($_GET['post']) == 1 && $_GET['post'] != 'archive') { require $root."includes/article-end.php"; } else { require $root."includes/default-end.php"; diff --git a/Media/Music/_index.php b/Media/Music/_index.php @@ -6,7 +6,7 @@ $tags="blog,media,music"; $message=$title; $submessage="An influx of listening material."; -if (isset($_GET['post']) == 1) { +if (isset($_GET['post']) == 1 && $_GET['post'] != 'archive') { require $root."includes/article-start.php"; require $_GET['post']; } else { @@ -17,7 +17,7 @@ if (isset($_GET['post']) == 1) { ?> <?php -if (isset($_GET['post']) == 1) { +if (isset($_GET['post']) == 1 && $_GET['post'] != 'archive') { require $root."includes/article-end.php"; } else { require $root."includes/default-end.php"; diff --git a/includes/archive.php b/includes/archive.php @@ -15,7 +15,7 @@ function archiveLink () { } function archive ($includearr) { - $searches = explode(" ", $_GET['search']); + $searches = explode(" ", trim($_GET['search'])); echo '<table>'; echo '<colgroup>'; echo '<col class="titlecol">'; @@ -38,12 +38,16 @@ function archive ($includearr) { $title = str_replace("\'","'",$title); # AND logic + $cont = 1; if (isset($_GET['search'])) { foreach ($searches as $search) { - if (!preg_match("/{$search}/i", $title)) { - break 2; + if (preg_match("/{$search}/i", $title)) { + $cont = 0; } } + if ($cont == 1) { + continue; + } } #if (isset($_GET['search']) && !preg_match("/{$_GET['search']}/i", $title)) { # continue; diff --git a/includes/archivesearchbar.php b/includes/archivesearchbar.php @@ -13,7 +13,8 @@ echo '<div class="section search">'; echo 'Search: <input name="search" />'; echo '<input type="submit" value=">" />'; if (isset($_GET['search'])) { - echo '<br /><br />Searching for \''.$_GET['search'].'\'.'; + $searching = str_replace(" ", "', '", trim($_GET['search'])); + echo '<br /><br />Searching for \''.$searching.'\'.'; echo '<br /><a href="'.$file.'?post=archive">Clear Search</a>'; } echo '</form>'; diff --git a/includes/listing-content.php b/includes/listing-content.php @@ -49,9 +49,9 @@ require $root."includes/archive.php"; - if ($root == "../../") { + /*if ($root == "../../") { $indexfile = "home.php"; - } + }*/ if (!isset($includearr)) { echo '<div class="section nothinghere">';