X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=photo-tags.git;a=blobdiff_plain;f=index.php;h=bb56f89cf31ae1b94a7e57d508c6fd66d04bc8f8;hp=5e93f62d94cfb146d5e46f1ab23009913e44e584;hb=cb822f5550deb1f1a904f9b94ee6bbe569c3e056;hpb=b03d63d5006a71307d4f04b22170bdeddc8d8746 diff --git a/index.php b/index.php index 5e93f62..bb56f89 100644 --- a/index.php +++ b/index.php @@ -19,169 +19,95 @@ if(isset($_REQUEST["tag"])) else $tags = ""; +if(isset($_REQUEST["pic"])) + $pic = intval(htmlentities($_REQUEST["pic"])); +else + $pic = -1; +/* end parse flags */ + +/* autoversioning of js and css files */ +function autoversion($file) +{ + /* changes the file name of e.g. css/style.css to css/style..css/js + * this way the browser can cache the file and will reload it if the file changed + * needs to have .htaccess set up correctly to link back to css/style.css */ + + /* only use it for file that have an absolut path */ + if(!file_exists(dirname($_SERVER['SCRIPT_FILENAME']). '/' . $file)) + return $file; + + $md5 = md5_file(dirname($_SERVER['SCRIPT_FILENAME']). '/' . $file); + return preg_replace('{\\.([^./]+)$}', ".$md5.\$1", $file); +} + +/* The basic layout */ ?> + + + <?php echo htmlspecialchars($title) ?> - - - + +" /> +" /> + -
test
+

- - + +
-
- Tags: + + +

Current tags: + + all +

-
-
+
+ +
+ + +