From 2330bb06ececee220d854883a2870a3adf17c277 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 19 Oct 2014 03:54:53 +0200 Subject: Version 4.1. Support for photo galleries and advanced caching. --- functions.php | 419 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 406 insertions(+), 13 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index 9f5ff49..31eeb94 100644 --- a/functions.php +++ b/functions.php @@ -24,7 +24,7 @@ function failure($reason, $httpcode, $ajax = true, $heading = NULL){ exit; } - // TODO: Put pretty HTML here, please + // TODO: Put pretty HTML here, please --deprecated? # print full error page if($heading != NULL) @@ -111,8 +111,8 @@ if( isset($_GET["goto"]) && $_GET["goto"] != "" ) { } function print_logout(){ - global $cache; - $cache = false; + global $c; + $c->bypassCache = true; global $user; if ( $user->isLoggedIn() ){ $user->logout(); @@ -348,8 +348,8 @@ function _add_entry(){ function print_404(){ header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); - global $cache; - $cache = false; + global $c; + $c->bypassCache=true; ?>
Wir haben die Seite '' nicht gefunden!
- Geh eins zurück! + Geh eins zurück! bypassCache = true; lredirect("account"); global $user; ?> @@ -619,8 +619,8 @@ function print_recover($option = false){ } function print_download(){ - global $cache; - $cache = false; + global $c; + $c->bypassCache = true; if ( ! isset($_GET["type"]) || $_GET["type"] == "plain" ) $type = "plain"; else @@ -641,12 +641,388 @@ function print_download(){ prepare("SELECT name, description, owner, time FROM " . DBPREFIX . "gallery WHERE id = %d ;", $_GET["gallery"]); + $res = $db->doQuery($sql); + require 'static/modal-new-gallery.html'; + if ( $res->num_rows <= 0 ) { + // Start 404 + $c->bypassCache=true; + +?> +