Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional gametracker support #927

Open
wants to merge 13 commits into
base: php81
Choose a base branch
from
4 changes: 2 additions & 2 deletions web/configs/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.8.0",
"git": "1294",
"version": "1.8.1",
"git": "1305",
"dev": true
}
1 change: 1 addition & 0 deletions web/install/includes/sql/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ INSERT INTO `{prefix}_settings` (`setting`, `value`) VALUES
('config.enablesubmit', '1'),
('config.exportpublic', '0'),
('config.enablepubliccomments', '0'),
('config.enablegametracker', '0'),
('config.enablekickit', '1'),
('config.dateformat', 'Y-m-d H:i:s'),
('config.theme', 'default'),
Expand Down
4 changes: 4 additions & 0 deletions web/pages/admin.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@
$steamloginopt = (isset($_POST['enable_steamlogin']) && $_POST['enable_steamlogin'] == "on" ? 1 : 0);

$publiccomments = (isset($_POST['enable_publiccomments']) && $_POST['enable_publiccomments'] == "on" ? 1 : 0);

$gametracker = (isset($_POST['enable_gametracker']) && $_POST['enable_gametracker'] == "on" ? 1 : 0);

$edit = $GLOBALS['db']->Execute("REPLACE INTO " . DB_PREFIX . "_settings (`value`, `setting`) VALUES
(" . (int) $exportpub . ", 'config.exportpublic'),
Expand All @@ -286,6 +288,7 @@
(" . (int) $friendsban . ", 'config.enablefriendsbanning'),
(" . (int) $adminrehash . ", 'config.enableadminrehashing'),
(" . (int) $publiccomments . ", 'config.enablepubliccomments'),
(" . (int) $gametracker . ", 'config.enablegametracker'),
(" . (int) $steamloginopt . ", 'config.enablesteamlogin')");


Expand Down Expand Up @@ -369,6 +372,7 @@
$('enable_adminrehashing').checked = <?=(int)Config::getBool('config.enableadminrehashing');?>;
$('enable_steamlogin').checked = <?=(int)Config::getBool('config.enablesteamlogin');?>;
$('enable_publiccomments').checked = <?=(int)Config::getBool('config.enablepubliccomments');?>;
$('enable_gametracker').checked = <?=(int)Config::getBool('config.enablegametracker');?>;
$('mail_verify_peer').checked = <?=(int)Config::getBool('smtp.verify_peer');?>;

<?php
Expand Down
15 changes: 15 additions & 0 deletions web/themes/default/page_admin_settings_features.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@

<!-- end public comments -->

<!-- gametracker support -->


<tr>
<td valign="top"><div class="rowdesc">{help_icon title="Enable GameTracker Support" message="Check this box, if you want to enable GameTracker support."}Enable GameTracker Support</div></td>
<td>
<div align="left">
<input type="checkbox" name="enable_gametracker" id="enable_gametracker" />
</div>
<div id="enable_gametracker.msg" class="badentry"></div>
</td>
</tr>

<!-- end gametracker support -->


<tr>
<td colspan="2" align="center">
Expand Down
10 changes: 8 additions & 2 deletions web/themes/default/page_servers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
<br />
<br />
<div align='center'>
<p style="font-size: 13px;">{$server.ip}:{$server.port}</p>
<p style="font-size: 13px;">{$server.ip}:{$server.port}</p>
{if (Config::getBool('config.enablegametracker')) }
<div style='padding-right:13px;'<a href="https://www.gametracker.com/server_info/{$server.ip}:{$server.port}/" target="_blank"><img src="https://cache.gametracker.com/server_info/{$server.ip}:{$server.port}/b_350_20_eaebeb_eaebeb_2a2723_eaebeb.png" border="0" width="350" height="20" alt=""/></a></div>
{/if}
<input type='submit' onclick="document.location = 'steam://connect/{$server.ip}:{$server.port}'" name='button' class='btn game' style='margin:0px;' id='button' value='Join game' />
<input type='button' onclick="ShowBox('Reloading..','<b>Refreshing the Serverdata...</b><br><i>Please Wait!</i>', 'blue', '', false);document.getElementById('dialog-control').setStyle('display', 'none');xajax_RefreshServer({$server.sid});" name='button' class='btn refresh' style='margin:0;' id='button' value='Refresh' />
</div>
Expand All @@ -51,7 +54,10 @@
<div id="noplayer_{$server.sid}" name="noplayer_{$server.sid}" style="display:none;"><br />
<h2 style="color: #333;">No players in the server</h2><br />
<div align='center'>
<p style="font-size: 13px;">{$server.ip}:{$server.port}</p>
<p style="font-size: 13px;">{$server.ip}:{$server.port}</p>
{if (Config::getBool('config.enablegametracker')) }
<div style='padding-right:13px;'><a href="https://www.gametracker.com/server_info/{$server.ip}:{$server.port}/" target="_blank"><img src='https://cache.gametracker.com/server_info/{$server.ip}:{$server.port}/banner_560x95.png'/></a></div>
{/if}
<input type='submit' onclick="document.location = 'steam://connect/{$server.ip}:{$server.port}'" name='button' class='btn game' style='margin:0;' id='button' value='Join game' />
<input type='button' onclick="ShowBox('Reloading..','<b>Refreshing the Serverdata...</b><br><i>Please Wait!</i>', 'blue', '', false);document.getElementById('dialog-control').setStyle('display', 'none');xajax_RefreshServer({$server.sid});" name='button' class='btn refresh' style='margin:0;' id='button' value='Refresh' /><br /><br />
</div>
Expand Down
11 changes: 11 additions & 0 deletions web/updater/data/706.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

$sql = <<<SQL
INSERT INTO `:prefix_settings`
(`setting`, `value`, `id`) VALUES ('config.enablegametracker', '0', NULL);
SQL;

$this->dbs->query($sql);
$this->dbs->execute();

return true;
3 changes: 2 additions & 1 deletion web/updater/store.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"702": "702.php",
"703": "703.php",
"704": "704.php",
"705": "705.php"
"705": "705.php",
"706": "706.php"
}