Reupload after bitbucket wipe

This commit is contained in:
Chris Lynch
2013-12-25 18:43:29 -05:00
commit 965453909e
5942 changed files with 99045 additions and 0 deletions

View File

@ -0,0 +1 @@
deny from all

View File

@ -0,0 +1,97 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$edlist = new EditList("id", "hlstats_Actions", "game", false);
$edlist->columns[] = new EditListColumn("game", "Game", 0, true, "hidden", $gamecode);
$edlist->columns[] = new EditListColumn("code", "Action Code", 15, true, "text", "", 64);
$edlist->columns[] = new EditListColumn("for_PlayerActions", "Player Action", 0, false, "checkbox");
$edlist->columns[] = new EditListColumn("for_PlayerPlayerActions", "PlyrPlyr Action", 0, false, "checkbox");
$edlist->columns[] = new EditListColumn("for_TeamActions", "Team Action", 0, false, "checkbox");
$edlist->columns[] = new EditListColumn("for_WorldActions", "World Action", 0, false, "checkbox");
$edlist->columns[] = new EditListColumn("reward_player", "Player Points Reward", 4, false, "text", "0");
$edlist->columns[] = new EditListColumn("reward_team", "Team Points Reward", 4, false, "text", "0");
$edlist->columns[] = new EditListColumn("team", "Team", 0, false, "select", "hlstats_Teams.name/code/game='$gamecode'");
$edlist->columns[] = new EditListColumn("description", "Action Description", 23, true, "text", "", 128);
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
You can make an action map-specific by prepending the map name and an underscore to the Action Code. For example, if the map "<b>rock2</b>" has an action "<b>goalitem</b>" then you can either make the action code just "<b>goalitem</b>" (in which case it will match all maps) or you can make it "<b>rock2_goalitem</b>" to match only on the "rock2" map.<p>
<?php
$result = $db->query("
SELECT
id,
code,
reward_player,
reward_team,
team,
description,
for_PlayerActions,
for_PlayerPlayerActions,
for_TeamActions,
for_WorldActions
FROM
hlstats_Actions
WHERE
game='$gamecode'
ORDER BY
code ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,88 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 100) die ("Access denied!");
$edlist = new EditList("username", "hlstats_Users", "user", false);
$edlist->columns[] = new EditListColumn("username", "Username", 15, true, "text", "", 16);
$edlist->columns[] = new EditListColumn("password", "Password", 15, true, "password", "", 16);
$edlist->columns[] = new EditListColumn("acclevel", "Access Level", 25, true, "select", "0/No Access;80/Restricted;100/Administrator");
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
Usernames and passwords can be set up for access to this HLstats Admin area. For most sites you will only want one admin user - yourself. Some sites may however need to give administration access to several people.<p>
<b>Note</b> Passwords are encrypted in the database and so cannot be viewed. However, you can change a user's password by entering a new plain text value in the Password field.<p>
<b>Access Levels</b><br>
&#149; <i>Restricted</i> users only have access to the Host Groups, Clan Tag Patterns, Weapons, Teams, Awards and Actions configuration areas. This means these users cannot set Options or add new Games, Servers or Admin Users to HLstats, or use any of the admin Tools.<br>
&#149; <i>Administrator</i> users have full, unrestricted access.<p>
<?php
$result = $db->query("
SELECT
username,
IF(password='','','(encrypted)') AS password,
acclevel
FROM
hlstats_Users
ORDER BY
username
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,82 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$edlist = new EditList("awardId", "hlstats_Awards", "award", false);
$edlist->columns[] = new EditListColumn("game", "Game", 0, true, "hidden", $gamecode);
$edlist->columns[] = new EditListColumn("awardType", "Type", 0, true, "hidden", "O");
$edlist->columns[] = new EditListColumn("code", "Action", 0, true, "select", "hlstats_Actions.description/code/game='$gamecode' AND for_PlayerActions='1'");
$edlist->columns[] = new EditListColumn("name", "Award Name", 20, true, "text", "", 128);
$edlist->columns[] = new EditListColumn("verb", "Verb Plural", 20, true, "text", "", 64);
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
$result = $db->query("
SELECT
awardId,
code,
name,
verb
FROM
hlstats_Awards
WHERE
game='$gamecode'
AND awardType='O'
ORDER BY
code ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,81 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata['acclevel'] < 80) die ('Access denied!');
$edlist = new EditList('awardId', 'hlstats_Awards', 'award', false);
$edlist->columns[] = new EditListColumn('game', 'Game', 0, true, 'hidden', $gamecode);
$edlist->columns[] = new EditListColumn('awardType', 'Type', 0, true, 'hidden', 'P');
$edlist->columns[] = new EditListColumn('code', 'Action', 0, true, 'select', "hlstats_Actions.description/code/game='$gamecode' AND for_PlayerPlayerActions='1'");
$edlist->columns[] = new EditListColumn('name', 'Award Name', 20, true, 'text', '', 128);
$edlist->columns[] = new EditListColumn('verb', 'Verb Plural', 20, true, 'text', '', 64);
if ($_POST)
{
if ($edlist->update())
message('success', 'Operation successful.');
else
message('warning', $edlist->error());
}
$result = $db->query("
SELECT
awardId,
code,
name,
verb
FROM
hlstats_Awards
WHERE
game='$gamecode'
AND awardType='P'
ORDER BY
code ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,81 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata['acclevel'] < 80) die ('Access denied!');
$edlist = new EditList('awardId', 'hlstats_Awards', 'award', false);
$edlist->columns[] = new EditListColumn('game', 'Game', 0, true, 'hidden', $gamecode);
$edlist->columns[] = new EditListColumn('awardType', 'Type', 0, true, 'hidden', 'V');
$edlist->columns[] = new EditListColumn('code', 'Action', 0, true, 'select', "hlstats_Actions.description/code/game='$gamecode' AND for_PlayerPlayerActions='1'");
$edlist->columns[] = new EditListColumn('name', 'Award Name', 20, true, 'text', '', 128);
$edlist->columns[] = new EditListColumn('verb', 'Verb Plural', 20, true, 'text', '', 64);
if ($_POST)
{
if ($edlist->update())
message('success', 'Operation successful.');
else
message('warning', $edlist->error());
}
$result = $db->query("
SELECT
awardId,
code,
name,
verb
FROM
hlstats_Awards
WHERE
game='$gamecode'
AND awardType='V'
ORDER BY
code ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,82 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$edlist = new EditList("awardId", "hlstats_Awards", "award", false);
$edlist->columns[] = new EditListColumn("game", "Game", 0, true, "hidden", $gamecode);
$edlist->columns[] = new EditListColumn("awardType", "Type", 0, true, "hidden", "W");
$edlist->columns[] = new EditListColumn("code", "Weapon", 0, true, "select", "hlstats_Weapons.name/code/game='$gamecode';latency/*Latency;mostkills/*Most Kills;bonuspoints/*Bonus Points;suicide/*Suicides;teamkills/*Team Kills;connectiontime/*Connection Time;killstreak/*Kill Streak;deathstreak/*Death Streak;allsentrykills/*All Sentry Kills (TF2)");
$edlist->columns[] = new EditListColumn("name", "Award Name", 20, true, "text", "", 128);
$edlist->columns[] = new EditListColumn("verb", "Verb Plural", 20, true, "text", "", 64);
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
$result = $db->query("
SELECT
awardId,
code,
name,
verb
FROM
hlstats_Awards
WHERE
game='$gamecode'
AND awardType='W'
ORDER BY
code ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,146 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$edlist = new EditList("id", "hlstats_ClanTags", "clan", false);
$edlist->columns[] = new EditListColumn("pattern", "Pattern", 40, true, "text", "", 64);
$edlist->columns[] = new EditListColumn("position", "Match Position", 0, true, "select", "EITHER/EITHER;START/START only;END/END only");
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
Here you can define the patterns used to determine what clan a player is in. These patterns are applied to players' names when they connect or change name.<p>
Special characters in the pattern:<p>
<table border=0 cellspacing=0 cellpadding=4>
<tr class="head">
<td class="fSmall">Character</td>
<td class="fSmall">Description</td>
</tr>
<tr>
<td class="fNormal"><tt>A</tt></td>
<td class="fNormal">Matches one character (i.e. a character is required)</td>
</tr>
<tr>
<td class="fNormal"><tt>X</tt></td>
<td class="fNormal">Matches zero or one characters (i.e. a character is optional)</td>
</tr>
<tr>
<td class="fNormal"><tt>a</tt></td>
<td class="fNormal">Matches literal A or a</td>
</tr>
<tr>
<td class="fNormal"><tt>x</tt></td>
<td class="fNormal">Matches literal X or x</td>
</tr>
</table><p>
Example patterns:<p>
<table border=0 cellspacing=0 cellpadding=4>
<tr class="head">
<td class="fSmall">Pattern</td>
<td class="fSmall">Description</td>
<td class="fSmall">Example</td>
</tr>
<tr>
<td class="fNormal"><tt>[AXXXXX]</tt></td>
<td class="fNormal">Matches 1 to 6 characters inside square braces</td>
<td class="fNormal"><tt>[ZOOM]Player</tt></td>
</tr>
<tr>
<td class="fNormal"><tt>{AAXX}</tt></td>
<td class="fNormal">Matches 2 to 4 characters inside curly braces</td>
<td class="fNormal"><tt>{S3G}Player</tt></td>
</tr>
<tr>
<td class="fNormal"><tt>rex>></tt></td>
<td class="fNormal">Matches the string "rex>>", "REX>>", etc.</td>
<td class="fNormal"><tt>REX>>Tyranno</tt></td>
</tr>
</table><p>
Avoid adding patterns to the database that are too generic. Always ensure you have at least one literal (non-special) character in the pattern -- for example if you were to add the pattern "AXXA", it would match any player with 2 or more letters in their name!<p>
The Match Position field sets which end of the player's name the clan tag is allowed to appear.<p>
<?php
$result = $db->query("
SELECT
id,
pattern,
position
FROM
hlstats_ClanTags
ORDER BY
id
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,204 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
function delete_game($game)
{
global $db;
$srvtables = array(
"hlstats_Events_Admin",
"hlstats_Events_ChangeName",
"hlstats_Events_ChangeRole",
"hlstats_Events_ChangeTeam",
"hlstats_Events_Chat",
"hlstats_Events_Connects",
"hlstats_Events_Disconnects",
"hlstats_Events_Entries",
"hlstats_Events_Frags",
"hlstats_Events_Latency",
"hlstats_Events_PlayerActions",
"hlstats_Events_PlayerPlayerActions",
"hlstats_Events_Rcon",
"hlstats_Events_Statsme",
"hlstats_Events_Statsme2",
"hlstats_Events_StatsmeLatency",
"hlstats_Events_StatsmeTime",
"hlstats_Events_Suicides",
"hlstats_Events_TeamBonuses",
"hlstats_Events_Teamkills",
"hlstats_Servers_Config"
);
$pltables = array(
"hlstats_PlayerNames"
);
$dbtables = array(
"hlstats_Actions",
"hlstats_Awards",
"hlstats_Ribbons",
"hlstats_Roles",
"hlstats_Teams",
"hlstats_Weapons",
"hlstats_Ranks",
"hlstats_Maps_Counts",
"hlstats_Servers",
"hlstats_Players_History",
"hlstats_Players_Awards",
"hlstats_Players_Ribbons",
"hlstats_PlayerUniqueIds",
"hlstats_Players",
"hlstats_Clans",
"hlstats_Trend"
);
$resultServers = $db->query("SELECT serverId FROM hlstats_Servers WHERE game = '$game'");
if ($db->num_rows($resultServers) > 0)
{
$serverlist = "(";
while ($server = $db->fetch_row($resultServers))
{
$serverlist .= $server[0].',';
}
$serverlist = preg_replace('/,$/', ')',$serverlist);
foreach ($srvtables as $srvt)
{
echo "<li>$srvt ... ";
$db->query("DELETE FROM $srvt WHERE serverId IN $serverlist");
echo "OK</li>\n";
}
echo "<li>hlstats_server_load ... ";
$db->query("DELETE FROM hlstats_server_load WHERE server_id IN $serverlist");
echo "OK</li>\n";
}
$resultPlayers = $db->query("SELECT playerId FROM hlstats_Players WHERE game = '$game'");
if ($db->num_rows($resultPlayers) > 0)
{
$playerlist = "(";
while ($player = $db->fetch_row($resultPlayers))
{
$playerlist .= $player[0].',';
}
$playerlist = preg_replace('/,$/', ')',$playerlist);
foreach ($pltables as $plt)
{
echo "<li>$plt ... ";
$db->query("DELETE FROM $plt WHERE playerId IN $playerlist");
echo "OK</li>\n";
}
}
foreach ($dbtables as $dbt)
{
echo "<li>$dbt ... ";
echo removeGameSettings($dbt, $game);
}
echo "<li>hlstats_Games ...";
$db->query("DELETE FROM hlstats_Games WHERE code='$game'");
echo "OK\n";
echo "</ul><p>\n";
echo "Done.<p>";
}
function removeGameSettings($table, $game) {
global $db;
$db->query("SELECT COUNT(game) AS cnt FROM $table WHERE game='$game';");
$r = $db->fetch_array();
if ($r['cnt'] == 0)
{
$ret = "No data existent for selected gametype.";
}
else
{
$ret = $r['cnt']." entries deleted!";
$SQL = "DELETE FROM $table WHERE game='$game';";
$db->query($SQL);
}
return $ret."\n";
}
$edlist = new EditList("code", "hlstats_Games", "game", false, false, "", 'delete_game');
$edlist->columns[] = new EditListColumn("code", "Game Code", 10, true, "readonly", "", 16);
$edlist->columns[] = new EditListColumn("name", "Display Name", 30, true, "text", "", 128);
$edlist->columns[] = new EditListColumn("realgame", "Game", 50, true, "select", "hlstats_Games_Supported.name/code/", 128);
$edlist->columns[] = new EditListColumn("hidden", "<center>Hide Game</center>", 0, false, "checkbox");
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
Enter the codes and full names for all the games you want to collect statistics for. (Game codes should be the same as the mod folder name, e.g. "valve".)<br /><br />
After creating a game, you will be able to configure servers, awards, etc. for that game under Game Settings.<br /><br />
<strong>NOTE</strong>: Be cautious of deleting a game. Deleting a game will remove all related settings, including servers, players, and events for that game (and may take a while). You will have to manually remove any images yourself. IF YOU DELETE THE LAST GAME OF A TYPE, THERE IS NO EASY WAY TO MAKE A NEW GAME OF THAT TYPE. If you want to delete and that is the case, you are probably better off deleting all servers for that game and then just hiding the game.<br /><br />
<?php
$result = $db->query("
SELECT
code,
name,
realgame,
hidden
FROM
hlstats_Games
ORDER BY
code ASC
");
$edlist->draw($result, false);
?>
<table style="width:75%;border:0;" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,84 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 100) die ("Access denied!");
$edlist = new EditList("id", "hlstats_HostGroups", "server", false);
$edlist->columns[] = new EditListColumn("pattern", "Host Pattern", 30, true, "text", "", 128);
$edlist->columns[] = new EditListColumn("name", "Group Name", 30, true, "text", "", 128);
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
Host Groups allow you to group, for example, all players from "...adsl.someisp.net" as "SomeISP ADSL", in the Host Statistics admin tool.<p>
The Host Pattern should look like the <b>end</b> of the hostname. For example a pattern ".adsl.someisp.net" will match "1234.ny.adsl.someisp.net". You can use asterisks "*" in the pattern, e.g. ".ny.*.someisp.net". The asterisk matches zero or more of any character except a dot ".".<p>
The patterns are sorted below in the order they will be applied. A more specific pattern should match before a less specific pattern.<p>
<b>Note</b> Run <b>hlstats-resolve.pl --regroup</b> to apply grouping changes to existing data.<p>
<?php $result = $db->query("
SELECT
id,
pattern,
name,
LENGTH(pattern) AS patternlength
FROM
hlstats_HostGroups
ORDER BY
patternlength DESC,
pattern ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,157 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
if ( count($_POST) > 0 )
{
$db->query("SELECT * FROM `hlstats_Servers` WHERE `address` = '" . $db->escape(clean_data($_POST['server_address'])) . "' AND `port` = '" . $db->escape(clean_data($_POST['server_port'])) . "'");
if ( $row = $db->fetch_array() )
message("warning", "Server [" . $row['name'] . "] already exists");
else
{
$db->query("SELECT `realgame` FROM `hlstats_Games` WHERE `code` = '" . $db->escape($selGame) . "'");
if ( list($game) = $db->fetch_row() )
{
$script_path = (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on")) ? 'https://' : 'http://';
$script_path .= $_SERVER['HTTP_HOST'];
$script_path .= str_replace("\\","/",dirname($_SERVER["PHP_SELF"]));
$db->query(sprintf("INSERT INTO `hlstats_Servers` (`address`, `port`, `name`, `game`, `publicaddress`, `rcon_password`) VALUES ('%s', '%d', '%s', '%s', '%s', '%s')",
$db->escape(clean_data($_POST['server_address'])),
$db->escape(clean_data($_POST['server_port'])),
$db->escape(clean_data($_POST['server_name'])),
$db->escape($selGame),
$db->escape(clean_data($_POST['public_address'])),
$db->escape(mystripslashes($_POST['server_rcon']))
));
$insert_id = $db->insert_id();
$db->query("INSERT INTO `hlstats_Servers_Config` (`serverId`, `parameter`, `value`)
SELECT '" . $insert_id . "', `parameter`, `value`
FROM `hlstats_Mods_Defaults` WHERE `code` = '" . $db->escape(mystripslashes($_POST['game_mod'])) . "';");
$db->query("INSERT INTO `hlstats_Servers_Config` (`serverId`, `parameter`, `value`) VALUES
('" . $insert_id . "', 'Mod', '" . $db->escape(mystripslashes($_POST['game_mod'])) . "');");
$db->query("INSERT INTO `hlstats_Servers_Config` (`serverId`, `parameter`, `value`)
SELECT '" . $insert_id . "', `parameter`, `value`
FROM `hlstats_Games_Defaults` WHERE `code` = '" . $db->escape($game) . "'
ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);");
$db->query("UPDATE hlstats_Servers_Config
SET `value` = '" . $db->escape($script_path) . "'
WHERE serverId = '" . $insert_id . "' AND `parameter` = 'HLStatsURL'");
$_POST = array();
// psychonic - worst. redirect. ever.
// but we can't just use header() since admin.php already started part of the page and hacking it in before would be even messier
echo "<script type=\"text/javascript\"> window.location.href=\"".$g_options['scripturl']."?mode=admin&game=$selGame&task=serversettings&key=$insert_id#startsettings\"; </script>";
exit;
}
}
}
function clean_data($data)
{
return trim(htmlspecialchars(mystripslashes($data)));
}
?>
Enter the address of a server that you want to accept data from.<br /><br />
The "Public Address" should be the address you want shown to users. If left blank, it will be generated from the IP Address and Port. If you are using any kind of log relaying utility (i.e. hlstats.pl will not be receiving data directly from the game servers), you will want to set the IP Address and Port to the address of the log relay program, and set the Public Address to the real address of the game server. You will need a separate log relay for each game server. You can specify a hostname (or anything at all) in the Public Address.<p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top" class="table_border">
<td>
<script type="text/javascript">
function checkMod() {
if (!document.newserverform.server_address.value.match(/^\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b$/)) {
alert('Server address must be a valid IP address');
return false;
}
if (document.newserverform.game_mod.value == 'PLEASESELECT') {
alert('You must make a selection for Admin Mod');
return false;
}
document.newserverform.submit();
}
</script>
<table width="100%" border=0 cellspacing=1 cellpadding=4>
<tr valign="bottom" class="head">
<td class='fSmall'>Server IP Address</td>
<td class='fSmall'><input type="text" name="server_address" maxlength="15" size="15" value="<?php echo clean_data($_POST['server_address']); ?>" /></td>
</tr>
<tr valign="bottom" class="head">
<td class='fSmall'>Server Port</td>
<td class='fSmall'><input type="text" name="server_port" maxlength="5" size="5" value="<?php echo clean_data($_POST['server_port']); ?>" /></td>
</tr>
<tr valign="bottom" class="head">
<td class='fSmall'>Server Name</td>
<td class='fSmall'><input type="text" name="server_name" maxlength="255" size="35" value="<?php echo clean_data($_POST['server_name']); ?>" /></td>
</tr>
<tr valign="bottom" class="head">
<td class='fSmall'>Rcon Password</td>
<td class='fSmall'><input type="text" name="server_rcon" maxlength="128" size="15" value="<?php echo clean_data($_POST['server_rcon']); ?>" /></td>
</tr>
<tr valign="bottom" class="head">
<td class='fSmall'>Public Address</td>
<td class='fSmall'><input type="text" name="public_address" maxlength="128" size="15" value="<?php echo clean_data($_POST['public_address']); ?>" /></td>
</tr>
<tr valign="bottom" class="head">
<td class='fSmall'>Admin Mod</td>
<td class='fSmall'>
<select name="game_mod">
<option value="PLEASESELECT">PLEASE SELECT</option>
<?php
$db->query("SELECT code, name FROM `hlstats_Mods_Supported`");
while ( $row = $db->fetch_array() )
{
echo '<option value="' . $row['code'] . '">' . $row['name'] . '</option>';
}
?>
</select>
</td>
</tr>
</table>
</td>
</tr>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Add Server " class="submit" onclick="checkMod();return false;"></td>
</tr>
</table>

View File

@ -0,0 +1,312 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata['acclevel'] < 80) die ('Access denied!'); ?>
<div style="width:60%;height:50px;border:0;padding:0;margin:auto;background-color:#F00;text-align:center;color:#FFF;font-size:medium;font-weight:bold;vertical-align:middle;">
Options with an asterisk (*) beside them require a restart of the perl daemon to fully take effect.</div>
<br />
<?php
class OptionGroup
{
var $title = '';
var $options = array();
function OptionGroup ($title)
{
$this->title = $title;
}
function draw ()
{
global $g_options;
?>
<p><strong><?php echo $this->title; ?></strong></p>
<table class="data-table" style="width:75%">
<?php
foreach ($this->options as $opt)
{
$opt->draw();
}
?>
</table>
<?php
}
function update ()
{
global $db;
foreach ($this->options as $opt)
{
if (($this->title == 'Fonts') || ($this->title == 'General')) {
$optval = $_POST[$opt->name];
$search_pattern = array('/script/i', '/;/', '/%/');
$replace_pattern = array('', '', '');
$optval = preg_replace($search_pattern, $replace_pattern, $optval);
} else {
$optval = valid_request($_POST[$opt->name], 0);
}
$result = $db->query("
SELECT
value
FROM
hlstats_Options
WHERE
keyname='$opt->name'
");
if ($db->num_rows($result) == 1)
{
$result = $db->query("
UPDATE
hlstats_Options
SET
value='$optval'
WHERE
keyname='$opt->name'
");
}
else
{
$result = $db->query("
INSERT INTO
hlstats_Options
(
keyname,
value
)
VALUES
(
'$opt->name',
'$optval'
)
");
}
}
}
}
class Option
{
var $name;
var $title;
var $type;
function Option ($name, $title, $type)
{
$this->name = $name;
$this->title = $title;
$this->type = $type;
}
function draw ()
{
global $g_options, $optiondata, $db;
?>
<tr class="bg1" style="vertical-align:middle";>
<td class="fNormal" style="width:45%;"><?php
echo $this->title . ":";
?></td>
<td style="width:55%;"><?php
switch ($this->type)
{
case 'textarea':
echo "<textarea name=\"$this->name\" cols=\"35\" rows=\"4\" wrap=\"virtual\">";
echo html_entity_decode($optiondata[$this->name]);
echo '</textarea>';
break;
case 'styles':
echo "<select name=\"$this->name\" style=\"width: 226px\">";
$d = dir('styles');
while (false !== ($e = $d->read())) {
if (is_file("styles/$e") && ($e != '.') && ($e != '..')) {
$ename = ucwords(strtolower(str_replace(array('_','.css'), array(' ',''), $e)));
$sel = '';
if ($e==$g_options['style'])
$sel = 'selected="selected"';
echo "<option value=\"$e\"$sel>$ename</option>";
}
}
$d->close();
echo '</select>';
break;
case 'select':
echo "<select name=\"$this->name\" style=\"width: 226px\">";
$result = $db->query("SELECT `value`,`text` FROM hlstats_Options_Choices WHERE keyname='$this->name' ORDER BY isDefault desc");
while ($rowdata = $db->fetch_array($result)) {
if ($rowdata['value'] == $optiondata[$this->name]) {
echo '<option value="'.$rowdata['value'].'" selected="selected">'.$rowdata['text'];
} else {
echo '<option value="'.$rowdata['value'].'">'.$rowdata['text'];
}
}
echo '</select>';
break;
default:
echo "<input type=\"text\" name=\"$this->name\" size=\"35\" value=\"";
echo html_entity_decode($optiondata[$this->name]);
echo '" class="textbox" maxlength="255" />';
}
?></td>
</tr>
<?php
}
}
$optiongroups = array();
$optiongroups[0] = new OptionGroup('Site Settings');
$optiongroups[0]->options[] = new Option('sitename', 'Site Name', 'text');
$optiongroups[0]->options[] = new Option('siteurl', 'Site URL', 'text');
$optiongroups[0]->options[] = new Option('contact', 'Contact URL', 'text');
$optiongroups[0]->options[] = new Option('bannerdisplay', 'Show Banner', 'select');
$optiongroups[0]->options[] = new Option('bannerfile', 'Banner file name (in hlstatsimg/) or full banner URL', 'text');
$optiongroups[0]->options[] = new Option('playerinfo_tabs', 'Use tabs in playerinfo to show/hide sections current page or just show all at once', 'select');
$optiongroups[0]->options[] = new Option('slider', 'Enable AJAX gliding server list (accordion effect) on homepage of each game (only affects games with more than one server)', 'select');
$optiongroups[0]->options[] = new Option('nav_globalchat', 'Show Chat nav-link', 'select');
$optiongroups[0]->options[] = new Option('nav_cheaters', 'Show Banned Players nav-link', 'select');
$optiongroups[0]->options[] = new Option('sourcebans_address', 'SourceBans URL<br />Enter the relative or full path to your SourceBans web site, if you have one. Ex: http://www.yoursite.com/sourcebans/ or /sourcebans/', 'text');
$optiongroups[0]->options[] = new Option('forum_address', 'Forum URL<br />Enter the relative or full path to your forum/message board, if you have one. Ex: http://www.yoursite.com/forum/ or /forum/', 'text');
$optiongroups[0]->options[] = new Option('show_weapon_target_flash', 'Show hitbox flash animation instead of plain html table for games with accuracy tracking (on supported games)', 'select');
$optiongroups[0]->options[] = new Option('show_server_load_image', 'Show load summaries from all monitored servers', 'select');
$optiongroups[0]->options[] = new Option('showqueries', 'Show "Executed X queries, generated this page in Y Seconds." message in footer?', 'select');
$optiongroups[0]->options[] = new Option('sigbackground', 'Default background for forum signature(Numbers 1-11 or random)<br />Look in sig folder to see background choices', 'text');
$optiongroups[0]->options[] = new Option('modrewrite', 'Use modrewrite to make forum signature image compatible with more forum types. (To utilize this, you <strong>must</strong> have modrewrite enabled on your webserver and add the following text to a .htaccess file in the directory of hlstats.php)<br /><br /><textarea rows="3" cols="72" style="overflow:hidden;">
RewriteEngine On
RewriteRule sig-(.*)-(.*).png$ sig.php?player_id=$1&background=$2 [L]</textarea>', 'select');
$optiongroups[1] = new OptionGroup('GeoIP data & Google Map settings');
$optiongroups[1]->options[] = new Option('countrydata', 'Show features requiring GeoIP data', 'select');
$optiongroups[1]->options[] = new Option('show_google_map', 'Show Google worldmap', 'select');
$optiongroups[1]->options[] = new Option('google_map_region', 'Google Maps Region', 'select');
$optiongroups[1]->options[] = new Option('google_map_type', 'Google Maps Type', 'select');
$optiongroups[1]->options[] = new Option('UseGeoIPBinary', '*Choose whether to use GeoCityLite data loaded into mysql database or from binary file. (If binary, GeoLiteCity.dat goes in perl/GeoLiteCity and Geo::IP::PurePerl module is required', 'select');
$optiongroups[2] = new OptionGroup('Awards settings');
$optiongroups[2]->options[] = new Option('gamehome_show_awards', 'Show daily award winners on Game Frontpage', 'select');
$optiongroups[2]->options[] = new Option('awarddailycols', 'Daily Awards: columns count', 'text');
$optiongroups[2]->options[] = new Option('awardglobalcols', 'Global Awards: columns count', 'text');
$optiongroups[2]->options[] = new Option('awardrankscols', 'Player Ranks: columns count', 'text');
$optiongroups[2]->options[] = new Option('awardribbonscols', 'Ribbons: columns count', 'text');
$optiongroups[3] = new OptionGroup('Hit counter settings');
$optiongroups[3]->options[] = new Option('counter_visit_timeout', 'Visit cookie timeout in minutes', 'text');
$optiongroups[3]->options[] = new Option('counter_visits', 'Current Visits', 'text');
$optiongroups[3]->options[] = new Option('counter_hits', 'Current Page Hits', 'text');
$optiongroups[20] = new OptionGroup('Paths');
$optiongroups[20]->options[] = new Option('map_dlurl', 'Map Download URL<br /><span class="fSmall">(%MAP% = map, %GAME% = gamecode)</span>. Leave blank to suppress download link.', 'text');
$optiongroups[30] = new OptionGroup('Visual style settings');
$optiongroups[30]->options[] = new Option('graphbg_load', 'Server Load graph: background color hex# (RRGGBB)', 'text');
$optiongroups[30]->options[] = new Option('graphtxt_load', 'Server Load graph: text color# (RRGGBB)', 'text');
$optiongroups[30]->options[] = new Option('graphbg_trend', 'Player Trend graph: background color hex# (RRGGBB)', 'text');
$optiongroups[30]->options[] = new Option('graphtxt_trend', 'Player Trend graph: text color hex# (RRGGBB)', 'text');
$optiongroups[30]->options[] = new Option('style', 'Stylesheet filename to use', 'styles');
$optiongroups[30]->options[] = new Option('display_style_selector', 'Display Style Selector?<br />Allow end users to change the style they are using.', 'select');
$optiongroups[30]->options[] = new Option('display_gamelist', 'Enable Gamelist icons<br />Enables or Disables the game icons near the top-right of all pages.', 'select');
$optiongroups[35] = new OptionGroup('Ranking settings');
$optiongroups[35]->options[] = new Option('rankingtype', '*Ranking type', 'select');
$optiongroups[35]->options[] = new Option('MinActivity', '*HLstatsX will automatically hide players which have no event more days than this value. (Default 28 days)', 'text');
$optiongroups[40] = new OptionGroup('Daemon Settings');
$optiongroups[40]->options[] = new Option('Mode', '*Sets the player-tracking mode.<br><ul><LI><b>Steam ID</b> - Recommended for public Internet server use. Players will be tracked by Steam ID.<LI><b>Player Name</b> - Useful for shared-PC environments, such as Internet cafes, etc. Players will be tracked by nickname. <LI><b>IP Address</b> - Useful for LAN servers where players do not have a real Steam ID. Players will be tracked by IP Address. </UL>', 'select');
$optiongroups[40]->options[] = new Option('AllowOnlyConfigServers', '*Allow only servers set up in admin panel to be tracked. Other servers will NOT automatically added and tracked! This is a big security thing', 'select');
$optiongroups[40]->options[] = new Option('DeleteDays', '*HLstatsX will automatically delete history events from the events tables when they are over this many days old. This is important for performance reasons. Set lower if you are logging a large number of game servers or find the load on the MySQL server is too high', 'text');
$optiongroups[40]->options[] = new Option('DNSResolveIP', '*Resolve player IP addresses to hostnames. Requires a working DNS setup (on the box running hlstats.pl)', 'select');
$optiongroups[40]->options[] = new Option('DNSTimeout', '*Time, in seconds, to wait for DNS queries to complete before cancelling DNS resolves. You may need to increase this if on a slow connection or if you find a lot of IPs are not being resolved; however, hlstats.pl cannot be parsing log data while waiting for an IP to resolve', 'text');
$optiongroups[40]->options[] = new Option('MailTo', '*E-mail address to mail database errors to', 'text');
$optiongroups[40]->options[] = new Option('MailPath', '*Path to the mail program -- usually /usr/sbin/sendmail on webhosts', 'text');
$optiongroups[40]->options[] = new Option('Rcon', '*Allow HLstatsX to send Rcon commands to the game servers', 'select');
$optiongroups[40]->options[] = new Option('RconIgnoreSelf', '*Ignore (do not log) Rcon commands originating from the same IP as the server being rcon-ed (useful if you run any kind of monitoring script which polls the server regularly by rcon)', 'select');
$optiongroups[40]->options[] = new Option('RconRecord', '*Record Rcon commands to the Admin event table. This can be useful to see what your admins are doing, but if you run programs like PB it can also fill your database up with a lot of useless junk', 'select');
$optiongroups[40]->options[] = new Option('UseTimestamp', '*If no (default), use the current time on the database server for the timestamp when recording events. If yes, use the timestamp provided on the log data. Unless you are processing old log files on STDIN or your game server is in a different timezone than webhost, you probably want to set this to no', 'select');
$optiongroups[40]->options[] = new Option('TrackStatsTrend', '*Save how many players, kills etc, are in the database each day and give access to graphical statistics', 'select');
$optiongroups[40]->options[] = new Option('GlobalBanning', '*Make player bans available on all participating servers. Players who were banned permanently are automatic hidden from rankings', 'select');
$optiongroups[40]->options[] = new Option('LogChat', '*Log player chat to database', 'select');
$optiongroups[40]->options[] = new Option('LogChatAdmins', '*Log admin chat to database', 'select');
$optiongroups[40]->options[] = new Option('GlobalChat', '*Broadcast chat messages through all particapting servers. To all, none, or admins only', 'select');
$optiongroups[50] = new OptionGroup('Point calculation settings');
$optiongroups[50]->options[] = new Option('SkillMaxChange', '*Maximum number of skill points a player will gain from each frag. Default 25', 'text');
$optiongroups[50]->options[] = new Option('SkillMinChange', '*Minimum number of skill points a player will gain from each frag. Default 2', 'text');
$optiongroups[50]->options[] = new Option('PlayerMinKills', '*Number of kills a player must have before receiving regular points. (Before this threshold is reached, the killer and victim will only gain/lose the minimum point value) Default 50', 'text');
$optiongroups[50]->options[] = new Option('SkillRatioCap', '*Cap killer\'s gained skill with ratio using *XYZ*SaYnt\'s method "designed such that an excellent player will have to get about a 2:1 ratio against noobs to hold steady in points"', 'select');
$optiongroups[60] = new OptionGroup('Proxy Settings');
$optiongroups[60]->options[] = new Option('Proxy_Key', '*Key to use when sending remote commands to Daemon, empty for disable', 'text');
$optiongroups[60]->options[] = new Option('Proxy_Daemons', '*List of daemons to send PROXY events from (used by proxy-daemon.pl), use "," as delimiter, eg &lt;ip&gt;:&lt;port&gt;,&lt;ip&gt;:&lt;port&gt;,... ', 'text');
if (!empty($_POST))
{
foreach ($optiongroups as $og)
{
$og->update();
}
message('success', 'Options updated successfully.');
}
$result = $db->query("SELECT keyname, value FROM hlstats_Options");
while ($rowdata = $db->fetch_row($result))
{
$optiondata[$rowdata[0]] = $rowdata[1];
}
foreach ($optiongroups as $og)
{
$og->draw();
}
?>
<tr style="height:50px;">
<td style="text-align:center;" colspan="2"><input type="submit" value=" Apply " class="submit" /></td>
</tr>
</table>

View File

@ -0,0 +1,89 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$edlist = new EditList("rankId", "hlstats_Ranks", "", false);
$edlist->columns[] = new EditListColumn("game", "Game", 0, true, "hidden", $gamecode);
$edlist->columns[] = new EditListColumn("image", "Image file", 45, true, "text", "", 64);
$edlist->columns[] = new EditListColumn("minKills", "Minimum kills", 15, true, "text", "", 64);
$edlist->columns[] = new EditListColumn("maxKills", "Maximum kills", 15, true, "text", "", 64);
$edlist->columns[] = new EditListColumn("rankName", "Rank Name", 45, true, "text", "", 64);
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
Note: be sure to set the minKills/maxKills values correctly (no gap).<br>
Images have to be given without ".gif" and "_small" extension!<p>
<?php
$result = $db->query("
SELECT
rankId,
game,
image,
minKills,
maxKills,
rankName
FROM
hlstats_Ranks
WHERE
game='$gamecode'
ORDER BY
minKills ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,97 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$edlist = new EditList("ribbonId", "hlstats_Ribbons", "game", false);
$edlist->columns[] = new EditListColumn("game", "Game", 0, true, "hidden", $gamecode);
// $edlist->columns[] = new EditListColumn("ribbonId", "Ribbon", 0, true, "select", "hlstats_Ribbons.ribbonName/ribbonId/game='$gamecode'");
$edlist->columns[] = new EditListColumn("ribbonName", "Ribbon Name", 30, false, "text", "name", 64);
$edlist->columns[] = new EditListColumn("image", "Image file", 30, false, "text", "name.png", 64);
$edlist->columns[] = new EditListColumn("awardCode", "Trigger Award", 0, false, "select", "hlstats_Awards.name/code/game='$gamecode'");
$edlist->columns[] = new EditListColumn("awardCount", "No. awards needed", 10, true, "text", "0", 64);
$edlist->columns[] = new EditListColumn("special", "Special logic", 10, false, "text", "0", 64);
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
Special Logic:<br>
<ul>
<li>0 = standard ribbon (weapon award triggered)
<li>1 = CSS Only: HeadShot ribbon
<li>2 = Connection Time ribbon (no. of awards = connection time in hours to trigger this ribbon, select any award code - it will be ignored)
</ul>
<?php
$result = $db->query("
SELECT
ribbonId,
game,
awardCode,
awardCount,
image,
ribbonName,
special
FROM
hlstats_Ribbons
WHERE
game='$gamecode'
ORDER BY
awardCount,awardCode
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,89 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$edlist = new EditList("ribbonTriggerId", "hlstats_Ribbons_Trigger", "game");
$edlist->columns[] = new EditListColumn("game", "Game", 0, true, "hidden", $gamecode);
$edlist->columns[] = new EditListColumn("ribbonId", "Ribbon", 0, true, "select", "hlstats_Ribbons.ribbonName/ribbonId/game='$gamecode'");
$edlist->columns[] = new EditListColumn("awardCode", "Trigger Award", 0, false, "select", "hlstats_Awards.name/code/game='$gamecode'");
$edlist->columns[] = new EditListColumn("awardCount", "No. awards needed", 15, true, "text", "0", 64);
$edlist->columns[] = new EditListColumn("special", "Special logic", 15, false, "text", "0", 64);
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
Always set special logic = 0 unless you know what you're doing!
<?php
$result = $db->query("
SELECT
ribbonTriggerId,
game,
ribbonId,
awardCode,
awardCount,
special
FROM
hlstats_Ribbons_Trigger
WHERE
game='$gamecode'
ORDER BY
ribbonTriggerId ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,83 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$edlist = new EditList("roleId", "hlstats_Roles", "role", false);
$edlist->columns[] = new EditListColumn("game", "Game", 0, true, "hidden", $gamecode);
$edlist->columns[] = new EditListColumn("code", "Role Code", 20, true, "text", "", 32);
$edlist->columns[] = new EditListColumn("name", "Role Name", 20, true, "text", "", 64);
$edlist->columns[] = new EditListColumn("hidden", "<center>Hide Role</center>", 0, false, "checkbox");
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
You can specify descriptive names for each game's role codes.<p>
<?php $result = $db->query("
SELECT
roleId,
code,
name,
hidden
FROM
hlstats_Roles
WHERE
game='$gamecode'
ORDER BY
code ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,100 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
function delete_server($server)
{
global $db;
$db->query("DELETE FROM `hlstats_Servers_Config` WHERE `serverId` = '" . $db->escape($server) . "';");
$db->query("DELETE FROM `hlstats_server_load` WHERE `server_id` = '" . $db->escape($server) . "'");
}
$edlist = new EditList("serverId", "hlstats_Servers", "server",true,true,"serversettings", 'delete_server');
$edlist->columns[] = new EditListColumn("address", "IP Address", 15, true, "ipaddress", "", 15);
$edlist->columns[] = new EditListColumn("port", "Port", 5, true, "text", "27015", 5);
$edlist->columns[] = new EditListColumn("name", "Server Name", 35, true, "text", "", 255);
$edlist->columns[] = new EditListColumn("rcon_password", "Rcon Password", 10, false, "password", "", 128);
$edlist->columns[] = new EditListColumn("publicaddress", "Public Address", 20, false, "text", "", 128);
$edlist->columns[] = new EditListColumn("game", "Game", 20, true, "select", "hlstats_Games.name/code/realgame='".getRealGame($gamecode)."'");
$edlist->columns[] = new EditListColumn("sortorder", "Sort Order", 2, true, "text", "", 255);
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
<br /><br />
<?php
$result = $db->query("
SELECT
serverId,
address,
port,
name,
sortorder,
publicaddress,
game,
IF(rcon_password='','','(encrypted)') AS rcon_password
FROM
hlstats_Servers
WHERE
game='$gamecode'
ORDER BY
address ASC,
port ASC
");
$edlist->draw($result, false);
?>
<table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,179 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') )
die('Do not access this file directly.');
if ($auth->userdata['acclevel'] < 80)
die ('Access denied!');
function setdefaults($key)
{
global $db;
// get default values
$db->query("DELETE FROM hlstats_Servers_Config WHERE serverId=$key;");
$db->query("INSERT INTO hlstats_Servers_Config (serverId, parameter, value) SELECT $key,parameter,value FROM hlstats_Servers_Config_Default");
// get server ip and port
$db->query("SELECT CONCAT(address, ':', port) AS addr FROM hlstats_Servers WHERE serverId=$key;");
$r = $db->fetch_array();
}
if (isset($_GET['key'])) {
$key = valid_request(intval($_GET['key']),1);
} else {
if (isset($_POST['key'])) {
$key = valid_request(intval($_POST['key']),1);
} else {
$key = 0;
}
}
if ($key==0)
die('Server ID not set!');
if (isset($_POST['sourceId'])) {
$sourceId = valid_request(intval($_POST['sourceId']),1);
} else {
$sourceId = 0;
}
?>
<table id="startsettings" width="60%" align="center" border=0 cellspacing=0 cellpadding=0 class="border">
<tr>
<td>
<table width="100%" border=0 cellspacing=1 cellpadding=10>
<tr bgcolor="#FF0000">
<td class="fNormal" style="color: #FFF; font-weight: bold; font-size: medium;" align="center">
Note: For changes on this page to take effect, you <strong>must</strong> <a href="<?php echo $g_options['scripturl'] . "?mode=admin&amp;task=tools_perlcontrol"; ?>">reload</a> or restart the HLX:CE daemon.
</td>
</tr>
</table></td>
</tr>
</table>
<br>
<?php
// get available help texts
$db->query("SELECT parameter,description FROM hlstats_Servers_Config_Default");
$helptexts = array();
while ($r = $db->fetch_array())
$helptexts[strtolower($r['parameter'])] = $r['description'];
$edlist = new EditList('serverConfigId', 'hlstats_Servers_Config','', false);
$footerscript = $edlist->setHelp('helpdiv','parameter',$helptexts);
$edlist->columns[] = new EditListColumn('serverId', 'Server ID', 0, true, 'hidden', $key);
$edlist->columns[] = new EditListColumn('parameter', 'Server parameter name', 30, true, 'readonly', '', 50);
$edlist->columns[] = new EditListColumn('value', 'Parameter value', 60, false, 'text', '', 128);
if ($_POST)
if ($_POST['setdefaults']=='defaults') {
setdefaults($key);
} else
if ($_POST['sourceId']!='0') {
// copy server settings from another server
$db->query("DELETE FROM hlstats_Servers_Config WHERE serverId=$key");
$db->query("INSERT INTO hlstats_Servers_Config (serverId, parameter, value) SELECT $key,parameter,value FROM hlstats_Servers_Config WHERE serverId=$sourceId");
// get server ip and port
$db->query("SELECT CONCAT(address, ':', port) AS addr FROM hlstats_Servers WHERE serverId=$key;");
$r = $db->fetch_array();
} else {
if ($edlist->update())
message('success', 'Operation successful.');
else
message('warning', $edlist->error());
}
?>
These are the actual server parameters used by the hlstats.pl script.<br>
<?php
$result = $db->query("
SELECT
*
FROM
hlstats_Servers_Config
WHERE
serverId=$key
ORDER BY
parameter ASC
");
if ($db->num_rows($result) == 0) {
setdefaults($key);
$result = $db->query("
SELECT
*
FROM
hlstats_Servers_Config
WHERE
serverId=$key
ORDER BY
parameter ASC
");
}
$edlist->draw($result);
// get all other server id's
$sourceIds = '';
$db->query("SELECT CONCAT(name,' (',address,':',port,')') AS name, serverId FROM hlstats_Servers WHERE serverId<>$key ORDER BY name, address, port");
while ($r = $db->fetch_array())
$sourceIds .= '<OPTION VALUE="'.$r['serverId'].'">'.$r['name'];
?>
<INPUT TYPE="hidden" NAME="key" VALUE="<?php echo $key ?>">
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center">
<INPUT TYPE="checkbox" NAME="setdefaults" VALUE="defaults"> Reset all settings to default!<br>
Set all options like existing server configuration:
<SELECT NAME="sourceId">
<OPTION VALUE="0">Select a server
<?php echo $sourceIds; ?>
</SELECT><br>
<input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,86 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$edlist = new EditList("teamId", "hlstats_Teams", "team", false);
$edlist->columns[] = new EditListColumn("game", "Game", 0, true, "hidden", $gamecode);
$edlist->columns[] = new EditListColumn("code", "Team Code", 20, true, "text", "", 32);
$edlist->columns[] = new EditListColumn("name", "Team Name", 20, true, "text", "", 64);
$edlist->columns[] = new EditListColumn("playerlist_color", "Color Code", 20, false, "text", "", 64);
$edlist->columns[] = new EditListColumn("playerlist_bgcolor", "Bg Color Code", 20, false, "text", "", 64);
$edlist->columns[] = new EditListColumn("hidden", "<center>Hide Team</center>", 0, false, "checkbox");
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
You can specify descriptive names for each game's team codes.<p>
<?php $result = $db->query("
SELECT
teamId,
code,
name,
hidden,
playerlist_color,
playerlist_bgcolor
FROM
hlstats_Teams
WHERE
game='$gamecode'
ORDER BY
code ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,208 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width=9 height=6 class="imageformat"><b>&nbsp;<?php echo $task->title; ?></b> (Last <?php echo $g_options["DeleteDays"]; ?> Days)<p>
<?php
$table = new Table(
array(
new TableColumn(
"eventTime",
"Date",
"width=20"
),
new TableColumn(
"eventType",
"Type",
"width=10&align=center"
),
new TableColumn(
"eventDesc",
"Description",
"width=40&sort=no&append=.&embedlink=yes"
),
new TableColumn(
"serverName",
"Server",
"width=20"
),
new TableColumn(
"map",
"Map",
"width=10"
)
),
"eventTime",
"eventTime",
"eventType",
false,
50,
"page",
"sort",
"sortorder"
);
$db->query("DROP TABLE IF EXISTS hlstats_AdminEventHistory");
$db->query("
CREATE TEMPORARY TABLE hlstats_AdminEventHistory
(
eventType VARCHAR(64) NOT NULL,
eventTime DATETIME NOT NULL,
eventDesc VARCHAR(255) NOT NULL,
serverName VARCHAR(255) NOT NULL,
map VARCHAR(64) NOT NULL
) DEFAULT CHARSET=utf8
");
function insertEvents ($table, $select)
{
global $db;
$select = str_replace("<table>", "hlstats_Events_$table", $select);
$db->query("
INSERT INTO
hlstats_AdminEventHistory
(
eventType,
eventTime,
eventDesc,
serverName,
map
)
$select
");
}
insertEvents("Rcon", "
SELECT
CONCAT(<table>.type, ' Rcon'),
<table>.eventTime,
CONCAT('\"', command, '\"\nFrom: %A%".$g_options['scripturl']."?mode=search&q=', remoteIp, '&st=ip&game=%', remoteIp, '%/A%', IF(password<>'',CONCAT(', password: \"', password, '\"'),'')),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId = <table>.serverId
");
insertEvents("Admin", "
SELECT
<table>.type,
<table>.eventTime,
IF(playerName != '',
CONCAT('\"', playerName, '\": ', message),
message
),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId = <table>.serverId
");
if (isset($_GET['type']) && $_GET['type'] != '')
{
$where = "WHERE eventType='".$db->escape($_GET['type'])."'";
}
else
{
$where = "";
}
$result = $db->query("
SELECT
eventTime,
eventType,
eventDesc,
serverName,
map
FROM
hlstats_AdminEventHistory
$where
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT
$table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(*)
FROM
hlstats_AdminEventHistory
$where
");
list($numitems) = $db->fetch_row($resultCount);
?>
<form method="get" action="<?php echo $g_options["scripturl"]; ?>">
<input type="hidden" name="mode" value="admin" />
<input type="hidden" name="task" value="<?php echo $code; ?>" />
<input type="hidden" name="sort" value="<?php echo $sort; ?>" />
<input type="hidden" name="sortorder" value="<?php echo $sortorder; ?>" />
<b style="padding-left:35px;">&#149;</b> Show only events of type: <?php
$resultTypes = $db->query("
SELECT
DISTINCT eventType
FROM
hlstats_AdminEventHistory
ORDER BY
eventType ASC
");
$types[""] = "(All)";
while (list($k) = $db->fetch_row($resultTypes))
{
$types[$k] = $k;
}
echo getSelect("type", $types, $type);
?> <input type="submit" value="Filter" class="smallsubmit" /><br /><br />
</form>
<?php
$table->draw($result, $numitems, 95, "center");
?>

View File

@ -0,0 +1,130 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width=9 height=6 class="imageformat"><b>&nbsp;<?php echo $task->title; ?></b><p>
<span style="padding-left:35px;">You can enter a player or clan ID number directly, or you can search for a player or clan.</span><p>
<table border="0" width="95%" align="center" border=0 cellspacing=0 cellpadding=0>
<tr valign="top">
<td width="100%" class="fNormal">&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width=9 height=6 class="imageformat"><b>&nbsp;Jump Direct</b><p>
<form method="GET" action="<?php echo $g_options["scripturl"]; ?>">
<input type="hidden" name="mode" value="admin">
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td width="5%">&nbsp;</td>
<td width="95%">
<table width="40%" border=0 cellspacing=0 cellpadding=0 class="border">
<tr valign="top" >
<td>
<table width="100%" border=0 cellspacing=1 cellpadding=4>
<?php print_r($this); ?>
<tr valign="middle" class="bg1">
<td nowrap width="45%" class="fNormal">Type:</td>
<td width="55%">
<?php
echo getSelect("task",
array(
"tools_editdetails_player"=>"Player",
"tools_editdetails_clan"=>"Clan"
)
);
?></td>
</tr>
<tr valign="middle" class="bg1">
<td nowrap width="45%" class="fNormal">ID Number:</td>
<td width="55%"><input type="text" name="id" size=15 maxlength=12 class="textbox"></td>
</tr>
</table></td>
<td align="right">
<table border=0 cellspacing=0 cellpadding=10>
<tr>
<td><input type="submit" value=" Edit &gt;&gt; " class="submit"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</form></td>
</tr>
</table><p>
<?php
require(PAGE_PATH . "/search-class.php");
$sr_query = $_GET["q"];
$search_pattern = array("/script/i", "/;/", "/%/");
$replace_pattern = array("", "", "");
$sr_query = preg_replace($search_pattern, $replace_pattern, $sr_query);
$sr_type = valid_request($_GET["st"], 0) or "player";
$sr_game = valid_request($_GET["game"], 0);
$search = new Search($sr_query, $sr_type, $sr_game);
$search->drawForm(array(
"mode"=>"admin",
"task"=>$selTask
));
if ($sr_query)
{
$search->drawResults(
"mode=admin&task=tools_editdetails_player&id=%k",
"mode=admin&task=tools_editdetails_clan&id=%k"
);
}
?>

View File

@ -0,0 +1,106 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$id=-1;
if ((isset($_GET['id'])) && (is_numeric($_GET['id'])))
$id = valid_request($_GET['id'], 1);
$result = $db->query("SELECT `value` FROM hlstats_Options_Choices WHERE `keyname` = 'google_map_region' ORDER BY `value`");
while ($rowdata = $db->fetch_row($result))
{
$mapselect.=";".$rowdata[0]."/".ucwords(strtolower($rowdata[0]));
}
$mapselect.=";";
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width="9" height="6" class="imageformat" alt="" /><b>&nbsp;<a href="<?php echo $g_options['scripturl']; ?>?mode=admin&amp;task=tools_editdetails">Edit Player or Clan Details</a></b><br />
<img src="<?php echo IMAGE_PATH; ?>/spacer.gif" width="1" height="8" border="0"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width="9" height="6" class="imageformat" alt="" /><b>&nbsp;<?php echo "Edit Clan #$id"; ?></b><br /><br />
<form method="post" action="<?php echo $g_options['scripturl'] . "?mode=admin&amp;task=$selTask&amp;id=$id&" . strip_tags(SID); ?>">
<?php
$proppage = new PropertyPage("hlstats_Clans", "clanId", $id, array(
new PropertyPage_Group("Profile", array(
new PropertyPage_Property("name", "Clan Name", "text"),
new PropertyPage_Property("homepage", "Homepage URL", "text"),
new PropertyPage_Property("mapregion", "Map Region", "select", $mapselect),
new PropertyPage_Property("hidden", "1 = Hide from clan list", "text")
))
));
if (isset($_POST['name']))
{
$proppage->update();
message("success", "Profile updated successfully.");
}
$result = $db->query("
SELECT
*
FROM
hlstats_Clans
WHERE
clanId='$id'
");
if ($db->num_rows() < 1) die("No clan exists with ID #$id");
$data = $db->fetch_array($result);
echo "<span class='fTitle'>";
echo $data['tag'];
echo "</span>";
echo "<span class='fNormal'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
. "<a href=\"" . $g_options['scripturl'] . "?mode=claninfo&amp;clan=$id&amp;" . strip_tags(SID) . "\">"
. "(View Clan Details)</a></span>";
?><br /><br />
<table width="60%" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fNormal"><?php
$proppage->draw($data);
?>
<center><input type="submit" value=" Apply " class="submit"></center></td>
</tr>
</table>
</form>

View File

@ -0,0 +1,166 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') )
{
die('Do not access this file directly.');
}
if ($auth->userdata["acclevel"] < 80)
{
die ("Access denied!");
}
$id=-1;
if ((isset($_GET['id'])) && (is_numeric($_GET['id'])))
{
$id = valid_request($_GET['id'], 1);
}
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width="9" height="6" class="imageformat" alt="" /><b>&nbsp;<a href="<?php echo $g_options['scripturl']; ?>?mode=admin&amp;task=tools_editdetails">Edit Player or Clan Details</a></b><br />
<img src="<?php echo IMAGE_PATH; ?>/spacer.gif" width="1" height="8" border="0" alt=""><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width="9" height="6" class="imageformat" alt="" /><b>&nbsp;<?php echo "Edit Player #$id"; ?></b><br /><br />
<form method="post" action="<?php echo $g_options['scripturl'] . "?mode=admin&amp;task=$selTask&amp;id=$id&amp;" . strip_tags(SID); ?>">
<?php
// get available country flag files
$result = $db->query("SELECT `flag`,`name` FROM hlstats_Countries ORDER BY `name`");
while ($rowdata = $db->fetch_row($result))
{
$flagselect.=";".$rowdata[0]."/".$rowdata[1];
}
$flagselect.=";";
$proppage = new PropertyPage("hlstats_Players", "playerId", $id, array(
new PropertyPage_Group("Profile", array(
new PropertyPage_Property("fullName", "Real Name", "text"),
new PropertyPage_Property("email", "E-mail Address", "text"),
new PropertyPage_Property("homepage", "Homepage URL", "text"),
new PropertyPage_Property("flag", "Country Flag", "select",$flagselect),
new PropertyPage_Property("skill", "Points", "text"),
new PropertyPage_Property("kills", "Kills", "text"),
new PropertyPage_Property("deaths", "Deaths", "text"),
new PropertyPage_Property("headshots", "Headshots", "text"),
new PropertyPage_Property("suicides", "Suicides", "text"),
new PropertyPage_Property("hideranking", "Hide Ranking", "select", "0/No;1/Yes;2/Flag as Banned;3/Inactive (Automatic);"),
new PropertyPage_Property("blockavatar", "Force Default Avatar Image (note that this overrides images in hlstatsimg/avatars)", "select", "0/No;1/Yes;"),
))
));
if (isset($_POST['fullName']))
{
$proppage->update();
message("success", "Profile updated successfully.");
}
$playerId = $db->escape($id);
$result = $db->query("
SELECT
*
FROM
hlstats_Players
WHERE
playerId='$playerId'
");
if ($db->num_rows() < 1) die("No player exists with ID #$id");
$data = $db->fetch_array($result);
echo '<span class="fTitle">';
echo $data['lastName'];
echo '</span>';
echo '<span class="fNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
. '<a href="' . $g_options['scripturl'] . "?mode=playerinfo&amp;player=$id&amp;" . strip_tags(SID) . '">'
. '(View Player Details)</a></span>';
?><br /><br />
<table width="60%" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fNormal"><?php
$proppage->draw($data);
?>
<center><input type="submit" value=" Apply " class="submit" /></center></td>
</tr>
</table>
</form>
<?php
$tblIps = new Table
(
array
(
new TableColumn
(
'ipAddress',
'IP Address',
'width=40'
),
new TableColumn
(
'eventTime',
'Last Used',
'width=60'
)
),
'ipAddress',
'eventTime',
'eventTime'
);
$result = $db->query
("
SELECT
ipAddress,
eventTime
FROM
hlstats_Events_Connects
WHERE
playerId = $playerId
GROUP BY
ipAddress
ORDER BY
eventTime DESC
");
?>
<div class="block">
<?php
printSectionTitle('Player IP Addresses');
$tblIps->draw($result, 50, 50);
?>
</div><br /><br />

View File

@ -0,0 +1,198 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width=9 height=6 class="imageformat"><b>&nbsp;<?php
if (isset($_GET['hostgroup']))
{
$hostgroup = $_GET['hostgroup'];
?><a href="<?php echo $g_options["scripturl"]; ?>?mode=admin&task=<?php echo $selTask; ?>"><?php
}
echo $task->title;
if (isset($_GET['hostgroup']))
{
echo "</a>";
}
?></b> (Last <?php echo $g_options["DeleteDays"]; ?> Days)<?php
if (isset($_GET['hostgroup']))
{
?><br>
<img src="<?php echo IMAGE_PATH; ?>/spacer.gif" width=1 height=8 border=0><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width=9 height=6 class="imageformat"><b>&nbsp;<?php echo $hostgroup; ?></b><p>
<?php
}
else
{
echo "<p>";
}
?>
<?php
if (isset($_GET['hostgroup']))
{
$table = new Table(
array(
new TableColumn(
"host",
"Host",
"width=41"
),
new TableColumn(
"freq",
"Connects",
"width=12&align=right"
),
new TableColumn(
"percent",
"Percentage of Connects",
"width=30&sort=no&type=bargraph"
),
new TableColumn(
"percent",
"%",
"width=12&sort=no&align=right&append=" . urlencode("%")
)
),
"host", // keycol
"freq", // sort
"host", // sort2
true, // showranking
50 // numperpage
);
if ($hostgroup == "(Unresolved IP Addresses)")
$hostgroup = "";
$result = $db->query("
SELECT
COUNT(*),
COUNT(DISTINCT ipAddress)
FROM
hlstats_Events_Connects
WHERE
hostgroup='".mysql_real_escape_string($hostgroup)."'
");
list($totalconnects, $numitems) = $db->fetch_row($result);
$result = $db->query("
SELECT
IF(hostname='', ipAddress, hostname) AS host,
COUNT(hostname) AS freq,
(COUNT(hostname) / $totalconnects) * 100 AS percent
FROM
hlstats_Events_Connects
WHERE
hostgroup='".mysql_real_escape_String($hostgroup)."'
GROUP BY
host
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT
$table->startitem,$table->numperpage
");
$table->draw($result, $numitems, 95, "center");
}
else
{
$table = new Table(
array(
new TableColumn(
"hostgroup",
"Host",
"width=41&icon=server&link=" . urlencode("mode=admin&task=tools_ipstats&hostgroup=%k")
),
new TableColumn(
"freq",
"Connects",
"width=12&align=right"
),
new TableColumn(
"percent",
"Percentage of Connects",
"width=30&sort=no&type=bargraph"
),
new TableColumn(
"percent",
"%",
"width=12&sort=no&align=right&append=" . urlencode("%")
)
),
"hostgroup", // keycol
"freq", // sort
"hostgroup", // sort2
true, // showranking
50 // numperpage
);
$result = $db->query("
SELECT
COUNT(*),
COUNT(DISTINCT hostgroup)
FROM
hlstats_Events_Connects
");
list($totalconnects, $numitems) = $db->fetch_row($result);
$result = $db->query("
SELECT
IF(hostgroup='', '(Unresolved IP Addresses)', hostgroup) AS hostgroup,
COUNT(hostgroup) AS freq,
(COUNT(hostgroup) / $totalconnects) * 100 AS percent
FROM
hlstats_Events_Connects
GROUP BY
hostgroup
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT
$table->startitem,$table->numperpage
");
$table->draw($result, $numitems, 95, "center");
}
?>

View File

@ -0,0 +1,138 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 100) die ("Access denied!");
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width="9" height="6" class="imageformat"><b>&nbsp;<?php echo $task->title; ?></b><p>
<span style="padding-left:35px;">Optimizing tables...</span></td>
</tr>
</table><br /><br />
<?php
flush();
$result = $db->query("SHOW TABLES");
while (list($table) = $db->fetch_row($result))
{
if ($dbtables) $dbtables .= ", ";
$dbtables .= $table;
}
$tableOptimize = new Table(
array(
new TableColumn(
"Table",
"Table",
"width=30&sort=no"
),
new TableColumn(
"Op",
"Operation",
"width=12&sort=no"
),
new TableColumn(
"Msg_type",
"Msg. Type",
"width=12&sort=no"
),
new TableColumn(
"Msg_text",
"Message",
"width=46&sort=no"
)
),
"Table",
"Table",
"Msg_type",
false,
9999
);
$result = $db->query("OPTIMIZE TABLE $dbtables");
$tableOptimize->draw($result, mysql_num_rows($result), 80);
?>
<br /><br />
<table style="width:90%;text-align:center;border:0" cellspacing="0" cellpadding="2">
<tr>
<td class="fNormal">Analyzing tables...</td>
</tr>
</table><br /><br />
<?php
$tableAnalyze = new Table(
array(
new TableColumn(
"Table",
"Table",
"width=30&sort=no"
),
new TableColumn(
"Op",
"Operation",
"width=12&sort=no"
),
new TableColumn(
"Msg_type",
"Msg. Type",
"width=12&sort=no"
),
new TableColumn(
"Msg_text",
"Message",
"width=46&sort=no"
)
),
"Table",
"Table",
"Msg_type",
false,
9999
);
$result = $db->query("ANALYZE TABLE $dbtables");
$tableAnalyze->draw($result, mysql_num_rows($result), 80);
?>

View File

@ -0,0 +1,160 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" ><strong>&nbsp;<?php echo $task->title; ?></strong>
<?php
$commands[0]["name"] = "Reload Configuration";
$commands[0]["cmd"] = "RELOAD";
$commands[1]["name"] = "Shut down the Daemon *";
$commands[1]["cmd"] = "KILL";
if (isset($_POST['confirm']))
{
$host = $_POST['masterserver'];
$port = $_POST["port"];
$command = $commands[$_POST["command"]]["cmd"];
if (!$command) die ('Invalid command!');
if ($port==0) $port = "27500";
// Check if we're contacting a remote host -- if so, need proxy_key configured for this to work (die and throw an error if we're missing it)
if (($host != "127.0.0.1") && ($host != "localhost"))
{
if ($g_options['Proxy_Key'] == "")
{
echo "<p><strong>Warning:</strong> You are connecting to a remote daemon and do not have a Proxy Key configured.</p>";
echo "<p>Please visit the <a href=\"{$g_options['scripturl']}?mode=admin&task=options#options\">HLstatsX:CE Settings page</a> and configure a Proxy Key. Once configured, manually restart your daemon.</p>";
die();
}
}
echo "<div style=\"margin-left: 50px;\"><ul>\n";
echo "<li>Sending Command to HLstatsX: CE Daemon at $host:$port &mdash; ";
$host = gethostbyname($host);
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$packet = "";
if ($g_options['Proxy_Key'])
{
$packet = "PROXY Key={$g_options['Proxy_Key']} PROXY C;".$command.";";
}
else
{
$packet = "C;".$command.";";
}
$bytes_sent = socket_sendto($socket, $packet, strlen($packet), 0, $host, $port);
echo "<strong>".$bytes_sent."</strong> bytes <strong>OK</strong></li>";
echo "<li>Waiting for Backend Answer...";
$recv_bytes = 0;
$buffer = "";
$timeout = 5;
$answer = "";
$packets = 0;
$read = array($socket);
while (socket_select($read, $write = NULL, $except = NULL, $timeout) > 0) {
$recv_bytes += socket_recvfrom($socket, $buffer, 2000, 0, $host, $port);
$answer .= $buffer;
$buffer = "";
$timeout = "1";
$packets++;
}
echo "recieving <strong>$recv_bytes</strong> bytes in <strong>$packets</strong> packets...<strong>OK</strong></li>";
if ($packets>0) {
echo "<li>Backend Answer: ".$answer."</li>";
}
else
{
echo "<li><em>No packets received &mdash; check if backend dead or not listening on $host:$port</em></li>";
}
echo "<li>Closing connection to backend...";
socket_close($socket);
echo "<strong>OK</strong></li>";
echo "</ul></div>\n";
echo "<img src=\"".IMAGE_PATH."/rightarrow.gif\" /> <a href=\"{$g_options['scripturl']}?mode=admin\">Return to Administration Center</a>";
}
else
{
?>
<p>After every configuration change made in the Administration Center, you should reload the daemon configuration. To do so, enter the hostname or IP address of your HLXCE daemon and choose the reload option. You can also shut down your daemon from this panel. <strong>NOTE: The daemon can not be restarted through the web interface!</strong></p>
<form method="POST">
<table class="data-table">
<tr class="bg1">
<td width="40%"><label for="masterserver">Daemon IP or Hostname:</label><p>Hostname or IP address of your HLX:CE Daemon<br />Normally the IP or Hostname listed in the "logaddress_add" line on your game server.<br />example: daemon1.hlxce.com <em>or</em> 1.2.3.4</p></td>
<td><input type="text" name="masterserver" value="localhost"></td>
</tr>
<tr class="bg2">
<td><label for="port">Daemon Port:</label><p>Port number the daemon (or proxy_daemon) is listening on.<br />Normally the port listed in the "logaddress_add" line on your game server configuration.<br />example: 27500</p></td>
<td><input type="text" name="port" value="27500" size="6"></td>
</tr>
<tr class="bg1">
<td><label for="command">Command:</label><p>Select the operation to perform on the daemon<br /><strong>* Note: If you shut the daemond down through this page it can not be restarted through this interface!</strong></p></td>
<td><SELECT NAME="command"><?php
$i = 0;
foreach ($commands as $cmd) {
echo "<OPTION VALUE=\"$i\">".$cmd["name"];
$i++;
}
?>
</SELECT></td>
</table>
<input type="hidden" name="confirm" value="1">
<div style="text-align: center; margin-top: 20px;">
<input type="submit" value=" EXECUTE ">
</div>
</form>
<?php
}
?>

View File

@ -0,0 +1,996 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') )
{
die('Do not access this file directly.');
}
if ($auth->userdata['acclevel'] < 80)
{
die ('Access denied!');
}
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width="9" height="6" class="imageformat" alt="" /><strong>&nbsp;<?php echo $task->title; ?></strong><br /><br />
<?php
if (isset($_POST['confirm']))
{
echo "<ul>\n";
$gamefilter = '';
if (isset($_POST['game']) && $_POST['game'] != '')
{
$gamefilter = " WHERE game='".$db->escape($_POST['game'])."'";
}
$clearAll = isset($_POST['clear_all']);
$clearAllDelete = isset($_POST['clear_all_delete']);
$clearAllEvents = isset($_POST['clear_all_events']);
if (isset($_POST['clear_awards']) || $clearAll || $clearAllDelete)
{
echo "<li>Clearing awards ... ";
$db->query("UPDATE hlstats_Awards SET d_winner_id=NULL, d_winner_count=NULL, g_winner_id=NULL, g_winner_count=NULL $gamefilter");
if ($gamefilter == '')
{
$db->query("TRUNCATE TABLE `hlstats_Players_Awards`");
$db->query("TRUNCATE TABLE `hlstats_Players_Ribbons`");
}
else
{
$db->query("DELETE FROM `hlstats_Players_Awards` $gamefilter");
$db->query("DELETE FROM `hlstats_Players_Ribbons` $gamefilter");
}
echo "OK</li>\n";
}
if (isset($_POST['clear_sessions']) || $clearAll || $clearAllDelete)
{
echo "<li>Removing players' session history ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Players_History`";
}
else
{
$SQL = "DELETE FROM `hlstats_Players_History` $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_names']) || $clearAll || $clearAllDelete)
{
echo "<li>Removing players' names history ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_PlayerNames`";
}
else
{
$SQL = "DELETE FROM `hlstats_PlayerNames` WHERE playerId IN (SELECT playerId FROM hlstats_Players $gamefilter)";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_names_counts']) || $clearAll || $clearAllDelete)
{
echo "<li>Resetting players' names' counts ... ";
$SQL = "UPDATE `hlstats_PlayerNames` SET connection_time=0, numuses=0, kills=0, deaths=0, suicides=0, headshots=0, shots=0, hits=0 WHERE playerId IN (SELECT playerId FROM hlstats_Players $gamefilter)";
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_skill']) || $clearAll || $clearAllDelete)
{
echo "<li>Resetting all Players' Skill ... ";
$SQL = "UPDATE hlstats_Players SET skill=1000 $gamefilter";
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_pcounts']) || $clearAll || $clearAllDelete)
{
echo "<li>Resetting all Players' Counts ... ";
$SQL = "UPDATE hlstats_Players SET connection_time=0, kills=0, deaths=0, suicides=0, shots=0, hits=0, headshots=0, last_skill_change=0, kill_streak=0, death_streak=0 $gamefilter";
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_scounts']) || $clearAll || $clearAllDelete)
{
echo "<li>Resetting Servers' Counts ... ";
$db->query("UPDATE hlstats_Servers SET kills=0, players=0, rounds=0, suicides=0, ".
"headshots=0, bombs_planted=0, bombs_defused=0, ct_wins=0, ts_wins=0, ".
"ct_shots=0, ct_hits=0, ts_shots=0, ts_hits=0, ".
"map_ct_shots=0, map_ct_hits=0, map_ts_shots=0, map_ts_hits=0, ".
"map_rounds=0, map_ct_wins=0, map_ts_wins=0, map_started=0, map_changes=0, ".
"act_map='', act_players=0 $gamefilter");
echo "OK</li>\n";
}
if (isset($_POST['clear_wcounts']) || $clearAll || $clearAllDelete)
{
echo "<li>Resetting Weapons' Counts ... ";
$SQL = "UPDATE hlstats_Weapons SET kills=0, headshots=0 $gamefilter";
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_acounts']) || $clearAll || $clearAllDelete)
{
echo "<li>Resetting Actions' Counts ... ";
$SQL = "UPDATE hlstats_Actions SET `count`=0 $gamefilter";
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_mcounts']) || $clearAll || $clearAllDelete)
{
echo "<li>Resetting Maps' Counts ... ";
$SQL = "UPDATE hlstats_Maps_Counts SET `kills`=0, `headshots`=0 $gamefilter";
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_rcounts']) || $clearAll || $clearAllDelete)
{
echo "<li>Resetting Roles' Counts ... ";
$SQL = "UPDATE hlstats_Roles SET picked=0, kills=0, deaths=0 $gamefilter";
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_admin']) || $clearAll || $clearAllDelete)
{
echo "<li>Deleting Admin Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Admin`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Admin` USING `hlstats_Events_Admin` INNER JOIN hlstats_Servers ON (hlstats_Events_Admin.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_changename']) || $clearAll || $clearAllDelete)
{
echo "<li>Deleting Name Change Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_ChangeName`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_ChangeName` USING `hlstats_Events_ChangeName` INNER JOIN hlstats_Servers ON (hlstats_Events_ChangeName.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_changerole']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Role Change Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_ChangeRole`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_ChangeRole` USING `hlstats_Events_ChangeRole` INNER JOIN hlstats_Servers ON (hlstats_Events_ChangeRole.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_changeteam']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Team Change Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_ChangeTeam`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_ChangeTeam` USING `hlstats_Events_ChangeTeam` INNER JOIN hlstats_Servers ON (hlstats_Events_ChangeTeam.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_chat']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Chat Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Chat`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Chat` USING `hlstats_Events_Chat` INNER JOIN hlstats_Servers ON (hlstats_Events_Chat.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_connects']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Connect Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Connects`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Connects` USING `hlstats_Events_Connects` INNER JOIN hlstats_Servers ON (hlstats_Events_Connects.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_disconnects']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Disconnect Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Disconnects`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Disconnects` USING `hlstats_Events_Disconnects` INNER JOIN hlstats_Servers ON (hlstats_Events_Disconnects.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_entries']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Entry Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Entries`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Entries` USING `hlstats_Events_Entries` INNER JOIN hlstats_Servers ON (hlstats_Events_Entries.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_frags']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Frag Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Frags`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Frags` USING `hlstats_Events_Frags` INNER JOIN hlstats_Servers ON (hlstats_Events_Frags.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_latency']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Latency Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Latency`";
$SQL2 = "TRUNCATE TABLE `hlstats_Events_StatsmeLatency`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Latency` USING `hlstats_Events_Latency` INNER JOIN hlstats_Servers ON (hlstats_Events_Latency.serverId=hlstats_Servers.serverId) $gamefilter";
$SQL2 = "DELETE FROM `hlstats_Events_StatsmeLatency` USING `hlstats_Events_StatsmeLatency` INNER JOIN hlstats_Servers ON (hlstats_Events_StatsmeLatency.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL) && $db->query($SQL2))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_actions']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Action Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_PlayerActions`";
$SQL2 = "TRUNCATE TABLE `hlstats_Events_PlayerPlayerActions`";
$SQL3 = "TRUNCATE TABLE `hlstats_Events_TeamBonuses`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_PlayerActions` USING `hlstats_Events_PlayerActions` INNER JOIN hlstats_Servers ON (hlstats_Events_PlayerActions.serverId=hlstats_Servers.serverId) $gamefilter";
$SQL2 = "DELETE FROM `hlstats_Events_PlayerPlayerActions` USING `hlstats_Events_PlayerPlayerActions` INNER JOIN hlstats_Servers ON (hlstats_Events_PlayerPlayerActions.serverId=hlstats_Servers.serverId) $gamefilter";
$SQL3 = "DELETE FROM `hlstats_Events_TeamBonuses` USING `hlstats_Events_TeamBonuses` INNER JOIN hlstats_Servers ON (hlstats_Events_TeamBonuses.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL) && $db->query($SQL2) && $db->query($SQL3))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_rcon']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Rcon Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Rcon`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Rcon` USING `hlstats_Events_Rcon` INNER JOIN hlstats_Servers ON (hlstats_Events_Rcon.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_statsme']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Weapon Stats Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Statsme`";
$SQL2 = "TRUNCATE TABLE `hlstats_Events_Statsme2`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Statsme` USING `hlstats_Events_Statsme` INNER JOIN hlstats_Servers ON (hlstats_Events_Statsme.serverId=hlstats_Servers.serverId) $gamefilter";
$SQL2 = "DELETE FROM `hlstats_Events_Statsme2` USING `hlstats_Events_Statsme2` INNER JOIN hlstats_Servers ON (hlstats_Events_Statsme2.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL) && $db->query($SQL2))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_statsmetime']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Statsme Time Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_StatsmeTime`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_StatsmeTime` USING `hlstats_Events_StatsmeTime` INNER JOIN hlstats_Servers ON (hlstats_Events_StatsmeTime.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_suicides']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Suicide Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Suicides`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Suicides` USING `hlstats_Events_Suicides` INNER JOIN hlstats_Servers ON (hlstats_Events_Suicides.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if (isset($_POST['clear_events_teamkills']) || $clearAll || $clearAllDelete || $clearAllEvents)
{
echo "<li>Deleting Teamkill Events ... ";
if ($gamefilter == '')
{
$SQL = "TRUNCATE TABLE `hlstats_Events_Teamkills`";
}
else
{
$SQL = "DELETE FROM `hlstats_Events_Teamkills` USING `hlstats_Events_Teamkills` INNER JOIN hlstats_Servers ON (hlstats_Events_Teamkills.serverId=hlstats_Servers.serverId) $gamefilter";
}
if ($db->query($SQL))
{
echo "OK</li>\n";
}
else
{
echo "ERROR</li>\n";
}
}
if ($clearAllDelete)
{
$dbtables = array(
'hlstats_Clans',
'hlstats_PlayerUniqueIds',
'hlstats_Players'
);
foreach ($dbtables as $dbt)
{
echo "<li>Clearing $dbt ... ";
if ($gamefilter == '')
{
$db->query("TRUNCATE TABLE $dbt");
}
else
{
$db->query("DELETE FROM $dbt $gamefilter");
}
echo "OK</li>\n";
}
}
echo "</ul>\n";
echo "Done.<br /><br />";
}
else
{
$result = $db->query("SELECT code, name, hidden FROM `hlstats_Games` ORDER BY hidden, name, code;");
unset($games);
$games[] = '<option value="" selected="selected" />All games';
while (list($code, $name, $hidden) = $db->fetch_row($result))
{
$disabled_flag = "";
if ($hidden == 1) {
$disabled_flag = "* ";
}
$games[] = "<option value=\"$code\" />$disabled_flag$name - $code\n";
}
?>
<script type="text/javascript">
function clear_all_delete_checked()
{
if (document.resetform.clear_all_delete.checked) {
document.resetform.clear_all.disabled = true;
document.resetform.clear_all_events.disabled = true;
document.resetform.clear_awards.disabled = true;
document.resetform.clear_sessions.disabled = true;
document.resetform.clear_names.disabled = true;
document.resetform.clear_names_counts.disabled = true;
document.resetform.clear_skill.disabled = true;
document.resetform.clear_pcounts.disabled = true;
document.resetform.clear_scounts.disabled = true;
document.resetform.clear_wcounts.disabled = true;
document.resetform.clear_acounts.disabled = true;
document.resetform.clear_mcounts.disabled = true;
document.resetform.clear_rcounts.disabled = true;
document.resetform.clear_events_admin.disabled = true;
document.resetform.clear_events_rcon.disabled = true;
document.resetform.clear_events_connects.disabled = true;
document.resetform.clear_events_disconnects.disabled = true;
document.resetform.clear_events_entries.disabled = true;
document.resetform.clear_events_chat.disabled = true;
document.resetform.clear_events_changename.disabled = true;
document.resetform.clear_events_changerole.disabled = true;
document.resetform.clear_events_changeteam.disabled = true;
document.resetform.clear_events_frags.disabled = true;
document.resetform.clear_events_suicides.disabled = true;
document.resetform.clear_events_teamkills.disabled = true;
document.resetform.clear_events_statsme.disabled = true;
document.resetform.clear_events_actions.disabled = true;
document.resetform.clear_events_latency.disabled = true;
document.resetform.clear_events_statsmetime.disabled = true;
document.resetform.clear_all.checked = true;
document.resetform.clear_all_events.checked = true;
document.resetform.clear_awards.checked = true;
document.resetform.clear_sessions.checked = true;
document.resetform.clear_names.checked = true;
document.resetform.clear_names_counts.checked = true;
document.resetform.clear_skill.checked = true;
document.resetform.clear_pcounts.checked = true;
document.resetform.clear_scounts.checked = true;
document.resetform.clear_wcounts.checked = true;
document.resetform.clear_acounts.checked = true;
document.resetform.clear_mcounts.checked = true;
document.resetform.clear_rcounts.checked = true;
document.resetform.clear_events_admin.checked = true;
document.resetform.clear_events_rcon.checked = true;
document.resetform.clear_events_connects.checked = true;
document.resetform.clear_events_disconnects.checked = true;
document.resetform.clear_events_entries.checked = true;
document.resetform.clear_events_chat.checked = true;
document.resetform.clear_events_changename.checked = true;
document.resetform.clear_events_changerole.checked = true;
document.resetform.clear_events_changeteam.checked = true;
document.resetform.clear_events_frags.checked = true;
document.resetform.clear_events_suicides.checked = true;
document.resetform.clear_events_teamkills.checked = true;
document.resetform.clear_events_statsme.checked = true;
document.resetform.clear_events_actions.checked = true;
document.resetform.clear_events_latency.checked = true;
document.resetform.clear_events_statsmetime.checked = true;
}
else
{
document.resetform.clear_all.disabled = false;
document.resetform.clear_all_events.disabled = false;
document.resetform.clear_awards.disabled = false;
document.resetform.clear_sessions.disabled = false;
document.resetform.clear_names.disabled = false;
document.resetform.clear_names_counts.disabled = false;
document.resetform.clear_skill.disabled = false;
document.resetform.clear_pcounts.disabled = false;
document.resetform.clear_scounts.disabled = false;
document.resetform.clear_wcounts.disabled = false;
document.resetform.clear_acounts.disabled = false;
document.resetform.clear_mcounts.disabled = false;
document.resetform.clear_rcounts.disabled = false;
document.resetform.clear_events_admin.disabled = false;
document.resetform.clear_events_rcon.disabled = false;
document.resetform.clear_events_connects.disabled = false;
document.resetform.clear_events_disconnects.disabled = false;
document.resetform.clear_events_entries.disabled = false;
document.resetform.clear_events_chat.disabled = false;
document.resetform.clear_events_changename.disabled = false;
document.resetform.clear_events_changerole.disabled = false;
document.resetform.clear_events_changeteam.disabled = false;
document.resetform.clear_events_frags.disabled = false;
document.resetform.clear_events_suicides.disabled = false;
document.resetform.clear_events_teamkills.disabled = false;
document.resetform.clear_events_statsme.disabled = false;
document.resetform.clear_events_actions.disabled = false;
document.resetform.clear_events_latency.disabled = false;
document.resetform.clear_events_statsmetime.disabled = false;
document.resetform.clear_all.checked = false;
document.resetform.clear_all_events.checked = false;
document.resetform.clear_awards.checked = false;
document.resetform.clear_sessions.checked = false;
document.resetform.clear_names.checked = false;
document.resetform.clear_names_counts.checked = false;
document.resetform.clear_skill.checked = false;
document.resetform.clear_pcounts.checked = false;
document.resetform.clear_scounts.checked = false;
document.resetform.clear_wcounts.checked = false;
document.resetform.clear_acounts.checked = false;
document.resetform.clear_mcounts.checked = false;
document.resetform.clear_rcounts.checked = false;
document.resetform.clear_events_admin.checked = false;
document.resetform.clear_events_rcon.checked = false;
document.resetform.clear_events_connects.checked = false;
document.resetform.clear_events_disconnects.checked = false;
document.resetform.clear_events_entries.checked = false;
document.resetform.clear_events_chat.checked = false;
document.resetform.clear_events_changename.checked = false;
document.resetform.clear_events_changerole.checked = false;
document.resetform.clear_events_changeteam.checked = false;
document.resetform.clear_events_frags.checked = false;
document.resetform.clear_events_suicides.checked = false;
document.resetform.clear_events_teamkills.checked = false;
document.resetform.clear_events_statsme.checked = false;
document.resetform.clear_events_actions.checked = false;
document.resetform.clear_events_latency.checked = false;
document.resetform.clear_events_statsmetime.checked = false;
}
}
function clear_all_checked()
{
if (document.resetform.clear_all.checked) {
document.resetform.clear_all_events.disabled = true;
document.resetform.clear_awards.disabled = true;
document.resetform.clear_sessions.disabled = true;
document.resetform.clear_names.disabled = true;
document.resetform.clear_names_counts.disabled = true;
document.resetform.clear_skill.disabled = true;
document.resetform.clear_pcounts.disabled = true;
document.resetform.clear_scounts.disabled = true;
document.resetform.clear_wcounts.disabled = true;
document.resetform.clear_acounts.disabled = true;
document.resetform.clear_mcounts.disabled = true;
document.resetform.clear_rcounts.disabled = true;
document.resetform.clear_events_admin.disabled = true;
document.resetform.clear_events_rcon.disabled = true;
document.resetform.clear_events_connects.disabled = true;
document.resetform.clear_events_disconnects.disabled = true;
document.resetform.clear_events_entries.disabled = true;
document.resetform.clear_events_chat.disabled = true;
document.resetform.clear_events_changename.disabled = true;
document.resetform.clear_events_changerole.disabled = true;
document.resetform.clear_events_changeteam.disabled = true;
document.resetform.clear_events_frags.disabled = true;
document.resetform.clear_events_suicides.disabled = true;
document.resetform.clear_events_teamkills.disabled = true;
document.resetform.clear_events_statsme.disabled = true;
document.resetform.clear_events_actions.disabled = true;
document.resetform.clear_events_latency.disabled = true;
document.resetform.clear_events_statsmetime.disabled = true;
document.resetform.clear_all_events.checked = true;
document.resetform.clear_awards.checked = true;
document.resetform.clear_sessions.checked = true;
document.resetform.clear_names.checked = true;
document.resetform.clear_names_counts.checked = true;
document.resetform.clear_skill.checked = true;
document.resetform.clear_pcounts.checked = true;
document.resetform.clear_scounts.checked = true;
document.resetform.clear_wcounts.checked = true;
document.resetform.clear_acounts.checked = true;
document.resetform.clear_mcounts.checked = true;
document.resetform.clear_rcounts.checked = true;
document.resetform.clear_events_admin.checked = true;
document.resetform.clear_events_rcon.checked = true;
document.resetform.clear_events_connects.checked = true;
document.resetform.clear_events_disconnects.checked = true;
document.resetform.clear_events_entries.checked = true;
document.resetform.clear_events_chat.checked = true;
document.resetform.clear_events_changename.checked = true;
document.resetform.clear_events_changerole.checked = true;
document.resetform.clear_events_changeteam.checked = true;
document.resetform.clear_events_frags.checked = true;
document.resetform.clear_events_suicides.checked = true;
document.resetform.clear_events_teamkills.checked = true;
document.resetform.clear_events_statsme.checked = true;
document.resetform.clear_events_actions.checked = true;
document.resetform.clear_events_latency.checked = true;
document.resetform.clear_events_statsmetime.checked = true;
}
else
{
document.resetform.clear_all_events.disabled = false;
document.resetform.clear_awards.disabled = false;
document.resetform.clear_sessions.disabled = false;
document.resetform.clear_names.disabled = false;
document.resetform.clear_names_counts.disabled = false;
document.resetform.clear_skill.disabled = false;
document.resetform.clear_pcounts.disabled = false;
document.resetform.clear_scounts.disabled = false;
document.resetform.clear_wcounts.disabled = false;
document.resetform.clear_acounts.disabled = false;
document.resetform.clear_mcounts.disabled = false;
document.resetform.clear_rcounts.disabled = false;
document.resetform.clear_events_admin.disabled = false;
document.resetform.clear_events_rcon.disabled = false;
document.resetform.clear_events_connects.disabled = false;
document.resetform.clear_events_disconnects.disabled = false;
document.resetform.clear_events_entries.disabled = false;
document.resetform.clear_events_chat.disabled = false;
document.resetform.clear_events_changename.disabled = false;
document.resetform.clear_events_changerole.disabled = false;
document.resetform.clear_events_changeteam.disabled = false;
document.resetform.clear_events_frags.disabled = false;
document.resetform.clear_events_suicides.disabled = false;
document.resetform.clear_events_teamkills.disabled = false;
document.resetform.clear_events_statsme.disabled = false;
document.resetform.clear_events_actions.disabled = false;
document.resetform.clear_events_latency.disabled = false;
document.resetform.clear_events_statsmetime.disabled = false;
document.resetform.clear_all_events.checked = false;
document.resetform.clear_awards.checked = false;
document.resetform.clear_sessions.checked = false;
document.resetform.clear_names.checked = false;
document.resetform.clear_names_counts.checked = false;
document.resetform.clear_skill.checked = false;
document.resetform.clear_pcounts.checked = false;
document.resetform.clear_scounts.checked = false;
document.resetform.clear_wcounts.checked = false;
document.resetform.clear_acounts.checked = false;
document.resetform.clear_mcounts.checked = false;
document.resetform.clear_rcounts.checked = false;
document.resetform.clear_events_admin.checked = false;
document.resetform.clear_events_rcon.checked = false;
document.resetform.clear_events_connects.checked = false;
document.resetform.clear_events_disconnects.checked = false;
document.resetform.clear_events_entries.checked = false;
document.resetform.clear_events_chat.checked = false;
document.resetform.clear_events_changename.checked = false;
document.resetform.clear_events_changerole.checked = false;
document.resetform.clear_events_changeteam.checked = false;
document.resetform.clear_events_frags.checked = false;
document.resetform.clear_events_suicides.checked = false;
document.resetform.clear_events_teamkills.checked = false;
document.resetform.clear_events_statsme.checked = false;
document.resetform.clear_events_actions.checked = false;
document.resetform.clear_events_latency.checked = false;
document.resetform.clear_events_statsmetime.checked = false;
}
}
function clear_all_events_checked()
{
if (document.resetform.clear_all_events.checked) {
document.resetform.clear_events_admin.disabled = true;
document.resetform.clear_events_rcon.disabled = true;
document.resetform.clear_events_connects.disabled = true;
document.resetform.clear_events_disconnects.disabled = true;
document.resetform.clear_events_entries.disabled = true;
document.resetform.clear_events_chat.disabled = true;
document.resetform.clear_events_changename.disabled = true;
document.resetform.clear_events_changerole.disabled = true;
document.resetform.clear_events_changeteam.disabled = true;
document.resetform.clear_events_frags.disabled = true;
document.resetform.clear_events_suicides.disabled = true;
document.resetform.clear_events_teamkills.disabled = true;
document.resetform.clear_events_statsme.disabled = true;
document.resetform.clear_events_actions.disabled = true;
document.resetform.clear_events_latency.disabled = true;
document.resetform.clear_events_statsmetime.disabled = true;
document.resetform.clear_events_admin.checked = true;
document.resetform.clear_events_rcon.checked = true;
document.resetform.clear_events_connects.checked = true;
document.resetform.clear_events_disconnects.checked = true;
document.resetform.clear_events_entries.checked = true;
document.resetform.clear_events_chat.checked = true;
document.resetform.clear_events_changename.checked = true;
document.resetform.clear_events_changerole.checked = true;
document.resetform.clear_events_changeteam.checked = true;
document.resetform.clear_events_frags.checked = true;
document.resetform.clear_events_suicides.checked = true;
document.resetform.clear_events_teamkills.checked = true;
document.resetform.clear_events_statsme.checked = true;
document.resetform.clear_events_actions.checked = true;
document.resetform.clear_events_latency.checked = true;
document.resetform.clear_events_statsmetime.checked = true;
}
else
{
document.resetform.clear_events_admin.disabled = false;
document.resetform.clear_events_rcon.disabled = false;
document.resetform.clear_events_connects.disabled = false;
document.resetform.clear_events_disconnects.disabled = false;
document.resetform.clear_events_entries.disabled = false;
document.resetform.clear_events_chat.disabled = false;
document.resetform.clear_events_changename.disabled = false;
document.resetform.clear_events_changerole.disabled = false;
document.resetform.clear_events_changeteam.disabled = false;
document.resetform.clear_events_frags.disabled = false;
document.resetform.clear_events_suicides.disabled = false;
document.resetform.clear_events_teamkills.disabled = false;
document.resetform.clear_events_statsme.disabled = false;
document.resetform.clear_events_actions.disabled = false;
document.resetform.clear_events_latency.disabled = false;
document.resetform.clear_events_statsmetime.disabled = false;
document.resetform.clear_events_admin.checked = false;
document.resetform.clear_events_rcon.checked = false;
document.resetform.clear_events_connects.checked = false;
document.resetform.clear_events_disconnects.checked = false;
document.resetform.clear_events_entries.checked = false;
document.resetform.clear_events_chat.checked = false;
document.resetform.clear_events_changename.checked = false;
document.resetform.clear_events_changerole.checked = false;
document.resetform.clear_events_changeteam.checked = false;
document.resetform.clear_events_frags.checked = false;
document.resetform.clear_events_suicides.checked = false;
document.resetform.clear_events_teamkills.checked = false;
document.resetform.clear_events_statsme.checked = false;
document.resetform.clear_events_actions.checked = false;
document.resetform.clear_events_latency.checked = false;
document.resetform.clear_events_statsmetime.checked = false;
}
}
function name_history_checked()
{
if (document.resetform.clear_names.checked) {
document.resetform.clear_names_counts.disabled = true;
document.resetform.clear_names_counts.checked = true;
}
else
{
document.resetform.clear_names_counts.disabled = false;
document.resetform.clear_names_counts.checked = false;
}
}
</script>
<form name="resetform" method="post">
<table width="600" align="center" border="0" cellspacing="0" cellpadding="0" class="border">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="10">
<tr class="bg1">
<td class="fNormal" align="middle">
<select name="game">
<?php foreach ($games as $g) echo $g; ?>
</select><br />
<em>* indicates game is currently disabled</em>
<table width="350" align="middle" border="0"><tr class="bg1"><td class="fNormal" align="left">
<ul style="list-style-type:none;">
<li style="font-weight:bold;"><input type="checkbox" name="clear_all_delete" onclick="clear_all_delete_checked()" /> Reset/Clear All and Delete Players and Clans</li><br />
<li style="font-weight:bold;"><input type="checkbox" name="clear_all" onclick="clear_all_checked()" /> Reset/Clear All</li>
<li><input type="checkbox" name="clear_awards" /> Clear Players' Awards History and Ribbons</li>
<li><input type="checkbox" name="clear_sessions" /> Clear Players' Session History</li>
<li><input type="checkbox" name="clear_names" onclick="name_history_checked()" /> Clear Players' Name History</li>
<li><input type="checkbox" name="clear_names_counts" /> Reset Players' Names' Counts</li>
<li><input type="checkbox" name="clear_skill" /> Reset Players' Skill</li>
<li><input type="checkbox" name="clear_pcounts" /> Reset Players' Counts</li>
<li><input type="checkbox" name="clear_scounts" /> Reset Servers' Counts</li>
<li><input type="checkbox" name="clear_wcounts" /> Reset Weapons' Counts</li>
<li><input type="checkbox" name="clear_acounts" /> Reset Actions' Counts</li>
<li><input type="checkbox" name="clear_mcounts" /> Reset Maps' Counts</li>
<li><input type="checkbox" name="clear_rcounts" /> Reset Roles' Counts</li>
<br />
<li style="font-weight:bold;"><input type="checkbox" name="clear_all_events" onclick="clear_all_events_checked()" /> Delete All Events</li>
<li><input type="checkbox" name="clear_events_admin" /> Delete Admin Events</li>
<li><input type="checkbox" name="clear_events_rcon" /> Delete Rcon Events</li>
<li><input type="checkbox" name="clear_events_connects" /> Delete Connect Events</li>
<li><input type="checkbox" name="clear_events_disconnects" /> Delete Disconnect Events</li>
<li><input type="checkbox" name="clear_events_entries" /> Delete Entry Events</li>
<li><input type="checkbox" name="clear_events_chat" /> Delete Chat Events</li>
<li><input type="checkbox" name="clear_events_changename" /> Delete Name Change Events</li>
<li><input type="checkbox" name="clear_events_changerole" /> Delete Role Change Events</li>
<li><input type="checkbox" name="clear_events_changeteam" /> Delete Team Change Events</li>
<li><input type="checkbox" name="clear_events_frags" /> Delete Frags Events</li>
<li><input type="checkbox" name="clear_events_suicides" /> Delete Suicide Events</li>
<li><input type="checkbox" name="clear_events_teamkills" /> Delete Teamkill Events</li>
<li><input type="checkbox" name="clear_events_statsme" /> Delete Weapon Stats Events</li>
<li><input type="checkbox" name="clear_events_actions" /> Delete Action Events</li>
<li><input type="checkbox" name="clear_events_latency" /> Delete Latency Events</li>
<li><input type="checkbox" name="clear_events_statsmetime" /> Delete Statsme Time Events</li>
</ul>
<br />
</td></tr></table>
<p align="middle" />
Are you sure you want to reset the above? (All other admin settings will be retained.)<br /><br />
<strong>Note</strong> You should <a href="<?php echo $g_options['scripturl'] . "?mode=admin&amp;task=tools_perlcontrol"; ?>" style="text-decoration:underline;font-weight:bold">stop the HLX:CE daemon</a> before resetting the stats. You can restart it after the reset completes.<br /><br />
<input type="hidden" name="confirm" value="1" />
<input type="submit" value=" Click here to confirm Reset " />
</td>
</tr>
</table></td>
</tr>
</table>
</form>
<?php
}
?>

View File

@ -0,0 +1,127 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width=9 height=6 class="imageformat"><b>&nbsp;<?php echo $task->title; ?></b><p>
<?php
if (isset($_POST['confirm']))
{
echo "<ul>\n";
$dbt = "Deleting all inactive Players";
echo "<li>$dbt ... ";
$minTimestamp = date("U")-(3600*24*30);
$SQL = "DELETE FROM hlstats_Players WHERE last_event<$minTimestamp;";
if ($db->query($SQL)) echo "OK\n"; else echo "ERROR\n";
$dbt = "Deleting Clans without Players";
echo "<li>$dbt ... ";
$SQL = "DELETE FROM hlstats_Clans USING hlstats_Clans LEFT JOIN hlstats_Players ON (clan=clanId) WHERE isnull(clan);";
if ($db->query($SQL)) echo "OK\n"; else echo "ERROR\n";
$dbt = "Deleting Names from inactive Players";
echo "<li>$dbt ... ";
$SQL = "DELETE FROM hlstats_PlayerNames USING hlstats_PlayerNames LEFT JOIN hlstats_Players ON (hlstats_PlayerNames.playerId=hlstats_Players.playerId) WHERE isnull(hlstats_Players.playerId);";
if ($db->query($SQL)) echo "OK\n"; else echo "ERROR\n";
$dbt = "Deleting SteamIDs from inactive Players";
echo "<li>$dbt ... ";
$SQL = "DELETE FROM hlstats_PlayerUniqueIds USING hlstats_PlayerUniqueIds LEFT JOIN hlstats_Players ON (hlstats_PlayerUniqueIds.playerId=hlstats_Players.playerId) WHERE isnull(hlstats_Players.playerId);";
if ($db->query($SQL)) echo "OK\n"; else echo "ERROR\n";
$dbt = "Deleting Awards from inactive Players";
echo "<li>$dbt ... ";
$SQL = "DELETE FROM hlstats_Players_Awards USING hlstats_Players_Awards LEFT JOIN hlstats_Players ON (hlstats_Players_Awards.playerId=hlstats_Players.playerId) WHERE isnull(hlstats_Players.playerId);";
if ($db->query($SQL)) echo "OK\n"; else echo "ERROR\n";
$dbt = "Deleting Ribbons from inactvie Players";
echo "<li>$dbt ... ";
$SQL = "DELETE FROM hlstats_Players_Ribbons USING hlstats_Players_Ribbons LEFT JOIN hlstats_Players ON (hlstats_Players_Ribbons.playerId=hlstats_Players.playerId) WHERE isnull(hlstats_Players.playerId);";
if ($db->query($SQL)) echo "OK\n"; else echo "ERROR\n";
$dbt = "Deleting History from inactive Players";
echo "<li>$dbt ... ";
$SQL = "DELETE FROM hlstats_Players_History USING hlstats_Players_History LEFT JOIN hlstats_Players ON (hlstats_Players_History.playerId=hlstats_Players.playerId) WHERE isnull(hlstats_Players.playerId);";
if ($db->query($SQL)) echo "OK\n"; else echo "ERROR\n";
// $dbt = "Resetting Players count for all servers";
// echo "<li>$dbt ... ";
// $SQL = "UPDATE hlstats_Servers SET players=0;";
// if ($db->query($SQL)) echo "OK\n"; else echo "ERROR\n";
echo "</ul>\n";
echo "Done.<p>";
}
else
{
?>
<form method="POST">
<table width="60%" align="center" border=0 cellspacing=0 cellpadding=0 class="border">
<tr>
<td>
<table width="100%" border=0 cellspacing=1 cellpadding=10>
<tr class="bg1">
<td class="fNormal">
Are you sure you want to clean up all statistics? All inactive players, clans and events will be deleted from the database. (All other admin settings will be retained.)<p>
<b>Note</b> You should kill <b>hlstats.pl</b> before resetting the stats. You can restart it after they are reset.<p>
<input type="hidden" name="confirm" value="1">
<center><input type="submit" value=" Reset Stats "></center>
</td>
</tr>
</table></td>
</tr>
</table>
</form>
<?php
}
?>

View File

@ -0,0 +1,162 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') )
die('Do not access this file directly.');
if ($auth->userdata['acclevel'] < 80)
die ('Access denied!');
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width=9 height=6 class="imageformat"><b>&nbsp;<?php echo $task->title; ?></b><p>
<?php
if (isset($_POST['confirm']))
{
$convert_to = 'utf8_general_ci';
$character_set= 'utf8';
if ($_POST['printonly'] > 0) {
echo '<strong>Run these statements against your MySql database</strong><br><br>';
echo "ALTER DATABASE `".DB_NAME."` DEFAULT CHARACTER SET $character_set COLLATE $convert_to;<br>";
$rs_tables = $db->query('SHOW TABLES') or die(mysql_error());
while ($row_tables = $db->fetch_row($rs_tables))
{
$table = mysql_real_escape_string($row_tables[0]);
echo "ALTER TABLE `$table` DEFAULT CHARACTER SET $character_set;<br>";
$rs = $db->query("SHOW FULL FIELDS FROM `$table` WHERE collation is not null AND collation <> 'utf8_general_ci'") or die(mysql_error());
while ($row=mysql_fetch_assoc($rs))
{
if ($row['Collation'] == '')
continue;
if ( strtolower($row['Null']) == 'yes' )
$nullable = ' NULL ';
else
$nullable = ' NOT NULL';
if ( $row['Default'] === NULL && $nullable = ' NOT NULL ')
$default = " DEFAULT ''";
else if ( $row['Default'] === NULL )
$default = ' DEFAULT NULL';
else if ($row['Default']!='')
$default = " DEFAULT '".mysql_real_escape_string($row['Default'])."'";
else
$default = '';
$field = mysql_real_escape_string($row['Field']);
echo "ALTER TABLE `$table` CHANGE `$field` `$field` $row[Type] CHARACTER SET $character_set COLLATE $convert_to $nullable $default;<br>";
}
}
} else {
echo "Converting database, table, and row collations to utf8:<ul>\n";
set_time_limit(0);
echo '<li>Changing '.DB_NAME.' default character set and collation... ';
$db->query("ALTER DATABASE `".DB_NAME."` DEFAULT CHARACTER SET $character_set COLLATE $convert_to;")or die(mysql_error());
echo 'OK';
$rs_tables = $db->query('SHOW TABLES') or die(mysql_error());
while ($row_tables = $db->fetch_row($rs_tables))
{
$table = mysql_real_escape_string($row_tables[0]);
echo "<li>Converting Table: $table ... ";
$db->query("ALTER TABLE `$table` DEFAULT CHARACTER SET $character_set;");
echo 'OK';
$rs = $db->query("SHOW FULL FIELDS FROM `$table` WHERE collation is not null AND collation <> 'utf8_general_ci'") or die(mysql_error());
while ($row=mysql_fetch_assoc($rs))
{
if ($row['Collation'] == '')
continue;
if ( strtolower($row['Null']) == 'yes' )
$nullable = ' NULL ';
else
$nullable = ' NOT NULL';
if ( $row['Default'] === NULL && $nullable = ' NOT NULL ')
$default = " DEFAULT ''";
else if ( $row['Default'] === NULL )
$default = ' DEFAULT NULL';
else if ($row['Default']!='')
$default = " DEFAULT '".mysql_real_escape_string($row['Default'])."'";
else
$default = '';
$field = mysql_real_escape_string($row['Field']);
echo "<li>Converting Table: $table Column: $field ... ";
$db->query("ALTER TABLE `$table` CHANGE `$field` `$field` $row[Type] CHARACTER SET $character_set COLLATE $convert_to $nullable $default;");
echo 'OK';
}
}
echo '</ul>';
echo 'Done.<p>';
}
} else {
?>
<form method="POST">
<table width="60%" align="center" border=0 cellspacing=0 cellpadding=0 class="border">
<tr>
<td>
<table width="100%" border=0 cellspacing=1 cellpadding=10>
<tr class="bg1">
<td class="fNormal">
Resets DB Collations if you get collation errors after an upgrade from another HLstats(X)-based system. <br><br>
You should not lose any data, but be sure to back up your database before running to be on the safe side.<br><br><br>
<input type="hidden" name="confirm" value="1">
<input type="radio" name="printonly" value="0" checked> Run the commands on the database<br>
<input type="radio" name="printonly" value="1"> Print the commands and I'll run them myself (recommended if you have a very large database likely to hang the script)<br>
<center><input type="submit" value="Generate commands and do the above"></center>
</td>
</tr>
</table></td>
</tr>
</table>
</form>
<?php
}
?>

View File

@ -0,0 +1,260 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') )
die('Do not access this file directly.');
if ($auth->userdata['acclevel'] < 80)
die ('Access denied!');
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width=9 height=6 class="imageformat"><b>&nbsp;<?php echo $task->title; ?></b><p>
<?php
function check_writable() {
$ok = '';
$f = IMAGE_PATH."/games/";
if (!is_writable($f))
$ok .= "<li>I have no permission to write to '$f'";
if ($ok != '') {
echo 'FATAL:<br><UL>';
echo $ok;
echo '</UL><br>Correct this before continuing';
die();
}
return true;
}
function getTableFields($table,$auto_increment) {
// get a field array of specified table
global $db;
$db->query("SHOW COLUMNS FROM $table;");
$res = array();
while ($r=$db->fetch_array())
{
if ((!$auto_increment) && ($r['Extra']=='auto_increment'))
{
continue;
}
else
{
array_push($res,$r['Field']);
}
}
return $res;
}
function copySettings($table,$game1,$game2) {
global $db;
$db->query("SELECT game FROM $table WHERE game='$game2' LIMIT 1;");
if ($db->num_rows()!=0)
$ret = 'Target gametype exists, nothing done!';
else {
$db->query("SELECT count(game) AS cnt FROM $table WHERE game='$game1';");
$r = $db->fetch_array();
if ($r['cnt']==0)
$ret = 'No data existent for source gametype.';
else {
$ret = $r['cnt'].' entries copied!';
$fields = '';
$ignoreFields = array('game','id','d_winner_id','d_winner_count','g_winner_id','g_winner_count','count','picked','kills','deaths','headshots');
foreach (getTableFields($table,0) AS $field) {
if (!in_array($field, $ignoreFields)) {
if ($fields!='')
$fields .= ', ';
$fields .= $field;
}
}
$SQL = "INSERT INTO $table ($fields,game) SELECT $fields,'$game2' FROM $table WHERE game='$game1';";
$db->query($SQL);
}
}
return $ret."</li>";
}
function mkdir_recursive($pathname) {
is_dir(dirname($pathname)) || mkdir_recursive(dirname($pathname));
return is_dir($pathname) || @mkdir($pathname);
}
function copyFile($source,$dest) {
if ($source != '') {
$source = IMAGE_PATH."/games/$source";
$dest = IMAGE_PATH."/games/$dest";
if (!is_file($source))
$ret = "File not found $source (dest: $dest)<br>";
else {
mkdir_recursive(dirname($dest));
if (!copy($source,$dest))
$ret = 'FAILED';
else
$ret = 'OK';
}
return "Copying '$source' to '$dest': $ret</li>";
}
return '';
}
function scanCopyFiles($source,$dest) {
global $files;
$d = dir(IMAGE_PATH.'/games/'.$source);
if ($d !== false) {
while (($entry=$d->read()) !== false) {
if (is_file(IMAGE_PATH.'/games/'.$source.'/'.$entry) && ($entry != '.') && ($entry != '..'))
$files[] = array($source.'/'.$entry,$dest.'/'.$entry);
if (is_dir(IMAGE_PATH.'/games/'.$source.'/'.$entry) && ($entry != '.') && ($entry != '..'))
scanCopyFiles($source.'/'.$entry,$dest.'/'.$entry);
}
$d->close();
}
}
if (isset($_POST['confirm'])) {
$game1 = '';
if (isset($_POST['game1']))
if ($_POST['game1']!='')
$game1 = $_POST['game1'];
$game2 = '';
if (isset($_POST['game2']))
if ($_POST['game2']!='')
$game2 = $_POST['game2'];
$game2name = '';
if (isset($_POST['game2name']))
if ($_POST['game2name']!='')
$game2name = $_POST['game2name'];
echo '<ul><br />';
check_writable();
$game2 = valid_request($game2, 0);
$game2name = valid_request($game2name, 0);
echo '<li>hlstats_Games ...';
$db->query("SELECT code FROM hlstats_Games WHERE code='$game2' LIMIT 1;");
if ($db->num_rows()!=0) {
echo '</ul><br /><br /><br />';
echo '<b>Target gametype exists, nothing done!</b><br /><br />';
} else {
$db->query("INSERT INTO hlstats_Games (code,name,hidden,realgame) SELECT '$game2', '$game2name', '0', realgame FROM hlstats_Games WHERE code='$game1'");
echo 'OK</li>';
$dbtables = array();
array_push($dbtables,
'hlstats_Actions',
'hlstats_Awards',
'hlstats_Ribbons',
'hlstats_Ranks',
'hlstats_Roles',
'hlstats_Teams',
'hlstats_Weapons'
);
foreach ($dbtables as $dbt) {
echo "<li>$dbt ... ";
echo copySettings($dbt,$game1,$game2);
}
echo '</ul><br /><br /><br />';
echo '<ul>';
$files = array(
array(
'',
''
)
);
scanCopyFiles("$game1/","$game2/");
foreach ($files as $f) {
echo '<li>';
echo copyFile($f[0],$f[1]);
}
echo '</ul><br /><br /><br />';
echo 'Done.<br /><br />';
}
} else {
$result = $db->query("SELECT code, name FROM hlstats_Games ORDER BY code;");
unset($games);
$games[] = '<option value="" selected="selected">Please select</option>';
while ($rowdata = $db->fetch_row($result))
{
$games[] = "<option value=\"$rowdata[0]\">$rowdata[0] - $rowdata[1]</option>";
}
?>
<form method="post">
<table width="60%" align="center" border="0" cellspacing="0" cellpadding="0" class="border">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="10">
<tr class="bg1">
<td class="fNormal" style="text-align:center;">
Are you sure to copy all settings from the selected gametype to the new gametype name?<br>
All existing images will be copied also to the new gametype!<p>
<input type="hidden" name="confirm" value="1" />
Existing gametype:
<select Name="game1">
<?php foreach ($games as $g) echo $g; ?>
</select><br />
New gametype code:
<input type="text" size="10" value="newcode" name="game2"><br />
New gametype name:
<input type="text" size="26" value="New Game" name="game2name"><br />
<input type="submit" value=" Copy selected gametype to the new name " />
</td>
</tr>
</table></td>
</tr>
</table>
</form>
<?php
}
?>

View File

@ -0,0 +1,193 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
?>
&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" width=9 height=6 class="imageformat"><b>&nbsp;<?php echo $task->title; ?></b><p>
<?php
$servers[0]["name"] = "ELstatsNEO Masterserver";
$servers[0]["host"] = "master.elstatsneo.de";
$servers[0]["port"] = 27801;
$servers[0]["packet"] = chr(255).chr(255)."Z".chr(255)."1.00".chr(255).chr(255).chr(255);
$servers[1]["name"] = "HLstatsX Masterserver (doesn't work anymore)";
$servers[1]["host"] = "master.hlstatsx.com";
$servers[1]["port"] = 27501;
$servers[1]["packet"] = chr(255).chr(255)."Z".chr(255);
function hide_cheaters($query) {
global $db;
$result = $db->query($query);
$cheater = array();
$query = "UPDATE hlstats_Players SET last_event = IF(hideranking <> 2, UNIX_TIMESTAMP(), last_event), hideranking = 2 WHERE playerId IN ";
$insert_part = "";
$first = 0;
while (list($player_id) = $db->fetch_row($result)) {
if ($first == 0)
$insert_part = "(".$player_id;
else
$insert_part .= ",".$player_id;
$first++;
}
if ($first > 0) {
echo "<li>Updating <b>$first</b> cheaters...";
$insert_part .= ")";
$update_query = $query.$insert_part;
$db->query($update_query);
echo "<b>OK</b></li>";
}
}
if (isset($_POST['confirm']))
{
echo "<ul>\n";
$s_id = $_POST['masterserver'];
$host = $servers[$s_id]["host"];
$port = $servers[$s_id]["port"];
echo "<li>Requesting cheaterlist from <b>$host:$port</b>...";
$host = gethostbyname($host);
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
$packet = $servers[$s_id]["packet"];
$bytes_sent = socket_sendto($socket, $packet, strlen($packet), 0, $host, $port);
echo "<b>".$bytes_sent."</b> bytes <b>OK</b></li>";
echo "<li>Retrieving data from masterserver...";
$recv_bytes = 0;
$buffer = "";
$timeout = 30;
$answer = "";
$packets = 0;
$read = array($socket);
while (socket_select($read, $write = NULL, $except = NULL, &$timeout) > 0) {
$recv_bytes += socket_recvfrom($socket, &$buffer, 2000, 0, &$host, &$port);
if (($buffer[0] == chr(255)) && ($buffer[1] == chr(255)) && ($buffer[2] == "Z") && ($buffer[3] == chr(255)) &&
($buffer[4] == "1") && ($buffer[5] == ".") && ($buffer[6] == "0") && ($buffer[7] == "0") && ($buffer[8] == chr(255))) {
$answer .= substr($buffer, 9, strlen($buffer));
}
$buffer = "";
$timeout = "1";
$packets++;
}
$steam_ids = explode(chr(255), $answer);
array_pop($steam_ids);
echo "recieving <b>$recv_bytes</b> bytes in <b>$packets</b> packets...<b>".count($steam_ids)."</b> cheaters...<b>OK</b></li>";
$query = "SELECT playerId FROM hlstats_PlayerUniqueIds WHERE uniqueId in ";
$insert_part = "";
$first = 0;
foreach ($steam_ids as $entry) {
// temporary: used to transfer current cheaters to elstatsneo masterserver ~~ 30000 cheaters transferred :)
// $db->query("INSERT INTO vac_ids VALUES ('$entry')");
if ($first == 0)
$insert_part = "('".$entry."'";
else
$insert_part .= ",'".$entry."'";
$first++;
if ($first % 50 == 0) {
$insert_part .= ")";
$select_query = $query.$insert_part;
hide_cheaters($select_query);
$insert_part = "";
$first = 0;
}
}
if ($first > 0) {
$insert_part .= ")";
$select_query = $query.$insert_part;
hide_cheaters($select_query);
}
echo "<li>Closing connection to masterserver...";
socket_close($socket);
echo "<b>OK</b></li>";
echo "</ul>\n";
} else {
?>
<form method="POST">
<table width="60%" align="center" border=0 cellspacing=0 cellpadding=0 class="border">
<tr>
<td>
<table width="100%" border=0 cellspacing=1 cellpadding=10>
<tr class="bg1">
<td class="fNormal">
If you synchronize with one of the selected master servers, some players may be marked as cheater. You will see them on your VAC Cheater list!<br>
Choose preferred masterserver:
<SELECT NAME="masterserver">
<?php
$i = 0;
foreach ($servers as $server) {
echo "<OPTION VALUE=\"$i\">".$server["name"];
$i++;
}
?>
</SELECT>
<p>
<input type="hidden" name="confirm" value="1">
<center><input type="submit" value=" Synchronize Stats "></center>
</td>
</tr>
</table></td>
</tr>
</table>
</form>
<?php
}
?>

View File

@ -0,0 +1,88 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata['acclevel'] < 80) die ('Access denied!');
$edlist = new EditList('serverId', 'hlstats_Servers_VoiceComm', '', false);
$edlist->columns[] = new EditListColumn('name', 'Server Name', 45, true, 'text', '', 64);
$edlist->columns[] = new EditListColumn('addr', 'Server IP or Hostname', 20, true, 'text', '', 64);
$edlist->columns[] = new EditListColumn('password', 'Password', 20, false, 'text', '', 64);
$edlist->columns[] = new EditListColumn('UDPPort', 'UDP Port (TS only)', 6, false, 'text', '8767', 64);
$edlist->columns[] = new EditListColumn('queryPort', 'Query Port (TS)/Connect Port (Vent)', 6, true, 'text', '51234', 64);
$edlist->columns[] = new EditListColumn('descr', 'Notes', 40, false, 'text', '', 64);
$edlist->columns[] = new EditListColumn('serverType', 'Server Type', 20, true, 'select', '0/Teamspeak;1/Ventrilo');
if ($_POST)
{
if ($edlist->update())
message('success', 'Operation successful.');
else
message('warning', $edlist->error());
}
?>
<?php
$result = $db->query("
SELECT
serverId,
name,
addr,
password,
UDPPort,
queryPort,
descr,
serverType
FROM
hlstats_Servers_VoiceComm
ORDER BY
serverType,
name
");
$edlist->draw($result);
?>
<table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>

View File

@ -0,0 +1,87 @@
<?php
/*
HLstatsX Community Edition - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)
http://www.hlxcommunity.com
HLstatsX Community Edition is a continuation of
ELstatsNEO - Real-time player and clan rankings and statistics
Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)
http://ovrsized.neo-soft.org/
ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX
HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2
http://www.hlstatsx.com/
Copyright (C) 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)
HLstatsX is an enhanced version of HLstats made by Simon Garner
HLstats - Real-time player and clan rankings and statistics for Half-Life
http://sourceforge.net/projects/hlstats/
Copyright (C) 2001 Simon Garner
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For support and installation notes visit http://www.hlxcommunity.com
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
if ($auth->userdata["acclevel"] < 80) die ("Access denied!");
$edlist = new EditList("weaponId", "hlstats_Weapons", "gun", false);
$edlist->columns[] = new EditListColumn("game", "Game", 0, true, "hidden", $gamecode);
$edlist->columns[] = new EditListColumn("code", "Weapon Code", 15, true, "text", "", 32);
$edlist->columns[] = new EditListColumn("name", "Weapon Name", 25, true, "text", "", 64);
$edlist->columns[] = new EditListColumn("modifier", "Points Modifier", 10, true, "text", "1.00");
if ($_POST)
{
if ($edlist->update())
message("success", "Operation successful.");
else
message("warning", $edlist->error());
}
?>
You can give each weapon a <i>points modifier</i>, a multiplier which determines how many points will be gained or lost for killing with or being killed by that weapon. (Refer to <a href="<?php echo $g_options["scripturl"]; ?>?mode=help#points">Help</a> for a full description of how points ratings are
calculated.) The baseline points modifier for weapons is 1.00. A points modifier of 0.00 will cause kills with that weapon to have no effect on players' points.<p>
<?php
$result = $db->query("
SELECT
weaponId,
code,
name,
modifier
FROM
hlstats_Weapons
WHERE
game='$gamecode'
ORDER BY
code ASC
");
$edlist->draw($result);
?>
<table width="75%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td align="center"><input type="submit" value=" Apply " class="submit"></td>
</tr>
</table>