Mercurial > hg > batmud > maputils
changeset 1699:0db1832c26c5
Sync.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 17 Sep 2017 16:01:07 +0300 |
parents | 715a37c954da |
children | c545329da759 |
files | www/common.inc.php www/config.inc.php www/index.php |
diffstat | 3 files changed, 27 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/www/common.inc.php Thu Sep 07 01:11:15 2017 +0300 +++ b/www/common.inc.php Sun Sep 17 16:01:07 2017 +0300 @@ -36,7 +36,7 @@ function mpPrintPageHeader($title, $extra = "") { - global $pageMapURL, $pageTitle; + global $pageTitle; cmPrintPageHeader($title, " <meta name=\"keywords\" content=\"batmud,map,laenor,lucentium,rothikgen,desolathya,furnachia,mud,mush,mmorpg,mmo,massively,multiplayer,online,network,game,ggr,pupunen\"/>\n". " <link rel=\"shortcut icon\" href=\"/maps/favicon.ico\" type=\"image/x-icon\" />\n".
--- a/www/config.inc.php Thu Sep 07 01:11:15 2017 +0300 +++ b/www/config.inc.php Sun Sep 17 16:01:07 2017 +0300 @@ -4,8 +4,11 @@ $pageLang = "en"; $wizImageURL = "wiz/"; -$currTime = getdate(); -if ($currTime["mday"] == 1 && $currTime["mon"] == 4) +// +// Check for special dates +// +$ctm = getdate(); +if ($ctm["mday"] == 1 && $ctm["mon"] == 4) //if (1) { $pageCSS = "aprilli.css"; @@ -15,9 +18,15 @@ $pageCSS = "maps.css"; +// +// Current main page +// $pageIndex = "index.php"; //$pageIndex = "maps.php"; +// +// Check for https etc. +// $protocolPrefix = (!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] == "off" || $_SERVER["HTTPS"] == "") ? "http" : "https"; $pageMapURL = $protocolPrefix."://tnsp.org/maps/";
--- a/www/index.php Thu Sep 07 01:11:15 2017 +0300 +++ b/www/index.php Sun Sep 17 16:01:07 2017 +0300 @@ -32,22 +32,28 @@ } +function mpCheckMTime($filename) +{ + global $lastMTime; + + $mtime = -1; + if (file_exists($filename) && ($mtime = filemtime($filename)) > $lastMTime) + $lastMTime = $mtime; +} + + function mpPrintLine($n, $filename, $mapName, $noExtra = FALSE) { global $lastMTime; mpPrintTR($n); - $mtime = -1; - $fname = $filename.".loc"; - if (file_exists($fname) && ($mtime = filemtime($fname)) > $lastMTime) - $lastMTime = $mtime; + mpCheckMTime($filename.".loc"); echo " <td>"; $fname = $filename.".html"; if (file_exists($fname)) { - if (($mtime = filemtime($fname)) > $lastMTime) - $lastMTime = $mtime; + mpCheckMTime($fname); echo mpGetURLLink($fname, $mapName); } else @@ -92,8 +98,8 @@ "<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"; + "</div>\n". + mpSpecialDate("index", 1); echo "<div id=\"intro\">\n". @@ -133,6 +139,7 @@ "</table>\n". "<p>(*) = Maps without JavaScript and with 'embedded' labels. Data last updated: <b>".mpGetMTimeStr($lastMTime)."</b>.</p>\n". "\n". + mpSpecialDate("index", 2). "<h2>Miscellaneous maps</h2>\n". "<table class=\"area\">\n". " <tr>\n".