X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Foutput.php;h=a075fb3f827e72a205142b667544ca7104ea6bce;hp=55122e329c44134109673d98a6cd6562d533d9bc;hb=9d189605d5ccdbd7125f2e8839c63fa2028d44c1;hpb=0b5b9bc1e0f67e7405d2b33da3a37d28e8325d7e diff --git a/include/output.php b/include/output.php index 55122e3..a075fb3 100644 --- a/include/output.php +++ b/include/output.php @@ -1,5 +1,5 @@ +/* Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arun Persaud * * This file is part of e-DoKo. * @@ -26,6 +26,21 @@ if(!isset($HOST)) /* functions which only ouput html */ +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); +} + + function output_ask_for_new_game($playerA,$playerB,$playerC,$playerD,$oldgameid) { global $RULES; @@ -410,13 +425,13 @@ function output_header() - - - - - - - + " /> + " /> + "/> + + + + @@ -438,7 +453,7 @@ function output_footer() echo "\n\n"; echo "