diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2011-04-22 16:58:41 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2011-04-22 16:58:41 +0200 |
commit | 98b1d8335ff2bdfe97e2a47b0608d4524c1fe287 (patch) | |
tree | eda360022574979c34bf15775e0de3646a12683c | |
parent | 94082a3769dc7a61cde454ec6ea7af9dff718caa (diff) |
[PHP] define errors
-rw-r--r-- | BigLine.php | 9 | ||||
-rw-r--r-- | Config.BigLine.php | 12 |
2 files changed, 11 insertions, 10 deletions
diff --git a/BigLine.php b/BigLine.php index ac8c40f..2f689d5 100644 --- a/BigLine.php +++ b/BigLine.php @@ -107,7 +107,7 @@ else $TracksPerDay = floor($playcount / $days); $TracksPerWeek = floor($playcount / $weeks); $TracksPerMonth = floor($playcount / $months); - define(TRACKS_PER_ALBUM, 13); + define("TRACKS_PER_ALBUM", 13); $AlbumsPerDay = floor($TracksPerDay / TRACKS_PER_ALBUM); $AlbumsPerWeek = floor($TracksPerWeek / TRACKS_PER_ALBUM); $AlbumsPerMonth = floor($TracksPerMonth / TRACKS_PER_ALBUM); @@ -163,7 +163,7 @@ else break; } - define(ANGLE,2); + define("ANGLE",2); $y=0; $username=ucfirst($username); @@ -240,14 +240,15 @@ function GetGMT($time) function SendCacheHeaders($lastmodified, $maxage, $limit="public") { $LastModified = GetGMT($lastmodified); - if ("$_SERVER[HTTP_IF_MODIFIED_SINCE]" == "$LastModified") + if (array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER) && + $_SERVER['HTTP_IF_MODIFIED_SINCE'] == "$LastModified") { header("HTTP/1.1 304 Not Modified"); exit; } /* Give a fresh copy */ - $Expires = GetGMT($_SERVER[REQUEST_TIME] + $maxage); + $Expires = GetGMT($_SERVER['REQUEST_TIME'] + $maxage); header("Cache-Control: max-age=$maxage, $limit"); header("Last-Modified: $LastModified"); header("Expires: $Expires"); diff --git a/Config.BigLine.php b/Config.BigLine.php index 047da12..5d40922 100644 --- a/Config.BigLine.php +++ b/Config.BigLine.php @@ -1,13 +1,13 @@ <? -define(TRUENESS, 4000); -define(CACHE, (3600*48)); -define(WIDTH, 200); -define(HEIGHT, 50); +define("TRUENESS", 4000); +define("CACHE", (3600*48)); +define("WIDTH", 200); +define("HEIGHT", 50); #putenv("GDFONTPATH=/usr/share/fonts/truetype"); putenv("GDFONTPATH=fonts"); -define(CACHE_FOLDER, "cache"); +define("CACHE_FOLDER", "cache"); include("Config.mysql.php"); @@ -74,7 +74,7 @@ $Types = array( ); // DEFAULT VALUES // -if ($user == "") $user="gugusse"; +if (!isset($user) || $user == "") $user="gugusse"; if (!array_key_exists($style, $Styles)) $style="Astonished"; if (!array_key_exists($color, $Colors)) $color="Black"; //if (!array_key_exists($type, $Types)) { $type="UNAVAILABLE" ; $color="Black" ; $username="gugusse" ; } |