Skip to content

Commit

Permalink
Enhancement (bf2sclone): Add environment variable to show page load s…
Browse files Browse the repository at this point in the history
…peed
  • Loading branch information
leojonathanoh committed Feb 23, 2024
1 parent 3a4bcb0 commit 8e46ce9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ services:
- DBLOGIN=admin
- DBPASSWORD=admin
# - TITLE=BF2S Clone
# - FOOTER_PAGELOADSPEED_ENABLE=false
- RANKING_REFRESH_TIME=0
# - RANKING_HIDE_BOTS=false
# - RANKING_HIDE_COUNTRY=false
Expand Down
3 changes: 3 additions & 0 deletions src/bf2sclone/config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ function defineVar($name, $default) {
// Leader board title
defineVar('TITLE', 'BF2S Clone');

// Whether to show page load speed in the footer
defineVar('FOOTER_PAGELOADSPEED_ENABLE', false);

// Refresh time in seconds for stats
defineVar('RANKING_REFRESH_TIME', 600); // -> default: 600 seconds (10 minutes)

Expand Down
5 changes: 3 additions & 2 deletions src/bf2sclone/template/current-ranking.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@
</div><!-- page 3 -->
</div><!-- page 2 -->
<div id="footer">This page was last updated {:LASTUPDATE:} ago. Next update will be in {:NEXTUPDATE:}<br>
This page was processed in {:PROCESSED:} seconds.</div>
<div id="footer">This page was last updated {:LASTUPDATE:} ago. Next update will be in {:NEXTUPDATE:}<br>' .
(FOOTER_PAGELOADSPEED_ENABLE ? 'This page was processed in {:PROCESSED:} seconds.</div>' : '') . '
<ul id="navitems">
<li class="' . ($GO == 'leaderboard' ? 'current' : '') . '"><a href="'. $ROOT .'?go=leaderboard">Leaderboard</a></li>
Expand Down
4 changes: 2 additions & 2 deletions src/bf2sclone/template/leaderboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
</div></div>
</div> <!-- Page 3 -->
<div id="footer">This page was last updated {:LASTUPDATE:} ago. Next update will be in {:NEXTUPDATE:}<br>
This page was processed in {:PROCESSED:} seconds.</div>
<div id="footer">This page was last updated {:LASTUPDATE:} ago. Next update will be in {:NEXTUPDATE:}<br>' .
(FOOTER_PAGELOADSPEED_ENABLE ? 'This page was processed in {:PROCESSED:} seconds.</div>' : '') . '
<ul id="navitems">
<li class="' . ($GO == 'leaderboard' ? 'current' : '') . '"><a href="'. $ROOT .'?go=leaderboard">Leaderboard</a></li>
Expand Down
4 changes: 2 additions & 2 deletions src/bf2sclone/template/playerstats.php
Original file line number Diff line number Diff line change
Expand Up @@ -1128,8 +1128,8 @@
</div> <!-- content-id --><!-- content -->
</div> <!-- Page 3 -->
<div id="footer">This page was last updated {:LASTUPDATE:} ago. Next update will be in {:NEXTUPDATE:}<br>
This page was processed in {:PROCESSED:} seconds.</div>
<div id="footer">This page was last updated {:LASTUPDATE:} ago. Next update will be in {:NEXTUPDATE:}<br>' .
(FOOTER_PAGELOADSPEED_ENABLE ? 'This page was processed in {:PROCESSED:} seconds.</div>' : '') . '
<ul id="navitems">
<li class="' . ($GO == 'leaderboard' ? 'current' : '') . '"><a href="'. $ROOT .'?go=leaderboard">Leaderboard</a></li>
Expand Down
4 changes: 2 additions & 2 deletions src/bf2sclone/template/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@
</div> <!-- content-id --><!-- content -->
</div> <!-- Page 3 -->
<div id="footer">This page was last updated {:LASTUPDATE:} ago. Next update will be in {:NEXTUPDATE:}<br>
This page was processed in {:PROCESSED:} seconds.</div>
<div id="footer">This page was last updated {:LASTUPDATE:} ago. Next update will be in {:NEXTUPDATE:}<br>' .
(FOOTER_PAGELOADSPEED_ENABLE ? 'This page was processed in {:PROCESSED:} seconds.</div>' : '') . '
<ul id="navitems">
<li class="' . ($GO == 'leaderboard' ? 'current' : '') . '"><a href="'. $ROOT .'?go=leaderboard">Leaderboard</a></li>
Expand Down
4 changes: 2 additions & 2 deletions src/bf2sclone/template/servers.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
</div> <!-- content-id --><!-- content -->
</div> <!-- Page 3 -->
<div id="footer">This page was last updated {:LASTUPDATE:} ago. Next update will be in {:NEXTUPDATE:}<br>
This page was processed in {:PROCESSED:} seconds.</div>
<div id="footer">This page was last updated {:LASTUPDATE:} ago. Next update will be in {:NEXTUPDATE:}<br>' .
(FOOTER_PAGELOADSPEED_ENABLE ? 'This page was processed in {:PROCESSED:} seconds.</div>' : '') . '
<ul id="navitems">
<li class="' . ($GO == 'leaderboard' ? 'current' : '') . '"><a href="'. $ROOT .'?go=leaderboard">Leaderboard</a></li>
Expand Down

0 comments on commit 8e46ce9

Please sign in to comment.