diff --git a/.gitignore b/.gitignore index 9174c38f..49625a12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +/.* +!/.github +!/.vscode /src/ASP/system/config/config.php.bak /src/python/bf2/logs/*.log /src/python/bf2/logs/snapshots/sent/*.txt diff --git a/src/bf2sclone/config.inc.php b/src/bf2sclone/config.inc.php index 4b83b002..9267dda9 100644 --- a/src/bf2sclone/config.inc.php +++ b/src/bf2sclone/config.inc.php @@ -18,8 +18,11 @@ function defineVar($name, $default) { defineVar('DBLOGIN', 'admin'); defineVar('DBPASSWORD', 'admin'); +// Home page. Possible values: 'currentranking', 'leaderboard', 'my-leaderboard', 'search', 'servers', 'ubar' +defineVar('HOME_PAGE', 'leaderboard'); + // Leader board title -defineVar('TITLE', 'BF2S Clone2'); +defineVar('TITLE', 'BF2S Clone'); // Refresh time in seconds for stats defineVar('RANKING_REFRESH_TIME', 600); // -> default: 600 seconds (10 minutes) diff --git a/src/bf2sclone/css/two-tiers.css b/src/bf2sclone/css/two-tiers.css index 1097f077..569aeb78 100644 --- a/src/bf2sclone/css/two-tiers.css +++ b/src/bf2sclone/css/two-tiers.css @@ -309,11 +309,16 @@ float: left; } body.inner #navitems li a { -padding: 0 4px; +margin: 0 2px; +padding: 0 2px; font-weight: bold; font-size: 10px; } +body.inner #navitems li.current a { +border-bottom: 1px dotted #FFEE40; +} + body.inner #getstats { position: absolute; top: 33px; diff --git a/src/bf2sclone/index.php b/src/bf2sclone/index.php index 77818c60..7ffcdda0 100644 --- a/src/bf2sclone/index.php +++ b/src/bf2sclone/index.php @@ -39,7 +39,8 @@ // IFF PID -> go show stats! $PID = isset($_GET["pid"]) ? mysqli_real_escape_string($GLOBALS['link'], $_GET["pid"]) : "0"; $SID = isset($_GET["sid"]) ? mysqli_real_escape_string($GLOBALS['link'], $_GET["sid"]) : "0"; -$GO = isset($_GET["go"]) ? $_GET["go"] : "0"; +$GO = HOME_PAGE; +$GO = isset($_GET["go"]) ? $_GET["go"] : $GO; $GET = isset($_POST["get"]) ? $_POST["get"] : 0; $SET = isset($_POST["set"]) ? $_POST["set"] : 0; $ADD = isset($_GET["add"]) ? $_GET["add"] : 0; @@ -342,7 +343,7 @@ /*************************************************************** * SHOW TOP TEN - default ***************************************************************/ -else +elseif(!$GO || strcasecmp($GO, 'leaderboard') == 0) { // show the top ten $LASTUPDATE = 0; @@ -356,7 +357,7 @@ else { $leaders = getTopPlayers(); - include( TEMPLATE_PATH .'home.php'); + include( TEMPLATE_PATH .'leaderboard.php'); // write cache file if (isCachedEnabled()) { @@ -368,6 +369,8 @@ $template = str_replace('{:LASTUPDATE:}', $LASTUPDATE, $template); $template = str_replace('{:NEXTUPDATE:}', $NEXTUPDATE, $template); +}else { + die('Invalid page.'); } // Closing connection diff --git a/src/bf2sclone/template/current-ranking.php b/src/bf2sclone/template/current-ranking.php index 22e84bbd..a724b5e0 100644 --- a/src/bf2sclone/template/current-ranking.php +++ b/src/bf2sclone/template/current-ranking.php @@ -86,11 +86,11 @@ This page was processed in {:PROCESSED:} seconds. diff --git a/src/bf2sclone/template/home.php b/src/bf2sclone/template/leaderboard.php similarity index 84% rename from src/bf2sclone/template/home.php rename to src/bf2sclone/template/leaderboard.php index a7fd64fd..8b5e9a9e 100644 --- a/src/bf2sclone/template/home.php +++ b/src/bf2sclone/template/leaderboard.php @@ -3,7 +3,7 @@ - ' . esc_attr(TITLE) . ' + Leaderboard, ' . esc_attr(TITLE) . ' @@ -93,11 +93,11 @@ This page was processed in {:PROCESSED:} seconds. diff --git a/src/bf2sclone/template/my-leaderboard.php b/src/bf2sclone/template/my-leaderboard.php index 8965b8cb..304fbede 100644 --- a/src/bf2sclone/template/my-leaderboard.php +++ b/src/bf2sclone/template/my-leaderboard.php @@ -125,11 +125,11 @@ diff --git a/src/bf2sclone/template/playerstats.php b/src/bf2sclone/template/playerstats.php index 75e6909d..2aa3d790 100644 --- a/src/bf2sclone/template/playerstats.php +++ b/src/bf2sclone/template/playerstats.php @@ -1132,11 +1132,11 @@ This page was processed in {:PROCESSED:} seconds. diff --git a/src/bf2sclone/template/search.php b/src/bf2sclone/template/search.php index bfbe17cf..eb271127 100644 --- a/src/bf2sclone/template/search.php +++ b/src/bf2sclone/template/search.php @@ -120,11 +120,11 @@ diff --git a/src/bf2sclone/template/server.php b/src/bf2sclone/template/server.php index 08ad4c16..5437f885 100644 --- a/src/bf2sclone/template/server.php +++ b/src/bf2sclone/template/server.php @@ -243,12 +243,11 @@ This page was processed in {:PROCESSED:} seconds. diff --git a/src/bf2sclone/template/servers.php b/src/bf2sclone/template/servers.php index 0ae76c09..5667438d 100644 --- a/src/bf2sclone/template/servers.php +++ b/src/bf2sclone/template/servers.php @@ -151,11 +151,11 @@ This page was processed in {:PROCESSED:} seconds. diff --git a/src/bf2sclone/template/ubar-badges-sf.php b/src/bf2sclone/template/ubar-badges-sf.php index f9d74145..bac72ffb 100644 --- a/src/bf2sclone/template/ubar-badges-sf.php +++ b/src/bf2sclone/template/ubar-badges-sf.php @@ -455,11 +455,11 @@ diff --git a/src/bf2sclone/template/ubar-badges.php b/src/bf2sclone/template/ubar-badges.php index 38938d8c..84c1577b 100644 --- a/src/bf2sclone/template/ubar-badges.php +++ b/src/bf2sclone/template/ubar-badges.php @@ -886,11 +886,11 @@ diff --git a/src/bf2sclone/template/ubar-index.php b/src/bf2sclone/template/ubar-index.php index 91766492..e9e162d2 100644 --- a/src/bf2sclone/template/ubar-index.php +++ b/src/bf2sclone/template/ubar-index.php @@ -132,11 +132,11 @@ diff --git a/src/bf2sclone/template/ubar-medals-sf.php b/src/bf2sclone/template/ubar-medals-sf.php index 07feaad2..320301bf 100644 --- a/src/bf2sclone/template/ubar-medals-sf.php +++ b/src/bf2sclone/template/ubar-medals-sf.php @@ -153,11 +153,11 @@ diff --git a/src/bf2sclone/template/ubar-medals.php b/src/bf2sclone/template/ubar-medals.php index b098442e..eb8941db 100644 --- a/src/bf2sclone/template/ubar-medals.php +++ b/src/bf2sclone/template/ubar-medals.php @@ -427,11 +427,11 @@ diff --git a/src/bf2sclone/template/ubar-ranks.php b/src/bf2sclone/template/ubar-ranks.php index 7b0c4fdf..1f0422b4 100644 --- a/src/bf2sclone/template/ubar-ranks.php +++ b/src/bf2sclone/template/ubar-ranks.php @@ -461,11 +461,11 @@ diff --git a/src/bf2sclone/template/ubar-ribbons-sf.php b/src/bf2sclone/template/ubar-ribbons-sf.php index fce6f77c..34c727d5 100644 --- a/src/bf2sclone/template/ubar-ribbons-sf.php +++ b/src/bf2sclone/template/ubar-ribbons-sf.php @@ -221,11 +221,11 @@ diff --git a/src/bf2sclone/template/ubar-ribbons.php b/src/bf2sclone/template/ubar-ribbons.php index 13aa6185..e36e08fe 100644 --- a/src/bf2sclone/template/ubar-ribbons.php +++ b/src/bf2sclone/template/ubar-ribbons.php @@ -394,11 +394,11 @@ diff --git a/src/bf2sclone/template/ubar-template.php b/src/bf2sclone/template/ubar-template.php index 63f9cdf5..b5d8a278 100644 --- a/src/bf2sclone/template/ubar-template.php +++ b/src/bf2sclone/template/ubar-template.php @@ -55,11 +55,11 @@