Mercurial > hg > batmud > maputils
changeset 1630:90e6a0eda2ae
Implement specialdate.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 02 Apr 2016 00:38:11 +0300 |
parents | 55e29835dcba |
children | 7350ca5704bb |
files | www/common.inc.php www/config.inc.php www/index.php www/loc.php |
diffstat | 4 files changed, 35 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/www/common.inc.php Thu Mar 17 22:04:23 2016 +0200 +++ b/www/common.inc.php Sat Apr 02 00:38:11 2016 +0300 @@ -355,4 +355,25 @@ echo "</div>\n"; } + +function mpSpecialDate($where, $index) +{ + global $specialDate; + $str = ""; + + switch ($specialDate) + { + case "aprilli": + for ($ni = 0; $ni < 4; $ni++) + { + $str .= "<img src=\"img/". + (($ni % 2 == 0 && $where == "index") ? "skull.gif" : "uc.gif"). + "\" alt=\"OMG\" />"; + } + break; + } + + return $str; +} + ?> \ No newline at end of file
--- a/www/config.inc.php Thu Mar 17 22:04:23 2016 +0200 +++ b/www/config.inc.php Sat Apr 02 00:38:11 2016 +0300 @@ -4,8 +4,17 @@ $pageGMapURL = "http://jeskko.pupunen.net/gmap2/"; //$pageGMapURL = "http://tnsp.org/gmap2/"; $batQuestURL = "http://www.bat.org/help/quests?str="; -//$pageCSS = "maps.css"; -$pageCSS = "new.css"; + +$currTime = getdate(); +if ($currTime["mday"] == 1 && $currTime["mon"] == 4) +{ + $pageCSS = "aprilli.css"; + $specialDate = "aprilli"; +} +else + $pageCSS = "maps.css"; + + $pageIndex = "index.php"; //$pageIndex = "maps.php";
--- a/www/index.php Thu Mar 17 22:04:23 2016 +0200 +++ b/www/index.php Sat Apr 02 00:38:11 2016 +0300 @@ -88,6 +88,7 @@ "<div class=\"advert\">". // "<a href=\"https://www.hdd.fi/\"><img src=\"/luk/img/hdd_fi.gif\" alt=\"hdd.fi - Edullista etƤlevytilaa\" /></a>". "<a href=\"http://tnsp.org/u/IqM\"><img src=\"/luk/img/skrolli.png\" alt=\"Skrolli\" /></a>". + mpSpecialDate("index", 1). "</div>\n"; echo
--- a/www/loc.php Thu Mar 17 22:04:23 2016 +0200 +++ b/www/loc.php Sat Apr 02 00:38:11 2016 +0300 @@ -324,7 +324,8 @@ asort($alphaLocs); echo - "<h3><a id=\"ch".$letter."\"></a>".$letter."</h3>\n". + "<h3 class=\"alpha\"><a id=\"ch".$letter."\"></a>".$letter."</h3>\n". + mpSpecialDate("loc", 2). "<table class=\"loc\">\n"; $n = 0;