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

1
web/pages/.htaccess Normal file
View File

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

336
web/pages/actioninfo.php Normal file
View File

@ -0,0 +1,336 @@
<?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.');
}
// Action Details
// Addon created by Rufus (rufus@nonstuff.de)
$action = valid_request($_GET['action'], 0)
or error('No action ID specified.');
$action_escaped=$db->escape($action);
$game_escaped=$db->escape($game);
$db->query("
SELECT
for_PlayerActions,for_PlayerPlayerActions, description
FROM
hlstats_Actions
WHERE
code='{$action_escaped}'
AND game='{$game_escaped}'
");
if ($db->num_rows() != 1)
{
$act_name = ucfirst($action);
$actiondata['for_PlayerActions']=1; // dummy these out, this should never happen?
$actiondata['for_PlayerPlayerActions']=0;
}
else
{
$actiondata = $db->fetch_array();
$db->free_result();
$act_name = $actiondata['description'];
}
$db->query("SELECT name FROM hlstats_Games WHERE code='{$game_escaped}'");
if ($db->num_rows() != 1)
error('Invalid or no game specified.');
else
list($gamename) = $db->fetch_row();
pageHeader(
array($gamename, 'Action Details', $act_name),
array(
$gamename=>$g_options['scripturl'] . "?game=$game",
'Action Statistics'=>$g_options['scripturl'] . "?mode=actions&game=$game",
'Action Details'=>''
),
$act_name
);
$table = new Table(
array(
new TableColumn(
'playerName',
'Player',
'width=45&align=left&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn(
'obj_count',
'Achieved',
'width=25&align=right'
),
new TableColumn(
'obj_bonus',
'Skill Bonus Total',
'width=25&align=right&sort=no'
)
),
'playerId',
'obj_count',
'playerName',
true,
40
);
if ($actiondata['for_PlayerActions']==1)
{
$result = $db->query("
SELECT
hlstats_Events_PlayerActions.playerId,
hlstats_Players.lastName AS playerName,
hlstats_Players.flag as flag,
COUNT(hlstats_Events_PlayerActions.id) AS obj_count,
COUNT(hlstats_Events_PlayerActions.id) * hlstats_Actions.reward_player AS obj_bonus
FROM
hlstats_Events_PlayerActions, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '{$action_escaped}' AND
hlstats_Players.game = '{$game_escaped}' AND
hlstats_Players.playerId = hlstats_Events_PlayerActions.playerId AND
hlstats_Events_PlayerActions.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking = '0'
GROUP BY
hlstats_Events_PlayerActions.playerId
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT $table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(DISTINCT hlstats_Events_PlayerActions.playerId),
COUNT(hlstats_Events_PlayerActions.Id)
FROM
hlstats_Events_PlayerActions, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '{$action_escaped}' AND
hlstats_Players.game = '{$game_escaped}' AND
hlstats_Players.playerId = hlstats_Events_PlayerActions.playerId AND
hlstats_Events_PlayerActions.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking = '0'
");
}
if($actiondata['for_PlayerPlayerActions']==1)
{
$result = $db->query("
SELECT
hlstats_Events_PlayerPlayerActions.playerId,
hlstats_Players.lastName AS playerName,
hlstats_Players.flag as flag,
COUNT(hlstats_Events_PlayerPlayerActions.id) AS obj_count,
COUNT(hlstats_Events_PlayerPlayerActions.id) * hlstats_Actions.reward_player AS obj_bonus
FROM
hlstats_Events_PlayerPlayerActions, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '{$action_escaped}' AND
hlstats_Players.game = '{$game_escaped}' AND
hlstats_Players.playerId = hlstats_Events_PlayerPlayerActions.playerId AND
hlstats_Events_PlayerPlayerActions.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking = '0'
GROUP BY
hlstats_Events_PlayerPlayerActions.playerId
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT $table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(DISTINCT hlstats_Events_PlayerPlayerActions.playerId),
COUNT(hlstats_Events_PlayerPlayerActions.Id)
FROM
hlstats_Events_PlayerPlayerActions, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '{$action_escaped}' AND
hlstats_Players.game = '{$game_escaped}' AND
hlstats_Players.playerId = hlstats_Events_PlayerPlayerActions.playerId AND
hlstats_Events_PlayerPlayerActions.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking = '0'
");
}
list($numitems, $totalact) = $db->fetch_row($resultCount);
if ($totalact == 0)
{
$result = $db->query("
SELECT
hlstats_Events_TeamBonuses.playerId,
hlstats_Players.lastName AS playerName,
hlstats_Players.flag as flag,
COUNT(hlstats_Events_TeamBonuses.id) AS obj_count,
COUNT(hlstats_Events_TeamBonuses.id) * hlstats_Actions.reward_player AS obj_bonus
FROM
hlstats_Events_TeamBonuses, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '{$action_escaped}' AND
hlstats_Players.game = '{$game_escaped}' AND
hlstats_Players.playerId = hlstats_Events_TeamBonuses.playerId AND
hlstats_Events_TeamBonuses.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking = '0'
GROUP BY
hlstats_Events_TeamBonuses.playerId
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT $table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(DISTINCT hlstats_Events_TeamBonuses.playerId),
COUNT(hlstats_Events_TeamBonuses.Id)
FROM
hlstats_Events_TeamBonuses, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '{$action_escaped}' AND
hlstats_Players.game = '{$game_escaped}' AND
hlstats_Players.playerId = hlstats_Events_TeamBonuses.playerId AND
hlstats_Events_TeamBonuses.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking = '0'
");
list($numitems, $totalact) = $db->fetch_row($resultCount);
}
?>
<div class="block">
<?php printSectionTitle('Action Details'); ?>
<div class="subblock">
<div style="float:left;">
<strong><?php echo $act_name; ?></strong> from a total of <strong><?php echo number_format(intval($totalact)); ?></strong> achievements (Last <?php echo $g_options['DeleteDays']; ?> Days)
</div>
<div style="float:right;">
Back to <a href="<?php echo $g_options['scripturl'] . "?mode=actions&amp;game=$game"; ?>">Action Statistics</a>
</div>
</div>
<div style="clear:both;padding:2px;"></div>
</div>
<?php
$table->draw($result, $numitems, 95, 'center');
if ($actiondata['for_PlayerPlayerActions'] == 1)
{
$table = new Table(
array(
new TableColumn(
'playerName',
'Player',
'width=45&align=left&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn(
'obj_count',
'Times Victimized',
'width=25&align=right'
),
new TableColumn(
'obj_bonus',
'Skill Bonus Total',
'width=25&align=right&sort=no'
)
),
'victimId',
'obj_count',
'playerName',
true,
40,
'vpage'
);
$result = $db->query("
SELECT
hlstats_Events_PlayerPlayerActions.victimId,
hlstats_Players.lastName AS playerName,
hlstats_Players.flag as flag,
COUNT(hlstats_Events_PlayerPlayerActions.id) AS obj_count,
COUNT(hlstats_Events_PlayerPlayerActions.id) * hlstats_Actions.reward_player * -1 AS obj_bonus
FROM
hlstats_Events_PlayerPlayerActions, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '{$action_escaped}' AND
hlstats_Players.game = '{$game_escaped}' AND
hlstats_Players.playerId = hlstats_Events_PlayerPlayerActions.victimId AND
hlstats_Events_PlayerPlayerActions.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking = '0'
GROUP BY
hlstats_Events_PlayerPlayerActions.victimId
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT $table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(DISTINCT hlstats_Events_PlayerPlayerActions.victimId),
COUNT(hlstats_Events_PlayerPlayerActions.Id)
FROM
hlstats_Events_PlayerPlayerActions, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '{$action_escaped}' AND
hlstats_Players.game = '{$game_escaped}' AND
hlstats_Players.playerId = hlstats_Events_PlayerPlayerActions.victimId AND
hlstats_Events_PlayerPlayerActions.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking = '0'
");
list($numitems, $totalact) = $db->fetch_row($resultCount);
?>
<div class="block">
<a name="victims"><?php printSectionTitle("Action Victim Details"); ?></a>
<div class="subblock">
<div style="float:left;">
<strong>Victims of <?php echo $act_name; ?></strong> (Last <?php echo $g_options['DeleteDays']; ?> Days)
</div>
</div>
<div style="clear:both;padding:2px;"></div>
</div>
<?php
$table->draw($result, $numitems, 95, 'center');
}
?>
</div>

137
web/pages/actions.php Normal file
View File

@ -0,0 +1,137 @@
<?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.');
}
// Action Statistics
// Addon Created by Rufus (rufus@nonstuff.de)
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
pageHeader
(
array ($gamename, 'Action Statistics'),
array ($gamename=>"%s?game=$game", 'Action Statistics'=>'')
);
$tblPlayerActions = new Table
(
array
(
new TableColumn
(
'description',
'Action',
'width=45&link=' . urlencode('mode=actioninfo&amp;action=%k&amp;game='.$game)
),
new TableColumn
(
'obj_count',
'Earned',
'width=25&align=right&append=+times'
),
new TableColumn
(
'obj_bonus',
'Reward',
'width=25&align=right'
)
),
'code',
'obj_count',
'description',
true,
9999,
'obj_page',
'obj_sort',
'obj_sortorder'
);
$result = $db->query
("
SELECT
hlstats_Actions.code,
hlstats_Actions.description,
hlstats_Actions.count AS obj_count,
hlstats_Actions.reward_player AS obj_bonus
FROM
hlstats_Actions
WHERE
hlstats_Actions.game = '$game'
AND hlstats_Actions.count > 0
GROUP BY
hlstats_Actions.id
ORDER BY
$tblPlayerActions->sort $tblPlayerActions->sortorder,
$tblPlayerActions->sort2 $tblPlayerActions->sortorder
");
?>
<div class="block">
<?php printSectionTitle('Action Statistics'); ?>
<div class="subblock">
<?php
$db->query
("
SELECT
SUM(count)
FROM
hlstats_Actions
WHERE
hlstats_Actions.game = '$game'
");
list($totalactions) = $db->fetch_row();
?>From a total of <strong><?php echo number_format($totalactions); ?></strong> earned actions
</div><br /><br />
<?php
$tblPlayerActions->draw($result, $db->num_rows($result), 95);
?><br /><br />
<div class="subblock">
<div style="float:right;">
Go to: <a href="<?php echo $g_options['scripturl'] . "?game=$game"; ?>"><?php echo $gamename; ?></a>
</div>
</div>
</div>

1267
web/pages/admin.php Normal file

File diff suppressed because it is too large Load Diff

79
web/pages/adminauth.php Normal file
View File

@ -0,0 +1,79 @@
<?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.'); }
pageHeader(array('Admin'), array('Admin' => ''));
?>
<div class="block">
<?php printSectionTitle('Authorization Required'); ?>
<div class="subblock">
<?php
if ($this->error)
{
?>
<img src="<?php echo IMAGE_PATH; ?>/warning.gif" style="padding-right:5px;">
<?php
echo "<span class=\"fTitle\" style=\"font-weight:bold;\">$this->error</span><br /><br />";
}
?>
<div style="float:left;margin-left:40px;">
<form method="post" name="auth">
<table class="data-table">
<tr style="vertical-align:middle;">
<td class="bg1" style="width:45%;border:0;">Username:</td>
<td class="bg1" style="width:55%;border:0;"><input type="text" name="authusername" size="20" maxlength="16" value="<?php echo $this->username; ?>" class="textbox"></td>
</tr>
<tr style="vertical-align:middle;">
<td class="bg1" style="width:45%;border:0;">Password:</td>
<td class="bg1" style="width:55%;border:0;"><input type="password" name="authpassword" size="20" maxlength="16" value="<?php echo $this->password; ?>" class="textbox"></td>
</tr>
<tr>
<td class="bg1" style="border:0;">&nbsp;</td>
<td class="bg1" style="border:0;"><input type="submit" value=" Login " id="authsubmit" class="submit"></td>
</tr>
</table><br />
Please ensure cookies are enabled in your browser security options.<br />
<!-- <strong>Note</strong> Do not select "Save my password" if other people will use this computer.</span> <br /><br /> -->
</form>
</div>
</div>
</div>

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>

126
web/pages/awards.php Normal file
View File

@ -0,0 +1,126 @@
<?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.');
}
// Awards Info Page
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
$type = valid_request($_GET['type']);
$tab = valid_request($_GET['tab']);
if ($type == 'ajax' )
{
$tabs = explode('|', preg_replace('[^a-z]', '', $tab));
foreach ( $tabs as $tab )
{
if ( file_exists(PAGE_PATH . '/awards_' . $tab . '.php') )
{
@include(PAGE_PATH . '/awards_' . $tab . '.php');
}
}
exit;
}
pageHeader(
array($gamename, 'Awards Info'),
array($gamename=>"%s?game=$game", 'Awards Info'=>'')
);
?>
<?php if ($g_options['playerinfo_tabs']=='1') { ?>
<div id="main">
<ul class="subsection_tabs" id="tabs_submenu">
<li><a href="#" id="tab_daily">Daily&nbsp;Awards</a></li>
<li><a href="#" id="tab_global">Global&nbsp;Awards</a></li>
<li><a href="#" id="tab_ranks">Ranks</a></li>
<li><a href="#" id="tab_ribbons">Ribbons</a></li>
</ul>
<br />
<div id="main_content"></div>
<?php
if ($tab)
{
$defaulttab = $tab;
}
else
{
$defaulttab = 'daily';
}
echo "<script type=\"text/javascript\">
new Tabs($('main_content'), $$('#main ul.subsection_tabs a'), {
'mode': 'awards',
'game': '$game',
'loadingImage': '".IMAGE_PATH."/ajax.gif',
'defaultTab': '$defaulttab'
});"
?>
</script>
</div>
<?php } else {
echo "\n<div id=\"daily\">\n";
include PAGE_PATH.'/awards_daily.php';
echo "\n</div>\n";
echo "\n<div id=\"global\">\n";
include PAGE_PATH.'/awards_global.php';
echo "\n</div>\n";
echo "\n<div id=\"ranks\">\n";
include PAGE_PATH.'/awards_ranks.php';
echo "\n</div>\n";
echo "\n<div id=\"ribbons\">\n";
include PAGE_PATH.'/awards_ribbons.php';
echo "\n</div>\n";
}
?>

166
web/pages/awards_daily.php Normal file
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.');
}
// Daily Awards - WeaponImages und auch als Icondarstellung
$resultAwards = $db->query("
SELECT
hlstats_Awards.awardId,
hlstats_Awards.awardType,
hlstats_Awards.code,
hlstats_Awards.name,
hlstats_Awards.verb,
hlstats_Awards.d_winner_id,
hlstats_Awards.d_winner_count,
hlstats_Players.lastName AS d_winner_name,
hlstats_Players.flag AS flag,
hlstats_Players.country AS country
FROM
hlstats_Awards
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId = hlstats_Awards.d_winner_id
WHERE
hlstats_Awards.game='$game'
ORDER BY
hlstats_Awards.name
");
$result = $db->query("
SELECT
IFNULL(value, 1)
FROM
hlstats_Options
WHERE
keyname='awards_numdays'
");
if ($db->num_rows($result) == 1)
list($awards_numdays) = $db->fetch_row($result);
else
$awards_numdays = 1;
$result = $db->query("
SELECT
DATE_FORMAT(value, '%W %e %b'),
DATE_FORMAT( DATE_SUB( value, INTERVAL $awards_numdays DAY ) , '%W %e %b' )
FROM
hlstats_Options
WHERE
keyname='awards_d_date'
");
list($awards_d_date, $awards_s_date) = $db->fetch_row($result);
?>
<div class="block">
<?php printSectionTitle((($awards_numdays == 1) ? 'Daily' : $awards_numdays.'Day')." Awards ($awards_d_date)"); ?>
<div class="subblock">
<table class="data-table">
<?php
// draw the daily award info table (5 columns)
$i = 0;
$cols = $g_options['awarddailycols'];
if ($cols < 1 || $cols > 10)
{
$cols = 5;
}
$colwidth = round(100 / $cols);
while ($r = $db->fetch_array($resultAwards))
{
if ($i == $cols)
{
echo '</tr>';
$i = 0;
}
if ($i==0)
{
echo '<tr class="bg1">';
}
if ($image = getImage("/games/$game/dawards/".strtolower($r['awardType'].'_'.$r['code'])))
{
$img = $image['url'];
}
elseif ($image = getImage("/games/$realgame/dawards/".strtolower($r['awardType'].'_'.$r['code'])))
{
$img = $image['url'];
}
else
{
$img = IMAGE_PATH.'/award.png';
}
$weapon = '<a href="hlstats.php?mode=dailyawardinfo&amp;award='.$r['awardId']."&amp;game=$game\"><img src=\"$img\" alt=\"".$r['code'].'" /></a>';
if ($r['d_winner_id'] > 0) {
if ($g_options['countrydata'] == 1) {
$imagestring = '<img src="'.getFlag($r['flag']).'" alt="'.$r['flag'].'" />&nbsp;&nbsp;';
} else {
$imagestring = '';
}
$winnerstring = '<strong>'.htmlspecialchars($r['d_winner_name'], ENT_COMPAT).'</strong>';
$achvd = "{$imagestring} <a href=\"hlstats.php?mode=playerinfo&amp;player={$r['d_winner_id']}&amp;game={$game}\">{$winnerstring}</a>";
$wincount = $r['d_winner_count'];
} else {
$achvd = "<em>No Award Winner</em>";
$wincount= "0";
}
echo "<td style=\"text-align:center;vertical-align:top;width:$colwidth%;\">
<strong>".$r['name'].'</strong><br /><br />'
."$weapon<br /><br />"
."$achvd<br />"
.'<span class="fSmall">'.$wincount. ' ' . htmlspecialchars($r['verb']).'</span>
</td>';
$i++;
}
if ($i != 0)
{
for ($i = $i; $i < $cols; $i++)
{
echo '<td class="bg1">&nbsp;</td>';
}
echo '</tr>';
}
?>
</table>
</div>
</div>

137
web/pages/awards_global.php Normal file
View File

@ -0,0 +1,137 @@
<?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.');
}
$resultAwards = $db->query("
SELECT
hlstats_Awards.awardType,
hlstats_Awards.code,
hlstats_Awards.name,
hlstats_Awards.verb,
hlstats_Awards.g_winner_id,
hlstats_Awards.g_winner_count,
hlstats_Players.lastName AS g_winner_name,
hlstats_Players.flag AS flag,
hlstats_Players.country AS country
FROM
hlstats_Awards
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId = hlstats_Awards.g_winner_id
WHERE
hlstats_Awards.game='$game'
ORDER BY
hlstats_Awards.name
");
?>
<div class="block">
<?php printSectionTitle('Global Awards'); ?>
<div class="subblock">
<table class="data-table">
<?php
$i = 0;
$cols = $g_options['awardglobalcols'];
if ($cols<1 || $cols>10)
{
$cols = 5;
}
$colwidth = round(100/$cols);
while ($r = $db->fetch_array($resultAwards))
{
if ($i==$cols)
{
echo '</tr>'; $i = 0;
}
if ($i==0)
{
echo '<tr class="bg1">';
}
if ($image = getImage("/games/$game/gawards/".strtolower($r['awardType'].'_'.$r['code'])))
{
$img = $image['url'];
}
elseif ($image = getImage("/games/$realgame/gawards/".strtolower($r['awardType'].'_'.$r['code'])))
{
$img = $image['url'];
}
else
{
$img = IMAGE_PATH.'/award.png';
}
$weapon = "<img src=\"$img\" alt=\"".$r['code'].'" />';
if ($r['g_winner_id'] > 0)
{
if ($g_options['countrydata'] == 1) {
$imagestring = '<img src="'.getFlag($r['flag']).'" alt="'.$r['country'].'" />&nbsp;&nbsp;';
} else {
$imagestring = '';
}
$winnerstring = '<strong>'.htmlspecialchars($r['g_winner_name'], ENT_COMPAT).'</strong>';
$achvd = "{$imagestring} <a href=\"hlstats.php?mode=playerinfo&amp;player={$r['g_winner_id']}&amp;game={$game}\">{$winnerstring}</a>";
$wincount = $r['g_winner_count'];
} else {
$achvd = "<em>No Award Winner</em>";
$wincount= "0";
}
echo "<td style=\"text-align:center;vertical-align:top;width:$colwidth%;\">
<strong>".$r['name'].'</strong><br /><br />'
."$weapon<br /><br />"
."$achvd<br />"
.'<span class="fSmall">'. $wincount . ' ' . htmlspecialchars($r['verb']).'</span>
</td>';
$i++;
}
if ($i != 0)
{
for ($i = $i; $i < $cols; $i++)
{
echo '<td class="bg1">&nbsp;</td>';
}
echo '</tr>';
}
?>
</table>
</div>
</div>

149
web/pages/awards_ranks.php Normal file
View File

@ -0,0 +1,149 @@
<?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.');
}
$result = $db->query("
SELECT
rankName,
minKills,
rankId,
count(playerId) AS obj_count
FROM
hlstats_Ranks
INNER JOIN
hlstats_Players
ON (
hlstats_Ranks.game=hlstats_Players.game
)
WHERE
kills>=minKills
AND kills<=maxKills
AND hlstats_Ranks.game='$game'
GROUP BY
rankName,
minKills
");
while ($r = $db->fetch_array())
{
$ranks[$r['rankId']] = $r['obj_count'];
}
// select the available ranks
$result = $db->query("
SELECT
rankName,
minKills,
maxKills,
rankId,
image
FROM
hlstats_Ranks
WHERE
hlstats_Ranks.game='$game'
ORDER BY
minKills
");
?>
<div class="block">
<?php printSectionTitle('Ranks'); ?>
<div class="subblock">
<table class="data-table">
<?php
// draw the rank info table (5 columns)
$i = 0;
$cols = $g_options['awardrankscols'];
if ($cols < 1 || $cols > 10) $cols = 5;
{
$colwidth = round(100 / $cols);
}
while ($r = $db->fetch_array())
{
if ($i == $cols)
{
echo "</tr>";
$i = 0;
}
if ($i == 0)
{
echo "<tr class='bg1'>";
}
$image = getImage('/ranks/'.$r['image'].'_small');
$link = '<a href="hlstats.php?mode=rankinfo&amp;rank='.$r['rankId']."&amp;game=$game\">";
if ($image)
{
$imagestring = '<img src="'.$image['url'].'" alt="'.$r['image'].'" />';
}
else
{
$imagestring = 'Player List';
}
$achvd = '';
if ($ranks[$r['rankId']] > 0)
{
$imagestring = "$link$imagestring</a>";
$achvd = 'Achieved by '.$ranks[$r['rankId']].' Players';
}
echo "<td style=\"text-align:center;vertical-align:top;width:$colwidth%;\">"
.'<strong>'.$r['rankName'].'</strong><br />'
.'<span class="fSmall">('.$r['minKills'].'-'.$r['maxKills'].'&nbsp;kills)'.'<br />'
."$achvd<br /></span>"
.$imagestring.'
</td>';
$i++;
}
if ($i != 0)
{
for ($i = $i; $i < $cols; $i++)
{
echo '<td class="bg1">&nbsp;</td>';
}
echo '</tr>';
}
?>
</table>
</div>
</div>

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.');
}
// select the available ribbons
$result = $db->query("
SELECT
hlstats_Ribbons.ribbonId,
ribbonName,
image,
name as awardName,
awardCount,
count(playerId) as achievedcount
FROM
hlstats_Ribbons
INNER JOIN
hlstats_Awards
ON (
awardCode=code
AND hlstats_Ribbons.game=hlstats_Awards.game
)
LEFT JOIN
hlstats_Players_Ribbons
ON (
hlstats_Ribbons.ribbonId=hlstats_Players_Ribbons.ribbonId
)
WHERE
hlstats_Ribbons.game='$game'
AND hlstats_Ribbons.special=0
GROUP BY
hlstats_Ribbons.ribbonId
ORDER BY
awardCount,
ribbonName,
awardCode
");
?>
<div class="block">
<?php printSectionTitle('Ribbons'); ?>
<div class="subblock">
<table class="data-table">
<?php
// draw the rank info table (5 columns)
$i = 0;
$i1 = 0;
$cnt = -1;
$cols = $g_options['awardribbonscols'];
if ($cols < 1 || $cols > 10)
{
$cols = 5;
}
$colwidth = round(100 / $cols);
while ($r = $db->fetch_array())
{
if ($cnt != $r['awardCount'])
{
$cnt = $r['awardCount'];
$i1++;
if ($i == $cols)
{
echo '</tr>';
}
$i = 0;
echo "<tr class=\"head\"><td colspan=\"5\"><strong>Ribbon Class #$i1 ($cnt awards required)</strong></td></tr>";
}
if ($i == $cols)
{
echo '</tr>';
$i = 0;
}
if ($i == 0)
{
echo '<tr class="bg1">';
}
$link = '<a href="hlstats.php?mode=ribboninfo&amp;ribbon='.$r['ribbonId']."&amp;game=$game\">";
if (file_exists(IMAGE_PATH."/games/$game/ribbons/".$r['image']))
{
$image = IMAGE_PATH."/games/$game/ribbons/".$r['image'];
}
elseif (file_exists(IMAGE_PATH."/games/$realgame/ribbons/".$r['image']))
{
$image = IMAGE_PATH."/games/$realgame/ribbons/".$r['image'];
}
else
{
$image = IMAGE_PATH."/award.png";
}
$image = '<img src="'.$image.'" alt="'.$r['ribbonName'].'" />';
$achvd = '';
if ($r['achievedcount'] > 0)
{
$image = "$link$image</a>";
$achvd = 'Achieved by '.$r['achievedcount'].' players';
}
echo "<td style=\"text-align:center;vertical-align:top;width:$colwidth%;\">
<strong>".$r['ribbonName'].'</strong><br /><br /><span class="fSmall">'
."$achvd</span><br />$image
</td>";
$i++;
}
if ($i != 0)
{
for ($i = $i; $i < $cols; $i++)
{
echo '<td class="bg1">&nbsp;</td>';
}
echo '</tr>';
}
?>
</table>
</div>
</div>

220
web/pages/bans.php Normal file
View File

@ -0,0 +1,220 @@
<?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.');
}
// Player Rankings
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
if (isset($_GET['minkills']))
{
$minkills = valid_request(intval($_GET['minkills']),1);
}
else
{
$minkills = 0;
}
pageHeader
(
array ($gamename, 'Cheaters &amp; Banned Players'),
array ($gamename=>"%s?game=$game", 'Cheaters &amp; Banned Players'=>'')
);
$table = new Table
(
array(
new TableColumn
(
'lastName',
'Player',
'width=26&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn
(
'ban_date',
'Ban Date',
'width=15&align=right'
),
new TableColumn
(
'skill',
'Points',
'width=6&align=right'
),
new TableColumn
(
'activity',
'Activity',
'width=10&sort=no&type=bargraph'
),
new TableColumn
(
'kills',
'Kills',
'width=5&align=right'
),
new TableColumn
(
'deaths',
'Deaths',
'width=5&align=right'
),
new TableColumn
(
'headshots',
'Headshots',
'width=7&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=10&align=right'
),
new TableColumn
(
'hpk',
'HS:K',
'width=5&align=right'
),
new TableColumn
(
'acc',
'Accuracy',
'width=6&align=right&append=' . urlencode('%')
)
),
'playerId',
'last_event',
'skill',
true
);
$day_interval = 28;
$resultCount = $db->query
("
SELECT
COUNT(*)
FROM
hlstats_Players
WHERE
hlstats_Players.game = '$game'
AND hlstats_Players.hideranking = 2
AND hlstats_Players.kills >= $minkills
");
list($numitems) = $db->fetch_row($resultCount);
$result = $db->query
("
SELECT
hlstats_Players.playerId,
FROM_UNIXTIME(last_event,'%Y.%m.%d %T') as ban_date,
hlstats_Players.flag,
unhex(replace(hex(hlstats_Players.lastName), 'E280AE', '')) as lastName,
hlstats_Players.skill,
hlstats_Players.kills,
hlstats_Players.deaths,
IFNULL(ROUND(hlstats_Players.kills / IF(hlstats_Players.deaths = 0, 1, hlstats_Players.deaths), 2), '-') AS kpd,
hlstats_Players.headshots,
IFNULL(ROUND(hlstats_Players.headshots / hlstats_Players.kills, 2), '-') AS hpk,
IFNULL(ROUND((hlstats_Players.hits / hlstats_Players.shots * 100), 0), 0) AS acc,
activity
FROM
hlstats_Players
WHERE
hlstats_Players.game = '$game'
AND hlstats_Players.hideranking = 2
AND hlstats_Players.kills >= $minkills
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder,
hlstats_Players.lastName ASC
LIMIT
$table->startitem,
$table->numperpage
");
?>
<div class="block">
<?php printSectionTitle('Cheaters &amp; Banned Players'); ?>
<div class="subblock">
<div style="float:left;">
<form method="get" action="<?php echo $g_options['scripturl']; ?>">
<input type="hidden" name="mode" value="search" />
<input type="hidden" name="game" value="<?php echo $game; ?>" />
<input type="hidden" name="st" value="player" />
<strong>&#8226;</strong> Find a player:
<input type="text" name="q" size="20" maxlength="64" class="textbox" />
<input type="submit" value="Search" class="smallsubmit" />
</form>
</div>
</div><br /><br />
<div style="clear:both;padding-top:4px;"></div>
<?php $table->draw($result, $numitems, 95); ?><br /><br />
<div class="subblock">
<div style="float:left;">
<form method="get" action="<?php echo $g_options['scripturl']; ?>">
<?php
foreach ($_GET as $k=>$v)
{
$v = valid_request($v, 0);
if ($k != "minkills")
{
echo "<input type=\"hidden\" name=\"" . htmlspecialchars($k) . "\" value=\"" . htmlspecialchars($v) . "\" />\n";
}
}
?>
<strong>&#8226;</strong> Show only players with
<input type="text" name="minkills" size="4" maxlength="2" value="<?php echo $minkills; ?>" class="textbox" /> or more kills from a total <strong><?php echo number_format($numitems); ?></strong> banned players
<input type="submit" value="Apply" class="smallsubmit" />
</form>
</div>
<div style="float:right;">
Go to: <a href="<?php echo $g_options["scripturl"] . "?game=$game"; ?>"><?php echo $gamename; ?></a>
</div>
</div>
</div>

331
web/pages/chat.php Normal file
View File

@ -0,0 +1,331 @@
<?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.');
}
// Global Server Chat History
$showserver=0;
if (isset($_GET['server_id']))
{
$showserver = valid_request(strval($_GET['server_id']), true);
}
if ($showserver == 0)
{
$whereclause = "hlstats_Servers.game='$game'";
}
else
{
$whereclause = "hlstats_Servers.game='$game' AND hlstats_Events_Chat.serverId=$showserver";
}
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
pageHeader
(
array ($gamename, 'Server Chat Statistics'),
array ($gamename=>"%s?game=$game", 'Server Chat Statistics'=>'')
);
flush();
$servername = "(All Servers)";
if ($showserver != 0)
{
$result=$db->fetch_array
(
$db->query
("
SELECT
hlstats_Servers.name
FROM
hlstats_Servers
WHERE
hlstats_Servers.serverId = ".$db->escape($showserver)."
")
);
$servername = "(" . $result['name'] . ")";
}
?>
<div class="block">
<?php printSectionTitle("$gamename $servername Server Chat Log (Last ".$g_options['DeleteDays'].' Days)'); ?>
<div class="subblock">
<div style="float:left;">
<span>
<form method="get" action="<?php echo $g_options['scripturl']; ?>" style="margin:0px;padding:0px;">
<input type="hidden" name="mode" value="chat" />
<input type="hidden" name="game" value="<?php echo $game; ?>" />
<strong>&#8226;</strong> Show Chat from
<?php
/*
$result = $db->query
("
SELECT
DISTINCT hlstats_Events_Chat.serverId,
hlstats_Servers.name
FROM
hlstats_Events_Chat
INNER JOIN
hlstats_Servers
ON
hlstats_Events_Chat.serverId = hlstats_Servers.serverId
AND hlstats_Servers.game='$game'
ORDER BY
hlstats_Servers.sortorder,
hlstats_Servers.name,
hlstats_Events_Chat.serverId ASC
LIMIT
0,
50
");
*/
$result = $db->query
("
SELECT
hlstats_Servers.serverId,
hlstats_Servers.name
FROM
hlstats_Servers
WHERE
hlstats_Servers.game='$game'
ORDER BY
hlstats_Servers.sortorder,
hlstats_Servers.name,
hlstats_Servers.serverId ASC
LIMIT
0,
50
");
echo '<select name="server_id"><option value="0">All Servers</option>';
$dates = array ();
$serverids = array();
while ($rowdata = $db->fetch_array())
{
$serverids[] = $rowdata['serverId'];
$dates[] = $rowdata;
if ($showserver == $rowdata['serverId'])
echo '<option value="'.$rowdata['serverId'].'" selected>'.$rowdata['name'].'</option>';
else
echo '<option value="'.$rowdata['serverId'].'">'.$rowdata['name'].'</option>';
}
echo '</select>';
$filter=isset($_REQUEST['filter'])?$_REQUEST['filter']:"";
?>
Filter: <input type="text" name="filter" value="<?php echo htmlentities($filter); ?>" />
<input type="submit" value="View" class="smallsubmit" />
</form>
</span>
</div>
</div>
<div style="clear:both;padding-top:20px;"></div>
<?php
if ($showserver == 0)
{
$table = new Table(
array
(
new TableColumn
(
'eventTime',
'Date',
'width=16'
),
new TableColumn
(
'lastName',
'Player',
'width=17&sort=no&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn
(
'message',
'Message',
'width=34&sort=no&embedlink=yes'
),
new TableColumn
(
'serverName',
'Server',
'width=23&sort=no'
),
new TableColumn
(
'map',
'Map',
'width=10&sort=no'
)
),
'playerId',
'eventTime',
'lastName',
false,
50,
"page",
"sort",
"sortorder"
);
}
else
{
$table = new Table(
array
(
new TableColumn
(
'eventTime',
'Date',
'width=16'
),
new TableColumn
(
'lastName',
'Player',
'width=24&sort=no&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn
(
'message',
'Message',
'width=44&sort=no&embedlink=yes'
),
new TableColumn
(
'map',
'Map',
'width=16&sort=no'
)
),
'playerId',
'eventTime',
'lastName',
false,
50,
"page",
"sort",
"sortorder"
);
}
$whereclause2='';
if(!empty($filter))
{
$whereclause2="AND MATCH (hlstats_Events_Chat.message) AGAINST ('" . $db->escape($filter) . "' in BOOLEAN MODE)";
}
$surl = $g_options['scripturl'];
$result = $db->query
("
SELECT SQL_NO_CACHE
hlstats_Events_Chat.eventTime,
unhex(replace(hex(hlstats_Players.lastName), 'E280AE', '')) as lastName,
IF(hlstats_Events_Chat.message_mode=2, CONCAT('(Team) ', hlstats_Events_Chat.message), IF(hlstats_Events_Chat.message_mode=3, CONCAT('(Squad) ', hlstats_Events_Chat.message), hlstats_Events_Chat.message)) AS message,
hlstats_Servers.name AS serverName,
hlstats_Events_Chat.playerId,
hlstats_Players.flag,
hlstats_Events_Chat.map
FROM
hlstats_Events_Chat
INNER JOIN
hlstats_Players
ON
hlstats_Players.playerId = hlstats_Events_Chat.playerId
INNER JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = hlstats_Events_Chat.serverId
WHERE
$whereclause $whereclause2
ORDER BY
hlstats_Events_Chat.id $table->sortorder
LIMIT
$table->startitem,
$table->numperpage;
", true, false);
/*
$whereclause = "hlstats_Events_Chat.serverId ";
if($showserver == 0) {
$whereclause .= "in (".implode($serverids,',').")";
} else {
$whereclause .= "= $showserver";
}
*/
$db->query
("
SELECT
count(*)
FROM
hlstats_Events_Chat
INNER JOIN
hlstats_Players
ON
hlstats_Players.playerId = hlstats_Events_Chat.playerId
INNER JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = hlstats_Events_Chat.serverId
WHERE
$whereclause $whereclause2
");
if ($db->num_rows() < 1) $numitems = 0;
else
{
list($numitems) = $db->fetch_row();
}
$db->free_result();
$table->draw($result, $numitems, 95);
?><br /><br />
<div class="subblock">
<div style="float:right;">
Go to: <a href="<?php echo $g_options["scripturl"] . "?game=$game"; ?>"><?php echo $gamename; ?></a>
</div>
</div>
</div>

220
web/pages/chathistory.php Normal file
View File

@ -0,0 +1,220 @@
<?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.');
}
// Player Chat History
$player = valid_request(intval($_GET['player']), 1)
or error('No player ID specified.');
$db->query
("
SELECT
unhex(replace(hex(hlstats_Players.lastName), 'E280AE', '')) as lastName,
hlstats_Players.game
FROM
hlstats_Players
WHERE
hlstats_Players.playerId = $player
");
if ($db->num_rows() != 1)
{
error("No such player '$player'.");
}
$playerdata = $db->fetch_array();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . '...';
}
else
{
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$game = $playerdata['game'];
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() != 1)
{
$gamename = ucfirst($game);
}
else
{
list($gamename) = $db->fetch_row();
}
pageHeader
(
array ($gamename, 'Chat History', $pl_name),
array
(
$gamename=>$g_options['scripturl'] . "?game=$game",
'Player Rankings'=>$g_options['scripturl'] . "?mode=players&game=$game",
'Player Details'=>$g_options['scripturl'] . "?mode=playerinfo&player=$player",
'Chat History'=>''
),
$playername
);
flush();
$table = new Table
(
array
(
new TableColumn
(
'eventTime',
'Date',
'width=16'
),
new TableColumn
(
'message',
'Message',
'width=44&sort=no&append=.&embedlink=yes'
),
new TableColumn
(
'serverName',
'Server',
'width=24'
),
new TableColumn
(
'map',
'Map',
'width=16'
)
),
'eventTime',
'eventTime',
'serverName',
false,
50,
'page',
'sort',
'sortorder'
);
$surl = $g_options['scripturl'];
$whereclause="hlstats_Events_Chat.playerId = $player ";
$filter=isset($_REQUEST['filter'])?$_REQUEST['filter']:"";
if(!empty($filter))
{
$whereclause.="AND MATCH (hlstats_Events_Chat.message) AGAINST ('" . $db->escape($filter) . "' in BOOLEAN MODE)";
}
$result = $db->query
("
SELECT
hlstats_Events_Chat.eventTime,
IF(hlstats_Events_Chat.message_mode=2, CONCAT('(Team) ', hlstats_Events_Chat.message), IF(hlstats_Events_Chat.message_mode=3, CONCAT('(Squad) ', hlstats_Events_Chat.message), hlstats_Events_Chat.message)) AS message,
hlstats_Servers.name AS serverName,
hlstats_Events_Chat.map
FROM
hlstats_Events_Chat
LEFT JOIN
hlstats_Servers
ON
hlstats_Events_Chat.serverId = hlstats_Servers.serverId
WHERE
$whereclause
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT
$table->startitem,
$table->numperpage
");
$resultCount = $db->query
("
SELECT
COUNT(*)
FROM
hlstats_Events_Chat
LEFT JOIN
hlstats_Servers
ON
hlstats_Events_Chat.serverId = hlstats_Servers.serverId
WHERE
$whereclause
");
list($numitems) = $db->fetch_row($resultCount);
?>
<div class="block">
<?php
printSectionTitle('Player Chat History (Last '.$g_options['DeleteDays'].' Days)');
?>
<div class="subblock">
<div style="float:left;">
<span>
<form method="get" action="<?php echo $g_options['scripturl']; ?>" style="margin:0px;padding:0px;">
<input type="hidden" name="mode" value="chathistory" />
<input type="hidden" name="player" value="<?php echo $player; ?>" />
<strong>&#8226;</strong>
Filter: <input type="text" name="filter" value="<?php echo htmlentities($filter); ?>" />
<input type="submit" value="View" class="smallsubmit" />
</form>
</span>
</div>
</div>
<div style="clear: both; padding-top: 20px;"></div>
<?php
if ($numitems > 0)
{
$table->draw($result, $numitems, 95);
}
?><br /><br />
<div class="subblock">
<div style="float:right;">
Go to: <a href="<?php echo $g_options['scripturl'] . "?mode=playerinfo&amp;player=$player"; ?>"><?php echo $pl_name; ?>'s Statistics</a>
</div>
</div>
</div>

211
web/pages/claninfo.php Normal file
View File

@ -0,0 +1,211 @@
<?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
http://ovrsized.neo-soft.org/
Copyleft (L) 2008-20XX Malte Bayer (steam@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://ovrsized.neo-soft.org!
*/
if ( !defined('IN_HLSTATS') )
{
die('Do not access this file directly.');
}
// Clan Details
$clan = valid_request(intval($_GET["clan"]), 1)
or error("No clan ID specified.");
$db->query("
SELECT
hlstats_Clans.tag,
hlstats_Clans.name,
hlstats_Clans.homepage,
hlstats_Clans.game,
hlstats_Clans.mapregion,
SUM(hlstats_Players.kills) AS kills,
SUM(hlstats_Players.deaths) AS deaths,
SUM(hlstats_Players.headshots) AS headshots,
SUM(hlstats_Players.connection_time) AS connection_time,
COUNT(hlstats_Players.playerId) AS nummembers,
ROUND(AVG(hlstats_Players.skill)) AS avgskill,
TRUNCATE(AVG(activity),2) as activity
FROM
hlstats_Clans
LEFT JOIN
hlstats_Players
ON
hlstats_Players.clan = hlstats_Clans.clanId
WHERE
hlstats_Clans.clanId=$clan
AND hlstats_Players.hideranking = 0
GROUP BY
hlstats_Clans.clanId
");
if ($db->num_rows() != 1)
{
error("No such clan '$clan'.");
}
$clandata = $db->fetch_array();
$realkills = ($clandata['kills'] == 0) ? 1 : $clandata['kills'];
$realheadshots = ($clandata['headshots'] == 0) ? 1 : $clandata['headshots'];
$db->query("
SELECT
count(playerId)
FROM
hlstats_Players
WHERE
clan=$clan
GROUP BY
clan
");
list($totalclanplayers) = $db->fetch_array();
$db->free_result();
$cl_name = preg_replace('/\s/', '&nbsp;', htmlspecialchars($clandata['name']));
$cl_tag = preg_replace('/\s/', '&nbsp;', htmlspecialchars($clandata['tag']));
$cl_full = "$cl_tag $cl_name";
$game = $clandata['game'];
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
{
$gamename = ucfirst($game);
}
else
{
list($gamename) = $db->fetch_row();
}
if ( $_GET['type'] == 'ajax' )
{
unset($_GET['type']);
$tabs = explode('|', preg_replace('[^a-z]', '', $_GET['tab']));
foreach ( $tabs as $tab )
{
if ( file_exists(PAGE_PATH . '/claninfo_' . $tab . '.php') )
{
@include(PAGE_PATH . '/claninfo_' . $tab . '.php');
}
}
exit;
}
pageHeader(
array($gamename, 'Clan Details', $cl_full),
array(
$gamename=>$g_options['scripturl'] . "?game=$game",
'Clan Rankings'=>$g_options['scripturl'] . "?mode=clans&game=$game",
'Clan Details'=>''
),
$clandata['name']
);
if ( $g_options['show_google_map'] == 1 ) {
echo ('<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>');
}
?>
<div class="block" id="main">
<?php
// insert details pages here
if ($g_options['playerinfo_tabs'] == '1')
{
?>
<ul class="subsection_tabs" id="tabs_claninfo">
<li>
<a href="#" id="tab_general" id="general">General</a>
</li>
<li>
<a href="#" id="tab_actions|teams">Teams &amp; Actions</a>
</li>
<li>
<a href="#" id="tab_weapons">Weapons</a>
</li>
<li>
<a href="#" id="tab_mapperformance">Maps</a>
</li>
</ul><br />
<div id="main_content"></div>
<script type="text/javascript">
var Tabs = new Tabs($('main_content'), $$('#main ul.subsection_tabs a'), {
'mode': 'claninfo',
'game': '<?php echo $game; ?>',
'loadingImage': '<?php echo IMAGE_PATH; ?>/ajax.gif',
'defaultTab': 'general',
'extra': {'clan': '<?php echo $clan; ?>','members_page': '<?php echo valid_request($_GET['members_page'], true); ?>'}
});
</script>
<?php
} else {
echo "\n<div id=\"tabgeneral\">\n";
require_once PAGE_PATH.'/claninfo_general.php';
echo '</div>';
echo "\n<div id=\"tabteams\">\n";
require_once PAGE_PATH.'/claninfo_actions.php';
require_once PAGE_PATH.'/claninfo_teams.php';
echo '</div>';
echo "\n<div id=\"tabweapons\">\n";
require_once PAGE_PATH.'/claninfo_weapons.php';
echo '</div>';
echo "\n<div id=\"tabmaps\">\n";
require_once PAGE_PATH.'/claninfo_mapperformance.php';
echo '</div>';
}
?>
<div class="block" style="clear:both;padding-top:12px;">
<div class="subblock">
<div style="float:left;">
Items marked "*" above are generated from the last <?php echo $g_options['DeleteDays']; ?> days.
</div>
<div style="float:right;">
<?php
if (isset($_SESSION['loggedin']))
{
echo 'Admin Options: <a href="'.$g_options['scripturl']."?mode=admin&amp;task=tools_editdetails_clan&amp;id=$clan\">Edit Clan Details</a><br />";
}
?>
Go to: <a href="<?php echo $g_options['scripturl'] . "?mode=players&amp;game=$game"; ?>">Clan Rankings</a>
</div>
</div>
</div>

View File

@ -0,0 +1,195 @@
<?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.');
}
flush();
$tblPlayerActions = new Table(
array(
new TableColumn(
'description',
'Action',
'width=45&link=' . urlencode("mode=actioninfo&amp;action=%k&amp;game=$game")
),
new TableColumn(
'obj_count',
'Achieved',
'width=25&align=right&append=+times'
),
new TableColumn(
'obj_bonus',
'Points Bonus',
'width=25&align=right'
)
),
'code',
'obj_count',
'description',
true,
9999,
'obj_page',
'obj_sort',
'obj_sortorder',
'tabteams',
'desc',
true
);
$result = $db->query("
(SELECT
code,
hlstats_Actions.description,
COUNT(hlstats_Events_PlayerActions.id) AS obj_count,
SUM(hlstats_Events_PlayerActions.bonus) AS obj_bonus
FROM
hlstats_Actions
LEFT JOIN
hlstats_Events_PlayerActions
ON
hlstats_Events_PlayerActions.actionId = hlstats_Actions.id
LEFT JOIN
hlstats_Players
ON
hlstats_Players.playerId=hlstats_Events_PlayerActions.playerId
WHERE
clan=$clan
GROUP BY
hlstats_Actions.id)
UNION ALL
(SELECT
code,
hlstats_Actions.description,
COUNT(hlstats_Events_PlayerPlayerActions.id) AS obj_count,
SUM(hlstats_Events_PlayerPlayerActions.bonus) AS obj_bonus
FROM
hlstats_Actions
LEFT JOIN
hlstats_Events_PlayerPlayerActions
ON
hlstats_Events_PlayerPlayerActions.actionId = hlstats_Actions.id
LEFT JOIN
hlstats_Players
ON
hlstats_Players.playerId=hlstats_Events_PlayerPlayerActions.playerId
WHERE
clan=$clan
GROUP BY
hlstats_Actions.id)
ORDER BY
$tblPlayerActions->sort $tblPlayerActions->sortorder,
$tblPlayerActions->sort2 $tblPlayerActions->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
printSectionTitle('Player Actions *');
$tblPlayerActions->draw($result, $numitems, 95);
?>
<br /><br />
<?php
}
$tblPlayerPlayerActionsV = new Table(
array(
new TableColumn(
'description',
'Action',
'width=45&link=' . urlencode("mode=actioninfo&amp;action=%k&amp;game=$game#victims")
),
new TableColumn(
'obj_count',
'Times Victimized',
'width=25&align=right&append=+times'
),
new TableColumn(
'obj_bonus',
'Points Bonus',
'width=25&align=right'
)
),
'code',
'obj_count',
'description',
true,
9999,
'ppa_page',
'ppa_sort',
'ppa_sortorder',
'tabteams',
'desc',
true
);
$result = $db->query("
SELECT
code,
hlstats_Actions.description,
COUNT(hlstats_Events_PlayerPlayerActions.id) AS obj_count,
SUM(hlstats_Events_PlayerPlayerActions.bonus) * -1 AS obj_bonus
FROM
hlstats_Actions
LEFT JOIN hlstats_Events_PlayerPlayerActions ON
hlstats_Events_PlayerPlayerActions.actionId = hlstats_Actions.id
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId=hlstats_Events_PlayerPlayerActions.victimId
WHERE
clan=$clan
GROUP BY
hlstats_Actions.id
ORDER BY
$tblPlayerPlayerActionsV->sort $tblPlayerPlayerActionsV->sortorder,
$tblPlayerPlayerActionsV->sort2 $tblPlayerPlayerActionsV->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
printSectionTitle('Victims of Player-Player Actions *');
$tblPlayerPlayerActionsV->draw($result, $numitems, 95);
?>
<br /><br />
<?php
}
?>

View File

@ -0,0 +1,416 @@
<?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.');
}
printSectionTitle('Clan Information');
?>
<div class="subblock">
<div style="float:left;vertical-align:top;width:48.5%;">
<table class="data-table">
<tr class="data-table-head">
<td colspan="3">Statistics Summary</td>
</tr>
<tr class="bg1">
<td>Clan:</td>
<td colspan="2"><strong><?php echo $clandata['name']; ?></strong></td>
</tr>
<tr class="bg2">
<td>Home Page:</td>
<td colspan="2"><?php
if ($url = getLink($clandata['homepage']))
{
echo $url;
}
else
{
echo '(Not specified.)';
}
?></td>
</tr>
<tr class="bg1">
<td style="width:45%;">Activity:</td>
<td style="width:40%;"><?php
$width = sprintf("%d%%", $clandata['activity'] + 0.5);
$bar_type = 1;
if ($clandata['activity'] > 40)
$bar_type = "6";
elseif ($clandata['activity'] > 30)
$bar_type = "5";
elseif ($clandata['activity'] > 20)
$bar_type = "4";
elseif ($clandata['activity'] > 10)
$bar_type = "3";
elseif ($clandata['activity'] > 5)
$bar_type = "2";
echo "<img src=\"" . IMAGE_PATH . "/bar$bar_type.gif\" style=\"width:$width;height:10px;\" alt=\"".$clandata['activity']."%\" />";
?></td>
<td style="width:15%"><?php
echo sprintf('%0.2f', $clandata['activity']).'%';
?></td>
</tr>
<tr class="bg2">
<td>Members:</td>
<td colspan="2"><?php
echo $clandata['nummembers'].
" active members ($totalclanplayers total)";
?></td>
</tr>
<tr class="bg1">
<td>Avg. Member Points:</td>
<td colspan="2"><strong><?php
echo number_format($clandata['avgskill']);
?></strong></td>
</tr>
<tr class="bg2">
<td>Total Kills:</td>
<td colspan="2"><?php
echo number_format($clandata['kills']);
?></td>
</tr>
<tr class="bg1">
<td>Total Deaths:</td>
<td colspan="2"><?php
echo number_format($clandata['deaths']);
?></td>
</tr>
<tr class="bg2">
<td>Avg. Kills:</td>
<td colspan="2"><?php
echo number_format($clandata['kills'] / ($clandata['nummembers']));
?></td>
</tr>
<tr class="bg1">
<td>Kills per Death:</td>
<td colspan="2"><?php
if ($clandata['deaths'] != 0)
{
echo sprintf('<strong>%0.2f</strong>', $clandata['kills'] / $clandata['deaths']);
}
else
{
echo '-';
}
?></td>
</tr>
<tr class="bg2">
<td style="width:45%;">Kills per Minute:</td>
<td colspan="2" style="width:55%;"><?php
if ($clandata['connection_time'] > 0) {
echo sprintf("%.2f", ($clandata['kills'] / ($clandata['connection_time'] / 60)));
} else {
echo '-';
}
?></td>
</tr>
<tr class="bg1">
<td>Total Connection Time:</td>
<td colspan="2"><?php
echo timestamp_to_str($clandata['connection_time']);
?></td>
</tr>
<tr class="bg2">
<td>Avg. Connection Time:</td>
<td colspan="2"><?php
if ($clandata['connection_time'] > 0) {
echo timestamp_to_str($clandata['connection_time'] / ($clandata['nummembers']));
} else {
echo '-';
}
?></td>
</tr>
<tr class="bg1">
<td>Favorite Server:*</td>
<td colspan="2"><?php
$db->query("
SELECT
hlstats_Events_Entries.serverId,
hlstats_Servers.name,
COUNT(hlstats_Events_Entries.serverId) AS cnt
FROM
hlstats_Events_Entries
INNER JOIN
hlstats_Servers
ON
hlstats_Servers.serverId=hlstats_Events_Entries.serverId
INNER JOIN
hlstats_Players
ON
(hlstats_Events_Entries.playerId=hlstats_Players.playerId)
WHERE
clan=$clan
GROUP BY
hlstats_Events_Entries.serverId
ORDER BY
cnt DESC
LIMIT 1
");
list($favServerId,$favServerName) = $db->fetch_row();
echo "<a href='hlstats.php?game=$game&amp;mode=servers&amp;server_id=$favServerId'> $favServerName </a>";
?></td>
</tr>
<tr class="bg2">
<td>Favorite Map:*</td>
<td colspan="2"><?php
$db->query("
SELECT
hlstats_Events_Entries.map,
COUNT(map) AS cnt
FROM
hlstats_Events_Entries
INNER JOIN
hlstats_Players
ON
(hlstats_Events_Entries.playerId=hlstats_Players.playerId)
WHERE
clan=$clan
GROUP BY
hlstats_Events_Entries.map
ORDER BY
cnt DESC
LIMIT 1
");
list($favMap) = $db->fetch_row();
echo "<a href='hlstats.php?game=$game&amp;mode=mapinfo&amp;map=$favMap'> $favMap </a>";
?></td>
</tr>
<tr class="bg1">
<td>Favorite Weapon:*</td>
<td colspan="2"><?php
$result = $db->query("
SELECT
hlstats_Events_Frags.weapon,
hlstats_Weapons.name,
COUNT(hlstats_Events_Frags.weapon) AS kills,
SUM(hlstats_Events_Frags.headshot=1) as headshots
FROM
hlstats_Events_Frags
INNER JOIN
hlstats_Weapons
ON
hlstats_Weapons.code = hlstats_Events_Frags.weapon
INNER JOIN
hlstats_Players
ON
hlstats_Events_Frags.killerId=hlstats_Players.playerId
WHERE
clan=$clan
AND
hlstats_Weapons.game='$game'
GROUP BY
hlstats_Events_Frags.weapon
ORDER BY
kills desc, headshots desc
LIMIT 1
");
while ($rowdata = $db->fetch_row($result))
{
$fav_weapon = $rowdata[0];
$weap_name = htmlspecialchars($rowdata[1]);
}
if ($fav_weapon == '')
$fav_weapon = 'Unknown';
$image = getImage("/games/$game/weapons/$fav_weapon");
// check if image exists
$weaponlink = "<a href=\"hlstats.php?mode=weaponinfo&amp;weapon=$fav_weapon&amp;game=$game\">";
$cellbody = "$weaponlink<img src=\"" . $image['url'] . "\" alt=\"$weap_name\" title=\"$weap_name\" />";
if ($image) {
} else {
$cellbody = "$weaponlink<strong> $weaponlink$weap_name</strong>";
}
$cellbody .= "</a>";
echo $cellbody;
?></td>
</tr>
</table>
</div>
<div style="float:right;vertical-align:top;width:48.5%;">
<table class="data-table">
<tr class="data-table-head">
<td colspan="3">Player Locations</td>
</tr>
<tr class="bg1">
<td>
<div id="map" style="margin:10px auto;width: 430px; height: 290px;"></div>
</td>
</tr>
</table>
</div>
</div><br />
<?php
flush();
$tblMembers = new Table(
array(
new TableColumn(
'lastName',
'Name',
'width=32&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn(
'skill',
'Points',
'width=6&align=right'
),
new TableColumn(
'activity',
'Activity',
'width=10&sort=no&type=bargraph'
),
new TableColumn(
'connection_time',
'Time',
'width=13&align=right&type=timestamp'
),
new TableColumn(
'kills',
'Kills',
'width=6&align=right'
),
new TableColumn(
'percent',
'Clan Kills',
'width=10&sort=no&type=bargraph'
),
new TableColumn(
'percent',
'%',
'width=6&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'deaths',
'Deaths',
'width=6&align=right'
),
new TableColumn(
'kpd',
'Kpd',
'width=6&align=right'
),
),
'playerId',
'skill',
'kpd',
true,
20,
'members_page',
'members_sort',
'members_sortorder',
'members',
'desc',
true
);
$result = $db->query("
SELECT
hlstats_Players.playerId,
hlstats_Players.lastName,
hlstats_Players.country,
hlstats_Players.flag,
hlstats_Players.skill,
hlstats_Players.connection_time,
hlstats_Players.kills,
hlstats_Players.deaths,
ROUND(hlstats_Players.kills / IF(hlstats_Players.deaths = 0, 1, hlstats_Players.deaths), 2) AS kpd,
ROUND(hlstats_Players.kills / IF(" . $clandata['kills'] . " = 0, 1, ". $clandata['kills'] .") * 100, 2) AS percent,
activity
FROM
hlstats_Players
WHERE
hlstats_Players.clan=$clan
AND hlstats_Players.hideranking = 0
GROUP BY
hlstats_Players.playerId
ORDER BY
$tblMembers->sort $tblMembers->sortorder,
$tblMembers->sort2 $tblMembers->sortorder,
hlstats_Players.skill DESC
LIMIT $tblMembers->startitem,$tblMembers->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(*)
FROM
hlstats_Players
WHERE
hlstats_Players.clan=$clan
AND hlstats_Players.hideranking = 0
");
list($numitems) = $db->fetch_row($resultCount);
?>
<div style="clear:both;padding-top:20px;"></div>
<?php
printSectionTitle('Members');
$tblMembers->draw($result, $numitems, 95);
?>
<br /><br />
<?php
if ( $g_options['show_google_map'] == 1 ) {
include(INCLUDE_PATH . '/google_maps.php');
printMap('clan');
}
?>

View File

@ -0,0 +1,169 @@
<?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.');
}
flush();
$tblMaps = new Table(
array(
new TableColumn(
'map',
'Map Name',
'width=15&align=left&link=' . urlencode("mode=mapinfo&amp;map=%k&amp;game=$game")
),
new TableColumn(
'kills',
'Kills',
'width=6&align=right'
),
new TableColumn(
'kpercent',
'Percentage of Kills',
'width=15&sort=no&type=bargraph'
),
new TableColumn(
'kpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'deaths',
'Deaths',
'width=6&align=right'
),
new TableColumn(
'kpd',
'Kills per Death',
'width=13&align=right'
),
new TableColumn(
'headshots',
'Headshots',
'width=9&align=right'
),
new TableColumn(
'hpercent',
'Percentage of Headshots',
'width=16&sort=no&type=bargraph'
),
new TableColumn(
'hpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'hpk',
'Hpk',
'width=5&align=right'
)
),
'map',
'kills',
'kills',
true,
9999,
'maps_page',
'maps_sort',
'maps_sortorder',
'tabmaps',
'desc',
true
);
$db->query("
CREATE TEMPORARY TABLE tmp_clan_kills
SELECT
IF(map='', '(Unaccounted)', map) AS map,
COUNT(*) AS kills,
SUM(headshot=1) AS headshots
FROM
hlstats_Events_Frags, hlstats_Players
WHERE
hlstats_Players.playerId = hlstats_Events_Frags.killerId
AND hlstats_Players.clan = $clan
GROUP BY
map;
");
$db->query("
CREATE TEMPORARY TABLE tmp_clan_deaths
SELECT
IF(map='', '(Unaccounted)', map) AS map,
COUNT(*) AS deaths
FROM
hlstats_Events_Frags, hlstats_Players
WHERE
hlstats_Players.playerId = hlstats_Events_Frags.victimId
AND hlstats_Players.clan = $clan
GROUP BY
map;
");
$result = $db->query("
SELECT *,
IFNULL(kills/deaths, '-') AS kpd,
IFNULL(headshots / kills, '-') AS hpk,
ROUND(kills / $realkills * 100, 2) AS kpercent,
ROUND(headshots / $realheadshots * 100, 2) AS hpercent
FROM
tmp_clan_kills, tmp_clan_deaths
WHERE
tmp_clan_kills.map = tmp_clan_deaths.map
ORDER BY
$tblMaps->sort $tblMaps->sortorder,
$tblMaps->sort2 $tblMaps->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
?>
<div style="clear:both;padding-top:20px;"></div>
<?php
printSectionTitle('Map Performance *');
$tblMaps->draw($result, $db->num_rows($result), 95);
?>
<br /><br />
<?php
}
?>

View File

@ -0,0 +1,342 @@
<?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.');
}
flush();
$tblTeams = new Table(
array(
new TableColumn(
'name',
'Team',
'width=35'
),
new TableColumn(
'teamcount',
'Joined',
'width=10&align=right&append=+times'
),
new TableColumn(
'percent',
'Percentage of Times',
'width=40&sort=no&type=bargraph'
),
new TableColumn(
'percent',
'%',
'width=10&sort=no&align=right&append=' . urlencode('%')
)
),
'name',
'teamcount',
'name',
true,
9999,
'teams_page',
'teams_sort',
'teams_sortorder',
'tabteams',
'desc',
true
);
$db->query("
SELECT
COUNT(*)
FROM
hlstats_Events_ChangeTeam
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId=hlstats_Events_ChangeTeam.playerId
WHERE
clan=$clan
");
list($numteamjoins) = $db->fetch_row();
$result = $db->query("SELECT `code`,`name` FROM hlstats_Roles WHERE game='$game'");
while ($rowdata = $db->fetch_row($result))
{
$code = preg_replace("/[ \r\n\t]+/", '', $rowdata[0]);
$fname[strToLower($code)] = htmlspecialchars($rowdata[1]);
}
$result = $db->query("
SELECT
IFNULL(hlstats_Teams.name, hlstats_Events_ChangeTeam.team) AS name,
COUNT(hlstats_Events_ChangeTeam.id) AS teamcount,
ROUND(COUNT(hlstats_Events_ChangeTeam.id) / IF($numteamjoins = 0, 1, $numteamjoins) * 100, 2) AS percent
FROM
hlstats_Events_ChangeTeam
LEFT JOIN hlstats_Teams ON
hlstats_Events_ChangeTeam.team=hlstats_Teams.code
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId=hlstats_Events_ChangeTeam.playerId
WHERE
clan=$clan
AND hlstats_Teams.game='$game'
AND (hidden <>'1' OR hidden IS NULL)
GROUP BY
hlstats_Events_ChangeTeam.team
ORDER BY
$tblTeams->sort $tblTeams->sortorder,
$tblTeams->sort2 $tblTeams->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
printSectionTitle('Team Selection *');
$tblTeams->draw($result, $numitems, 95);
?>
<br /><br />
<?php
}
flush();
$tblRoles = new Table(
array
(
new TableColumn
(
'code',
'Role',
'width=25&type=roleimg&align=left&link=' . urlencode("mode=rolesinfo&amp;role=%k&amp;game=$game"),
$fname
),
new TableColumn
(
'rolecount',
'Joined',
'width=10&align=right&append=+times'
),
new TableColumn
(
'percent',
'%',
'width=10&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'percent',
'Ratio',
'width=20&sort=no&type=bargraph'
),
new TableColumn
(
'killsTotal',
'Kills',
'width=10&align=right'
),
new TableColumn
(
'deathsTotal',
'Deaths',
'width=10&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=10&align=right'
)
),
'code',
'rolecount',
'name',
true,
9999,
'roles_page',
'roles_sort',
'roles_sortorder',
'roles',
'desc',
true
);
$db->query("DROP TABLE IF EXISTS hlstats_Frags_as");
$db->query("
CREATE TEMPORARY TABLE hlstats_Frags_as
(
playerId INT(10),
kills INT(10),
deaths INT(10),
role varchar(128) NOT NULL default ''
)
");
$db->query("
INSERT INTO
hlstats_Frags_as
(
playerId,
kills,
role
)
SELECT
victimId,
killerId,
killerRole
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId LEFT JOIN hlstats_Players ON
hlstats_Players.playerId = hlstats_Events_Frags.killerId
WHERE
hlstats_Servers.game='$game' AND clan = $clan
");
$db->query("
INSERT INTO
hlstats_Frags_as
(
playerId,
deaths,
role
)
SELECT
killerId,
victimId,
victimRole
FROM
hlstats_Events_Frags
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = hlstats_Events_Frags.serverId
LEFT JOIN
hlstats_Players
ON
hlstats_Players.playerId = hlstats_Events_Frags.victimId
WHERE
hlstats_Servers.game='$game' AND clan = $clan
");
$db->query("DROP TABLE IF EXISTS hlstats_Frags_as_res");
$db->query("
CREATE TEMPORARY TABLE hlstats_Frags_as_res
(
killsTotal INT(10),
deathsTotal INT(10),
role varchar(128) NOT NULL default ''
)
");
$db->query("
INSERT INTO
hlstats_Frags_as_res
(
killsTotal,
deathsTotal,
role
)
SELECT
COUNT(hlstats_Frags_as.kills) AS kills,
COUNT(hlstats_Frags_as.deaths) AS deaths,
role
from hlstats_Frags_as GROUP by role
");
$db->query("
SELECT
COUNT(*)
FROM
hlstats_Events_ChangeRole
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId=hlstats_Events_ChangeRole.playerId
WHERE
clan=$clan
");
list($numrolejoins) = $db->fetch_row();
$result = $db->query("
SELECT
IFNULL(hlstats_Roles.name, hlstats_Events_ChangeRole.role) AS name,
IFNULL(hlstats_Roles.code, hlstats_Events_ChangeRole.role) AS code,
COUNT(hlstats_Events_ChangeRole.id) AS rolecount,
ROUND(COUNT(hlstats_Events_ChangeRole.id) / IF($numrolejoins = 0, 1, $numrolejoins) * 100, 2) AS percent,
killsTotal,
deathsTotal,
ROUND(killsTotal/if(deathsTotal=0,1,deathsTotal), 2) AS kpd
FROM
hlstats_Events_ChangeRole
LEFT JOIN
hlstats_Roles
ON
hlstats_Events_ChangeRole.role = hlstats_Roles.code
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = hlstats_Events_ChangeRole.serverId
LEFT JOIN
hlstats_Frags_as_res
ON
hlstats_Frags_as_res.role = hlstats_Events_ChangeRole.role
LEFT JOIN
hlstats_Players
ON
hlstats_Players.playerId = hlstats_Events_ChangeRole.playerId
WHERE
hlstats_Servers.game='$game'
AND hlstats_Players.clan=$clan
AND (hidden <>'1' OR hidden IS NULL)
AND hlstats_Roles.game = '$game'
GROUP BY
hlstats_Events_ChangeRole.role
ORDER BY
$tblRoles->sort $tblRoles->sortorder,
$tblRoles->sort2 $tblRoles->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
printSectionTitle('Role Selection *');
$tblRoles->draw($result, $numitems, 95);
?>
<br /><br />
<?php
}
?>

View File

@ -0,0 +1,635 @@
<?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.');
}
flush();
$realgame = getRealGame($game);
$result = $db->query("SELECT `code`,`name` FROM hlstats_Weapons WHERE game='$game'");
while ($rowdata = $db->fetch_row($result))
{
$code = $rowdata[0];
$fname[$code] = htmlspecialchars($rowdata[1]);
}
$tblWeapons = new Table(
array(
new TableColumn(
'weapon',
'Weapon',
'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&amp;weapon=%k&amp;game=$game"),
$fname
),
new TableColumn(
'modifier',
'Points Modifier',
'width=10&align=right'
),
new TableColumn(
'kills',
'Kills',
'width=11&align=right'
),
new TableColumn(
'kpercent',
'Percentage of Kills',
'width=18&sort=no&type=bargraph'
),
new TableColumn(
'kpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'headshots',
'Headshots',
'width=8&align=right'
),
new TableColumn(
'hpercent',
'Percentage of Headshots',
'width=18&sort=no&type=bargraph'
),
new TableColumn(
'hpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'hpk',
'Hpk',
'width=5&align=right'
)
),
'weapon',
'kills',
'weapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'tabweapons',
'desc',
true
);
$result = $db->query("
SELECT
hlstats_Events_Frags.weapon,
IFNULL(hlstats_Weapons.modifier, 1.00) AS modifier,
COUNT(hlstats_Events_Frags.weapon) AS kills,
ROUND(COUNT(hlstats_Events_Frags.weapon) / $realkills * 100, 2) AS kpercent,
SUM(hlstats_Events_Frags.headshot=1) as headshots,
ROUND(SUM(hlstats_Events_Frags.headshot=1) / IF(COUNT(hlstats_Events_Frags.weapon) = 0, 1, COUNT(hlstats_Events_Frags.weapon)), 2) AS hpk,
ROUND(SUM(hlstats_Events_Frags.headshot=1) / $realheadshots * 100, 2) AS hpercent
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Weapons ON
hlstats_Weapons.code = hlstats_Events_Frags.weapon
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId=hlstats_Events_Frags.killerId
WHERE
clan=$clan
AND
hlstats_Weapons.game='$game'
GROUP BY
hlstats_Events_Frags.weapon
ORDER BY
$tblWeapons->sort $tblWeapons->sortorder,
$tblWeapons->sort2 $tblWeapons->sortorder
");
printSectionTitle('Weapon Usage *');
$tblWeapons->draw($result, $db->num_rows($result), 95);
?>
<br /><br />
<!-- Begin StatsMe Addon 1.0 by JustinHoMi@aol.com -->
<?php
flush();
$tblWeaponstats = new Table(
array(
new TableColumn(
'smweapon',
'Weapon',
'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&amp;weapon=%k&amp;game=$game"),
$fname
),
new TableColumn(
'smshots',
'Shots',
'width=8&align=right'
),
new TableColumn(
'smhits',
'Hits',
'width=8&align=right'
),
new TableColumn(
'smdamage',
'Damage',
'width=8&align=right'
),
new TableColumn(
'smheadshots',
'Headshots',
'width=8&align=right'
),
new TableColumn(
'smkills',
'Kills',
'width=7&align=right'
),
new TableColumn(
'smkdr',
'Kills per Death',
'width=12&align=right'
),
new TableColumn(
'smaccuracy',
'Accuracy',
'width=8&align=right&append=' . urlencode('%')
),
new TableColumn(
'smdhr',
'Damage per Hit',
'width=10&align=right'
),
new TableColumn(
'smspk',
'Shots per Kill',
'width=11&align=right'
)
),
'smweapon',
'smkills',
'smweapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'tabweapons',
'desc',
true
);
$result = $db->query("
SELECT
hlstats_Events_Statsme.weapon AS smweapon,
SUM(hlstats_Events_Statsme.kills) AS smkills,
SUM(hlstats_Events_Statsme.hits) AS smhits,
SUM(hlstats_Events_Statsme.shots) AS smshots,
SUM(hlstats_Events_Statsme.headshots) AS smheadshots,
SUM(hlstats_Events_Statsme.deaths) AS smdeaths,
SUM(hlstats_Events_Statsme.damage) AS smdamage,
ROUND((SUM(hlstats_Events_Statsme.damage) / (IF( SUM(hlstats_Events_Statsme.hits)=0, 1, SUM(hlstats_Events_Statsme.hits) ))), 1) as smdhr,
SUM(hlstats_Events_Statsme.kills) / IF((SUM(hlstats_Events_Statsme.deaths)=0), 1, (SUM(hlstats_Events_Statsme.deaths))) as smkdr,
ROUND((SUM(hlstats_Events_Statsme.hits) / SUM(hlstats_Events_Statsme.shots) * 100), 1) as smaccuracy,
ROUND(( (IF(SUM(hlstats_Events_Statsme.kills)=0, 0, SUM(hlstats_Events_Statsme.shots))) / (IF( SUM(hlstats_Events_Statsme.kills)=0, 1, SUM(hlstats_Events_Statsme.kills) ))), 1) as smspk
FROM
hlstats_Events_Statsme
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId=hlstats_Events_Statsme.playerId
WHERE
clan=$clan
GROUP BY
hlstats_Events_Statsme.weapon
HAVING
SUM(hlstats_Events_Statsme.shots)>0
ORDER BY
$tblWeaponstats->sort $tblWeaponstats->sortorder,
$tblWeaponstats->sort2 $tblWeaponstats->sortorder
");
if ($db->num_rows($result) != 0)
{
printSectionTitle('Weapon Stats *');
$tblWeaponstats->draw($result, $db->num_rows($result), 95);
?>
<br /><br />
<!-- End StatsMe Addon 1.0 by JustinHoMi@aol.com -->
<?php
}
flush();
if ($g_options['show_weapon_target_flash'] == 1) {
$tblWeaponstats2 = new Table(
array(
new TableColumn(
'smweapon',
'Weapon',
'width=35&type=weaponimg&align=center&link='.urlencode("javascript:switch_weapon('%k');"),
$fname
),
new TableColumn(
'smhits',
'Hits',
'width=15&align=right'
),
new TableColumn(
'smleft',
'Left',
'width=15&align=right&append=' . urlencode('%')
),
new TableColumn(
'smmiddle',
'Middle',
'width=15&align=right&append=' . urlencode('%')
),
new TableColumn(
'smright',
'Right',
'width=15&align=right&append=' . urlencode('%')
)
),
'smweapon',
'smhits',
'smweapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'tabweapons',
'desc',
true
);
} else {
$tblWeaponstats2 = new Table(
array(
new TableColumn(
'smweapon',
'Weapon',
'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&amp;weapon=%k&amp;game=$game"),
$fname
),
new TableColumn(
'smhits',
'Hits',
'width=7&align=right'
),
new TableColumn(
'smhead',
'Head',
'width=7&align=right'
),
new TableColumn(
'smchest',
'Chest',
'width=7&align=right'
),
new TableColumn(
'smstomach',
'Stomach',
'width=7&align=right'
),
new TableColumn(
'smleftarm',
'Left Arm',
'width=7&align=right'
),
new TableColumn(
'smrightarm',
'Right Arm',
'width=7&align=right'
),
new TableColumn(
'smleftleg',
'Left Leg',
'width=7&align=right'
),
new TableColumn(
'smrightleg',
'Right Leg',
'width=7&align=right'
),
new TableColumn(
'smleft',
'Left',
'width=8&align=right&append=' . urlencode('%')
),
new TableColumn(
'smmiddle',
'Middle',
'width=8&align=right&append=' . urlencode('%')
),
new TableColumn(
'smright',
'Right',
'width=8&align=right&append=' . urlencode('%')
)
),
'smweapon',
'smhits',
'smweapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'weaponstats2',
'desc',
true
);
}
$query = "
SELECT
hlstats_Events_Statsme2.weapon AS smweapon,
SUM(hlstats_Events_Statsme2.head) AS smhead,
SUM(hlstats_Events_Statsme2.chest) AS smchest,
SUM(hlstats_Events_Statsme2.stomach) AS smstomach,
SUM(hlstats_Events_Statsme2.leftarm) AS smleftarm,
SUM(hlstats_Events_Statsme2.rightarm) AS smrightarm,
SUM(hlstats_Events_Statsme2.leftleg) AS smleftleg,
SUM(hlstats_Events_Statsme2.rightleg) AS smrightleg,
SUM(hlstats_Events_Statsme2.head)+SUM(hlstats_Events_Statsme2.chest)+SUM(hlstats_Events_Statsme2.stomach)+
SUM(hlstats_Events_Statsme2.leftarm)+SUM(hlstats_Events_Statsme2.rightarm)+SUM(hlstats_Events_Statsme2.leftleg)+
SUM(hlstats_Events_Statsme2.rightleg) as smhits,
IFNULL(ROUND((SUM(hlstats_Events_Statsme2.leftarm) + SUM(hlstats_Events_Statsme2.leftleg)) / (SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach) + SUM(hlstats_Events_Statsme2.leftarm ) + SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.leftleg) + SUM(hlstats_Events_Statsme2.rightleg)) * 100, 1), 0.0) AS smleft,
IFNULL(ROUND((SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.rightleg)) / (SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach) + SUM(hlstats_Events_Statsme2.leftarm ) + SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.leftleg) + SUM(hlstats_Events_Statsme2.rightleg)) * 100, 1), 0.0) AS smright,
IFNULL(ROUND((SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach)) / (SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach) + SUM(hlstats_Events_Statsme2.leftarm ) + SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.leftleg) + SUM(hlstats_Events_Statsme2.rightleg)) * 100, 1), 0.0) AS smmiddle
FROM
hlstats_Events_Statsme2
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId=hlstats_Events_Statsme2.playerId
WHERE
clan=$clan
GROUP BY
hlstats_Events_Statsme2.weapon
HAVING
smhits > 0
ORDER BY
$tblWeaponstats2->sort $tblWeaponstats2->sortorder,
$tblWeaponstats2->sort2 $tblWeaponstats2->sortorder
";
$result = $db->query($query);
if ($db->num_rows($result) != 0)
{
printSectionTitle('Weapon Targets *');
if ($g_options['show_weapon_target_flash'] == 1)
{
?>
<div class="subblock">
<div style="float:left;vertical-align:top;width:52%;">
<script type="text/javascript">
/* <![CDATA[ */
<?php
$weapon_data = array();
$css_models = array('ct', 'ct2', 'ct3', 'ct4', 'ts', 'ts2', 'ts3', 'ts4');
$css_ct_weapons = array('usp', 'tmp', 'm4a1',
'aug', 'famas', 'sig550');
$css_ts_weapons = array('glock', 'elite', 'mac10',
'ak47', 'sg552', 'galil',
'g3sg1');
$css_random_weapons = array('knife', 'deagle', 'p228',
'm3', 'xm1014', 'mp5navy',
'p90', 'scout', 'awp',
'm249', 'hegrenade', 'flashbang',
'ump45', 'smokegrenade_projectile');
$dods_models = array('allies', 'axis');
$dods_allies_weapons = array('thompson', 'colt', 'spring',
'garand', 'riflegren_us', 'm1carbine',
'bar', 'amerknife', '30cal',
'bazooka', 'frag_us', 'riflegren_us',
'smoke_us');
$dods_axis_weapons = array('spade', 'riflegren_ger', 'k98',
'mp40', 'p38', 'frag_ger',
'smoke_ger', 'mp44', 'k98_scoped',
'mg42', 'pschreck', 'c96');
$l4d_models = array('zombie1', 'zombie2', 'zombie3');
$insmod_models = array('insmod1', 'insmod2');
$fof_models = array('fof1', 'fof2');
$ges_models = array('ges-bond', 'ges-boris');
$dinodday_models = array('ddd_allies', 'ddd_axis');
$dinodday_allies_weapons = array('garand', 'greasegun', 'thompson', 'shotgun',
'sten', 'carbine', 'bar', 'mosin', 'p38',
'piat', 'nagant', 'flechette', 'pistol', 'trigger');
$dinodday_axis_weapons = array('mp40', 'k98', 'mp44', 'k98sniper', 'luger',
'stygimoloch', 'mg42', 'trex');
while ($rowdata = $db->fetch_array()) {
$weapon_data['total']['head'] += $rowdata['smhead'];
$weapon_data['total']['leftarm'] += $rowdata['smleftarm'];
$weapon_data['total']['rightarm'] += $rowdata['smrightarm'];
$weapon_data['total']['chest'] += $rowdata['smchest'];
$weapon_data['total']['stomach'] += $rowdata['smstomach'];
$weapon_data['total']['leftleg'] += $rowdata['smleftleg'];
$weapon_data['total']['rightleg'] += $rowdata['smrightleg'];
$weapon_data[$rowdata['smweapon']]['head'] = $rowdata['smhead'];
$weapon_data[$rowdata['smweapon']]['leftarm'] = $rowdata['smleftarm'];
$weapon_data[$rowdata['smweapon']]['rightarm'] = $rowdata['smrightarm'];
$weapon_data[$rowdata['smweapon']]['chest'] = $rowdata['smchest'];
$weapon_data[$rowdata['smweapon']]['stomach'] = $rowdata['smstomach'];
$weapon_data[$rowdata['smweapon']]['leftleg'] = $rowdata['smleftleg'];
$weapon_data[$rowdata['smweapon']]['rightleg'] = $rowdata['smrightleg'];
switch ($realgame) {
case 'dods':
$weapon_data[$rowdata['smweapon']]['model'] = 'allies';
break;
case 'l4d':
$weapon_data[$rowdata['smweapon']]['model'] = 'zombie1';
break;
case 'hl2mp':
$weapon_data[$rowdata["smweapon"]]['model'] = 'alyx';
break;
case 'insmod':
$weapon_data[$rowdata['smweapon']]['model'] = 'insmod1';
break;
case 'zps':
$weapon_data[$rowdata["smweapon"]]['model'] = 'zps1';
break;
case 'ges':
$weapon_data[$rowdata["smweapon"]]['model'] = 'ges-bond';
break;
case 'tfc':
$weapon_data[$rowdata["smweapon"]]['model'] = 'pyro';
break;
case 'fof':
$weapon_data[$rowdata['smweapon']]['model'] = 'fof1';
break;
case 'dinodday':
$weapon_data[$rowdata['smweapon']]['model'] = 'ddd_allies';
break;
default:
$weapon_data[$rowdata['smweapon']]['model'] = 'ct';
}
if ($realgame == 'css' || $realgame == 'cstrike') {
if (in_array($rowdata['smweapon'], $css_random_weapons)) {
$weapon_data[$rowdata['smweapon']]['model'] = $css_models[array_rand($css_models)];
} elseif (in_array($rowdata['smweapon'], $css_ct_weapons)) {
$weapon_data[$rowdata['smweapon']]['model'] = $css_models[rand(0, 2) + 3];
} elseif (in_array($rowdata['smweapon'], $css_ts_weapons)) {
$weapon_data[$rowdata['smweapon']]['model'] = $css_models[rand(0, 2)];
}
} elseif ($realgame == 'dods') {
if (in_array($rowdata['smweapon'], $dods_allies_weapons)) {
$weapon_data[$rowdata['smweapon']]['model'] = $dods_models[1];
} elseif (in_array($rowdata['smweapon'], $dods_axis_weapons)) {
$weapon_data[$rowdata['smweapon']]['model'] = $dods_models[0];
}
} elseif ($realgame == 'dinodday') {
if (in_array($rowdata['smweapon'], $dinodday_allies_weapons)) {
$weapon_data[$rowdata['smweapon']]['model'] = $dinodday_models[1];
} elseif (in_array($rowdata['smweapon'], $dinodday_axis_weapons)) {
$weapon_data[$rowdata['smweapon']]['model'] = $dinodday_models[0];
}
}
}
switch ($realgame) {
case 'dods':
$start_model = $dods_models[array_rand($dods_models)];
break;
case 'l4d':
$start_model = $l4d_models[array_rand($l4d_models)];
break;
case 'hl2mp':
$start_model = 'alyx';
break;
case 'insmod':
$start_model = $insmod_models[array_rand($insmod_models)];
break;
case 'zps':
$start_model = 'zps1';
break;
case 'ges':
$start_model = $ges_models[array_rand($ges_models)];
break;
case 'tfc':
$start_model = 'pyro';
break;
case 'fof':
$start_model = $fof_models[array_rand($fof_models)];
break;
case 'dinodday':
$start_model = $dinodday_models[array_rand($dinodday_models)];
break;
default:
$start_model = $css_models[array_rand($css_models)];
}
$weapon_data['total']['model'] = $start_model;
echo "var data_array = new Array();\n";
$i = 1;
foreach ($weapon_data as $key => $entry) {
if ($key == 'total')
$key = 'All Weapons';
echo "data_array['$key'] = ['".ucfirst($key)."',".$entry['head'].",".$entry['leftarm'].",".$entry['rightarm'].",".$entry['chest'].",".$entry['stomach'].",".$entry['leftleg'].",".$entry['rightleg'].",'".$entry['model']."'];\n";
$i++;
}
$result = $db->query($query);
?>
function switch_weapon(weapon) {
if (document.embeds && document.embeds.hitbox) {
if (document.embeds.hitbox.LoadMovie) {
document.embeds.hitbox.LoadMovie(0, '<?php echo IMAGE_PATH; ?>/hitbox.swf?wname='+data_array[weapon][0]
+'&head='+data_array[weapon][1]+'&rightarm='+data_array[weapon][2]
+'&leftarm='+data_array[weapon][3]+'&chest='+data_array[weapon][4]
+'&stomach='+data_array[weapon][5]+'&rightleg='+data_array[weapon][6]
+'&leftleg='+data_array[weapon][7]+'&model='+data_array[weapon][8]
+'&numcolor_num=#<?php echo $g_options['graphtxt_load'] ?>&numcolor_pct=#<?php echo $g_options['graphtxt_load'] ?>&linecolor=#<?php echo $g_options['graphtxt_load'] ?>&barcolor=#FFFFFF&barbackground=#000000&textcolor=#FFFFFF&captioncolor=#FFFFFF&textcolor_total=#FFFFFF');
}
} else if (document.getElementById) {
var obj = document.getElementById('hitbox');
if (typeof obj.LoadMovie != 'undefined') {
obj.LoadMovie(0, '<?php echo IMAGE_PATH; ?>/hitbox.swf?wname='+data_array[weapon][0]
+'&head='+data_array[weapon][1]+'&rightarm='+data_array[weapon][2]
+'&leftarm='+data_array[weapon][3]+'&chest='+data_array[weapon][4]
+'&stomach='+data_array[weapon][5]+'&rightleg='+data_array[weapon][6]
+'&leftleg='+data_array[weapon][7]+'&model='+data_array[weapon][8]
+'&numcolor_num=#<?php echo $g_options['graphtxt_load'] ?>&numcolor_pct=#<?php echo $g_options['graphtxt_load'] ?>&linecolor=#<?php echo $g_options['graphtxt_load'] ?>&barcolor=#FFFFFF&barbackground=#000000&textcolor=#FFFFFF&captioncolor=#FFFFFF&textcolor_total=#FFFFFF');
}
}
}
</script>
<?php
$tblWeaponstats2->draw($result, $db->num_rows($result), 100);
$flashlink = IMAGE_PATH.'/hitbox.swf?wname=All+Weapons&amp;head='.$weapon_data['total']['head'].'&amp;rightarm='.$weapon_data['total']['leftarm'].'&amp;leftarm='.$weapon_data['total']['rightarm'].'&amp;chest='.$weapon_data['total']['chest'].'&amp;stomach='.$weapon_data['total']['stomach'].'&amp;rightleg='.$weapon_data['total']['leftleg'].'&amp;leftleg='.$weapon_data['total']['rightleg'].'&amp;model='.$start_model.'&amp;numcolor_num=#'.$g_options['graphtxt_load'].'&amp;numcolor_pct=#'.$g_options['graphtxt_load'].'&amp;linecolor=#'.$g_options['graphtxt_load'].'&amp;barcolor=#FFFFFF&amp;barbackground=#000000&amp;textcolor=#FFFFFF&amp;captioncolor=#FFFFFF&amp;textcolor_total=#FFFFFF';
?>
</div>
<div style="float:right;vertical-align:top;width:480px;">
<table class="data-table">
<tr class="data-table-head">
<td style="text-align:center;">Targets</td>
</tr>
<tr class="bg1">
<td style="text-align:center;">
<object width="470" height="360" align="middle" id="hitbox" data="<?php echo $flashlink; ?>" type="application/x-shockwave-flash">
<param name="movie" value="<?php echo $flashlink; ?>" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="bgcolor" value="#<?php echo $g_options['graphbg_load'] ?>" />
The hitbox display requires <a href="http://www.adobe.com" target="_blank">Adobe Flash Player</a> to view.
</object>
</td>
</tr>
<tr class="bg2">
<td style="text-align:center;">
<a href="javascript:switch_weapon('All Weapons');">Show total target statistics</a>
</td>
</tr>
</table>
</div>
<?php
}
else
{
$tblWeaponstats2->draw($result, $db->num_rows($result), 95);
}
?>
<br /><br />
<?php
}
?>

241
web/pages/clans.php Normal file
View File

@ -0,0 +1,241 @@
<?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.');
}
// Clan Rankings
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
if (isset($_GET['minmembers']))
{
$minmembers = valid_request(intval($_GET["minmembers"]),1);
}
else
{
$minmembers = 3;
}
pageHeader
(
array ($gamename, 'Clan Rankings'),
array ($gamename=>"%s?game=$game", 'Clan Rankings' => '')
);
$table = new Table
(
array
(
new TableColumn
(
'name',
'Clan',
'width=25&icon=clan&link=' . urlencode('mode=claninfo&amp;clan=%k')
),
new TableColumn
(
'tag',
'Tag',
'width=15&align=center'
),
new TableColumn
(
'skill',
'Avg. Points',
'width=8&align=right&skill_change=1'
),
new TableColumn
(
'nummembers',
'Members',
'width=5&align=right'
),
new TableColumn
(
'activity',
'Activity',
'width=8&type=bargraph'
),
new TableColumn
(
'connection_time',
'Connection Time',
'width=13&align=right&type=timestamp'
),
new TableColumn
(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=7&align=right'
)
),
'clanId',
'skill',
'kpd',
true
);
$result = $db->query
("
SELECT
hlstats_Clans.clanId,
hlstats_Clans.name,
hlstats_Clans.tag,
COUNT(hlstats_Players.playerId) AS nummembers,
SUM(hlstats_Players.kills) AS kills,
SUM(hlstats_Players.deaths) AS deaths,
SUM(hlstats_Players.connection_time) AS connection_time,
ROUND(AVG(hlstats_Players.skill)) AS skill,
ROUND(AVG(hlstats_Players.last_skill_change)) AS last_skill_change,
ROUND(SUM(hlstats_Players.kills) / IF(SUM(hlstats_Players.deaths) = 0, 1, SUM(hlstats_Players.deaths)), 2) AS kpd,
TRUNCATE(AVG(activity), 2) AS activity
FROM
hlstats_Clans,
hlstats_Players
WHERE
hlstats_Clans.game = '$game'
AND hlstats_Clans.hidden <> 1
AND hlstats_Players.clan = hlstats_Clans.clanId
AND hlstats_Players.hideranking = 0
GROUP BY
hlstats_Clans.clanId
HAVING
activity >= 0
AND nummembers >= $minmembers
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder,
hlstats_Clans.name ASC
LIMIT
$table->startitem,
$table->numperpage
");
$resultCount = $db->query
("
SELECT
hlstats_Clans.clanId,
SUM(activity) AS activity
FROM
hlstats_Clans
LEFT JOIN
hlstats_Players
ON
hlstats_Players.clan = hlstats_Clans.clanId
WHERE
hlstats_Clans.game = '$game'
AND hlstats_Clans.hidden <> 1
AND hlstats_Players.hideranking = 0
GROUP BY
hlstats_Clans.clanId
HAVING
activity >= 0
AND COUNT(hlstats_Players.playerId) >= $minmembers
");
?>
<div class="block">
<?php printSectionTitle('Clan Rankings'); ?>
<div class="subblock">
<div style="float:left;">
<form method="get" action="<?php echo $g_options['scripturl']; ?>">
<input type="hidden" name="mode" value="search" />
<input type="hidden" name="game" value="<?php echo $game; ?>" />
<input type="hidden" name="st" value="clan" />
<strong>&#8226;</strong> Find a clan:
<input type="text" name="q" size="20" maxlength="64" class="textbox" />
<input type="submit" value="Search" class="smallsubmit" />
</form>
</div>
<div style="clear:both;"></div>
</div>
<br /><br />
<?php $table->draw($result, $db->num_rows($resultCount), 95); ?><br /><br />
<div class="subblock">
<div style="float:left;">
<form method="get" action="<?php echo $g_options['scripturl']; ?>">
<?php
$db->query
("
SELECT
COUNT(*) AS total_clans
FROM
hlstats_Clans
WHERE
hlstats_Clans.game = '$game'
");
list($total_clans) = $db->fetch_row();
foreach ($_GET as $k=>$v)
{
$v = valid_request($v, 0);
if ($k != "minmembers")
{
echo "<input type=\"hidden\" name=\"" . htmlspecialchars($k) . "\" value=\"" . htmlspecialchars($v) . "\" />\n";
}
}
?>
<strong>&#8226;</strong> Show only clans with
<input type="text" name="minmembers" size="4" maxlength="2" value="<?php echo $minmembers; ?>" class="textbox" /> or more members from a total of <strong><?php echo number_format($total_clans); ?></strong> clans
<input type="submit" value="Apply" class="smallsubmit" />
</form>
</div>
<div style="float:right;">
Go to: <a href="<?php echo $g_options["scripturl"] . "?mode=players&amp;game=$game"; ?>">Player Rankings</a>
</div>
</div>
</div>

281
web/pages/contents.php Normal file
View File

@ -0,0 +1,281 @@
<?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.');
}
// Contents
$resultGames = $db->query("
SELECT
code,
name
FROM
hlstats_Games
WHERE
hidden='0'
ORDER BY
realgame, name ASC
");
$num_games = $db->num_rows($resultGames);
$redirect_to_game = 0;
if ($num_games == 1 || $game = valid_request($_GET['game'], 0)) {
$redirect_to_game++;
if ($num_games == 1) {
list($game) = $db->fetch_row($resultGames);
}
include(PAGE_PATH . '/game.php');
} else {
unset($_SESSION['game']);
pageHeader(array('Contents'), array('Contents' => ''));
include(PAGE_PATH . '/voicecomm_serverlist.php');
printSectionTitle('Games');
?>
<div class="subblock">
<table class="data-table">
<tr class="data-table-head">
<td class="fSmall" width="60%" align="left">&nbsp;Game</td>
<td class="fSmall" width="10%" align="center">&nbsp;Players</td>
<td class="fSmall" width="20%" align="center">&nbsp;Top Player</td>
<td class="fSmall" width="10%" align="center">&nbsp;Top Clan</td>
</tr>
<?php
$nonhiddengamestring = "(";
while ($gamedata = $db->fetch_row($resultGames))
{
$nonhiddengamestring .= "'$gamedata[0]',";
$result = $db->query("
SELECT
playerId,
lastName,
activity
FROM
hlstats_Players
WHERE
game='$gamedata[0]'
AND hideranking=0
ORDER BY
".$g_options['rankingtype']." DESC,
(kills/IF(deaths=0,1,deaths)) DESC
LIMIT 1
");
if ($db->num_rows($result) == 1)
{
$topplayer = $db->fetch_row($result);
}
else
{
$topplayer = false;
}
$result = $db->query("
SELECT
hlstats_Clans.clanId,
hlstats_Clans.name,
AVG(hlstats_Players.skill) AS skill,
AVG(hlstats_Players.kills) AS kills,
COUNT(hlstats_Players.playerId) AS numplayers
FROM
hlstats_Clans
LEFT JOIN
hlstats_Players
ON
hlstats_Players.clan = hlstats_Clans.clanId
WHERE
hlstats_Clans.game='$gamedata[0]'
AND hlstats_Clans.hidden = 0
AND hlstats_Players.hideranking=0
GROUP BY
hlstats_Clans.clanId
HAVING
".$g_options['rankingtype']." IS NOT NULL
AND numplayers >= 3
ORDER BY
".$g_options['rankingtype']." DESC
LIMIT 1
");
if ($db->num_rows($result) == 1)
{
$topclan = $db->fetch_row($result);
}
else
{
$topclan = false;
}
$result= $db->query("
SELECT
SUM(act_players) AS `act_players`,
SUM(max_players) AS `max_players`
FROM
hlstats_Servers
WHERE
hlstats_Servers.game='$gamedata[0]'
");
$numplayers = $db->fetch_array($result);
if ($numplayers['act_players'] == 0 and $numplayers['max_players'] == 0)
$numplayers = false;
else
$player_string = $numplayers['act_players'].'/'.$numplayers['max_players'];
?>
<tr class="game-table-row">
<td class="game-table-cell" style="height:30px">
<div style="float:left;line-height:30px;" class="fHeading">&nbsp;<a href="<?php echo $g_options['scripturl'] . "?game=$gamedata[0]"; ?>"><img src="<?php
$image = getImage("/games/$gamedata[0]/game");
if ($image)
echo $image['url'];
else
echo IMAGE_PATH . '/game.gif';
?>" style="margin-left: 3px; margin-right: 4px;" alt="Game" /></a><a href="<?php echo $g_options['scripturl'] . "?game=$gamedata[0]"; ?>"><?php echo $gamedata[1]; ?></a>
</div>
<div style="float:right;">
<div style="margin-left: 3px; margin-right: 4px; vertical-align:top; text-align:center;"><a href="<?php echo $g_options['scripturl'] . "?mode=clans&amp;game=$gamedata[0]"; ?>"><img src="<?php echo IMAGE_PATH; ?>/clan.gif" alt="Clan Rankings" /></a></div>
<div style="vertical-align:bottom; text-align:left;">&nbsp;<a href="<?php echo $g_options['scripturl'] . "?mode=clans&amp;game=$gamedata[0]"; ?>" class="fSmall">Clans</a>&nbsp;&nbsp;</div>
</div>
<div style="float:right;">
<div style="margin-left: 3px; margin-right: 4px; vertical-align:top; text-align:center;"><a href="<?php echo $g_options['scripturl'] . "?mode=players&amp;game=$gamedata[0]"; ?>"><img src="<?php echo IMAGE_PATH; ?>/player.gif" alt="Player Rankings" /></a></div>
<div style="vertical-align:bottom; text-align:left;">&nbsp;<a href="<?php echo $g_options['scripturl'] . "?mode=players&amp;game=$gamedata[0]"; ?>" class="fSmall">Players</a>&nbsp;&nbsp;</div>
</div>
</td>
<td class="game-table-cell" style="text-align:center;"><?php
if ($numplayers)
{
echo $player_string;
}
else
{
echo '-';
}
?>
</td>
<td class="game-table-cell" style="text-align:center;"><?php
if ($topplayer)
{
echo '<a href="' . $g_options['scripturl'] . '?mode=playerinfo&amp;player='
. $topplayer[0] . '">'.htmlspecialchars($topplayer[1], ENT_COMPAT).'</a>';
}
else
{
echo '-';
}
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
if ($topclan)
{
echo '<a href="' . $g_options['scripturl'] . '?mode=claninfo&amp;clan='
. $topclan[0] . '">'.htmlspecialchars($topclan[1], ENT_COMPAT).'</a>';
}
else
{
echo '-';
}
?></td>
</tr>
<?php
}
?>
</table>
</div><br /><br />
<br />
<?php
printSectionTitle('General Statistics');
$nonhiddengamestring = preg_replace('/,$/', ')', $nonhiddengamestring);
$result = $db->query("SELECT COUNT(playerId) FROM hlstats_Players WHERE game IN $nonhiddengamestring");
list($num_players) = $db->fetch_row($result);
$num_players = number_format($num_players);
$result = $db->query("SELECT COUNT(clanId) FROM hlstats_Clans WHERE game IN $nonhiddengamestring");
list($num_clans) = $db->fetch_row($result);
$num_clans = number_format($num_clans);
$result = $db->query("SELECT COUNT(serverId) FROM hlstats_Servers WHERE game IN $nonhiddengamestring");
list($num_servers) = $db->fetch_row($result);
$num_servers = number_format($num_servers);
$result = $db->query("SELECT SUM(kills) FROM hlstats_Servers WHERE game IN $nonhiddengamestring");
list($num_kills) = $db->fetch_row($result);
$num_kills = number_format($num_kills);
$result = $db->query("
SELECT
eventTime
FROM
hlstats_Events_Frags
ORDER BY
id DESC
LIMIT 1
");
list($lastevent) = $db->fetch_row($result);
?>
<div class="subblock">
<ul>
<li><?php
echo "<strong>$num_players</strong> players and <strong>$num_clans</strong> clans "
. "ranked in <strong>$num_games</strong> games on <strong>$num_servers</strong>"
. " servers with <strong>$num_kills</strong> kills."; ?></li>
<?php
if ($lastevent)
{
echo "\t\t\t\t<li>Last Kill <strong> " . date('g:i:s A, D. M. d, Y', strtotime($lastevent)) . "</strong></li>";
}
?>
<li>All statistics are generated in real-time. Event history data expires after <strong><?php echo $g_options['DeleteDays']; ?></strong> days.</li>
</ul>
</div>
<?php
}
?>

227
web/pages/countryclans.php Normal file
View File

@ -0,0 +1,227 @@
<?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.');
}
// Country Clan Rankings
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
if (isset($_GET['minmembers']))
{
$minmembers = valid_request(intval($_GET["minmembers"]),1);
}
else
{
$minmembers = 3;
}
pageHeader
(
array ($gamename, 'Country Rankings'),
array ($gamename=>"%s?game=$game", 'Country Rankings' => '')
);
$table = new Table
(
array
(
new TableColumn
(
'name',
'Country',
'width=40&flag=1&link=' . urlencode('mode=countryclansinfo&amp;flag=%k&amp;game='.$game)
),
new TableColumn
(
'skill',
'Avg. Points',
'width=8&skill_change=1&align=right'
),
new TableColumn
(
"nummembers",
"Members",
"width=5&align=right"
),
new TableColumn
(
'activity',
'Activity',
'width=8&type=bargraph'
),
new TableColumn
(
'connection_time',
'Connection Time',
'width=13&align=right&type=timestamp'
),
new TableColumn
(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=7&align=right'
)
),
'flag',
'skill',
'kpd',
true
);
$result = $db->query
("
SELECT
hlstats_Countries.flag,
hlstats_Countries.name,
COUNT(hlstats_Players.playerId) AS nummembers,
SUM(hlstats_Players.kills) AS kills,
SUM(hlstats_Players.deaths) AS deaths,
SUM(hlstats_Players.connection_time) AS connection_time,
ROUND(AVG(hlstats_Players.skill)) AS skill,
ROUND(AVG(hlstats_Players.last_skill_change)) AS last_skill_change,
ROUND(SUM(hlstats_Players.kills) / IF(SUM(hlstats_Players.deaths) = 0, 1, SUM(hlstats_Players.deaths)), 2) AS kpd,
TRUNCATE(AVG(activity), 2) AS activity
FROM
hlstats_Countries
LEFT JOIN
hlstats_Players
ON
hlstats_Players.flag = hlstats_Countries.flag
WHERE
hlstats_Players.game = '$game'
AND hlstats_Players.hideranking = 0
AND IF(".$g_options['MinActivity']." > (UNIX_TIMESTAMP() - hlstats_Players.last_event), ((100 / ".$g_options['MinActivity'].") * (".$g_options['MinActivity']." - (UNIX_TIMESTAMP() - hlstats_Players.last_event))), -1) >= 0
GROUP BY
hlstats_Countries.flag
HAVING
activity >= 0
AND nummembers >= $minmembers
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder,
hlstats_Countries.name ASC
LIMIT
$table->startitem,
$table->numperpage
");
$resultCount = $db->query
("
SELECT
hlstats_Countries.flag,
SUM(activity) AS activity
FROM
hlstats_Countries
LEFT JOIN
hlstats_Players
ON
hlstats_Players.flag = hlstats_Countries.flag
WHERE
hlstats_Players.game = '$game'
AND hlstats_Players.hideranking = 0
GROUP BY
hlstats_Countries.flag
HAVING
activity >= 0
AND COUNT(hlstats_Players.playerId) >= $minmembers
");
?>
<div class="block">
<?php
printSectionTitle('Country Rankings');
$table->draw($result, $db->num_rows($resultCount), 95);
?><br /><br />
<div class="subblock">
<div style="float:left;">
<form method="get" action="<?php echo $g_options['scripturl']; ?>">
<?php
$db->query
("
SELECT
COUNT(DISTINCT flag) AS total_countrys
FROM
hlstats_Players
WHERE
hlstats_Players.flag NOT LIKE ''
AND hlstats_Players.game = '$game'
AND hlstats_Players.hideranking = 0
");
list($total_countrys) = $db->fetch_row();
foreach ($_GET as $k=>$v)
{
$v = valid_request($v, 0);
if ($k != 'minmembers')
{
echo "<input type=\"hidden\" name=\"" . htmlspecialchars($k) . "\" value=\"" . htmlspecialchars($v) . "\" />\n";
}
}
?>
<strong>&#8226;</strong> Show only clans with
<input type="text" name="minmembers" size="4" maxlength="2" value="<?php echo $minmembers; ?>" class="textbox" /> or more members from a total of <b><?php echo number_format($total_countrys); ?></b> countrys
<input type="submit" value="Apply" class="smallsubmit" />
</form>
</div>
<div style="float:right;">
Go to: <a href="<?php echo $g_options['scripturl'] . "?game=$game"; ?>"><?php echo $gamename; ?></a>
</div>
<div style="clear:both;"></div>
</div>
</div>

View File

@ -0,0 +1,354 @@
<?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.');
}
// Country Details
$flag = valid_request($_GET['flag'],0)
or error('No country ID specified.');
$SQL = "
SELECT
hlstats_Countries.flag,
hlstats_Countries.name,
COUNT(hlstats_Players.playerId) AS nummembers,
SUM(hlstats_Players.kills) AS kills,
SUM(hlstats_Players.deaths) AS deaths,
SUM(hlstats_Players.connection_time) AS connection_time,
ROUND(AVG(hlstats_Players.skill)) AS avgskill,
IFNULL(SUM(hlstats_Players.kills) / SUM(hlstats_Players.deaths), '-') AS kpd,
TRUNCATE(AVG(activity), 2) as activity
FROM
hlstats_Countries
INNER JOIN
hlstats_Players
ON (
hlstats_Players.flag=hlstats_Countries.flag
)
WHERE
hlstats_Players.game='$game'
AND hlstats_Players.flag='$flag'
AND hlstats_Players.hideranking = 0
AND activity >= 0
GROUP BY
hlstats_Countries.flag
";
$db->query($SQL);
if ($db->num_rows() != 1)
error("No such countryclan '$flag'.");
$clandata = $db->fetch_array();
$db->free_result();
$cl_name = str_replace(' ', '&nbsp;', htmlspecialchars($clandata['name']));
$cl_tag = str_replace(' ', '&nbsp;', htmlspecialchars($clandata['tag']));
$cl_full = "$cl_tag $cl_name";
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
{
$gamename = ucfirst($game);
}
else
{
list($gamename) = $db->fetch_row();
}
pageHeader(
array($gamename, 'Country Details', $cl_full),
array(
$gamename=>$g_options['scripturl'] . "?game=$game",
'Country Rankings'=>$g_options['scripturl'] . "?mode=countryclans&game=$game",
'Country Details'=>''
),
$clandata['name']
);
?>
<div class="block">
<?php printSectionTitle('Country Information'); ?>
<div class="subblock">
<div style="float:left;width:48.5%;">
<table class="data-table">
<tr class="data-table-head">
<td colspan="3">Statistics Summary</td>
</tr>
<tr class="bg1">
<td>Country:</td>
<td colspan="2"><?php
echo '<img src="'.getFlag($clandata['flag']).'" alt="'.strtolower($playerdata['country']).'" title="'.strtolower($playerdata['country']).'" />&nbsp;';
echo '<strong>' . $clandata['name'] . '</strong>';
?></td>
</tr>
<tr class="bg2">
<td style="width:45%;"><?php
echo 'Activity:';
?></td>
<td align="left" width="40%"><?php
$width = sprintf('%d%%', $clandata['activity'] + 0.5);
$bar_type = 1;
if ($clandata['activity'] > 40)
$bar_type = 6;
elseif ($clandata['activity'] > 30)
$bar_type = 5;
elseif ($clandata['activity'] > 20)
$bar_type = 4;
elseif ($clandata['activity'] > 10)
$bar_type = 3;
elseif ($clandata['activity'] > 5)
$bar_type = 2;
echo '<img src="' . IMAGE_PATH . "/bar$bar_type.gif\" style=\"width:$width;height:10px;border:0;\" alt=\"".$clandata['activity'].'%" />';
?></td>
<td style="width:15%;"><?php
echo sprintf('%0.2f', $clandata['activity']).'%';
?></td>
</tr>
<tr class="bg1">
<td>Members:</td>
<td colspan="2">
<strong><?php echo $clandata['nummembers']; ?></strong>
<em>active members</em>
</td>
</tr>
<tr class="bg2">
<td>Total Kills:</td>
<td colspan="2"><?php
echo number_format($clandata['kills']);
?></td>
</tr>
<tr class="bg1">
<td>Total Deaths:</td>
<td colspan="2"><?php
echo number_format($clandata['deaths']);
?></td>
</tr>
<tr class="bg2">
<td>Avg. Kills:</td>
<td colspan="2"><?php
echo number_format($clandata['kills'] / ($clandata['nummembers']));
?></td>
</tr>
<tr class="bg1">
<td>Kills per Death:</td>
<td colspan="2"><?php
if ($clandata['deaths'] != 0)
{
printf('<strong>' . '%0.2f', $clandata['kills'] / $clandata['deaths']) . '</strong>';
}
else
{
echo '-';
}
?></td>
</tr>
<tr class="bg2">
<td style="width:45%;">Kills per Minute:</td>
<td colspan="2" style="width:55%;"><?php
if ($clandata['connection_time'] > 0) {
echo sprintf('%.2f', ($clandata['kills'] / ($clandata['connection_time'] / 60)));
} else {
echo '-';
}
?></td>
</tr>
<tr class="bg1">
<td>Avg. Member Points:</td>
<td colspan="2"><?php
echo '<strong>' . number_format($clandata['avgskill']) . '</strong>';
?></td>
</tr>
<tr class="bg2">
<td >Avg. Connection Time:</td>
<td colspan="2"><?php
if ($clandata['connection_time'] > 0) {
echo timestamp_to_str($clandata['connection_time'] / ($clandata['nummembers']));
} else {
echo '-';
}
?></td>
</tr>
<tr class="bg1">
<td>Total Connection Time:</td>
<td colspan="2"><?php
echo timestamp_to_str($clandata['connection_time']);
?></td>
</tr>
</table>
</div>
<div style="float:right;width:48.5%;text-align:center;padding-top:50px;">
<?php
if (file_exists(IMAGE_PATH.'/flags/'.strtolower($flag).'_large.png')) {
echo '<img src="'.IMAGE_PATH.'/flags/'.strtolower($flag).'_large.png" style="border:0px;" alt="'.$flag.'" />';
} else {
echo '<img src="'.IMAGE_PATH.'/countryclanlogos/NA.png" style="border:0px;" alt="" />';
}
?>
</div>
<div style="clear:both;"></div>
</div>
</div>
<?php
flush();
$tblMembers = new Table(
array(
new TableColumn(
'lastName',
'Name',
'width=32&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn(
'skill',
'Points',
'width=6&align=right'
),
new TableColumn(
'activity',
'Activity',
'width=10&sort=no&type=bargraph'
),
new TableColumn(
'connection_time',
'Time',
'width=13&align=right&type=timestamp'
),
new TableColumn(
'kills',
'Kills',
'width=6&align=right'
),
new TableColumn(
'percent',
'Clan Kills',
'width=10&sort=no&type=bargraph'
),
new TableColumn(
'percent',
'%',
'width=6&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'deaths',
'Deaths',
'width=6&align=right'
),
new TableColumn(
'kpd',
'Kpd',
'width=6&align=right'
),
),
'playerId',
'skill',
'kpd',
true,
20,
'members_page',
'members_sort',
'members_sortorder',
'members'
);
$result = $db->query("
SELECT
hlstats_Players.playerId,
hlstats_Players.lastName,
hlstats_Players.country,
hlstats_Players.flag,
hlstats_Players.skill,
hlstats_Players.connection_time,
hlstats_Players.kills,
hlstats_Players.deaths,
ROUND(hlstats_Players.kills / IF(hlstats_Players.deaths = 0, 1, hlstats_Players.deaths), 2) AS kpd,
ROUND(hlstats_Players.kills / IF(" . $clandata['kills'] . " = 0, 1, " . $clandata['kills'] . ") * 100, 2) AS percent,
IF(".$g_options['MinActivity']." > (UNIX_TIMESTAMP() - last_event), ((100/".$g_options['MinActivity'].") * (".$g_options['MinActivity']." - (UNIX_TIMESTAMP() - last_event))), -1) as activity
FROM
hlstats_Players
WHERE
flag='$flag'
AND hlstats_Players.hideranking = 0
AND hlstats_Players.game='$game'
GROUP BY
hlstats_Players.playerId
HAVING
activity >= 0
ORDER BY
$tblMembers->sort $tblMembers->sortorder,
$tblMembers->sort2 $tblMembers->sortorder,
lastName ASC
LIMIT $tblMembers->startitem,$tblMembers->numperpage
");
$resultCount = $db->query("
SELECT
playerId,
IF(".$g_options['MinActivity']." > (UNIX_TIMESTAMP() - last_event), ((100/".$g_options['MinActivity'].") * (".$g_options['MinActivity']." - (UNIX_TIMESTAMP() - last_event))), -1) as activity
FROM
hlstats_Players
WHERE
flag='$flag'
AND hlstats_Players.hideranking = 0
AND hlstats_Players.game='$game'
GROUP BY
hlstats_Players.playerId
HAVING
activity >= 0
");
$numitems = $db->num_rows($resultCount);
?>
<div class="block" style="padding-top:10px;">
<?php
printSectionTitle('Members');
$tblMembers->draw($result, $numitems, 95);
?></div>

View File

@ -0,0 +1,167 @@
<?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.');
}
// Daily Award Statistics
$award = valid_request($_GET['award'], true)
or error('No award ID specified.');
$db->query("
SELECT
awardType,
code,
name,
verb
FROM
hlstats_Awards
WHERE
hlstats_Awards.awardid=$award
");
$awarddata = $db->fetch_array();
$db->free_result();
$awardname = $awarddata['name'];
$awardverb = $awarddata['verb'];
$awardtype = $awarddata['awardType'];
$awardcode = $awarddata['code'];
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() < 1)
{
error("No such game '$game'.");
}
list($gamename) = $db->fetch_row();
$db->free_result();
pageHeader(
array($gamename, 'Award Details', $awardname),
array(
$gamename=>$g_options['scripturl'] . "?game=$game",
'Awards Statistics' => $g_options['scripturl'] . "?mode=awards&game=$game",
'Awards Details' => ''
),
$awardname
);
$table = new Table(
array(
new TableColumn(
'awardTime',
'Day',
'width=20&align=left'
),
new TableColumn(
'lastName',
'Player',
'width=40&align=left&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn(
'count',
'Count for the Day',
'width=35&align=right&append=' . urlencode(" $awardverb")
)
),
'playerId',
'awardTime',
'lastName',
true,
30
);
$result = $db->query("
SELECT
hlstats_Players_Awards.playerId,
awardTime,
lastName,
flag,
count
FROM
hlstats_Players_Awards
LEFT JOIN
hlstats_Players
ON
hlstats_Players_Awards.playerId = hlstats_Players.playerId
WHERE
awardid=$award
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT $table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
awardTime
FROM
hlstats_Players_Awards
WHERE
awardid=$award
");
$numitems = mysql_num_rows($resultCount);
?>
<div class="block">
<?php printSectionTitle('Daily Award Details'); ?>
<div class="subblock">
<div style="float:right;">
Back to <a href="<?php echo $g_options['scripturl'] . "?mode=awards&amp;game=$game"; ?>">Daily Awards</a>
</div>
<div style="clear:both;"></div>
</div>
<br /><br />
<?php
$img = IMAGE_PATH."/games/$game/dawards/".strtolower($awardtype).'_'.strtolower($awardcode).'.png';
if (!is_file($img))
{
$img = IMAGE_PATH.'/award.png';
}
echo "<img src=\"$img\" alt=\"$awardcode\" /> <strong>$awardname</strong>";
$table->draw($result, $numitems, 95, 'center');
?>
</div>

91
web/pages/footer.php Normal file
View File

@ -0,0 +1,91 @@
<?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.');
}
// calculate the scripttime
global $scripttime, $db;
$scripttime = round(microtime(true) - $scripttime, 4);
?>
<div style="clear:both;"></div>
<br />
<br />
<div id="footer">
<a href="http://www.hlxce.com" target="_blank"><img src="<?php echo IMAGE_PATH; ?>/footer-small.png" alt="HLstatsX Community Edition" border="0" /></a>
</div>
<br />
<div class="fSmall" style="text-align:center;">
<?php
if($_SESSION['nojs'] == 1) {
echo 'You are currently viewing the basic version of this page, please enable JavaScript and reload the page to access full functionality.<br />';
}
echo 'Generated in real-time by <a href="http://www.hlxce.com" target="_blank">HLstatsX Community Edition '.$g_options['version'].'</a>';
if ($g_options['showqueries'] == 1) {
echo '
<br />
Executed '.$db->querycount." queries, generated this page in $scripttime Seconds\n";
}
?>
<br />
All images are copyrighted by their respective owners.
<?php
echo '<br /><br />[<a href="'.$g_options['scripturl']."?mode=admin\">Admin</a>]";
if (isset($_SESSION['loggedin'])) {
echo '&nbsp;[<a href="hlstats.php?logout=1">Logout</a>]';
}
?>
</div>
</div>
<?php
global $mode, $redirect_to_game;
if (($g_options["show_google_map"] == 1) && ($mode == "contents") && ($redirect_to_game > 0))
{
include(INCLUDE_PATH . '/google_maps.php');
printMap();
}
?>
</body>
</html>

551
web/pages/game.php Normal file
View File

@ -0,0 +1,551 @@
<?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.');
}
require (PAGE_PATH . '/livestats.php');
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() < 1) {
error("No such game '$game'.");
}
list($gamename) = $db->fetch_row();
$db->free_result();
pageHeader(array($gamename), array($gamename => ''));
include (PAGE_PATH . '/voicecomm_serverlist.php');
$query = "
SELECT
count(*)
FROM
hlstats_Players
WHERE
game='$game'
";
$result = $db->query($query);
list($total_players) = $db->fetch_row($result);
$query = "
SELECT
players
FROM
hlstats_Trend
WHERE
game='$game'
AND timestamp<=" . (time() - 86400) . "
ORDER BY
timestamp DESC LIMIT 0,1
";
$result = $db->query($query);
list($total_players_24h) = $db->fetch_row($result);
$players_last_day = -1;
if ($total_players_24h > 0) {
$players_last_day = $total_players - $total_players_24h;
}
$query = "
SELECT
SUM(kills),
SUM(headshots),
count(serverId)
FROM
hlstats_Servers
WHERE
game='$game'
";
$result = $db->query($query);
list($total_kills, $total_headshots, $total_servers) = $db->fetch_row($result);
$query = "
SELECT
kills
FROM
hlstats_Trend
WHERE
game='$game'
AND timestamp<=" . (time() - 86400) . "
ORDER BY
timestamp DESC LIMIT 0,1
";
$result = $db->query($query);
list($total_kills_24h) = $db->fetch_row($result);
$db->free_result();
$kills_last_day = -1;
if ($total_kills_24h > 0) {
$kills_last_day = $total_kills - $total_kills_24h;
}
$query = "
SELECT
serverId,
name,
IF(publicaddress != '',
publicaddress,
concat(address, ':', port)
) AS addr,
kills,
headshots,
act_players,
max_players,
act_map,
map_started,
map_ct_wins,
map_ts_wins
FROM
hlstats_Servers
WHERE
game='$game'
ORDER BY
sortorder, name, serverId
";
$db->query($query);
$servers = $db->fetch_row_set();
$db->free_result();
?>
<div class="block">
<?php printSectionTitle('Participating Servers'); ?>
<div class="subblock">
<?php
if (count($servers) == 1)
{
?>
<table class="data-table">
<tr class="data-table-head"><td><?php
if ($total_kills > 0)
$hpk = sprintf("%.2f", ($total_headshots / $total_kills) * 100);
else
$hpk = sprintf("%.2f", 0);
if ($players_last_day > -1)
echo "Tracking <b>" . number_format($total_players) . "</b> players (<b>+" . number_format($players_last_day) . "</b> new players last 24h) with <b>" . number_format($total_kills) . "</b> kills (<b>+" . number_format($kills_last_day) . "</b> last 24h) and <b>" . number_format($total_headshots) . "</b> headshots (<b>$hpk%</b>) on <b>" . number_format($total_servers) . "</b> servers";
else
echo "Tracking <b>" . number_format($total_players) . "</b> players with <b>" . number_format($total_kills) . "</b> kills and <b>" . number_format($total_headshots) . "</b> headshots (<b>$hpk%</b>) on <b>" . number_format($total_servers) . "</b> servers";
?></td>
</tr>
</table>
<?php
}
else
{
if ($g_options['slider'] == 1) {
?>
<table class="data-table" id="accordion">
<?php
} else {
?>
<table class="data-table">
<?php
}
?>
<tr class="data-table-head"><td colspan="9" style="padding:4px;width:100%;"><?php
if ($total_kills > 0)
$hpk = sprintf("%.2f", ($total_headshots / $total_kills) * 100);
else
$hpk = sprintf("%.2f", 0);
if ($players_last_day > -1)
echo "Tracking <b>" . number_format($total_players) . "</b> players (<b>+" . number_format($players_last_day) . "</b> new players last 24h) with <b>" . number_format($total_kills) . "</b> kills (<b>+" . number_format($kills_last_day) . "</b> last 24h) and <b>" . number_format($total_headshots) . "</b> headshots (<b>$hpk%</b>) on <b>" . number_format($total_servers) . "</b> servers";
else
echo "Tracking <b>" . number_format($total_players) . "</b> players with <b>" . number_format($total_kills) . "</b> kills and <b>" . number_format($total_headshots) . "</b> headshots (<b>$hpk%</b>) on <b>" . number_format($total_servers) . "</b> servers";
?></td>
</tr>
<tr class="data-table-head">
<td class="fSmall" style="width:37%;">&nbsp;Server</td>
<td class="fSmall" style="width:19%;">&nbsp;Address</td>
<td class="fSmall" style="width:7%;text-align:center;">&nbsp;Map</td>
<td class="fSmall" style="width:7%;text-align:center;">&nbsp;Played</td>
<td class="fSmall" style="width:10%;text-align:center;">&nbsp;Players</td>
<td class="fSmall" style="width:7%;text-align:center;">&nbsp;Kills</td>
<td class="fSmall" style="width:7%;text-align:center;">&nbsp;Headshots</td>
<td class="fSmall" style="width:6%;text-align:center;">&nbsp;HS:K</td>
</tr>
<?php
$i = 0;
for ($i = 0; $i < count($servers); $i++)
{
$rowdata = $servers[$i];
$server_id = $rowdata['serverId'];
$c = ($i % 2) + 1;
$addr = $rowdata['addr'];
$kills = $rowdata['kills'];
$headshots = $rowdata['headshots'];
$player_string = $rowdata['act_players'] . '/' . $rowdata['max_players'];
$map_teama_wins = $rowdata['map_ct_wins'];
$map_teamb_wins = $rowdata['map_ts_wins'];
?>
<?php
if ($g_options['slider'] == 1) {
?>
<tr class="game-table-row toggler" style="cursor: pointer;" onmouseover="this.setAttribute('class', 'game-table-row-hover');" onmouseout="this.setAttribute('class', 'game-table-row toggler');">
<td class="game-table-cell">
<?php
} else {
?>
<tr class="game-table-row">
<td class="game-table-cell">
<?php
}
$image = getImage("/games/$game/game");
echo '<img src="';
if ($image)
echo $image['url'];
else
echo IMAGE_PATH . '/game.gif';
echo "\" alt=\"$game\" />&nbsp;";
echo '<b>' . $rowdata['name'] . '</b>';
?></td>
<td class="game-table-cell"><?php
echo "$addr (<a href=\"steam://connect/$addr\">Join</a>)";
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
echo $rowdata['act_map'];
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
$stamp = $rowdata['map_started']==0?0:time() - $rowdata['map_started'];
$hours = sprintf("%02d", floor($stamp / 3600));
$min = sprintf("%02d", floor(($stamp % 3600) / 60));
$sec = sprintf("%02d", floor($stamp % 60));
echo $hours . ":" . $min . ":" . $sec;
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
echo $player_string;
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
echo number_format($kills);
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
echo number_format($headshots);
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
if ($kills > 0)
echo sprintf("%.2f", ($headshots / $kills));
else
echo sprintf("%.2f", 0);
?></td>
</tr>
<?php
if ($g_options['slider'] == 1) {
?>
<tr>
<td colspan="9" style="padding: 0px; border: none;">
<div class="opener">
<?php printserverstats($server_id); ?>
<div class="subblock">
<?php
$range_arr = array(1=>"24h View", 2=>"Last Week", 3=>"Last Month", 4=>"Last Year");
foreach($range_arr as $range_code => $range_name) {
print('<table class="data-table"><tr class="data-table-head">');
print('<td class="fSmall">&nbsp;'.$range_name.'</td></tr>');
print('<tr class="data-table-row"><td style="text-align:center; height: 200px; vertical-align:middle;">');
print('<img ');
if(!$_SESSION['nojs']) {
/* Javascript is on, so delay loading the image,
until the accordion code is called below. We do this
by setting src to a static image, and storing the 'real' image
URL in delaysrc. */
print('src="' . IMAGE_PATH .'/title-small.png" delay');
}
print('src="show_graph.php?type=0&amp;width=870&amp;height=200&amp;'.
'game='.$game.'&amp;server_id='.$server_id.'&amp;'.
'bgcolor='.$g_options['graphbg_load'].'&amp;color='.$g_options['graphtxt_load'].
'&amp;range='.$range_code.'" alt="'.$range_name.'" title="'.$range_name.'" />');
print('</td></tr> </table><br /><br />');
}
?>
</div>
</div>
</td>
</tr>
<?php
}
}
echo '</table>';
if ($g_options['slider'] == 1) {
?>
<script type="text/javascript">
var myAccordion = new Accordion($('accordion'), 'tr.toggler', 'div.opener', {
opacity: false,
display: '-1',
alwaysHide: true,
onActive: function(toggler, element){
toggler.setStyle('color', '#ff3300');
/* here we set the 'src' attribute properly,
so that the images load once the accordion is opened */
element.getElements('img').each(function(el) {
if(el.get('delaysrc')!=null)
el.set('src', el.get('delaysrc'));
});
},
onBackground: function(toggler, element){
toggler.setStyle('color', '#222');
}
});
</script>
<?php
}
}
if (($g_options['show_google_map'] == 1) || ($g_options['show_server_load_image'] == 1)) {
echo '<table class="data-table" style="margin-bottom:40px;">';
if ($g_options['show_google_map'] == 1) {
?>
<tr class="data-table-row">
<td style="text-align:center;">
<div id="map" style="margin:10px auto;width: 870px; height: 380px; color:black;"></div>
</td>
</tr>
<?php
}
if ($g_options['show_server_load_image'] == 1) {
?>
<tr class="data-table-row">
<td style="text-align:center;padding:0px;">
<img src="show_graph.php?type=1&amp;game=<?php echo $game ?>&amp;width=870&amp;height=200&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>" alt="Server Load Graph" title="serverLoadGraph" />
</td>
</tr>
<?php
}
echo '</table>';
}
if (($g_options['show_google_map'] == 0) && ($g_options['show_server_load_image'] == 0)) {
echo '<br /> ';
}
if ($g_options['slider'] == 0 || ($g_options['slider'] == 1 && count($servers) == 1)) {
$i=0;
for ($i=0; $i<count($servers); $i++)
{
$rowdata = $servers[$i];
$server_id = $rowdata['serverId'];
$c = ($i % 2) + 1;
$addr = $rowdata['addr'];
$kills = $rowdata['kills'];
$headshots = $rowdata['headshots'];
$player_string = $rowdata['act_players'] . "/" . $rowdata['max_players'];
$map_teama_wins = $rowdata['map_ct_wins'];
$map_teamb_wins = $rowdata['map_ts_wins'];
?>
<table class="data-table">
<tr class="data-table-head">
<td class="fSmall" style="width:37%;">&nbsp;Server</td>
<td class="fSmall" style="width:19%;">&nbsp;Address</td>
<td class="fSmall" style="width:7%;text-align:center;">&nbsp;Map</td>
<td class="fSmall" style="width:7%;text-align:center;">&nbsp;Played</td>
<td class="fSmall" style="width:10%;text-align:center;">&nbsp;Players</td>
<td class="fSmall" style="width:7%;text-align:center;">&nbsp;Kills</td>
<td class="fSmall" style="width:7%;text-align:center;">&nbsp;Headshots</td>
<td class="fSmall" style="width:6%;text-align:center;">&nbsp;HS:K</td>
</tr>
<tr class="game-table-row">
<td class="game-table-cell"><?php
$image = getImage("/games/$game/game");
echo '<img src="';
if ($image)
echo $image['url'];
else
echo IMAGE_PATH . '/game.gif';
echo "\" alt=\"$game\" />&nbsp;";
echo "<b><a href=\"" . $g_options['scripturl'] . "?mode=servers&amp;server_id=$server_id&amp;game=$game\" style=\"text-decoration:none;\">" . htmlspecialchars($rowdata['name']) . "</a></b>";
?></td>
<td class="game-table-cell"><?php
echo "$addr <a href=\"steam://connect/$addr\" style=\"color:black\">(Join)</a>";
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
echo $rowdata['act_map'];
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
$stamp = $rowdata['map_started']==0?0:time() - $rowdata['map_started'];
$hours = sprintf('%02d', floor($stamp / 3600));
$min = sprintf('%02d', floor(($stamp % 3600) / 60));
$sec = sprintf('%02d', floor($stamp % 60));
echo $hours . ':' . $min . ':' . $sec;
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
echo $player_string;
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
echo number_format($kills);
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
echo number_format($headshots);
?></td>
<td class="game-table-cell" style="text-align:center;"><?php
if ($kills > 0)
echo sprintf('%.4f', ($headshots / $kills));
else
echo sprintf('%.4f', 0);
?></td>
</tr>
</table>
<table class="data-table">
<tr class="data-table-row">
<td style="padding:0px;text-align:center;">
<a href="<?php $g_options['scripturl'] ?>?mode=servers&amp;server_id=<?php echo $server_id ?>&amp;game=<?php echo $game ?>" style="text-decoration:none;"><img src="show_graph.php?type=0&amp;game=<?php echo $game; ?>&amp;width=870&amp;height=200&amp;server_id=<?php echo $server_id ?>&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>" style="border:0px;" alt="Server Load Graph" title="Server Load Graph" /></a>
</td>
</tr>
</table>
<?php
printserverstats($server_id);
} // for servers
}
?>
</div></div>
<?php
if ($g_options['gamehome_show_awards'] == 1) {
$resultAwards = $db->query("
SELECT
hlstats_Awards.awardId,
hlstats_Awards.name,
hlstats_Awards.verb,
hlstats_Awards.d_winner_id,
hlstats_Awards.d_winner_count,
hlstats_Players.lastName AS d_winner_name,
hlstats_Players.flag AS flag,
hlstats_Players.country AS country
FROM
hlstats_Awards
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId = hlstats_Awards.d_winner_id
WHERE
hlstats_Awards.game='$game'
ORDER BY
hlstats_Awards.name
");
$result = $db->query("
SELECT
IFNULL(value, 1)
FROM
hlstats_Options
WHERE
keyname='awards_numdays'
");
if ($db->num_rows($result) == 1)
list($awards_numdays) = $db->fetch_row($result);
else
$awards_numdays = 1;
$result = $db->query("
SELECT
DATE_FORMAT(value, '%W %e %b'),
DATE_FORMAT( DATE_SUB( value, INTERVAL $awards_numdays DAY ) , '%W %e %b' )
FROM
hlstats_Options
WHERE
keyname='awards_d_date'
");
list($awards_d_date, $awards_s_date) = $db->fetch_row($result);
if ($db->num_rows($resultAwards) > 0 && $awards_d_date) {
?>
<div class="block" style="padding-top:20px">
<?php
printSectionTitle((($awards_numdays == 1) ? 'Daily' : "$awards_numdays Day")." Awards ($awards_d_date)");
?>
<div class="subblock">
<table class="data-table">
<?php
$c = 0;
while ($awarddata = $db->fetch_array($resultAwards))
{
$colour = ($c % 2) + 1;
$c++;
?>
<tr class="bg<?php echo $colour; ?>">
<td style="width:40%;"><?php
echo '<a href="'.$g_options['scripturl'].'?mode=dailyawardinfo&amp;award='.$awarddata['awardId']."&amp;game=$game\">".htmlspecialchars($awarddata['name']).'</a>';
?></td>
<td style="width:60%;"><?php
if ($awarddata['d_winner_id']) {
if ($g_options['countrydata'] == 1) {
$flag = '0.gif';
$alt = 'Unknown Country';
if ($awarddata['flag'] != '') {
$alt = ucfirst(strtolower($awarddata['country']));
}
echo "<img src=\"" . getFlag($awarddata['flag']) . "\" hspace=\"4\" alt=\"$alt\" title=\"$alt\" /><a href=\"{$g_options['scripturl']}?mode=playerinfo&amp;player={$awarddata['d_winner_id']}\"><b>" . htmlspecialchars($awarddata['d_winner_name'], ENT_COMPAT) . "</b></a> ({$awarddata['d_winner_count']} " . htmlspecialchars($awarddata['verb']) . ")";
} else {
echo "<img src=\"" . IMAGE_PATH . "/player.gif\" hspace=\"4\" alt=\"Player\" /><a href=\"{$g_options['scripturl']}?mode=playerinfo&amp;player={$awarddata['d_winner_id']}\"><b>" . htmlspecialchars($awarddata['d_winner_name'], ENT_COMPAT) . "</b></a> ({$awarddata['d_winner_count']} ". htmlspecialchars($awarddata['verb']) . ")";
}
}
else
{
echo '&nbsp;&nbsp; <em>No Award Winner</em>';
}
?></td>
</tr>
<?php
}
?></table>
</div></div>
<?php
}
}
?>

78
web/pages/gameslist.php Normal file
View File

@ -0,0 +1,78 @@
<?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.');
}
global $game;
// Get list of active games
$resultGames = $db->query("
SELECT
code,
name
FROM
hlstats_Games
WHERE
hidden='0'
ORDER BY
realgame, name ASC
");
?>
<ul id="header_gameslist">
<?php
// Iterate over array of game names and codes
while ($gamedata = $db->fetch_row($resultGames))
{
$image = getImage("/games/$gamedata[0]/game");
if ($image) {
if ($game == $gamedata[0]) {
$img_id = 'id="gameslist-active-game"';
} else {
$img_id = '';
}
echo "\t\t\t<li>\n";
echo "\t\t\t\t<a href=\"" . $g_options['scripturl'] . "?game=$gamedata[0]\">" .
"<img src=\"" .$image['url'] ."\" style=\"margin-left: 2px; margin-right: 2px;\" alt=\"" . strtoupper($gamedata[0]) ."\" title=\"" . $gamedata[1] ."\" $img_id /></a>";
echo "\n\t\t\t</li>\n";
}
}
?>
</ul>

340
web/pages/header.php Normal file
View File

@ -0,0 +1,340 @@
<?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.');
}
/*
* HLstatsX Page Header This file will be inserted at the top of every page
* generated by HLstats. This file can contain PHP code.
*/
// hit counter
$db->query("UPDATE hlstats_Options SET value=value+1 WHERE keyname='counter_hits';");
// visit counter
if ($_COOKIE['ELstatsNEO_Visit'] == 0) {
// kein cookie gefunden, also visitcounter erh<72>hen und cookie setzen
$db->query("UPDATE hlstats_Options SET value=value+1 WHERE keyname='counter_visits';");
@setcookie('ELstatsNEO_Visit', '1', time() + ($g_options['counter_visit_timeout'] * 60), '/');
}
global $game,$mode;
// see if they have a defined style or a new style they'd like
$selectedStyle = (isset($_COOKIE['style']) && $_COOKIE['style']) ? $_COOKIE['style'] : "";
$selectedStyle = isset($_POST['stylesheet']) ? $_POST['stylesheet'] : $selectedStyle;
// if they do make sure it exists
if(!empty($selectedStyle))
{
// this assumes that styles is up a directory from page_path, this might be a bad assumption
$testfile=sprintf("%s/%s/%s", PAGE_PATH, '../styles', $selectedStyle);
if(!file_exists($testfile))
{
$selectedStyle = "";
}
}
// if they don't have one defined or the defined was is invalid use the default
if(empty($selectedStyle))
{
$selectedStyle=$g_options['style'];
}
// if they had one, or tried to have one, set it to whatever we resolved it to
if (isset($_POST['stylesheet']) || isset($_COOKIE['style']))
{
setcookie('style', $selectedStyle, time()+60*60*24*30);
}
// this code here assumes that styles end with .css (the selector box for users and for admin does NOT check), someone may want to change this -octo
// Determine if we have custom nav images available
if ($selectedStyle) {
$style = preg_replace('/\.css$/','',$selectedStyle);
} else {
$style = preg_replace('/\.css$/','',$g_options['style']);
}
$iconpath = IMAGE_PATH . "/icons";
if (file_exists($iconpath . "/" . $style)) {
$iconpath = $iconpath . "/" . $style;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<link rel="stylesheet" type="text/css" href="hlstats.css" />
<link rel="stylesheet" type="text/css" href="styles/<?php echo $selectedStyle; ?>" />
<link rel="stylesheet" type="text/css" href="css/SqueezeBox.css" />
<!-- U R A SMACKHEAD -->
<?php
if ($mode == 'players')
{
echo "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/Autocompleter.css\" />\n";
}
?>
<link rel="SHORTCUT ICON" href="favicon.ico" />
<script type="text/javascript" src="<?php echo INCLUDE_PATH; ?>/js/mootools.js"></script>
<script type="text/javascript" src="<?php echo INCLUDE_PATH; ?>/js/SqueezeBox.js"></script>
<script type="text/javascript" src="<?php echo INCLUDE_PATH; ?>/js/heatmap.js"></script>
<?php
if ($g_options['playerinfo_tabs'] == '1') {
?>
<script type="text/javascript" src="<?php echo INCLUDE_PATH; ?>/js/tabs.js"></script>
<?php
}
?>
<title>
<?php
echo $g_options['sitename'];
foreach ($title as $t)
{
echo " - $t";
}
?>
</title>
</head>
<body>
<?php
//JS Check
if ( $_POST['js'] )
{
$_SESSION['nojs'] = 0;
} else {
if ((!isset($_SESSION['nojs'])) or ($_SESSION['nojs'] == 1)) {
// Send javascript form - if they have javascript enabled it will POST the JS variable, and the code above will update their session variable
echo '
<!-- Either this is your first visit in a while, or you don\'t have javascript enabled -->
<form name="jsform" id="jsform" action="" method="post" style="display:none">
<div>
<input name="js" type="text" value="true" />
<script type="text/javascript">
document.jsform.submit();
</script>
</div>
</form>'
;
$_SESSION['nojs'] = 1;
$g_options['playerinfo_tabs'] = 0;
$g_options['show_google_map'] = 0;
}
}
// Determine if we should show SourceBans links/Forum links
if ($g_options['sourcebans_address'] && file_exists($iconpath . "/title-sourcebans.png")) {
$extratabs .= "<li><a href=\"". $g_options['sourcebans_address'] . "\" target=\"_blank\"><img src=\"" . $iconpath . "/title-sourcebans.png\" alt=\"SourceBans\" /></a></li>\n";
}
if ($g_options['forum_address'] && file_exists($iconpath . "/title-forum.png")) {
$extratabs .= "<li><a href=\"" . $g_options['forum_address'] . "\" target=\"_blank\"><img src=\"" . $iconpath . "/title-forum.png\" alt=\"Forum\" /></a></li>\n";
}
?>
<div class="block">
<div class="headerblock">
<div class="title">
<a href="<?php echo $g_options['scripturl']; ?>"><img src="<?php echo $iconpath; ?>/title.png" alt="HLstatsX Community Edition" title="HLstatsX Community Edition" /></a>
</div>
<?php
// Grab count of active games -- if 1, we won't show the games list icons
$resultGames = $db->query("
SELECT
COUNT(code)
FROM
hlstats_Games
WHERE
hidden='0'
");
list($num_games) = $db->fetch_row($resultGames);
if ($num_games > 1 && $g_options['display_gamelist'] == 1) {
?>
<div class="header_gameslist"><?php @include(PAGE_PATH .'/gameslist.php'); ?></div>
<?php
}
?>
<div class="headertabs">
<ul>
<li><a href="<?php echo $g_options['scripturl'] ?>"><img src="<?php echo $iconpath; ?>/title-contents.png" alt="Contents" /></a></li>
<li><a href="<?php echo $g_options['scripturl'] ?>?mode=search"><img src="<?php echo $iconpath; ?>/title-search.png" alt="Search" /></a></li>
<?php if ($extratabs) { print $extratabs; } ?>
<li><a href="<?php echo $g_options['scripturl'] ?>?mode=help"><img src="<?php echo $iconpath; ?>/title-help.png" alt="Help" /></a></li>
</ul>
</div>
</div>
<div class="location" style="clear:both;width:100%;">
<ul class="fNormal" style="float:left">
<?php
if ($g_options['sitename'] && $g_options['siteurl'])
{
echo '<li><a href="http://' . preg_replace('/http:\/\//', '', $g_options['siteurl']) . '">'. $g_options['sitename'] . '</a> <span class="arrow">&raquo;</span></li>';
}
echo '<li><a href="http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '">HLstatsX</a>';
$i=0;
foreach ($location as $l=>$url)
{
$url = preg_replace('/%s/', $g_options['scripturl'], $url);
$url = preg_replace('/&/', '&amp;', $url);
echo ' <span class="arrow">&raquo;</span></li><li>';
if ($url) {
echo "<a href=\"$url\">$l</a>";
} else {
echo "<strong>$l</strong>";
}
$i++;
}
?> </li>
</ul>
<?php
if ($g_options['display_style_selector'] == 1) {
?>
<div class="fNormal" style="float:right;">
<form name="style_selection" id="style_selection" action="" method="post"> Style:
<select name="stylesheet" onchange="document.style_selection.submit()">
<?php
$d = dir('styles');
while (false !== ($e = $d->read())) {
if (is_file("styles/$e") && ($e != '.') && ($e != '..') && $e != $g_options['style']) {
$ename = ucwords(strtolower(str_replace(array('_','.css'), array(' ',''), $e)));
$styles[$e] = $ename;
}
}
$d->close();
asort($styles);
$styles = array_merge(array($g_options['style'] => 'Default'),$styles);
foreach ($styles as $e => $ename) {
$sel = '';
if ($e == $selectedStyle) $sel = ' selected="selected"';
echo "\t\t\t\t<option value=\"$e\"$sel>$ename</option>\n";
} ?>
</select>
</form>
</div>
<?php
}
?>
</div>
<div class="location_under" style="clear:both;width:100%;"></div>
</div>
<br />
<div class="content" style="clear:both;">
<?php
global $mode;
if ($g_options['bannerdisplay'] != 0 && ($mode == 'contents' || $g_options['bannerdisplay']==1)) {
?>
<div class="block" style="text-align:center;">
<img src="<?php echo ((strncmp($g_options['bannerfile'], 'http:/', 6) == 0)?$g_options['bannerfile']:IMAGE_PATH.'/'.$g_options['bannerfile']); ?>" alt="Banner" />
</div>
<?php
}
?>
<?php
if ($game != '') {
?>
<span class="fHeading">&nbsp;<img src="<?php echo IMAGE_PATH; ?>/downarrow.gif" alt="" />&nbsp;Sections</span><p />
<ul class="navbar">
<li><a href="<?php echo $g_options['scripturl'] . "?game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-servers.png" alt="Servers" /></a> <a href="<?php echo $g_options['scripturl'] . "?game=$game"; ?>" class="fHeading">Servers</a></li>
<?php
if ($g_options['nav_globalchat']==1) {
?>
<li><a href="<?php echo $g_options['scripturl'] . "?mode=chat&amp;game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-chat.png" alt="Chat" /></a> <a href="<?php echo $g_options['scripturl'] . "?mode=chat&amp;game=$game"; ?>" class="fHeading">Chat</a></li>
<?php
}
?>
<li><a href="<?php echo $g_options['scripturl'] . "?mode=players&amp;game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-players.png" alt="Players" /></a> <a href="<?php echo $g_options['scripturl'] . "?mode=players&amp;game=$game"; ?>" class="fHeading">Players</a></li>
<li><a href="<?php echo $g_options['scripturl'] . "?mode=clans&amp;game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-clans.png" alt="Clans" /></a> <a href="<?php echo $g_options['scripturl'] . "?mode=clans&amp;game=$game"; ?>" class="fHeading">Clans</a></li>
<?php
if ($g_options["countrydata"]==1) {
?>
<li><a href="<?php echo $g_options['scripturl'] . "?mode=countryclans&amp;game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-countryclans.png" alt="CountryClans" /></a> <a href="<?php echo $g_options['scripturl'] . "?mode=countryclans&amp;game=$game&amp;sort=nummembers"; ?>" class="fHeading">Countries</a></li>
<?php
}
?>
<li><a href="<?php echo $g_options['scripturl'] . "?mode=awards&amp;game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-awards.png" alt="Awards" /></a> <a href="<?php echo $g_options['scripturl'] . "?mode=awards&amp;game=$game"; ?>" class="fHeading">Awards</a></li>
<?php
// look for actions
$db->query("SELECT game FROM hlstats_Actions WHERE game='".$game."' LIMIT 1");
if ($db->num_rows()>0) {
?>
<li><a href="<?php echo $g_options['scripturl'] . "?mode=actions&amp;game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-actions.png" alt="Actions" /></a> <a href="<?php echo $g_options['scripturl'] . "?mode=actions&amp;game=$game"; ?>" class="fHeading">Actions</a></li>
<?php
}
?>
<li><a href="<?php echo $g_options['scripturl'] . "?mode=weapons&amp;game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-weapons.png" alt="Weapons" /></a> <a href="<?php echo $g_options['scripturl'] . "?mode=weapons&amp;game=$game"; ?>" class="fHeading">Weapons</a></li>
<li><a href="<?php echo $g_options['scripturl'] . "?mode=maps&amp;game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-maps.png" alt="Maps" /></a> <a href="<?php echo $g_options['scripturl'] . "?mode=maps&amp;game=$game"; ?>" class="fHeading">Maps</a></li>
<?php
$result = $db->query("SELECT game from hlstats_Roles WHERE game='$game' AND hidden = '0'");
$numitems = $db->num_rows($result);
if ($numitems > 0) {
?>
<li><a href="<?php echo $g_options['scripturl'] . "?mode=roles&amp;game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-roles.png" alt="Roles" /></a> <a href="<?php echo $g_options['scripturl'] . "?mode=roles&amp;game=$game"; ?>" class="fHeading">Roles</a></li>
<?php
}
if ($g_options['nav_cheaters'] == 1) {
?>
<li><a href="<?php echo $g_options['scripturl'] . "?mode=bans&amp;game=$game"; ?>" class="fHeading"><img src="<?php echo $iconpath; ?>/nav-bans.png" alt="Banned" /></a> <a href="<?php echo $g_options['scripturl'] . "?mode=bans&amp;game=$game"; ?>" class="fHeading">Bans</a></li>
<?php
}
?>
</ul>
<?php
}
?>

324
web/pages/help.php Normal file
View File

@ -0,0 +1,324 @@
<?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.');
}
global $game;
$resultGames = $db->query
("
SELECT
hlstats_Games.code,
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.hidden = '0'
ORDER BY
hlstats_Games.name ASC
LIMIT
0,
1
");
list($game) = $db->fetch_row($resultGames);
// Help
pageHeader
(
array ('Help'),
array ('Help' => '')
);
?>
<div class="block">
<?php printSectionTitle('Questions'); ?>
<ol>
<li>
<a href="#players">How are players tracked? Or, why is my name listed more than once?</a><br />
</li>
<li>
<a href="#points">How is the "points" rating calculated?</a><br />
</li>
<li>
<a href="#weaponmods">What are all the weapon points modifiers?</a><br />
</li>
<li>
<a href="#set">How can I set my real name, e-mail address, and homepage?</a><br />
</li>
<li>
<a href="#hideranking">My rank is embarrassing. How can I opt out?</a>
</li>
</ol>
<?php printSectionTitle('Answers'); ?>
<div style="margin-left:2%;">
<h1 class="fTitle" style="padding-top:10px;"><a name="players">1. How are players tracked? Or, why is my name listed more than once?</a></h1><br /><br />
<?php
if ($g_options['Mode'] == 'NameTrack')
{
?>
Players are tracked by nickname. All statistics for any player using a particular name will be grouped under that name. It is not possible for a name to be listed more than once for each game.<br /><br />
<?php
}
else
{
if ($g_options['Mode'] == 'LAN')
{
$uniqueid = 'IP Address';
$uniqueid_plural = 'IP Addresses';
?>
Players are tracked by IP Address. IP addresses are specific to a computer on a network.<br /><br />
<?php
}
else
{
$uniqueid = 'Unique ID';
$uniqueid_plural = 'Unique IDs';
?>
Players are tracked by Unique ID. Your Unique ID is the last two sections of your Steam ID (X:XXXX).<br /><br />
<?php
}
?>
A player may have more than one name. On the Player Rankings pages, players are shown with the most recent name they used in the game. If you click on a player's name, the Player Details page will show you a list of all other names that this player uses, if any, under the Aliases section (if the player has not used any other names, the Aliases section will not be displayed).<br /><br />
Your name may be listed more than once if somebody else (with a different <?php echo $uniqueid; ?>) uses the same name.<br /><br />
You can use the <a href="<?php echo $g_options['scripturl']; ?>?mode=search">Search</a> function to find a player by name or <?php echo $uniqueid; ?>.<br /><br />
<?php
}
?>
<h1 class="fTitle" style="padding-top:10px;"><a name="points">2. How is the "points" rating calculated?</a></h1><br /><br />
A new player has 1000 points. Every time you make a kill, you gain a certain amount of points depending on a) the victim's points rating, and b) the weapon you used. If you kill someone with a higher points rating than you, then you gain more points than if you kill someone with a lower points rating than you. Therefore, killing newbies will not get you as far as killing the #1 player. And if you kill someone with your knife, you gain more points than if you kill them with a rifle, for example.<br /><br />
When you are killed, you lose a certain amount of points, which again depends on the points rating of your killer and the weapon they used (you don't lose as many points for being killed by the #1 player with a rifle than you do for being killed by a low ranked player with a knife). This makes moving up the rankings easier, but makes staying in the top spots harder.<br /><br />
Specifically, the equations are:<br /><br />
<pre> Killer Points = Killer Points + (Victim Points / Killer Points)
&times; Weapon Modifier &times; 5
Victim Points = Victim Points - (Victim Points / Killer Points)
&times; Weapon Modifier &times; 5</pre><br /><br />
Plus, the following point bonuses are available for completing objectives in some games:<br /><br />
<a name="actions" />
<?php
$tblActions = new Table
(
array
(
new TableColumn
(
'gamename',
'Game',
'width=24&sort=no'
),
new TableColumn
(
'for_PlayerActions',
'Player Action',
'width=4&sort=no&align=center'
),
new TableColumn
(
'for_PlayerPlayerActions',
'PlyrPlyr Action',
'width=4&sort=no&align=center'
),
new TableColumn
(
'for_TeamActions',
'Team Action',
'width=4&sort=no&align=center'
),
new TableColumn
(
'for_WorldActions',
'World Action',
'width=4&sort=no&align=center'
),
new TableColumn
(
'description',
'Action',
'width=33'
),
new TableColumn
(
's_reward_player',
'Player Reward',
'width=12'
),
new TableColumn
(
's_reward_team',
'Team Reward',
'width=15'
)
),
'id',
'description',
's_reward_player',
false,
9999,
'act_page',
'act_sort',
'act_sortorder',
'actions',
'asc'
);
$result = $db->query
("
SELECT
hlstats_Games.name AS gamename,
hlstats_Actions.description,
IF(SIGN(hlstats_Actions.reward_player) > 0, CONCAT('+', hlstats_Actions.reward_player), hlstats_Actions.reward_player) AS s_reward_player,
IF(hlstats_Actions.team != '' AND hlstats_Actions.reward_team != 0,
IF(SIGN(hlstats_Actions.reward_team) >= 0, CONCAT(hlstats_Teams.name, ' +', hlstats_Actions.reward_team), CONCAT(hlstats_Teams.name, ' ', hlstats_Actions.reward_team)), '') AS s_reward_team,
IF(for_PlayerActions='1', 'Yes', 'No') AS for_PlayerActions,
IF(for_PlayerPlayerActions='1', 'Yes', 'No') AS for_PlayerPlayerActions,
IF(for_TeamActions='1', 'Yes', 'No') AS for_TeamActions,
IF(for_WorldActions='1', 'Yes', 'No') AS for_WorldActions
FROM
hlstats_Actions
INNER JOIN
hlstats_Games
ON
hlstats_Games.code = hlstats_Actions.game
AND hlstats_Games.hidden = '0'
LEFT JOIN
hlstats_Teams
ON
hlstats_Teams.code = hlstats_Actions.team
AND hlstats_Teams.game = hlstats_Actions.game
ORDER BY
hlstats_Actions.game ASC,
$tblActions->sort $tblActions->sortorder,
$tblActions->sort2 $tblActions->sortorder
");
$numitems = $db->num_rows($result);
$tblActions->draw($result, $numitems, 90, 'center');
?><br /><br />
<strong>Note:</strong> The player who triggers an action may receive both the player reward and the team reward.<br /><br />
<h1 class="fTitle" style="padding-top:10px;"><a name="weaponmods">3. What are all the weapon points modifiers?</a></h1><br /><br />
Weapon points modifiers are used to determine how many points you should gain or lose when you make a kill or are killed by another player. Higher modifiers indicate that more points will be gained when killing with that weapon (and similarly, more points will be lost when being killed <em>by</em> that weapon). Modifiers generally range from 0.00 to 2.00.<br /><br />
<a name="weapons"></a>
<?php
$tblWeapons = new Table
(
array
(
new TableColumn
(
'gamename',
'Game',
'width=24&sort=no'
),
new TableColumn
(
'code',
'Weapon',
'width=14'
),
new TableColumn
(
'name',
'Name',
'width=50'
),
new TableColumn
(
'modifier',
'Points Modifier',
'width=12'
)
),
'weaponId',
'modifier',
'code',
false,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'weapons',
'desc'
);
$result = $db->query
("
SELECT
hlstats_Games.name AS gamename,
hlstats_Weapons.code,
hlstats_Weapons.name,
hlstats_Weapons.modifier
FROM
hlstats_Weapons
INNER JOIN
hlstats_Games
ON
hlstats_Games.code = hlstats_Weapons.game
AND hlstats_Games.hidden = '0'
ORDER BY
hlstats_Weapons.game ASC,
$tblWeapons->sort $tblWeapons->sortorder,
$tblWeapons->sort2 $tblWeapons->sortorder
");
$numitems = $db->num_rows($result);
$tblWeapons->draw($result, $numitems, 90, "center");
?><br /><br />
<h1 class="fTitle" style="padding-top:10px;"><a name="set">4. How can I set my real name, e-mail address, and homepage?</a></h1><br /><br />
Player profile options can be configured by saying the appropriate <strong>HLX_SET</strong> command while you are playing on a participating game server. To say commands, push your chat key and type the command text.<br /><br />
Syntax: say <strong>/hlx_set option value</strong>.<br /><br />
Acceptable "options" are:
<ul>
<li><strong>realname</strong><br />
Sets your Real Name as shown in your profile.<br />
Example: &nbsp; <strong>/hlx_set realname Joe Bloggs</strong><br /><br />
</li>
<li><strong>email</strong><br />
Sets your E-mail Address as shown in your profile.<br />
Example: &nbsp; <strong>/hlx_set email joe@joebloggs.com</strong><br /><br />
</li>
<li><strong>homepage</strong><br />
Sets your Home Page as shown in your profile.<br />
Example: &nbsp; <strong>/hlx_set homepage http://www.joebloggs.com/</strong><br /><br />
</li>
</ul>
<strong>Note:</strong> These are not standard Half-Life console commands. If you type them in the console, Half-Life will give you an error.<br /><br />For a full list of supported ingame commands, type the word help into ingame chat.<br /><br />
<h1 class="fTitle" style="padding-top:10px;"><a name="hideranking">5. My rank is embarrassing. How can I opt out?</a></h1><br /><br />
Say <b>/hlx_hideranking</b> while playing on a participating game server. This will toggle you between being visible on the Player Rankings and being invisible.<br /><br />
<strong>Note:</strong> You will still be tracked and you can still view your Player Details page. Use the <a href="<?php echo $g_options['scripturl']; ?>?mode=search">Search</a> page to find yourself.
</div>
</div>

View File

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

View File

@ -0,0 +1,215 @@
<?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.'); }
// Player Details
$player = valid_request(intval($_GET['player']), 1);
$uniqueid = valid_request(strval($_GET['uniqueid']), 0);
$game = valid_request(strval($_GET['game']), 0);
if (!$player && $uniqueid)
{
if (!$game)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid");
exit;
}
$db->query("
SELECT
playerId
FROM
hlstats_PlayerUniqueIds
WHERE
uniqueId='$uniqueid'
AND game='$game'
");
if ($db->num_rows() > 1)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid&game=$game");
exit;
}
elseif ($db->num_rows() < 1)
{
error("No players found matching uniqueId '$uniqueid'");
}
else
{
list($player) = $db->fetch_row();
$player = intval($player);
}
}
elseif (!$player && !$uniqueid)
{
error('No player ID specified.');
}
$db->query("
SELECT
hlstats_Players.playerId,
hlstats_Players.lastName,
hlstats_Players.game
FROM
hlstats_Players
WHERE
playerId='$player'
");
if ($db->num_rows() != 1)
error("No such player '$player'.");
$playerdata = $db->fetch_array();
$db->free_result();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . "...";
}
else
{
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$pl_urlname = urlencode($playerdata['lastName']);
$game = $playerdata['game'];
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
$gamename = ucfirst($game);
else
list($gamename) = $db->fetch_row();
$tblWeaponstats = new Table(
array(
new TableColumn(
'smweapon',
'Weapon',
'width=10&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&weapon=%k&game=$game")
),
new TableColumn(
'smshots',
'Shots',
'width=10&align=right'
),
new TableColumn(
'smhits',
'Hits',
'width=10&align=right'
),
new TableColumn(
'smdamage',
'Damage',
'width=10&align=right'
),
new TableColumn(
'smheadshots',
'Headshots',
'width=9&align=right'
),
new TableColumn(
'smkills',
'Kills',
'width=9&align=right'
),
new TableColumn(
'smaccuracy',
'Accuracy',
'width=9&align=right&append=' . urlencode('%')
),
new TableColumn(
'smdhr',
'Damage Per Hit',
'width=14&align=right'
),
new TableColumn(
'smspk',
'Shots Per Kill',
'width=14&align=right'
)
),
'smweapon',
'smkdr',
'smweapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'weaponstats'
);
$result = $db->query("
SELECT
hlstats_Events_Statsme.weapon AS smweapon,
SUM(hlstats_Events_Statsme.kills) AS smkills,
SUM(hlstats_Events_Statsme.hits) AS smhits,
SUM(hlstats_Events_Statsme.shots) AS smshots,
SUM(hlstats_Events_Statsme.headshots) AS smheadshots,
SUM(hlstats_Events_Statsme.deaths) AS smdeaths,
SUM(hlstats_Events_Statsme.damage) AS smdamage,
ROUND((SUM(hlstats_Events_Statsme.damage) / (IF( SUM(hlstats_Events_Statsme.hits)=0, 1, SUM(hlstats_Events_Statsme.hits) ))), 1) as smdhr,
SUM(hlstats_Events_Statsme.kills) / IF((SUM(hlstats_Events_Statsme.deaths)=0), 1, (SUM(hlstats_Events_Statsme.deaths))) as smkdr,
ROUND((SUM(hlstats_Events_Statsme.hits) / SUM(hlstats_Events_Statsme.shots) * 100), 1) as smaccuracy,
ROUND(( (IF(SUM(hlstats_Events_Statsme.kills)=0, 0, SUM(hlstats_Events_Statsme.shots))) / (IF( SUM(hlstats_Events_Statsme.kills)=0, 1, SUM(hlstats_Events_Statsme.kills) ))), 1) as smspk
FROM
hlstats_Events_Statsme
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Statsme.serverId
WHERE
hlstats_Servers.game='$game' AND hlstats_Events_Statsme.PlayerId=$player
GROUP BY
hlstats_Events_Statsme.weapon
HAVING
SUM(hlstats_Events_Statsme.shots)>0
ORDER BY
$tblWeaponstats->sort $tblWeaponstats->sortorder,
$tblWeaponstats->sort2 $tblWeaponstats->sortorder
");
if ($db->num_rows($result) != 0)
{
$tblWeaponstats->draw($result, $db->num_rows($result), 100);
}
?>

View File

@ -0,0 +1,181 @@
<?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.'); }
// Action Details
// Addon created by Rufus (rufus@nonstuff.de)
$action = valid_request($_GET['action'], 0)
or error('No action ID specified.');
$db->query("
SELECT
description
FROM
hlstats_Actions
WHERE
id='$action_id'
AND game='$game'
");
if ($db->num_rows() != 1)
{
$act_name = ucfirst($action);
}
else
{
$actiondata = $db->fetch_array();
$db->free_result();
$act_name = $actiondata['description'];
}
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
error('Invalid or no game specified.');
else
list($gamename) = $db->fetch_row();
$table = new Table(
array(
new TableColumn(
'playerName',
'Player',
'width=45&align=left&flag=1&link=' . urlencode("mode=statsme&amp;player=%k")
),
new TableColumn(
'obj_count',
'Achieved',
'width=25&align=right'
),
new TableColumn(
'obj_bonus',
'Skill Bonus Total',
'width=25&align=right&sort=no'
)
),
'playerId',
'obj_count',
'playerName',
true,
50
);
$result = $db->query("
SELECT
hlstats_Events_PlayerActions.playerId,
hlstats_Players.lastName AS playerName,
hlstats_Players.flag as flag,
COUNT(hlstats_Events_PlayerActions.id) AS obj_count,
COUNT(hlstats_Events_PlayerActions.id) * hlstats_Actions.reward_player AS obj_bonus
FROM
hlstats_Events_PlayerActions, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '$action' AND
hlstats_Players.game = '$game' AND
hlstats_Players.playerId = hlstats_Events_PlayerActions.playerId AND
hlstats_Events_PlayerActions.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking<>'1'
GROUP BY
hlstats_Events_PlayerActions.playerId
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT $table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(DISTINCT hlstats_Events_PlayerActions.playerId),
COUNT(hlstats_Events_PlayerActions.Id)
FROM
hlstats_Events_PlayerActions, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '$action' AND
hlstats_Players.game = '$game' AND
hlstats_Players.playerId = hlstats_Events_PlayerActions.playerId AND
hlstats_Events_PlayerActions.actionId = hlstats_Actions.id
");
list($numitems, $totalact) = $db->fetch_row($resultCount);
if ($totalact == 0) {
$result = $db->query("
SELECT
hlstats_Events_TeamBonuses.playerId,
hlstats_Players.lastName AS playerName,
hlstats_Players.flag as flag,
COUNT(hlstats_Events_TeamBonuses.id) AS obj_count,
COUNT(hlstats_Events_TeamBonuses.id) * hlstats_Actions.reward_player AS obj_bonus
FROM
hlstats_Events_TeamBonuses, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '$action' AND
hlstats_Players.game = '$game' AND
hlstats_Players.playerId = hlstats_Events_TeamBonuses.playerId AND
hlstats_Events_TeamBonuses.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking<>'1'
GROUP BY
hlstats_Events_TeamBonuses.playerId
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT $table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(DISTINCT hlstats_Events_TeamBonuses.playerId),
COUNT(hlstats_Events_TeamBonuses.Id)
FROM
hlstats_Events_TeamBonuses, hlstats_Players, hlstats_Actions
WHERE
hlstats_Actions.code = '$action' AND
hlstats_Players.game = '$game' AND
hlstats_Players.playerId = hlstats_Events_TeamBonuses.playerId AND
hlstats_Events_TeamBonuses.actionId = hlstats_Actions.id
");
list($numitems, $totalact) = $db->fetch_row($resultCount);
}
?>
<?php
$table->draw($result, $numitems, 100, 'center');
?>

View File

@ -0,0 +1,114 @@
<?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.'); }
// Action Statistics
$player = valid_request(intval($_GET['player']), 1);
$uniqueid = valid_request(strval($_GET['uniqueid']), 0);
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
$tblPlayerActions = new Table(
array(
new TableColumn(
'description',
'Action',
'width=45&link=' . urlencode("mode=actioninfo&amp;action=%k&amp;game=$game")
),
new TableColumn(
'obj_count',
'Achieved',
'width=25&align=right&append=+times'
),
new TableColumn(
'obj_bonus',
'Skill Bonus',
'width=25&align=right'
)
),
'code',
'obj_count',
'description',
true,
9999,
'obj_page',
'obj_sort',
'obj_sortorder'
);
$db->query("
SELECT
SUM(count)
FROM
hlstats_Actions
WHERE
hlstats_Actions.game='$game'
");
list($totalactions) = $db->fetch_row();
$result = $db->query("
SELECT
code,
description,
count AS obj_count,
reward_player AS obj_bonus
FROM
hlstats_Actions
WHERE
hlstats_Actions.game='$game'
AND count > 0
GROUP BY
hlstats_Actions.id
ORDER BY
$tblPlayerActions->sort $tblPlayerActions->sortorder,
$tblPlayerActions->sort2 $tblPlayerActions->sortorder
");
?>
<?php
$tblPlayerActions->draw($result, $db->num_rows($result), 100);
?>

140
web/pages/ingame/bans.php Normal file
View File

@ -0,0 +1,140 @@
<?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.'); }
// Player Rankings
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
$minkills = 0;
$table = new Table(
array(
new TableColumn(
"lastName",
"Name",
"width=40&flag=1&link=" . urlencode("mode=statsme&amp;player=%k")
),
new TableColumn(
"ban_date",
"BanDate",
"width=25&align=right"
),
new TableColumn(
"skill",
"Points",
"width=5&align=right"
),
new TableColumn(
"kills",
"Kills",
"width=5&align=right"
),
new TableColumn(
"deaths",
"Deaths",
"width=5&align=right"
),
new TableColumn(
"headshots",
"Headshots",
"width=5&align=right"
),
new TableColumn(
"hpk",
"HS:K",
"width=5&align=right"
),
new TableColumn(
"kpd",
"KPD",
"width=5&align=right"
),
),
"playerId",
"last_event",
"skill",
true,
25
);
$result = $db->query("
SELECT
FROM_UNIXTIME(last_event,'%Y.%m.%d %T') as ban_date,
playerId,
lastName,
country,
flag,
skill,
kills,
deaths,
IFNULL(kills/deaths, '-') AS kpd,
headshots,
IFNULL(headshots/kills, '-') AS hpk
FROM
hlstats_Players
WHERE
game='$game'
AND hideranking=2
AND kills >= $minkills
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder,
lastName ASC
LIMIT $table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(*)
FROM
hlstats_Players
WHERE
game='$game'
AND hideranking=2
AND kills >= $minkills
");
list($numitems) = $db->fetch_row($resultCount);
$table->draw($result, 25, 100);
?>

View File

@ -0,0 +1,275 @@
<?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.'); }
// Clan Details
$clan = valid_request(intval($_GET['clan']),1)
or error('No clan ID specified.');
$db->query("
SELECT
hlstats_Clans.tag,
hlstats_Clans.name,
hlstats_Clans.homepage,
hlstats_Clans.game,
SUM(hlstats_Players.kills) AS kills,
SUM(hlstats_Players.deaths) AS deaths,
SUM(hlstats_Players.connection_time) AS connection_time,
COUNT(hlstats_Players.playerId) AS nummembers,
ROUND(AVG(hlstats_Players.skill)) AS avgskill,
TRUNCATE(AVG(activity),2) as activity
FROM
hlstats_Clans
LEFT JOIN hlstats_Players ON
hlstats_Players.clan = hlstats_Clans.clanId
WHERE
hlstats_Clans.clanId=$clan
AND hlstats_Players.hideranking = 0
GROUP BY
hlstats_Clans.clanId
");
if ($db->num_rows() != 1)
error("No such clan '$clan'.");
$clandata = $db->fetch_array();
$db->free_result();
$cl_name = preg_replace(' ', '&nbsp;', htmlspecialchars($clandata['name']));
$cl_tag = preg_replace(' ', '&nbsp;', htmlspecialchars($clandata['tag']));
$cl_full = "$cl_tag $cl_name";
$game = $clandata['game'];
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
$gamename = ucfirst($game);
else
list($gamename) = $db->fetch_row();
?>
<table class="data-table">
<tr class="data-table-head">
<td colspan="3" class="fSmall"><?php echo 'Clan Profile Stats Summary' ?></td>
</tr>
<tr class="bg1">
<td class="fSmall"><?php echo 'Clan Name' ?>:</td>
<td colspan="2" class="fSmall"><?php
echo '<strong>'.$clandata['name'].'</strong>';
?></td>
</tr>
<tr class="bg2">
<td class="fSmall"><?php echo 'Home Page' ?>:</td>
<td colspan="2" class="fSmall"><?php
if ($url = getLink($clandata['homepage']))
{
echo $url;
}
else
{
echo '(Not specified.)';
}
?></td>
</tr>
<tr class="bg1">
<td class="fSmall"><?php echo 'Number Of Members' ?>:</td>
<td colspan="2" class="fSmall"><?php
echo $clandata['nummembers'];
?></td>
</tr>
<tr class="bg2">
<td class="fSmall"><?php echo 'Avg. Member Points' ?>:</td>
<td colspan="2" class="fSmall"><?php
echo number_format($clandata['avgskill']);
?></td>
</tr>
<tr class="bg1">
<td style="width:45%;" class="fSmall"><?php echo 'Activity' ?>:</td>
<td style="width:40%;"><?php
$width = sprintf('%d%%', $clandata['activity'] + 0.5);
$bar_type = 1;
if ($clandata['activity'] > 40)
$bar_type = '6';
elseif ($clandata['activity'] > 30)
$bar_type = '5';
elseif ($clandata['activity'] > 20)
$bar_type = '4';
elseif ($clandata['activity'] > 10)
$bar_type = '3';
elseif ($clandata['activity'] > 5)
$bar_type = '2';
echo "<img src=\"" . IMAGE_PATH . "/bar$bar_type.gif\" class=\"bargraph\" style=\"width:$width%\" alt=\"".$clandata['activity'].'%">';
?></td>
<td style="width:15%;" class="fSmall"><?php
echo sprintf('%0.2f', $clandata['activity']).'%';
?></td>
</tr>
<tr class="bg2">
<td class="fSmall"><?php echo 'Total Kills' ?>:</td>
<td colspan="2" class="fSmall"><?php
echo number_format($clandata['kills']);
?></td>
</tr>
<tr class="bg1">
<td class="fSmall"><?php echo 'Total Deaths' ?>:</td>
<td colspan="2" class="fSmall"><?php
echo number_format($clandata['deaths']);
?></td>
</tr>
<tr class="bg2">
<td class="fSmall"><?php echo 'Kills per Death' ?>:</td>
<td colspan="2" class="fSmall"><?php
if ($clandata['deaths'] != 0)
{
printf('%0.2f', $clandata['kills'] / $clandata['deaths']);
}
else
{
echo '-';
}
?></td>
</tr>
<tr class="bg1">
<td class="fSmall"><?php echo 'Total Connection Time' ?>:</td>
<td colspan="2" class="fSmall"><?php
echo timestamp_to_str($clandata['connection_time']);
?></td>
</tr>
</table>
<?php
flush();
$tblMembers = new Table(
array(
new TableColumn(
'lastName',
'Name',
'width=32&flag=1&link=' . urlencode('mode=statsme&amp;player=%k')
),
new TableColumn(
'skill',
'Points',
'width=7&align=right'
),
new TableColumn(
'activity',
'Activity',
'width=9&sort=no&type=bargraph'
),
new TableColumn(
'connection_time',
'Time',
'width=14&align=right&type=timestamp'
),
new TableColumn(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn(
'percent',
'Clan Kills',
'width=5&sort=no&type=bargraph'
),
new TableColumn(
'percent',
'%',
'width=7&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn(
'kpd',
'KPD',
'width=7&align=right'
),
),
'playerId',
'skill',
'kpd',
true,
20,
'members_page',
'members_sort',
'members_sortorder',
'members'
);
$result = $db->query("
SELECT
playerId,
lastName,
country,
flag,
skill,
connection_time,
kills,
deaths,
IFNULL(kills/deaths, '-') AS kpd,
(kills/" . $clandata["kills"] . ") * 100 AS percent,
activity
FROM
hlstats_Players
WHERE
clan=$clan
AND hlstats_Players.hideranking = 0
ORDER BY
$tblMembers->sort $tblMembers->sortorder,
$tblMembers->sort2 $tblMembers->sortorder,
lastName ASC
LIMIT $tblMembers->startitem,$tblMembers->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(*)
FROM
hlstats_Players
WHERE
clan=$clan
AND hlstats_Players.hideranking = 0
");
list($numitems) = $db->fetch_row($resultCount);
$tblMembers->draw($result, $numitems, 100);
?>

177
web/pages/ingame/clans.php Normal file
View File

@ -0,0 +1,177 @@
<?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.'); }
// Clan Rankings
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
if (isset($_GET['minmembers']))
{
$minmembers = valid_request(intval($_GET['minmembers']), 1);
}
else
{
$minmembers = 3;
}
$table = new Table
(
array
(
new TableColumn
(
'name',
'Clan',
'width=25&icon=clan&link=' . urlencode('mode=claninfo&amp;clan=%k')
),
new TableColumn
(
'tag',
'Tag',
'width=15&align=center'
),
new TableColumn
(
'skill',
'Avg. Points',
'width=8&align=right&skill_change=1'
),
new TableColumn
(
'nummembers',
'Members',
'width=5&align=right'
),
new TableColumn
(
'activity',
'Activity',
'width=8&type=bargraph'
),
new TableColumn
(
'connection_time',
'Connection Time',
'width=13&align=right&type=timestamp'
),
new TableColumn
(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=7&align=right'
)
),
'clanId',
'skill',
'kpd',
true
);
$result = $db->query("
SELECT
hlstats_Clans.clanId,
hlstats_Clans.name,
hlstats_Clans.tag,
COUNT(hlstats_Players.playerId) AS nummembers,
SUM(hlstats_Players.kills) AS kills,
SUM(hlstats_Players.deaths) AS deaths,
SUM(hlstats_Players.connection_time) AS connection_time,
ROUND(AVG(hlstats_Players.skill)) AS skill,
IFNULL(SUM(hlstats_Players.kills)/SUM(hlstats_Players.deaths), '-') AS kpd,
TRUNCATE(AVG(activity),2) as activity
FROM
hlstats_Clans,
hlstats_Players
WHERE
hlstats_Clans.game = '$game'
AND hlstats_Clans.hidden <> 1
AND hlstats_Players.clan = hlstats_Clans.clanId
AND hlstats_Players.hideranking = 0
GROUP BY
hlstats_Clans.clanId
HAVING
activity >= 0 AND
nummembers >= $minmembers
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder,
name ASC
LIMIT
$table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
hlstats_Clans.clanId,
SUM(activity) as activity
FROM
hlstats_Clans
LEFT JOIN
hlstats_Players
ON
hlstats_Players.clan = hlstats_Clans.clanId
WHERE
hlstats_Clans.game = '$game'
AND hlstats_Clans.hidden <> 1
AND hlstats_Players.hideranking = 0
GROUP BY
hlstats_Clans.clanId
HAVING
activity >= 0 AND
COUNT(hlstats_Players.playerId) >= $minmembers
");
$table->draw($result, $db->num_rows($resultCount), 100);
?>

View File

@ -0,0 +1,57 @@
<?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.');
}
?>
<div style="clear:both;"></div>
<div id="footer">
<a href="http://www.hlxce.com" target="_blank"><img src="<?php echo IMAGE_PATH; ?>/footer-small.png" alt="HLstatsX Community Edition" border="0" /></a>
</div>
<br />
<div class="fSmall" style="text-align:center;">
Generated in real-time by <a href="http://www.hlxce.com" target="_blank">HLstatsX Community Edition <?php echo $g_options['version']; ?></a>
<br />
All images are copyrighted by their respective owners.
</div>
</body>
</html>

View File

@ -0,0 +1,75 @@
<?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.'); }
/*
* HLstats Page Header
* This file will be inserted at the top of every page generated by HLstats.
* This file can contain PHP code.
*/
Header ('Cache-Control: no-cache');
$lastpage = isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:"";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="hlstats.css">
<link rel="stylesheet" type="text/css" href="styles/<?php echo $g_options['style']; ?>">
<title>HLstatsX</title>
</head>
<body style="margin:0px;padding:0px;" id="ingame">
<div style="width:100%;height:50px;" class="headerblock">
<img src="<?php echo IMAGE_PATH; ?>/icons/title.png" alt="HLstats" />
<?php
if ($lastpage) {
?>
<div style="position: absolute; bottom:45%; right:0; color #FFFFFF;">
<a href="<?php echo $lastpage; ?>">&laquo;&nbsp;&nbsp;Go Back</a>
</div>
<?php
} ?>
</div>

243
web/pages/ingame/help.php Normal file
View File

@ -0,0 +1,243 @@
<?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.'); }
$server_id = 1;
if ((isset($_GET['server_id'])) && (is_numeric($_GET['server_id'])))
$server_id = valid_request($_GET['server_id'], 1);
?>
<strong>&nbsp;<a href="http://www.hlxcommunity.com">HLstatsX Community Edition</a> <?php echo $g_options['version']; ?></strong><br /><br />
<table style="width:100%;border:0;padding:1px;border-spacing:0;">
<tr class="data-table-head">
<td class="fSmall data-table" colspan="3">&nbsp;Commands display the results ingame</td>
</tr>
<tr class="bg1">
<td class="fNormal">rank [skill, points, place (to all)]</td>
<td class="fNormal">=</td>
<td class="fNormal">Current position</td>
</tr>
<tr class="bg1">
<td class="fNormal">kpd [kdratio, kdeath (to all)]</td>
<td class="fNormal">=</td>
<td class="fNormal">Total player statistics</td>
</tr>
<tr class="bg1">
<td class="fNormal">session [session_data (to all)]</td>
<td class="fNormal">=</td>
<td class="fNormal">Current session statistics</td>
</tr>
<tr class="bg1">
<td class="fNormal">next</td>
<td class="fNormal">=</td>
<td class="fNormal">Players ahead in the ranking.</td>
</tr>
<tr class="data-table-head">
<td class="fSmall data-table" colspan="3">&nbsp;Commands display the results in window</td>
</tr>
<tr class="bg1">
<td class="fNormal">load</td>
<td class="fNormal">=</td>
<td class="fNormal">Statistics from all servers</td>
</tr>
<tr class="bg1">
<td class="fNormal">status</td>
<td class="fNormal">=</td>
<td class="fNormal">Current server status</td>
</tr>
<tr class="bg1">
<td class="fNormal">servers</td>
<td class="fNormal">=</td>
<td class="fNormal">List of all participating servers</td>
</tr>
<tr class="bg1">
<td class="fNormal">top20 [top5, top10]</td>
<td class="fNormal">=</td>
<td class="fNormal">Top-Players</td>
</tr>
<tr class="bg1">
<td class="fNormal">clans</td>
<td class="fNormal">=</td>
<td class="fNormal">Clan ranking</td>
</tr>
<tr class="bg1">
<td class="fNormal">cheaters</td>
<td class="fNormal">=</td>
<td class="fNormal">Banned players</td>
</tr>
<tr class="bg1">
<td class="fNormal">statsme</td>
<td class="fNormal">=</td>
<td class="fNormal">Statistic summary</td>
</tr>
<tr class="bg1">
<td class="fNormal">weapons [weapon]</td>
<td class="fNormal">=</td>
<td class="fNormal">Weapons usage</td>
</tr>
<tr class="bg1">
<td class="fNormal">accuracy</td>
<td class="fNormal">=</td>
<td class="fNormal">Weapons accuracy</td>
</tr>
<tr class="bg1">
<td class="fNormal">targets [target]</td>
<td class="fNormal">=</td>
<td class="fNormal">Targets hit positions</td>
</tr>
<tr class="bg1">
<td class="fNormal">kills [kill, player_kills]</td>
<td class="fNormal">=</td>
<td class="fNormal">Kill statistics (5 or more kills)</td>
</tr>
<tr class="bg1">
<td class="fNormal">actions [action]</td>
<td class="fNormal">=</td>
<td class="fNormal">Server actions summary</td>
</tr>
<tr class="bg1">
<td class="fNormal">help [cmd, cmds, commands]</td>
<td class="fNormal">=</td>
<td class="fNormal">Help screen</td>
</tr>
<tr class="data-table-head">
<td class="fSmall data-table" colspan="3">&nbsp;Commands to set your user options</td>
</tr>
<tr class="bg1">
<td class="fNormal">hlx_auto clear|start|end|kill command</td>
<td class="fNormal">=</td>
<td class="fNormal">Auto-Command on specific event (on death, roundstart, roundend)</td>
</tr>
<tr class="bg1">
<td class="fNormal">hlx_display 0|1</td>
<td class="fNormal">=</td>
<td class="fNormal">Enable or disable displaying console events.</td>
</tr>
<tr class="bg1">
<td class="fNormal">hlx_chat 0|1</td>
<td class="fNormal">=</td>
<td class="fNormal">Enable or disable the displaying of global chat events(if enabled).</td>
</tr>
<tr class="bg1">
<td class="fNormal">/hlx_set realname|email|homepage [value]</td>
<td class="fNormal">=</td>
<td class="fNormal">(Type in chat, not console) Sets your player info.</td>
</tr>
<tr class="bg1">
<td class="fNormal">/hlx_hideranking</td>
<td class="fNormal">=</td>
<td class="fNormal">(Type in chat, not console) Makes you invisible on player rankings, unranked.</td>
</tr>
</table>
<table class="data-table">
<tr class="data-table-head">
<td style="width:55%;" class="fSmall">&nbsp;Participating Servers</td>
<td style="width:23%;" class="fSmall">&nbsp;Address</td>
<td style="width:6%;text-align:center" class="fSmall">&nbsp;Map</td>
<td style="width:6%;text-align:center" class="fSmall">&nbsp;Played</td>
<td style="width:10%;text-align:center" class="fSmall">&nbsp;Players</td>
</tr>
<?php
$query= "
SELECT
serverId,
name,
IF(publicaddress != '',
publicaddress,
concat(address, ':', port)
) AS addr,
kills,
headshots,
act_players,
max_players,
act_map,
map_started,
map_ct_wins,
map_ts_wins
FROM
hlstats_Servers
WHERE
game='$game'
ORDER BY
serverId
";
$db->query($query);
$this_server = array();
$servers = array();
while ($rowdata = $db->fetch_array()) {
$servers[] = $rowdata;
if ($rowdata['serverId'] == $server_id)
$this_server = $rowdata;
}
$i=0;
for ($i=0; $i<count($servers); $i++)
{
$rowdata = $servers[$i];
$server_id = $rowdata['serverId'];
$c = ($i % 2) + 1;
$addr = $rowdata["addr"];
$kills = $rowdata['kills'];
$headshots = $rowdata['headshots'];
$player_string = $rowdata['act_players']."/".$rowdata['max_players'];
$map_ct_wins = $rowdata['map_ct_wins'];
$map_ts_wins = $rowdata['map_ts_wins'];
?>
<tr class="bg<?php echo $c; ?>">
<td class="fSmall"><?php
echo '<strong>'.$rowdata['name'].'</strong>';
?></td>
<td class="fSmall"><?php
echo $addr;
?></td>
<td style="text-align:center;" class="fSmall"><?php
echo $rowdata['act_map'];
?></td>
<td style="text-align:center;" class="fSmall"><?php
$stamp = time()-$rowdata['map_started'];
$hours = sprintf('%02d', floor($stamp / 3600));
$min = sprintf('%02d', floor(($stamp % 3600) / 60));
$sec = sprintf('%02d', floor($stamp % 60));
echo "$hours:$min:$sec";
?></td>
<td style="text-align:center;" class="fSmall"><?php
echo $player_string;
?></td>
</tr>
<?php } ?>
</table>

306
web/pages/ingame/kills.php Normal file
View File

@ -0,0 +1,306 @@
<?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.'); }
// Player Details
$player = valid_request(intval($_GET['player']), 1);
$uniqueid = valid_request(strval($_GET['uniqueid']), 0);
$game = valid_request(strval($_GET['game']), 0);
if (!$player && $uniqueid)
{
if (!$game)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid");
exit;
}
$db->query("
SELECT
playerId
FROM
hlstats_PlayerUniqueIds
WHERE
uniqueId='$uniqueid'
AND game='$game'
");
if ($db->num_rows() > 1)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid&game=$game");
exit;
}
elseif ($db->num_rows() < 1)
{
error("No players found matching uniqueId '$uniqueid'");
}
else
{
list($player) = $db->fetch_row();
$player = intval($player);
}
}
elseif (!$player && !$uniqueid)
{
error('No player ID specified.');
}
$db->query("
SELECT
hlstats_Players.playerId,
hlstats_Players.lastName,
hlstats_Players.country,
hlstats_Players.flag,
hlstats_Players.clan,
hlstats_Players.fullName,
hlstats_Players.email,
hlstats_Players.homepage,
hlstats_Players.icq,
hlstats_Players.game,
hlstats_Players.skill,
hlstats_Players.kills,
hlstats_Players.deaths,
IFNULL(kills/deaths, '-') AS kpd,
hlstats_Players.suicides,
hlstats_Players.headshots,
IFNULL(headshots/kills, '-') AS hpk,
hlstats_Players.shots,
hlstats_Players.hits,
IFNULL(ROUND((hits / shots * 100), 1), 0.0) AS acc,
CONCAT(hlstats_Clans.tag, ' ', hlstats_Clans.name) AS clan_name,
activity
FROM
hlstats_Players
LEFT JOIN hlstats_Clans ON
hlstats_Clans.clanId = hlstats_Players.clan
WHERE
playerId='$player'
");
if ($db->num_rows() != 1)
error("No such player '$player'.");
$playerdata = $db->fetch_array();
$db->free_result();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . '...';
}
else
{
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$pl_urlname = urlencode($playerdata['lastName']);
$game = $playerdata['game'];
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
$gamename = ucfirst($game);
else
list($gamename) = $db->fetch_row();
$tblPlayerKillStats = new Table(
array(
new TableColumn(
'name',
'Victim',
'width=32&flag=1&link=' . urlencode('mode=statsme&player=%k')
),
new TableColumn(
'kills',
'Kills',
'width=8&align=right'
),
new TableColumn(
'deaths',
'Deaths',
'width=8&align=right'
),
new TableColumn(
'kpd',
'Kpd',
'width=12&align=right'
),
new TableColumn(
'headshots',
'Headshots',
'width=8&align=right'
),
new TableColumn(
'hpercent',
'Perc. Headshots',
'width=17&sort=no&type=bargraph'
),
new TableColumn(
'hpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'hpk',
'Hpk',
'width=5&align=right'
)
),
'victimId',
'kills',
'deaths',
true,
9999,
'playerkills_page',
'playerkills_sort',
'playerkills_sortorder',
'playerkills'
);
if(!isset($_GET['killLimit']))
$killLimit = 5;
else
$killLimit = valid_request($_GET['killLimit'], 1);
//there might be a better way to do this, but I could not figure one out.
$db->query("DROP TABLE IF EXISTS hlstats_Frags_Kills");
$db->query("
CREATE TEMPORARY TABLE hlstats_Frags_Kills
(
playerId INT(10),
kills INT(10),
deaths INT(10),
headshot INT(10)
)
");
$db->query("
INSERT INTO
hlstats_Frags_Kills
(
playerId,
kills,
headshot
)
SELECT
victimId,
killerId,
headshot
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND killerId = $player
GROUP BY
hlstats_Events_Frags.id
");
$db->query("
INSERT INTO
hlstats_Frags_Kills
(
playerId,
deaths
)
SELECT
killerId,
victimId
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND victimId = $player
");
$result = $db->query("
SELECT
SUM(hlstats_Frags_Kills.headshot) as headshots
FROM
hlstats_Frags_Kills
GROUP BY
hlstats_Frags_Kills.playerId
HAVING
COUNT(hlstats_Frags_Kills.kills) >= $killLimit
");
$realheadshots = 0;
while ($rowdata = $db->fetch_array($result)) {
$realheadshots += $rowdata['headshots'];
}
$result = $db->query("
SELECT
hlstats_Players.lastName AS name,
hlstats_Players.flag AS flag,
hlstats_Players.country AS country,
Count(hlstats_Frags_Kills.kills) AS kills,
Count(hlstats_Frags_Kills.deaths) AS deaths,
hlstats_Frags_Kills.playerId as victimId,
IFNULL(Count(hlstats_Frags_Kills.kills)/Count(hlstats_Frags_Kills.deaths),
IFNULL(FORMAT(Count(hlstats_Frags_Kills.kills), 2), '-')) AS kpd,
SUM(hlstats_Frags_Kills.headshot=1) AS headshots,
IFNULL(SUM(hlstats_Frags_Kills.headshot=1) / Count(hlstats_Frags_Kills.kills), '-') AS hpk,
ROUND(CONCAT(SUM(hlstats_Frags_Kills.headshot=1)) / $realheadshots * 100, 2) AS hpercent
FROM
hlstats_Frags_Kills,
hlstats_Players
WHERE
hlstats_Frags_Kills.playerId = hlstats_Players.playerId
GROUP BY
hlstats_Frags_Kills.playerId
HAVING
Count(hlstats_Frags_Kills.kills) >= $killLimit
ORDER BY
$tblPlayerKillStats->sort $tblPlayerKillStats->sortorder,
$tblPlayerKillStats->sort2 $tblPlayerKillStats->sortorder
LIMIT 0,15
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
$tblPlayerKillStats->draw($result, $numitems, 100);
}
?>

87
web/pages/ingame/load.php Normal file
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.'); }
$server_id = 1;
if ((isset($_GET['server_id'])) && (is_numeric($_GET['server_id'])))
$server_id = valid_request($_GET['server_id'], 1);
$query= "
SELECT
count(*)
FROM
hlstats_Players
WHERE
game='$game'
";
$result = $db->query($query);
list($total_players) = $db->fetch_row($result);
$query= "
SELECT
SUM(kills),
SUM(headshots),
count(serverId)
FROM
hlstats_Servers
WHERE
game='$game'
";
$result = $db->query($query);
list($total_kills, $total_headshots, $total_servers) = $db->fetch_row($result);
?>
<table class="data-table">
<tr class="data-table-head">
<td class="fSmall"><?php
if ($total_kills>0)
$hpk = sprintf('%.2f', ($total_headshots/$total_kills)*100);
else
$hpk = sprintf('%.2f', 0);
echo 'Tracking <strong>'.number_format($total_players).'</strong> players with <strong>'.number_format($total_kills).'</strong> kills and <strong>'.number_format($total_headshots)."</strong> headshots (<strong>$hpk%</strong>) on <strong>$total_servers</strong> servers"; ?>
</td>
</tr>
</table>
<table class="data-table" >
<tr class="data-table-head">
<td style="text-align:center;padding:0px;">
<img src="show_graph.php?type=0&amp;width=870&amp;height=200&amp;server_id=<?php echo $server_id ?>&amp;bgcolor=<?php echo $g_options['graphbg_load']; ?>&amp;color=<?php echo $g_options['graphtxt_load']; ?>" style="border:0px;">
</td>
</tr>
</table>

View File

@ -0,0 +1,124 @@
<?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.'); }
// Map Details
$map = valid_request($_GET['map'], 0)
or error('No map specified.');
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
error('Invalid or no game specified.');
else
list($gamename) = $db->fetch_row();
$table = new Table(
array(
new TableColumn(
'killerName',
'Player',
'width=60&align=left&flag=1&link=' . urlencode('mode=statsme&amp;player=%k')
),
new TableColumn(
'frags',
'Kills on $map',
'width=15&align=right'
),
new TableColumn(
'headshots',
'Headshots',
'width=15&align=right'
),
new TableColumn(
'hpk',
'Hpk',
'width=5&align=right'
),
),
'killerId', // keycol
'frags', // sort_default
'killerName', // sort_default2
true, // showranking
50 // numperpage
);
$result = $db->query("
SELECT
hlstats_Events_Frags.killerId,
hlstats_Players.lastName AS killerName,
hlstats_Players.flag as flag,
COUNT(hlstats_Events_Frags.map) AS frags,
SUM(hlstats_Events_Frags.headshot=1) as headshots,
IFNULL(SUM(hlstats_Events_Frags.headshot=1) / Count(hlstats_Events_Frags.map), '-') AS hpk
FROM
hlstats_Events_Frags,
hlstats_Players
WHERE
hlstats_Players.playerId = hlstats_Events_Frags.killerId
AND hlstats_Events_Frags.map='$map'
AND hlstats_Players.game='$game'
AND hlstats_Players.hideranking<>'1'
GROUP BY
hlstats_Events_Frags.killerId
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT $table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(DISTINCT hlstats_Events_Frags.killerId),
SUM(hlstats_Events_Frags.map='$map')
FROM
hlstats_Events_Frags,
hlstats_Servers
WHERE
hlstats_Servers.serverId = hlstats_Events_Frags.serverId
AND hlstats_Events_Frags.map='$map'
AND hlstats_Servers.game='$game'
");
list($numitems, $totalkills) = $db->fetch_row($resultCount);
?>
<?php
$table->draw($result, $numitems, 100, 'center');
?>

237
web/pages/ingame/maps.php Normal file
View File

@ -0,0 +1,237 @@
<?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.'); }
// Player Details
$player = valid_request(intval($_GET['player']), 1);
$uniqueid = valid_request(strval($_GET['uniqueid']), 0);
$game = valid_request(strval($_GET['game']), 0);
if (!$player && $uniqueid)
{
if (!$game)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid");
exit;
}
$db->query("
SELECT
playerId
FROM
hlstats_PlayerUniqueIds
WHERE
uniqueId='$uniqueid'
AND game='$game'
");
if ($db->num_rows() > 1)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid&game=$game");
exit;
}
elseif ($db->num_rows() < 1)
{
error("No players found matching uniqueId '$uniqueid'");
}
else
{
list($player) = $db->fetch_row();
$player = intval($player);
}
}
elseif (!$player && !$uniqueid)
{
error('No player ID specified.');
}
$db->query("
SELECT
hlstats_Players.playerId,
hlstats_Players.lastName,
hlstats_Players.game
FROM
hlstats_Players
WHERE
playerId='$player'
");
if ($db->num_rows() != 1)
error("No such player '$player'.");
$playerdata = $db->fetch_array();
$db->free_result();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . '...';
}
else
{
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$pl_urlname = urlencode($playerdata['lastName']);
$game = $playerdata['game'];
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
$gamename = ucfirst($game);
else
list($gamename) = $db->fetch_row();
$tblMaps = new Table(
array(
new TableColumn(
'map',
'Map Name',
'width=18&align=left&link=' . urlencode("mode=mapinfo&map=%k&game=$game")
),
new TableColumn(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn(
'kpercent',
'Perc. Kills',
'width=10&sort=no&type=bargraph'
),
new TableColumn(
'kpercent',
'%',
'width=6&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn(
'kpd',
'Kpd',
'width=13&align=right'
),
new TableColumn(
'headshots',
'Headshots',
'width=10&align=right'
),
new TableColumn(
'hpercent',
'Perc. Headshots',
'width=12&sort=no&type=bargraph'
),
new TableColumn(
'hpercent',
'%',
'width=6&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'hpk',
'Hpk',
'width=6&align=right'
)
),
'map',
'kpd',
'kills',
true,
9999,
'maps_page',
'maps_sort',
'maps_sortorder',
'maps'
);
$db->query("
SELECT
COUNT(*)
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND killerId='$player'
");
list($realkills) = $db->fetch_row();
$db->query("
SELECT
COUNT(*)
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND killerId='$player'
AND headshot=1
");
list($realheadshots) = $db->fetch_row();
$result = $db->query("
SELECT
IF(map='', '(Unaccounted)', map) AS map,
SUM(killerId=$player) AS kills,
SUM(victimId=$player) AS deaths,
IFNULL(SUM(killerId=$player) / SUM(victimId=$player), '-') AS kpd,
ROUND(CONCAT(SUM(killerId=$player)) / $realkills * 100, 2) AS kpercent,
SUM(killerID=$player AND headshot=1) as headshots,
IFNULL(SUM(killerID=$player AND headshot=1) / SUM(killerId=$player), '-') AS hpk,
ROUND(CONCAT(SUM(killerId=$player AND headshot=1)) / $realheadshots * 100, 2) AS hpercent
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND killerId='$player'
OR victimId='$player'
GROUP BY
map
ORDER BY
$tblMaps->sort $tblMaps->sortorder,
$tblMaps->sort2 $tblMaps->sortorder
");
$tblMaps->draw($result, $db->num_rows($result), 100);
?>

289
web/pages/ingame/motd.php Normal file
View File

@ -0,0 +1,289 @@
<?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
motd.inc - showing ingame a statistic summary on connect
------------------------------------------------------------------------------------
Created by Gregor Haenel (webmaster@flashman1986.de)
Enhanced by Tobias Oetzel
For support and installation notes visit http://ovrsized.neo-soft.org!
*/
if ( !defined('IN_HLSTATS') ) { die('Do not access this file directly.'); }
//
// Message of the day
//
//
// General
//
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
$minkills = 1;
$minmembers = 3;
$players = 10;
if ((isset($_GET['players'])) && (is_numeric($_GET['players'])))
$players = valid_request($_GET['players'], 1);
$clans = 3;
if ((isset($_GET['clans'])) && (is_numeric($_GET['clans'])))
$clans = valid_request($_GET['clans'], 1);
$servers = 9001;
if ((isset($_GET['servers'])) && (is_numeric($_GET['servers'])))
$servers = valid_request($_GET['servers'], 1);
//
// Top 10 Players
//
if($players > 0) {
$table_players = new Table(
array(
new TableColumn(
'lastName',
'Playername',
'width=50&flag=1&link=' . urlencode('mode=statsme&amp;player=%k')
),
new TableColumn(
'skill',
'Points',
'width=10&align=right'
),
new TableColumn(
'activity',
'Activity',
'width=10&sort=no&type=bargraph'
),
new TableColumn(
'connection_time',
'Time',
'width=15&align=right&type=timestamp'
),
new TableColumn(
'kpd',
'Kpd',
'width=10&align=right'
),
),
'playerId',
'skill',
'kpd',
true,
10
);
$result_players = $db->query("
SELECT
playerId,
lastName,
connection_time,
skill,
flag,
country,
IFNULL(kills/deaths, '-') AS kpd,
IFNULL(headshots/kills, '-') AS hpk,
activity
FROM
hlstats_Players
WHERE
game='$game'
AND hideranking=0
AND kills >= $minkills
ORDER BY
$table_players->sort $table_players->sortorder
LIMIT 0,$players
");
$table_players->draw($result_players, 10, 100);
}
//
// Top 3 Clans
//
if($clans > 0) {
$table_clans = new Table(
array(
new TableColumn(
'name',
'Clanname',
'width=50&link=' . urlencode('mode=claninfo&amp;clan=%k')
),
new TableColumn(
'tag',
'Tag',
'width=25&align=center'
),
new TableColumn(
'skill',
'Points',
'width=10&align=right'
),
new TableColumn(
'nummembers',
'Members',
'width=10&align=right'
),
),
'clanId',
'skill',
'kpd',
true,
3
);
$result_clans = $db->query("
SELECT
hlstats_Clans.clanId,
hlstats_Clans.name,
hlstats_Clans.tag,
COUNT(hlstats_Players.playerId) AS nummembers,
ROUND(AVG(hlstats_Players.skill)) AS skill,
TRUNCATE(AVG(IF(".$g_options['MinActivity']." > (UNIX_TIMESTAMP() - hlstats_Players.last_event), ((100/".$g_options['MinActivity'].") * (".$g_options['MinActivity']." - (UNIX_TIMESTAMP() - hlstats_Players.last_event))), -1)),2) as activity
FROM
hlstats_Clans
LEFT JOIN hlstats_Players ON
hlstats_Players.clan=hlstats_Clans.clanId
WHERE
hlstats_Clans.game='$game'
AND hlstats_Clans.hidden <> 1
AND hlstats_Players.hideranking = 0
AND IF(".$g_options['MinActivity']." > (UNIX_TIMESTAMP() - hlstats_Players.last_event), ((100/".$g_options['MinActivity'].") * (".$g_options['MinActivity']." - (UNIX_TIMESTAMP() - hlstats_Players.last_event))), -1) >= 0
GROUP BY
hlstats_Clans.clanId
HAVING
activity >= 0 AND
nummembers >= $minmembers
ORDER BY
$table_clans->sort $table_clans->sortorder
LIMIT 0,$clans
");
$table_clans->draw($result_clans, 3, 100);
}
//
// Servers
//
if ($servers > 0) { ?>
<table class="data-table" >
<tr class="data-table-head">
<td style="width:50%;" class="fSmall">&nbsp;Participating Servers</td>
<td style="width:20%;" class="fSmall">&nbsp;Address</td>
<td style="width:10%;text-align:center;" class="fSmall">&nbsp;Map</td>
<td style="width:10%;text-align:center;" class="fSmall">&nbsp;Played</td>
<td style="width:10%;" class="fSmall">&nbsp;Players</td>
</tr>
<?php
$query= "
SELECT
serverId,
name,
IF(publicaddress != '',
publicaddress,
concat(address, ':', port)
) AS addr,
kills,
headshots,
act_players,
max_players,
act_map,
map_started,
map_ct_wins,
map_ts_wins
FROM
hlstats_Servers
WHERE
game='$game'
ORDER BY
serverId
LIMIT 0, $servers
";
$db->query($query);
$this_server = array();
$servers = array();
while ($rowdata = $db->fetch_array()) {
$servers[] = $rowdata;
if ($rowdata['serverId'] == $server_id)
$this_server = $rowdata;
}
$i=0;
for ($i=0; $i<count($servers); $i++)
{
$rowdata = $servers[$i];
$server_id = $rowdata['serverId'];
$c = ($i % 2) + 1;
$addr = $rowdata['addr'];
$kills = $rowdata['kills'];
$headshots = $rowdata['headshots'];
$player_string = $rowdata['act_players']."/".$rowdata['max_players'];
$map_ct_wins = $rowdata['map_ct_wins'];
$map_ts_wins = $rowdata['map_ts_wins'];
?>
<tr class="bg<?php echo $c; ?>">
<td style="width:35%;" class="fSmall"><?php
echo '<strong>'.$rowdata['name'].'</strong>';
?></td>
<td style="width:20%;" class="fSmall"><?php
echo $addr;
?></td>
<td style="text-align:center;width:15%;" class="fSmall"><?php
echo $rowdata['act_map'];
?></td>
<td style="text-align:center;width:15%;" class="fSmall"><?php
$stamp = time()-$rowdata['map_started'];
$hours = sprintf('%02d', floor($stamp / 3600));
$min = sprintf('%02d', floor(($stamp % 3600) / 60));
$sec = sprintf('%02d', floor($stamp % 60));
echo "$hours:$min:$sec";
?></td>
<td style="text-align:center;width:15%;" class="fSmall"><?php
echo $player_string;
?></td>
</tr>
<?php } ?>
</table>
<?php } ?>

View File

@ -0,0 +1,244 @@
<?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.'); }
// Player Rankings
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() < 1)
error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
$minkills = 1;
if ($g_options['rankingtype'] != 'kills')
{
$table = new Table
(
array
(
new TableColumn
(
'lastName',
'Player',
'width=30&flag=1&link=' . urlencode('mode=statsme&amp;player=%k')
),
new TableColumn
(
'skill',
'Points',
'width=7&align=right&skill_change=1'
),
new TableColumn
(
'activity',
'Activity',
'width=10&sort=no&type=bargraph'
),
new TableColumn
(
'connection_time',
'Connection Time',
'width=10&align=right&type=timestamp'
),
new TableColumn
(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=6&align=right'
),
new TableColumn
(
'headshots',
'Headshots',
'width=6&align=right'
),
new TableColumn
(
'hpk',
'HS:K',
'width=6&align=right'
),
new TableColumn
(
'acc',
'Accuracy',
'width=6&align=right&append=' . urlencode('%')
)
),
'playerId',
$g_options['rankingtype'],
'kpd',
true
);
}
else
{
$table = new Table
(
array
(
new TableColumn
(
'lastName',
'Player',
'width=30&flag=1&link=' . urlencode('mode=statsme&amp;player=%k')
),
new TableColumn
(
'activity',
'Activity',
'width=10&sort=no&type=bargraph'
),
new TableColumn
(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=6&align=right'
),
new TableColumn
(
'headshots',
'Headshots',
'width=6&align=right'
),
new TableColumn
(
'hpk',
'HS:K',
'width=6&align=right'
),
new TableColumn
(
'acc',
'Accuracy',
'width=6&align=right&append=' . urlencode('%')
),
new TableColumn
(
'skill',
'Points',
'width=7&align=right&skill_change=1'
),
new TableColumn
(
'connection_time',
'Connection Time',
'width=10&align=right&type=timestamp'
)
),
'playerId',
$g_options['rankingtype'],
'kpd',
true
);
}
$day_interval = 28;
$result = $db->query("
SELECT
playerId,
connection_time,
lastName,
flag,
country,
skill,
kills,
deaths,
IFNULL(kills/deaths, '-') AS kpd,
headshots,
IFNULL(headshots/kills, '-') AS hpk,
IFNULL(ROUND((hits / shots * 100), 1), 0.0) AS acc,
activity,
last_skill_change
FROM
hlstats_Players
WHERE
game='$game'
AND hideranking=0
AND kills >= $minkills
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder,
lastName ASC
LIMIT
$table->startitem,
$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(*)
FROM
hlstats_Players
WHERE
game='$game'
AND hideranking=0
AND kills >= $minkills
");
list($numitems) = $db->fetch_row($resultCount);
$table->draw($result, 25, 100);
?>

View File

@ -0,0 +1,123 @@
<?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.'); }
$server_id = 1;
if ((isset($_GET['server_id'])) && (is_numeric($_GET['server_id'])))
$server_id = valid_request($_GET['server_id'], 1);
?>
<table class="data-table">
<tr class="data-table-head">
<td style="width:55%;" class="fSmall">&nbsp;Participating Servers</td>
<td style="width:23%;" class="fSmall">&nbsp;Address</td>
<td style="width:6%;text-align:center;" class="fSmall">&nbsp;Map</td>
<td style="width:6%;text-align:center;" class="fSmall">&nbsp;Played</td>
<td style="width:10%;text-align:center;" class="fSmall">&nbsp;Players</td>
</tr>
<?php
$query= "
SELECT
serverId,
name,
IF(publicaddress != '',
publicaddress,
concat(address, ':', port)
) AS addr,
kills,
headshots,
act_players,
max_players,
act_map,
map_started,
map_ct_wins,
map_ts_wins
FROM
hlstats_Servers
WHERE
game='$game'
ORDER BY
sortorder, name, serverId
";
$db->query($query);
$this_server = array();
$servers = array();
while ($rowdata = $db->fetch_array()) {
$servers[] = $rowdata;
if ($rowdata['serverId'] == $server_id)
$this_server = $rowdata;
}
$i=0;
for ($i=0; $i<count($servers); $i++)
{
$rowdata = $servers[$i];
$server_id = $rowdata['serverId'];
$c = ($i % 2) + 1;
$addr = $rowdata["addr"];
$kills = $rowdata['kills'];
$headshots = $rowdata['headshots'];
$player_string = $rowdata['act_players']."/".$rowdata['max_players'];
$map_ct_wins = $rowdata['map_ct_wins'];
$map_ts_wins = $rowdata['map_ts_wins'];
?>
<tr class="bg<?php echo $c; ?>">
<td class="fSmall"><?php
echo '<strong>'.$rowdata['name'].'</strong>';
?></td>
<td class="fSmall"><?php
echo $addr;
?></td>
<td style="text-align:center;" class="fSmall"><?php
echo $rowdata['act_map'];
?></td>
<td style="text-align:center;" class="fSmall"><?php
$stamp = time()-$rowdata['map_started'];
$hours = sprintf('%02d', floor($stamp / 3600));
$min = sprintf('%02d', floor(($stamp % 3600) / 60));
$sec = sprintf('%02d', floor($stamp % 60));
echo "$hours:$min:$sec";
?></td>
<td style="text-align:center;" class="fSmall"><?php
echo $player_string;
?></td>
</tr>
<?php } ?>
</table>

View File

@ -0,0 +1,358 @@
<?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.'); }
// Player Details
$player = valid_request(intval($_GET['player']), 1);
$uniqueid = valid_request(strval($_GET['uniqueid']), 0);
$game = valid_request(strval($_GET['game']), 0);
if (!$player && $uniqueid)
{
if (!$game)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid");
exit;
}
$uniqueid = preg_replace('/^STEAM_\d+?\:/i','',$uniqueid);
$db->query("
SELECT
playerId
FROM
hlstats_PlayerUniqueIds
WHERE
uniqueId='$uniqueid'
AND game='$game'
");
if ($db->num_rows() > 1)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid&game=$game");
exit;
}
elseif ($db->num_rows() < 1)
{
error("No players found matching uniqueId '$uniqueid'");
}
else
{
list($player) = $db->fetch_row();
$player = intval($player);
}
}
elseif (!$player && !$uniqueid)
{
error('No player ID specified.');
}
$db->query("
SELECT
hlstats_Players.playerId,
hlstats_Players.connection_time,
hlstats_Players.lastName,
hlstats_Players.country,
hlstats_Players.flag,
hlstats_Players.clan,
hlstats_Players.fullName,
hlstats_Players.email,
hlstats_Players.homepage,
hlstats_Players.icq,
hlstats_Players.game,
hlstats_Players.skill,
hlstats_Players.kills,
hlstats_Players.deaths,
IFNULL(kills/deaths, '-') AS kpd,
hlstats_Players.suicides,
hlstats_Players.headshots,
IFNULL(headshots/kills, '-') AS hpk,
hlstats_Players.shots,
hlstats_Players.hits,
hlstats_Players.teamkills,
hlstats_Players.kill_streak,
hlstats_Players.death_streak,
IFNULL(ROUND((hits / shots * 100), 1), 0.0) AS acc,
hlstats_Clans.name AS clan_name,
activity
FROM
hlstats_Players
LEFT JOIN hlstats_Clans ON
hlstats_Clans.clanId = hlstats_Players.clan
WHERE
playerId='$player'
");
if ($db->num_rows() != 1)
error("No such player '$player'.");
$playerdata = $db->fetch_array();
$db->free_result();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . '...';
}
else
{
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$pl_urlname = urlencode($playerdata['lastName']);
$game = $playerdata['game'];
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
$gamename = ucfirst($game);
else
list($gamename) = $db->fetch_row();
?>
<table class="data-table">
<tr class="data-table-head">
<td colspan="3" class="fSmall">Statistics Summary</td>
</tr>
<tr class="bg1">
<td class="fSmall">Name:</td>
<td colspan="2" class="fSmall"><?php
if ($g_options['countrydata'] == 1)
echo '<img src="'.getFlag($playerdata['flag']).'" alt="'.strtolower($playerdata['country']).'" title="'.strtolower($playerdata['country']).'">&nbsp;';
echo '<strong>' . htmlspecialchars($playerdata['lastName'], ENT_COMPAT) . '</strong>';
?></td>
</tr>
<tr class="bg2">
<td class="fSmall">Member of Clan:</td>
<td colspan="2" class="fSmall"><?php
if ($playerdata['clan']) {
echo '&nbsp;<a href="' . $g_options['scripturl']
. '?mode=claninfo&amp;clan=' . $playerdata['clan']
. '">'
. htmlspecialchars($playerdata['clan_name'], ENT_COMPAT) . '</a>';
} else
echo '(None)';
?></td>
</tr>
<tr class="bg1">
<td style="width:45%;" class="fSmall">Rank:</td>
<td colspan="2" style="width:55%;" class="fSmall"><?php
if ($playerdata['activity'] > 0) {
$rank = get_player_rank($playerdata);
} else {
$rank = 'Not active';
}
if (is_numeric($rank))
echo '<strong>' . number_format($rank) . '</strong>';
else
echo "<strong>$rank</strong>";
?></td>
</tr>
<tr class="bg2">
<td class="fSmall">Points:</td>
<td colspan="2" class="fSmall"><?php
echo '<strong>' . number_format($playerdata['skill']) . '</strong>';
?></td>
</tr>
<tr class="bg1">
<td style="width:45%;" class="fSmall">Activity:*</td>
<td style="width:45%;" class="fSmall"><?php
$width = sprintf('%d%%', $playerdata['activity'] + 0.5);
$bar_type = 1;
if ($playerdata['activity'] > 40)
$bar_type = '6';
elseif ($playerdata['activity'] > 30)
$bar_type = '5';
elseif ($playerdata['activity'] > 20)
$bar_type = '4';
elseif ($playerdata['activity'] > 10)
$bar_type = '3';
elseif ($playerdata['activity'] > 5)
$bar_type = '2';
echo '<img src="' . IMAGE_PATH . "/bar$bar_type.gif\" style=\"width:$width%;\" class=\"bargraph\" alt=\"".$playerdata['activity'].'%">';
?></td>
<td style="width:10%;" class="fSmall"><?php
echo $playerdata['activity'].'%';
?></td>
</tr>
<tr class="bg2">
<td style="width:45%;" class="fSmall">Kills:</td>
<td colspan="2" style="width:55%;" class="fSmall"><?php
echo number_format($playerdata['kills']);
$db->query("
SELECT
COUNT(*)
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND killerId='$player'
");
list($realkills) = $db->fetch_row();
echo ' ('.number_format($realkills).')';
?></td>
</tr>
<tr class="bg1">
<td class="fSmall">Deaths:</td>
<td colspan="2" class="fSmall"><?php
echo number_format($playerdata['deaths']);
?></td>
</tr>
<tr class="bg2">
<td class="fSmall">Suicides:</td>
<td colspan="2" class="fSmall"><?php
echo number_format($playerdata['suicides']);
?></td>
</tr>
<tr class="bg1">
<td class="fSmall">Kills per Death:</td>
<td colspan="2" class="fSmall"><?php
$db->query("
SELECT
IFNULL(SUM(killerId='$player')/SUM(victimId='$player'), '-') AS kpd
FROM
hlstats_Events_Frags,
hlstats_Servers
WHERE
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
AND (hlstats_Events_Frags.killerId='$player' OR hlstats_Events_Frags.victimId='$player')
AND hlstats_Servers.game='$game'
");
list($realkpd) = $db->fetch_row();
echo $playerdata['kpd'];
echo " ($realkpd)";
?></td>
</tr>
<tr class="bg2">
<td class="fSmall">Headshots:</td>
<td colspan="2" class="fSmall"><?php
$db->query("
SELECT
COUNT(*)
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND killerId='$player'
AND headshot=1
");
list($realheadshots) = $db->fetch_row();
if ($playerdata['headshots'] == 0)
echo number_format($realheadshots);
else
echo number_format($playerdata['headshots']);
echo ' ('.number_format($realheadshots).')';
?></td>
</tr>
<tr class="bg1">
<td class="fSmall">Headshots per Kill:</td>
<td colspan="2" class="fSmall"><?php
$db->query("
SELECT
IFNULL(SUM(headshot=1)/COUNT(*), '-') AS hpk
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND killerId='$player'
");
list($realhpk) = $db->fetch_row();
echo $playerdata['hpk'];
echo " ($realhpk)";
?></td>
</tr>
<tr class="bg2">
<td class="fSmall">Weapon Accuracy:</td>
<td colspan="2" class="fSmall"><?php
$db->query("
SELECT
IFNULL(ROUND((SUM(hlstats_Events_Statsme.hits) / SUM(hlstats_Events_Statsme.shots) * 100), 1), 0.0) AS accuracy,
SUM(hlstats_Events_Statsme.shots) as shots,
SUM(hlstats_Events_Statsme.hits) as hits
FROM
hlstats_Events_Statsme
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Statsme.serverId
WHERE
hlstats_Servers.game='$game' AND playerId='$player'
");
list($playerdata['accuracy'], $sm_shots, $sm_hits) = $db->fetch_row();
echo $playerdata['acc'] . '%';
echo ' ('.$playerdata['accuracy'] . '%)';
?></td>
</tr>
<tr class="bg1">
<td style="width:45%;" class="fSmall">Teammate Kills:</td>
<td colspan="2" style="width:55%;" class="fSmall"><?php
echo number_format($playerdata['teamkills']);
$db->query("
SELECT
COUNT(*)
FROM
hlstats_Events_Teamkills
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Teamkills.serverId
WHERE
hlstats_Servers.game='$game' AND killerId='$player'
");
list($realteamkills) = $db->fetch_row();
echo ' ('.number_format($realteamkills).')';
?></td>
</tr>
<tr class="bg2">
<td class="fSmall">Longest Kill Streak:</td>
<td colspan="2" class="fSmall"><?php
echo number_format($playerdata['kill_streak']);
?></td>
<tr class="bg1">
<td class="fSmall">Longest Death Streak:</td>
<td colspan="2" class="fSmall"><?php
echo number_format($playerdata['death_streak']);
?></td>
<tr class="bg2">
<td class="fSmall">Total Connection Time:</td>
<td colspan="2" class="fSmall"><?php
echo timestamp_to_str($playerdata['connection_time']);
?></td>
</tr>
</table>

166
web/pages/ingame/status.php Normal file
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.'); }
require(PAGE_PATH.'/livestats.php');
$server_id = 1;
if ((isset($_GET['server_id'])) && (is_numeric($_GET['server_id'])))
$server_id = valid_request($_GET['server_id'], 1);
$query= "
SELECT
count(*)
FROM
hlstats_Players
WHERE
game='$game'
";
$result = $db->query($query);
list($total_players) = $db->fetch_row($result);
$query= "
SELECT
SUM(kills),
SUM(headshots),
count(serverId)
FROM
hlstats_Servers
WHERE
game='$game'
";
$result = $db->query($query);
list($total_kills, $total_headshots, $total_servers) = $db->fetch_row($result);
$query= "
SELECT
serverId,
name,
IF(publicaddress != '',
publicaddress,
concat(address, ':', port)
) AS addr,
".//"statusurl,"
"kills,
headshots,
act_players,
max_players,
act_map,
map_started,
map_ct_wins,
map_ts_wins
FROM
hlstats_Servers
WHERE
serverId='".$server_id."'
ORDER BY
name ASC,
addr ASC
";
$db->query($query);
$servers = array();
while ($rowdata = $db->fetch_array())
$servers[] = $rowdata;
$i=0;
for ($i=0; $i<count($servers); $i++)
{
$rowdata = $servers[$i];
$server_id = $rowdata['serverId'];
$c = ($i % 2) + 1;
$addr = $rowdata["addr"];
$kills = $rowdata['kills'];
$headshots = $rowdata['headshots'];
$player_string = $rowdata['act_players']."/".$rowdata['max_players'];
$map_teama_wins = $rowdata['map_ct_wins'];
$map_teamb_wins = $rowdata['map_ts_wins'];
?>
<table class="data-table">
<tr class="data-table-head">
<td style="width:37%;" class="fSmall">&nbsp;Server</td>
<td style="width:23%;" class="fSmall">&nbsp;Address</td>
<td style="width:6%;text-align:center;" class="fSmall">&nbsp;Map</td>
<td style="width:6%;text-align:center;" class="fSmall">&nbsp;Played</td>
<td style="width:10%;text-align:center;" class="fSmall">&nbsp;Players</td>
<td style="width:6%;text-align:center;" class="fSmall">&nbsp;Kills</td>
<td style="width:6%;text-align:center;" class="fSmall">&nbsp;Headshots</td>
<td style="width:6%;text-align:center;" class="fSmall">&nbsp;Hpk</td>
</tr>
<tr class="bg1" valign="middle">
<td class="fSmall"><?php
echo '<strong>'.$rowdata['name'].'</strong>';
?></td>
<td class="fSmall"><?php
echo $addr;
?></td>
<td style="text-align:center;" class="fSmall"><?php
echo $rowdata['act_map'];
?></td>
<td style="text-align:center;" class="fSmall"><?php
$stamp = time()-$rowdata['map_started'];
$hours = sprintf('%02d', floor($stamp / 3600));
$min = sprintf('%02d', floor(($stamp % 3600) / 60));
$sec = sprintf('%02d', floor($stamp % 60));
echo "$hours:$min:$sec";
?></td>
<td style="text-align:center;" class="fSmall"><?php
echo $player_string;
?></td>
<td style="text-align:center;" class="fSmall"><?php
echo number_format($kills);
?></td>
<td style="text-align:center;" class="fSmall"><?php
echo number_format($headshots);
?></td>
<td style="text-align:center;" class="fSmall"><?php
if ($kills>0)
echo sprintf('%.4f', ($headshots/$kills));
else
echo sprintf('%.4f', 0);
?></td>
</tr>
</table>
<?php
printserverstats($server_id);
} // for servers
?>

View File

@ -0,0 +1,230 @@
<?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.'); }
// Player Details
$player = valid_request(intval($_GET['player']), 1);
$uniqueid = valid_request(strval($_GET['uniqueid']), 0);
$game = valid_request(strval($_GET['game']), 0);
if (!$player && $uniqueid)
{
if (!$game)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid");
exit;
}
$db->query("
SELECT
playerId
FROM
hlstats_PlayerUniqueIds
WHERE
uniqueId='$uniqueid'
AND game='$game'
");
if ($db->num_rows() > 1)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid&game=$game");
exit;
}
elseif ($db->num_rows() < 1)
{
error("No players found matching uniqueId '$uniqueid'");
}
else
{
list($player) = $db->fetch_row();
$player = intval($player);
}
}
elseif (!$player && !$uniqueid)
{
error('No player ID specified.');
}
$db->query("
SELECT
hlstats_Players.playerId,
hlstats_Players.lastName,
hlstats_Players.game
FROM
hlstats_Players
WHERE
playerId='$player'
");
if ($db->num_rows() != 1)
error("No such player '$player'.");
$playerdata = $db->fetch_array();
$db->free_result();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . '...';
}
else
{
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$pl_urlname = urlencode($playerdata['lastName']);
$game = $playerdata['game'];
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
$gamename = ucfirst($game);
else
list($gamename) = $db->fetch_row();
$tblWeaponstats2 = new Table(
array(
new TableColumn(
'smweapon',
'Weapon',
'width=10&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&weapon=%k&game=$game")
),
new TableColumn(
'smhits',
'Hits',
'width=8&align=right'
),
new TableColumn(
'smhead',
'Head',
'width=8&align=right'
),
new TableColumn(
'smchest',
'Chest',
'width=8&align=right'
),
new TableColumn(
'smstomach',
'Stomach',
'width=8&align=right'
),
new TableColumn(
'smleftarm',
'L. Arm',
'width=8&align=right'
),
new TableColumn(
'smrightarm',
'R. Arm',
'width=7&align=right'
),
new TableColumn(
'smleftleg',
'L. Leg',
'width=7&align=right'
),
new TableColumn(
'smrightleg',
'R. Leg',
'width=7&align=right'
),
new TableColumn(
'smleft',
'Left',
'width=8&align=right&append=' . urlencode('%')
),
new TableColumn(
'smmiddle',
'Middle',
'width=8&align=right&append=' . urlencode('%')
),
new TableColumn(
'smright',
'Right',
'width=8&align=right&append=' . urlencode('%')
)
),
'smweapon',
'smhits',
'smweapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'weaponstats2'
);
$result = $db->query("
SELECT
hlstats_Events_Statsme2.weapon AS smweapon,
SUM(hlstats_Events_Statsme2.head) AS smhead,
SUM(hlstats_Events_Statsme2.chest) AS smchest,
SUM(hlstats_Events_Statsme2.stomach) AS smstomach,
SUM(hlstats_Events_Statsme2.leftarm) AS smleftarm,
SUM(hlstats_Events_Statsme2.rightarm) AS smrightarm,
SUM(hlstats_Events_Statsme2.leftleg) AS smleftleg,
SUM(hlstats_Events_Statsme2.rightleg) AS smrightleg,
SUM(hlstats_Events_Statsme2.head)+SUM(hlstats_Events_Statsme2.chest)+SUM(hlstats_Events_Statsme2.stomach)+
SUM(hlstats_Events_Statsme2.leftarm)+SUM(hlstats_Events_Statsme2.rightarm)+SUM(hlstats_Events_Statsme2.leftleg)+
SUM(hlstats_Events_Statsme2.rightleg) as smhits,
IFNULL(ROUND((SUM(hlstats_Events_Statsme2.leftarm) + SUM(hlstats_Events_Statsme2.leftleg)) / (SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach) + SUM(hlstats_Events_Statsme2.leftarm ) + SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.leftleg) + SUM(hlstats_Events_Statsme2.rightleg)) * 100, 1), 0.0) AS smleft,
IFNULL(ROUND((SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.rightleg)) / (SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach) + SUM(hlstats_Events_Statsme2.leftarm ) + SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.leftleg) + SUM(hlstats_Events_Statsme2.rightleg)) * 100, 1), 0.0) AS smright,
IFNULL(ROUND((SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach)) / (SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach) + SUM(hlstats_Events_Statsme2.leftarm ) + SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.leftleg) + SUM(hlstats_Events_Statsme2.rightleg)) * 100, 1), 0.0) AS smmiddle
FROM
hlstats_Events_Statsme2
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Statsme2.serverId
WHERE
hlstats_Servers.game='$game' AND hlstats_Events_Statsme2.PlayerId=$player
GROUP BY
hlstats_Events_Statsme2.weapon
HAVING
smhits > 0
ORDER BY
$tblWeaponstats2->sort $tblWeaponstats2->sortorder,
$tblWeaponstats2->sort2 $tblWeaponstats2->sortorder
");
if ($db->num_rows($result) != 0)
{
$tblWeaponstats2->draw($result, $db->num_rows($result), 100);
}
?>

View File

@ -0,0 +1,128 @@
<?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.'); }
// Weapon Details
$weapon = valid_request($_GET['weapon'], 0)
or error('No weapon ID specified.');
$db->query("
SELECT
name
FROM
hlstats_Weapons
WHERE
code='$weapon'
AND game='$game'
");
if ($db->num_rows() != 1)
{
$wep_name = ucfirst($weapon);
}
else
{
$weapondata = $db->fetch_array();
$db->free_result();
$wep_name = $weapondata['name'];
}
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
error('Invalid or no game specified.');
else
list($gamename) = $db->fetch_row();
$table = new Table(
array(
new TableColumn(
'killerName',
'Player',
'width=60&align=left&flag=1&link=' . urlencode('mode=statsme&amp;player=%k')
),
new TableColumn(
'frags',
ucfirst($weapon) . ' kills',
'width=15&align=right'
),
new TableColumn(
'headshots',
'Headshots',
'width=15&align=right'
),
new TableColumn(
'hpk',
'Hpk',
'width=5&align=right'
),
),
'killerId', // keycol
'frags', // sort_default
'killerName', // sort_default2
true, // showranking
25 // numperpage
);
$result = $db->query("
SELECT
hlstats_Events_Frags.killerId,
hlstats_Players.country,
hlstats_Players.flag,
hlstats_Players.lastName AS killerName,
COUNT(hlstats_Events_Frags.weapon) AS frags,
SUM(hlstats_Events_Frags.headshot=1) as headshots,
IFNULL(SUM(hlstats_Events_Frags.headshot=1) / Count(hlstats_Events_Frags.weapon), '-') AS hpk
FROM
hlstats_Events_Frags,
hlstats_Players
WHERE
hlstats_Players.playerId = hlstats_Events_Frags.killerId
AND hlstats_Events_Frags.weapon='$weapon'
AND hlstats_Players.game='$game'
AND hlstats_Players.hideranking<>'1'
GROUP BY
hlstats_Events_Frags.killerId
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT $table->startitem,$table->numperpage
");
$table->draw($result, 25, 100);
?>

View File

@ -0,0 +1,233 @@
<?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.'); }
// Player Details
$player = valid_request(intval($_GET['player']), 1);
$uniqueid = valid_request(strval($_GET['uniqueid']), 0);
$game = valid_request(strval($_GET['game']), 0);
if (!$player && $uniqueid)
{
if (!$game)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid");
exit;
}
$db->query("
SELECT
playerId
FROM
hlstats_PlayerUniqueIds
WHERE
uniqueId='$uniqueid'
AND game='$game'
");
if ($db->num_rows() > 1)
{
header('Location: ' . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid&game=$game");
exit;
}
elseif ($db->num_rows() < 1)
{
error("No players found matching uniqueId '$uniqueid'");
}
else
{
list($player) = $db->fetch_row();
$player = intval($player);
}
}
elseif (!$player && !$uniqueid)
{
error('No player ID specified.');
}
$db->query("
SELECT
hlstats_Players.playerId,
hlstats_Players.lastName,
hlstats_Players.game
FROM
hlstats_Players
WHERE
playerId=$player
");
if ($db->num_rows() != 1)
error("No such player '$player'.");
$playerdata = $db->fetch_array();
$db->free_result();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . '...';
}
else
{
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$pl_urlname = urlencode($playerdata['lastName']);
$game = $playerdata['game'];
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
$gamename = ucfirst($game);
else
list($gamename) = $db->fetch_row();
$tblWeapons = new Table(
array(
new TableColumn(
'weapon',
'Weapon',
'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&weapon=%k&game=$game")
),
new TableColumn(
'modifier',
'Modifier',
'width=10&align=right'
),
new TableColumn(
'kills',
'Kills',
'width=11&align=right'
),
new TableColumn(
'kpercent',
'Perc. Kills',
'width=18&sort=no&type=bargraph'
),
new TableColumn(
'kpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'headshots',
'Headshots',
'width=8&align=right'
),
new TableColumn(
'hpercent',
'Perc. Headshots',
'width=18&sort=no&type=bargraph'
),
new TableColumn(
'hpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'hpk',
'Hpk',
'width=5&align=right'
)
),
'weapon',
'kills',
'weapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'weapons'
);
$db->query("
SELECT
COUNT(*)
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND killerId=$player
");
list($realkills) = $db->fetch_row();
$db->query("
SELECT
COUNT(*)
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND killerId=$player
AND headshot=1
");
list($realheadshots) = $db->fetch_row();
$result = $db->query("
SELECT
hlstats_Events_Frags.weapon,
IFNULL(hlstats_Weapons.modifier, 1.00) AS modifier,
COUNT(hlstats_Events_Frags.weapon) AS kills,
COUNT(hlstats_Events_Frags.weapon) / $realkills * 100 AS kpercent,
SUM(hlstats_Events_Frags.headshot=1) as headshots,
SUM(hlstats_Events_Frags.headshot=1) / COUNT(hlstats_Events_Frags.weapon) AS hpk,
SUM(hlstats_Events_Frags.headshot=1) / $realheadshots * 100 AS hpercent
FROM
hlstats_Events_Frags
LEFT JOIN hlstats_Weapons ON
hlstats_Weapons.code = hlstats_Events_Frags.weapon
LEFT JOIN hlstats_Servers ON
hlstats_Servers.serverId=hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game='$game' AND hlstats_Events_Frags.killerId=$player
AND (hlstats_Weapons.game='$game' OR hlstats_Weapons.weaponId IS NULL)
GROUP BY
hlstats_Events_Frags.weapon
ORDER BY
$tblWeapons->sort $tblWeapons->sortorder,
$tblWeapons->sort2 $tblWeapons->sortorder
");
$tblWeapons->draw($result, $db->num_rows($result), 100);
?>

539
web/pages/livestats.php Normal file
View File

@ -0,0 +1,539 @@
<?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.');
}
function printserverstats($server_id)
{
global $db, $g_options;
$query= "
SELECT
SUM(kills),
SUM(headshots),
count(serverId)
FROM
hlstats_Servers
WHERE
serverId='$server_id'
";
$result = $db->query($query);
list($total_kills, $total_headshots) = $db->fetch_row($result);
$query= "
SELECT
serverId,
name,
IF(publicaddress != '',
publicaddress,
concat(address, ':', port)
) AS addr,
statusurl,
kills,
players,
rounds, suicides,
headshots,
bombs_planted,
bombs_defused,
ct_wins,
ts_wins,
ct_shots,
ct_hits,
ts_shots,
ts_hits,
act_players,
max_players,
act_map,
map_started,
map_ct_wins,
map_ts_wins,
game
FROM
hlstats_Servers
WHERE
serverId='$server_id'
";
$result = $db->query($query);
$servers = array();
$servers[] = $db->fetch_array($result);
?>
<?php
$i=0;
for ($i=0; $i<count($servers); $i++)
{
$rowdata = $servers[$i];
$server_id = $rowdata['serverId'];
$game = $rowdata['game'];
$c = ($i % 2) + 1;
$addr = $rowdata["addr"];
$kills = $rowdata['kills'];
$headshots = $rowdata['headshots'];
$player_string = $rowdata['act_players']."/".$rowdata['max_players'];
$map_teama_wins = $rowdata['map_ct_wins'];
$map_teamb_wins = $rowdata['map_ts_wins'];
$mode = 'playerinfo';
if (strpos($_SERVER['PHP_SELF'], 'ingame') !== FALSE)
{
$mode = 'statsme';
}
//style="border:1px solid; margin-bottom:40px;margin-left:auto;margin-right:auto;"
?>
<table class="livestats-table">
<tr class="data-table-head">
<td class="fSmall" style="width:2%;">&nbsp;#</td>
<td class="fSmall" style="width:42%;text-align:left;">&nbsp;Player</td>
<td class="fSmall" colspan="3" style="width:5%;">&nbsp;Kills</td>
<td class="fSmall" style="width:4%;">&nbsp;Hs</td>
<td class="fSmall" style="width:8%;">&nbsp;HS:K</td>
<td class="fSmall" style="width:6%;">&nbsp;Acc</td>
<td class="fSmall" style="width:6%;">&nbsp;Lat</td>
<td class="fSmall" style="width:10%;">&nbsp;Time</td>
<td class="fSmall" style="width:6%;">&nbsp;+/-</td>
<td class="fSmall" style="width:6%;">&nbsp;Skill</td>
</tr>
<?php
unset($team_colors);
$statsdata = $db->query("
SELECT
team,
name,
teamkills,
teamdeaths,
teamheadshots,
teamping,
teamskill,
teamshots,
teamhits,
teamjointime,
IFNULL(playerlist_bgcolor,'#D5D5D5') as playerlist_bgcolor,
IFNULL(playerlist_color,'#050505') AS playerlist_color,
IFNULL( playerlist_index, 99 ) AS playerlist_index
FROM
hlstats_Teams
RIGHT JOIN
(SELECT
team,
sum( kills ) AS teamkills,
sum( deaths ) AS teamdeaths,
sum( headshots ) AS teamheadshots,
avg( ping /2 ) AS teamping,
avg( skill ) AS teamskill,
sum( shots ) AS teamshots,
sum( hits ) AS teamhits,
sum( unix_timestamp( NOW( ) ) - connected ) AS teamjointime
FROM
hlstats_Livestats
WHERE
server_id = $server_id
AND connected >0
GROUP BY
team
ORDER BY
teamkills
) teaminfo
ON
code = team
AND
hlstats_Teams.game = '$game'
ORDER BY
playerlist_index
LIMIT 0 , 30
");
$teamdata = array();
$playerdata = array();
$teamno = 0;
while ($thisteam = $db->fetch_array($statsdata))
{
$teamname = $db->escape($thisteam['team']);
$teamdata[$teamno] = $thisteam;
$pldata = $db->query("
SELECT
player_id,
name,
kills,
deaths,
headshots,
ping,
skill,
shots,
hits,
connected,
skill_change,
cli_flag
FROM
hlstats_Livestats
WHERE
server_id = $server_id
AND team = '$teamname'
ORDER BY
kills DESC
");
while ($thisplayer = $db->fetch_array($pldata))
{
$playerdata[$teamno][] = $thisplayer;
}
$teamno++;
}
$curteam = 0;
while (isset($teamdata[$curteam]))
{
$j=0;
$thisteam = $teamdata[$curteam];
$teamcolor = 'background:'.$thisteam['playerlist_bgcolor'].';color:'.$thisteam['playerlist_color'];
$bordercolor = 'background:'.$$thisteam['playerlist_bgcolor'].';color:'.$thisteam['playerlist_color'].';border-top:1px '.$thisteam['playerlist_color'].' solid';
$team_display_name = htmlspecialchars($thisteam['name']);
while (isset($playerdata[$curteam][$j]))
{
$thisplayer = $playerdata[$curteam][$j];
?>
<tr style="<?php echo $teamcolor ?>">
<td class="fSmall"><?php
if (isset($thisplayer) && $team_display_name)
{
echo ($j+1);
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="text-align:left;<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
if (strlen($thisplayer['name'])>50)
{
$thisplayer['name'] = substr($thisplayer['name'], 0, 50);
}
if ($g_options['countrydata'] == 1)
{
echo '<img src="'.getFlag($thisplayer['cli_flag']).'" alt="'.ucfirst(strtolower($thisplayer['cli_country'])).'" title="'.ucfirst(strtolower($thisplayer['cli_country'])).'" />&nbsp;';
}
echo '<a style="color:'.$thisteam['playerlist_color'].'" href="'.$g_options['scripturl'].'?mode='.$mode.'&amp;player='.$thisplayer['player_id'].'">';
echo htmlspecialchars($thisplayer['name'], ENT_COMPAT).'</a>';
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="text-align:right;width:2%;<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
echo $thisplayer['kills'];
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="width:1%;<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
echo ':';
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="text-align:left;width:2%;<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
echo $thisplayer['deaths'];
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
echo $thisplayer['headshots'];
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
$hpk = sprintf('%.2f', 0);
if ($thisplayer['kills'] > 0)
{
$hpk = sprintf('%.2f', $thisplayer['headshots']/$thisplayer['kills']);
}
echo $hpk;
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
$acc = sprintf('%.0f', 0);
if ($thisplayer['shots'] > 0)
{
$acc = sprintf('%.0f', ($thisplayer['hits']/$thisplayer['shots'])*100);
}
echo "$acc%";
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
echo sprintf('%.0f', $thisplayer['ping'] / 2);
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
if ($thisplayer['connected']>0)
{
$stamp = time()-$thisplayer['connected'];
$hours = sprintf('%02d', floor($stamp / 3600));
$min = sprintf('%02d', floor(($stamp % 3600) / 60));
$sec = sprintf('%02d', floor($stamp % 60));
echo $hours.':'.$min.':'.$sec;
}
else
{
echo 'Unknown';
}
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
echo $thisplayer['skill_change'];
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $teamcolor ?>" class="fSmall"><?php
if (isset($thisplayer))
{
echo number_format($thisplayer['skill']);
}
else
{
echo '&nbsp;';
}
?> </td>
</tr>
<?php
$j++;
}
if ($team_display_name)
{
?>
<tr style="<?php echo $teamcolor ?>">
<td style="<?php echo $bordercolor ?>" class="fSmall">&nbsp;</td>
<td style="text-align:left;<?php echo $bordercolor ?>" class="fSmall"><?php
echo "<strong>$team_display_name</strong>";
if (($map_teama_wins > 0) || ($map_teamb_wins > 0))
{
echo '&nbsp;('.$map_teama_wins.' wins)';
}
?> </td>
<td style="width:2%;text-align:right;<?php echo $bordercolor ?>" class="fSmall"><?php
if (count($teamdata[$curteam]) > 0)
{
echo $teamdata[$curteam]['teamkills'];
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="width:1%;<?php echo $bordercolor ?>" class="fSmall"><?php
if (count($teamdata[$curteam]) > 0)
{
echo ':';
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="width:2%;text-align:left;<?php echo $bordercolor ?>" class="fSmall"><?php
if (count($teamdata[$curteam]) > 0)
{
echo $teamdata[$curteam]['teamdeaths'];
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $bordercolor ?>" class="fSmall"><?php
if (count($teamdata[$curteam]) > 0)
{
echo $teamdata[$curteam]['teamheadshots'];
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $bordercolor ?>" class="fSmall"><?php
if (count($teamdata[$curteam]) > 0)
{
$hpk = sprintf('%.2f', 0);
if ($teama_kills > 0)
{
$hpk = sprintf('%.2f', $teamdata[$curteam]['headshots']/$teamdata[$curteam]['kills']);
}
echo $hpk;
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $bordercolor ?>" class="fSmall"><?php
if (count($teamdata[$curteam]) > 0)
{
$acc = sprintf('%.0f', 0);
if ($teama_shots > 0)
{
$acc = sprintf('%.0f', ($teamdata[$curteam]['teamhits']/$teamdata[$curteam]['teamshots'])*100);
}
echo "$acc%";
}
else
{
echo '&nbsp;';
}
?></td>
<td style="<?php echo $bordercolor ?>" class="fSmall"><?php
if (count($teamdata[$curteam]) > 0)
{
echo sprintf('%.0f', $teamdata[$curteam]['teamping'] / count($teamdata[$curteam]));
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $bordercolor ?>" class="fSmall"><?php
if (count($teamdata[$curteam]) > 0)
{
if ($teamdata[$curteam]['teamjointime'] > 0)
{
$stamp = $teamdata[$curteam]['teamjointime'];
$hours = sprintf('%02d', floor($stamp / 3600));
$min = sprintf('%02d', floor(($stamp % 3600) / 60));
$sec = sprintf('%02d', floor($stamp % 60));
echo $hours.':'.$min.':'.$sec;
}
else
{
echo 'Unknown';
}
}
else
{
echo '&nbsp;';
}
?> </td>
<td style="<?php echo $bordercolor ?>" class="fSmall">-</td>
<td style="<?php echo $bordercolor ?>" class="fSmall"><?php
if (count($teamdata[$curteam])>0)
{
echo number_format(sprintf('%.0f', $teamdata[$curteam]['teamskill']));
}
else
{
echo '&nbsp;';
}
?> </td>
</tr>
<?php
}
$curteam++;
} //while i for teams
if (count($teamdata) == 0)
{
?>
<tr>
<td style="background:#EFEFEF;color:black"><?php
echo '&nbsp;';
?> </td>
<td colspan="11" style="text-align:left;background:#EFEFEF;color:black"><?php
echo "No Players";
?> </td>
</tr>
<?php
}
?>
</table>
<?php
} // for servers
}
?>

213
web/pages/mapinfo.php Normal file
View File

@ -0,0 +1,213 @@
<?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.');
}
// Map Details
$map = valid_request($_GET['map'], 0)
or error('No map specified.');
$db->query("SELECT name FROM hlstats_Games WHERE code='$game'");
if ($db->num_rows() != 1)
{
error('Invalid or no game specified.');
}
else
{
list($gamename) = $db->fetch_row();
}
pageHeader(
array($gamename, 'Map Details', $map),
array(
$gamename=>$g_options['scripturl'] . "?game=$game",
'Map Statistics' => $g_options['scripturl'] . "?mode=maps&game=$game",
'Map Details' => ''
),
$map
);
$table = new Table(
array(
new TableColumn(
'killerName',
'Player',
'width=50&align=left&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn(
'frags',
"Kills on $map",
'width=25&align=right'
),
new TableColumn(
'headshots',
'Headshots',
'width=15&align=right'
),
new TableColumn(
'hpk',
'Hpk',
'width=5&align=right'
),
),
'killerId', // keycol
'frags', // sort_default
'killerName', // sort_default2
true, // showranking
50 // numperpage
);
$result = $db->query("
SELECT
hlstats_Events_Frags.killerId,
hlstats_Players.lastName AS killerName,
hlstats_Players.flag as flag,
COUNT(hlstats_Events_Frags.map) AS frags,
SUM(hlstats_Events_Frags.headshot=1) as headshots,
IFNULL(SUM(hlstats_Events_Frags.headshot=1) / Count(hlstats_Events_Frags.map), '-') AS hpk
FROM
hlstats_Events_Frags,
hlstats_Players
WHERE
hlstats_Players.playerId = hlstats_Events_Frags.killerId
AND hlstats_Events_Frags.map='$map'
AND hlstats_Players.game='$game'
AND hlstats_Players.hideranking<>'1'
GROUP BY
hlstats_Events_Frags.killerId
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT $table->startitem,$table->numperpage
");
$resultCount = $db->query("
SELECT
COUNT(DISTINCT hlstats_Events_Frags.killerId),
SUM(hlstats_Events_Frags.map='$map')
FROM
hlstats_Events_Frags,
hlstats_Servers
WHERE
hlstats_Servers.serverId = hlstats_Events_Frags.serverId
AND hlstats_Events_Frags.map='$map'
AND hlstats_Servers.game='$game'
");
list($numitems, $totalkills) = $db->fetch_row($resultCount);
?>
<div class="block">
<?php printSectionTitle('Map Details'); ?>
<div class="subblock">
<div style="float:left;">
<strong><?php echo $map; ?></strong>: From a total of <strong><?php echo number_format(intval($totalkills)); ?></strong> kills (Last <?php echo $g_options['DeleteDays']; ?> Days)
</div>
<div style="float:right;">
Back to <a href="<?php echo $g_options['scripturl'] . "?mode=maps&amp;game=$game"; ?>">Map Statistics</a>
</div>
<div style="clear:both;"></div>
</div>
</div>
<br /><br />
<div class="block">
<?php // figure out URL and absolute path of image
if ($mapimg = getImage("/games/$game/maps/$map"))
{
$mapimg = $mapimg['url'];
}
elseif ($mapimg = getImage("/games/$realgame/maps/$map"))
{
$mapimg = $mapimg['url'];
}
else
{
$mapimg = IMAGE_PATH."/nomap.png";
}
$heatmap = getImage("/games/$game/heatmaps/$map-kill");
$heatmapthumb = getImage("/games/$game/heatmaps/$map-kill-thumb");
if ($mapimg || $g_options['map_dlurl'] || $heatmap)
{
?>
<div class="subblock">
<div style="float:left;width:75%;">
<?php $table->draw($result, $numitems, 100, 'center'); ?>
</div>
<div style="float:right;">
<?php
if ($mapimg)
{
echo "<img src=\"$mapimg\" alt=\"$map\" />";
}
if ($g_options['map_dlurl'])
{
$map_dlurl = str_replace("%MAP%", $map, $g_options['map_dlurl']);
$map_dlurl = str_replace("%GAME%", $game, $map_dlurl);
$mapdlheader = @get_headers($map_dlurl);
if (preg_match("|200|", $mapdlheader[0])) {
echo "<p><a href=\"$map_dlurl\">Download this map...</a></p>";
}
}
if ($heatmap)
{
echo "<a href=\"" . $heatmap['url'] . "\" rel=\"boxed\" title=\"Heatmap: $map\"><br /><img src=\"" . $heatmapthumb['url'] . "\" alt=\"$map\" /></a>";
}
?>
</div>
</div>
<?php
}
else
{
$table->draw($result, $numitems, 95, 'center');
}
?>
</div>

175
web/pages/maps.php Normal file
View File

@ -0,0 +1,175 @@
<?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.');
}
// Map Statistics
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
pageHeader
(
array ($gamename, 'Map Statistics'),
array ($gamename=>"%s?game=$game", 'Map Statistics'=>'')
);
$tblMaps = new Table
(
array
(
new TableColumn
(
'map',
'Map',
'width=20&align=left&link=' . urlencode("mode=mapinfo&amp;map=%k&amp;game=$game")
),
new TableColumn
(
'kills',
'Kills',
'width=8&align=right'
),
new TableColumn
(
'kpercent',
'%',
'width=7&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'kpercent',
'Ratio',
'width=16&sort=no&type=bargraph'
),
new TableColumn
(
'headshots',
'Headshots',
'width=8&align=right'
),
new TableColumn
(
'hpercent',
'%',
'width=7&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'hpercent',
'Ratio',
'width=16&sort=no&type=bargraph'
),
new TableColumn
(
'hpk',
'HS:K',
'width=9&align=right'
),
new TableColumn
(
'map',
'HeatMap',
'width=4&type=heatmap'
)
),
'map',
'kills',
'map',
true,
9999,
'maps_page',
'maps_sort',
'maps_sortorder'
);
$db->query
("
SELECT
SUM(hlstats_Maps_Counts.kills),
SUM(hlstats_Maps_Counts.headshots)
FROM
hlstats_Maps_Counts
WHERE
hlstats_Maps_Counts.game = '$game'
");
list($realkills, $realheadshots) = $db->fetch_row();
$result = $db->query
("
SELECT
IF(hlstats_Maps_Counts.map = '', '(Unaccounted)', hlstats_Maps_Counts.map) AS map,
hlstats_Maps_Counts.kills,
ROUND(kills / ".(($realkills==0)?1:$realkills)." * 100, 2) AS kpercent,
hlstats_Maps_Counts.headshots,
ROUND(hlstats_Maps_Counts.headshots / IF(hlstats_Maps_Counts.kills = 0, 1, hlstats_Maps_Counts.kills), 2) AS hpk,
ROUND(hlstats_Maps_Counts.headshots / ".(($realheadshots==0)?1:$realheadshots)." * 100, 2) AS hpercent
FROM
hlstats_Maps_Counts
WHERE
hlstats_Maps_Counts.game = '$game'
ORDER BY
$tblMaps->sort $tblMaps->sortorder,
$tblMaps->sort2 $tblMaps->sortorder
");
?>
<div class="block">
<?php printSectionTitle('Map Statistics'); ?>
<div class="subblock">
<div style="float:left;">
From a total of <strong><?php echo number_format($realkills); ?></strong> kills with <strong><?php echo number_format($realheadshots); ?></strong> headshots
</div>
<div style="clear:both;"></div>
</div>
<br /><br />
<?php $tblMaps->draw($result, $db->num_rows($result), 95); ?><br /><br />
<div class="subblock">
<div style="float:right;">
Go to: <a href="<?php echo $g_options['scripturl'] . "?game=$game"; ?>"><?php echo $gamename; ?></a>
</div>
</div>
</div>

253
web/pages/playerawards.php Normal file
View File

@ -0,0 +1,253 @@
<?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.');
}
// Player Awards History
$player = valid_request($_GET['player'], 1)
or error("No player ID specified.");
$db->query
("
SELECT
hlstats_Players.lastName,
hlstats_Players.game
FROM
hlstats_Players
WHERE
hlstats_Players.playerId = $player
");
if ($db->num_rows() != 1)
{
error("No such player '$player'.");
}
$playerdata = $db->fetch_array();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . "...";
}
else
{
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$game = $playerdata['game'];
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() != 1)
{
$gamename = ucfirst($game);
}
else
{
list($gamename) = $db->fetch_row();
}
pageHeader
(
array ($gamename, 'Awards History', $pl_name),
array
(
$gamename=>$g_options['scripturl'] . "?game=$game",
'Player Rankings'=>$g_options['scripturl'] . "?mode=players&game=$game",
'Player Details'=>$g_options['scripturl'] . "?mode=playerinfo&player=$player",
'Awards History'=>''
),
$playername
);
flush();
$cnttext = 'Earned';
$lnktext = '&link='.urlencode("mode=playerawards&player=".$player."&amp;awardId=%k");
if (isset($_GET['awardId']))
{
$awardId = valid_request($_GET['awardId'], true) or error("No clan ID specified.");
}
$cnttext = 'Kills on Day';
$lnktext = '';
$table = new Table
(
array
(
new TableColumn
(
'awardTime',
(isset($awardId))?'Date':'Date Last Earned',
'width=17'
),
new TableColumn(
'name',
'Name',
'width=23'
),
new TableColumn(
'verb',
'Description',
'width=50'.$lnktext
),
new TableColumn(
'count',
$cnttext,
'width=10&align=right'
)
),
'awardId',
'awardTime',
'name',
false,
50,
'page',
'sort',
'sortorder'
);
$surl = $g_options['scripturl'];
if (isset($awardId))
{
$result = $db->query
("
SELECT
hlstats_Players_Awards.awardTime,
hlstats_Awards.Name,
hlstats_Awards.verb,
hlstats_Players_Awards.count,
hlstats_Awards.awardId
FROM
hlstats_Players_Awards
INNER JOIN
hlstats_Awards
ON
hlstats_Awards.awardId = hlstats_Players_Awards.awardId
WHERE
hlstats_Players_Awards.playerId = $player
AND hlstats_Players_Awards.awardId = $awardId
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT
$table->startitem,
$table->numperpage
");
$resultCount = $db->query
("
SELECT
COUNT(awardId)
FROM
hlstats_Players_Awards
WHERE
hlstats_Players_Awards.playerId = $player
AND hlstats_Players_Awards.awardId = $awardId
");
}
else
{
$result = $db->query
("
SELECT
MAX(hlstats_Players_Awards.awardTime) AS awardTime,
hlstats_Awards.name,
hlstats_Awards.verb,
COUNT(verb) AS count,
hlstats_Awards.awardId
FROM
hlstats_Players_Awards
INNER JOIN
hlstats_Awards
ON
hlstats_Awards.awardId = hlstats_Players_Awards.awardId
WHERE
hlstats_Players_Awards.playerId = $player
GROUP BY
hlstats_Awards.name,
hlstats_Awards.verb
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT
$table->startitem,$table->numperpage
");
$resultCount = $db->query
("
SELECT
COUNT(awardId)
FROM
hlstats_Players_Awards
WHERE
hlstats_Players_Awards.playerId = $player
GROUP BY
hlstats_Players_Awards.awardId
");
}
list($numitems) = $db->fetch_row($resultCount);
?>
<div class="block">
<?php
printSectionTitle('Player Awards History');
if ($numitems > 0)
{
$table->draw($result, $numitems, 95);
}
?><br /><br />
<div class="subblock">
<div style="float:right;">
<?php
$db->query
("
SELECT
hlstats_Players.lastName
FROM
hlstats_Players
WHERE
hlstats_Players.playerId = $player
");
list($lastName) = $db->fetch_row();
?>
Go to: <a href="<?php echo $g_options['scripturl'] . "?mode=playerinfo&amp;player=$player"; ?>"><?php echo $lastName; ?>'s Statistics</a>
</div>
</div>
</div>

563
web/pages/playerhistory.php Normal file
View File

@ -0,0 +1,563 @@
<?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.');
}
// Player History
$player = valid_request(intval($_GET['player']), 1)
or error('No player ID specified.');
$db->query
("
SELECT
hlstats_Players.lastName,
hlstats_Players.game
FROM
hlstats_Players
WHERE
hlstats_Players.playerId = $player
");
if ($db->num_rows() != 1)
{
error("No such player '$player'.");
}
$playerdata = $db->fetch_array();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . '...';
}
else
{
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$game = $playerdata['game'];
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() != 1)
{
$gamename = ucfirst($game);
}
else
{
list($gamename) = $db->fetch_row();
}
pageHeader
(
array ($gamename, 'Event History', $pl_name),
array
(
$gamename=>$g_options['scripturl'] . "?game=$game",
'Player Rankings'=>$g_options['scripturl'] . "?mode=players&game=$game",
'Player Details'=>$g_options['scripturl'] . "?mode=playerinfo&player=$player",
'Event History'=>''
),
$playername
);
flush();
$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'
);
$surl = $g_options['scripturl'];
// This would be better done with a UNION query, I think, but MySQL doesn't
// support them yet. (NOTE you need MySQL 3.23 for temporary table support.)
$db->query
("
DROP TABLE IF EXISTS
hlstats_EventHistory
");
$db->query
("
CREATE TEMPORARY TABLE
hlstats_EventHistory
(
eventType VARCHAR(32) 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_EventHistory
(
eventType,
eventTime,
eventDesc,
serverName,
map
)
$select
");
}
insertEvents
('TeamBonuses', "
SELECT
'Team Bonus',
<table>.eventTime,
CONCAT('My team received a points bonus of ', bonus, ' for triggering \"', IFNULL(hlstats_Actions.description,'Unknown'), '\"'),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Actions
ON
<table>.actionId = hlstats_Actions.id
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
WHERE
<table>.playerId = $player
AND
hlstats_Actions.game = '$game'
");
if ($g_options["Mode"] == "LAN")
{
$uqIdStr = "IP Address:";
}
else
{
$uqIdStr = "Unique ID:";
}
insertEvents
('Connects', "
SELECT
'Connect',
<table>.eventTime,
CONCAT('I connected to the server'),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
WHERE
<table>.playerId = $player
");
insertEvents
('Disconnects', "
SELECT
'Disconnect',
<table>.eventTime,
'I left the game',
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
WHERE
<table>.playerId = $player
");
insertEvents
('Entries', "
SELECT
'Entry',
<table>.eventTime,
'I entered the game',
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
WHERE
<table>.playerId = $player
");
insertEvents
('Frags', "
SELECT
'Kill',
<table>.eventTime,
CONCAT('I killed %A%$surl?mode=playerinfo&player=', victimId, '%', IFNULL(hlstats_Players.lastName,'Unknown'), '%/A%', ' with ', weapon),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
LEFT JOIN
hlstats_Players
ON
hlstats_Players.playerId = <table>.victimId
WHERE
<table>.killerId = $player
AND <table>.headshot = 0
");
insertEvents
('Frags', "
SELECT
'Kill',
<table>.eventTime,
CONCAT('I killed %A%$surl?mode=playerinfo&player=', victimId, '%', IFNULL(hlstats_Players.lastName,'Unknown'), '%/A%', ' with a headshot from ', weapon),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
LEFT JOIN
hlstats_Players
ON
hlstats_Players.playerId = <table>.victimId
WHERE
<table>.killerId = $player
AND <table>.headshot = 1
");
insertEvents
('Frags', "
SELECT
'Death',
<table>.eventTime,
CONCAT('%A%$surl?mode=playerinfo&player=', killerId, '%', IFNULL(hlstats_Players.lastName,'Unknown'), '%/A%', ' killed me with ', weapon),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
LEFT JOIN
hlstats_Players
ON
hlstats_Players.playerId = <table>.killerId
WHERE
<table>.victimId = $player
");
insertEvents
('Teamkills', "
SELECT
'Team Kill',
<table>.eventTime,
CONCAT('I killed teammate %A%$surl?mode=playerinfo&player=', victimId, '%', IFNULL(hlstats_Players.lastName,'Unknown'), '%/A%', ' with ', weapon),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
LEFT JOIN
hlstats_Players
ON
hlstats_Players.playerId = <table>.victimId
WHERE
<table>.killerId = $player
");
insertEvents
('Teamkills', "
SELECT
'Friendly Fire',
<table>.eventTime,
CONCAT('My teammate %A%$surl?mode=playerinfo&player=', killerId, '%', IFNULL(hlstats_Players.lastName, 'Unknown'), '%/A%', ' killed me with ', weapon),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
LEFT JOIN
hlstats_Players
ON
hlstats_Players.playerId = <table>.killerId
WHERE
<table>.victimId = $player
");
insertEvents
('ChangeRole', "
SELECT
'Role',
<table>.eventTime,
CONCAT('I changed role to ', role),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
WHERE
<table>.playerId = $player
");
insertEvents
('ChangeName', "
SELECT
'Name',
<table>.eventTime,
CONCAT('I changed my name from \"', oldName, '\" to \"', newName, '\"'),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
WHERE
<table>.playerId = $player
");
insertEvents
('PlayerActions', "
SELECT
'Action',
<table>.eventTime,
CONCAT('I received a points bonus of ', bonus, ' for triggering \"', IFNULL(hlstats_Actions.description,'Unknown'), '\"'),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
LEFT JOIN
hlstats_Actions
ON
hlstats_Actions.id = <table>.actionId
WHERE
<table>.playerId = $player
AND
hlstats_Actions.game = '$game'
");
insertEvents
('PlayerPlayerActions', "
SELECT
'Action',
<table>.eventTime,
CONCAT('I received a points bonus of ', bonus, ' for triggering \"', IFNULL(hlstats_Actions.description,'Unknown'), '\" against %A%$surl?mode=playerinfo&player=', victimId, '%', IFNULL(hlstats_Players.lastName,'Unknown'), '%/A%'),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
LEFT JOIN
hlstats_Actions
ON
hlstats_Actions.id = <table>.actionId
LEFT JOIN hlstats_Players ON
hlstats_Players.playerId = <table>.victimId
WHERE
<table>.playerId = $player
AND
hlstats_Actions.game = '$game'
");
insertEvents
('PlayerPlayerActions', "
SELECT
'Action',
<table>.eventTime,
CONCAT('%A%$surl?mode=playerinfo&player=', <table>.playerId, '%', IFNULL(hlstats_Players.lastName,'Unknown'), '%/A% triggered \"', IFNULL(hlstats_Actions.description,'Unknown'), '\" against me'),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
LEFT JOIN
hlstats_Actions
ON
hlstats_Actions.id = <table>.actionId
LEFT JOIN
hlstats_Players
ON
hlstats_Players.playerId = <table>.playerId
WHERE
<table>.victimId = $player
AND
hlstats_Actions.game = '$game'
");
insertEvents
('Suicides', "
SELECT
'Suicide',
<table>.eventTime,
CONCAT('I committed suicide with \"', weapon, '\"'),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
WHERE
<table>.playerId = $player
");
insertEvents
('ChangeTeam', "
SELECT
'Team',
<table>.eventTime,
IF(hlstats_Teams.name IS NULL, CONCAT('I joined team \"', team, '\"'), CONCAT('I joined team \"', team, '\" (', hlstats_Teams.name, ')')),
IFNULL(hlstats_Servers.name, 'Unknown'),
<table>.map
FROM
<table>
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = <table>.serverId
LEFT JOIN
hlstats_Teams
ON
hlstats_Teams.code = <table>.team
WHERE
<table>.playerId = $player
AND
hlstats_Teams.game = '$game'
");
$result = $db->query
("
SELECT
hlstats_EventHistory.eventTime,
hlstats_EventHistory.eventType,
hlstats_EventHistory.eventDesc,
hlstats_EventHistory.serverName,
hlstats_EventHistory.map
FROM
hlstats_EventHistory
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT
$table->startitem,
$table->numperpage
");
$resultCount = $db->query
("
SELECT
COUNT(*)
FROM
hlstats_EventHistory
");
list($numitems) = $db->fetch_row($resultCount);
?>
<div class="block">
<?php
printSectionTitle('Player Event History (Last '.$g_options['DeleteDays'].' Days)');
if ($numitems > 0)
{
$table->draw($result, $numitems, 95);
}
?><br /><br />
<div class="subblock">
<div style="float:right;">
Go to: <a href="<?php echo $g_options['scripturl'] . "?mode=playerinfo&amp;player=$player"; ?>"><?php echo $pl_name; ?>'s Statistics</a>
</div>
</div>
</div>

317
web/pages/playerinfo.php Normal file
View File

@ -0,0 +1,317 @@
<?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.');
}
// Player Details
$player = valid_request(intval($_GET['player']), 1);
$uniqueid = valid_request(strval($_GET['uniqueid']), 0);
$game = valid_request(strval($_GET['game']), 0);
if (!$player && $uniqueid)
{
if (!$game)
{
header("Location: " . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid");
exit;
}
$uniqueid = preg_replace('/^STEAM_\d+?\:/i','',$uniqueid);
$db->query
("
SELECT
hlstats_PlayerUniqueIds.playerId
FROM
hlstats_PlayerUniqueIds
WHERE
hlstats_PlayerUniqueIds.uniqueId = '$uniqueid'
");
if ($db->num_rows() > 1)
{
header("Location: " . $g_options['scripturl'] . "&mode=search&st=uniqueid&q=$uniqueid&game=$game");
exit;
}
elseif ($db->num_rows() < 1)
{
error("No players found matching uniqueId '$uniqueid'");
}
else
{
list($player) = $db->fetch_row();
$player = intval($player);
}
}
elseif (!$player && !$uniqueid)
{
error("No player ID specified.");
}
$db->query
("
SELECT
hlstats_Players.playerId,
hlstats_Players.connection_time,
unhex(replace(hex(hlstats_Players.lastName), 'E280AE', '')) as lastName,
hlstats_Players.country,
hlstats_Players.city,
hlstats_Players.flag,
hlstats_Players.clan,
hlstats_Players.fullName,
hlstats_Players.email,
hlstats_Players.homepage,
hlstats_Players.icq,
hlstats_Players.game,
hlstats_Players.hideranking,
hlstats_Players.blockavatar,
hlstats_Players.skill,
hlstats_Players.kills,
hlstats_Players.deaths,
IFNULL(kills / deaths, '-') AS kpd,
hlstats_Players.suicides,
hlstats_Players.headshots,
IFNULL(headshots / kills, '-') AS hpk,
hlstats_Players.shots,
hlstats_Players.hits,
hlstats_Players.teamkills,
IFNULL(ROUND((hits / shots * 100), 1), 0) AS acc,
CONCAT(hlstats_Clans.name) AS clan_name,
activity
FROM
hlstats_Players
LEFT JOIN
hlstats_Clans
ON
hlstats_Clans.clanId = hlstats_Players.clan
WHERE
hlstats_Players.playerId = '$player'
LIMIT
1
");
if ($db->num_rows() != 1)
{
error("No such player '$player'.");
}
$playerdata = $db->fetch_array();
$db->free_result();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . '...';
} else {
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$pl_urlname = urlencode($playerdata['lastName']);
$game = $playerdata['game'];
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() != 1)
{
$gamename = ucfirst($game);
}
else
{
list($gamename) = $db->fetch_row();
}
$hideranking = $playerdata['hideranking'];
if( $hideranking == 2 )
{
$statusmsg = '<span style="color:red;font-weight:bold;">Banned</span>';
}
else
{
$statusmsg = '<span style="color:green;font-weight:bold;">In good standing</span>';
}
// Required on a few pages, just decided to add it here
// May get moved in the future
$db->query
("
SELECT
COUNT(hlstats_Events_Frags.killerId)
FROM
hlstats_Events_Frags
WHERE
hlstats_Events_Frags.killerId = '$player'
AND hlstats_Events_Frags.headshot = 1
");
list($realheadshots) = $db->fetch_row();
$db->query
("
SELECT
COUNT(hlstats_Events_Frags.killerId)
FROM
hlstats_Events_Frags
WHERE
hlstats_Events_Frags.killerId = '$player'
");
list($realkills) = $db->fetch_row();
$db->query
("
SELECT
COUNT(hlstats_Events_Frags.victimId)
FROM
hlstats_Events_Frags
WHERE
hlstats_Events_Frags.victimId = '$player'
");
list($realdeaths) = $db->fetch_row();
$db->query
("
SELECT
COUNT(hlstats_Events_Teamkills.killerId)
FROM
hlstats_Events_Teamkills
WHERE
hlstats_Events_Teamkills.killerId = '$player'
");
list($realteamkills) = $db->fetch_row();
if(!isset($_GET['killLimit']))
$killLimit = 5;
else
$killLimit = valid_request($_GET['killLimit'], 1);
if ( $_GET['type'] == 'ajax' )
{
$tabs = explode('_', preg_replace('[^a-z]', '', $_GET['tab']));
foreach ( $tabs as $tab )
{
if ( file_exists(PAGE_PATH . "/playerinfo_$tab.php") )
{
@include(PAGE_PATH . "/playerinfo_$tab.php");
}
}
exit;
}
pageHeader
(
array ($gamename, 'Player Details', $pl_name),
array
(
$gamename=>$g_options['scripturl'] . "?game=$game",
'Player Rankings'=>$g_options['scripturl'] . "?mode=players&game=$game",
'Player Details'=>""
),
$pl_name
);
?>
<div class="block" id="main">
<?php
if ($g_options['playerinfo_tabs']=='1')
{
?>
<ul class="subsection_tabs" id="tabs_playerinfo">
<li>
<a href="#" id="tab_general_aliases">General</a>
</li>
<li>
<a href="#" id="tab_playeractions_teams">Teams &amp; Actions</a>
</li>
<li>
<a href="#" id="tab_weapons">Weapons</a>
</li>
<li>
<a href="#" id="tab_mapperformance_servers">Maps &amp; Servers</a>
</li>
<li>
<a href="#" id="tab_killstats">Killstats</a>
</li>
</ul><br />
<div id="main_content"></div>
<script type="text/javascript">
var Tabs = new Tabs
(
$('main_content'), $$('#main ul.subsection_tabs a'),
{
'mode': 'playerinfo',
'game': '<?php echo $game; ?>',
'loadingImage': '<?php echo IMAGE_PATH; ?>/ajax.gif',
'defaultTab': 'general_aliases',
'extra':
{
'player': '<?php echo $player; ?>', 'killLimit': '<?php echo $killLimit; ?>'
}
}
);
</script>
<?php
}
else
{
echo "\n<div id=\"tabgeneral\" class=\"tab\">\n";
require_once PAGE_PATH.'/playerinfo_general.php';
require_once PAGE_PATH.'/playerinfo_aliases.php';
echo '</div>';
echo "\n<div id=\"tabteams\" class=\"tab\">\n";
require_once PAGE_PATH.'/playerinfo_playeractions.php';
require_once PAGE_PATH.'/playerinfo_teams.php';
echo '</div>';
echo "\n<div id=\"tabweapons\" class=\"tab\">\n";
require_once PAGE_PATH.'/playerinfo_weapons.php';
echo '</div>';
echo "\n<div id=\"tabmaps\" class=\"tab\">\n";
require_once PAGE_PATH.'/playerinfo_mapperformance.php';
require_once PAGE_PATH.'/playerinfo_servers.php';
echo '</div>';
echo "\n<div id=\"tabkills\" class=\"tab\">\n";
require_once PAGE_PATH.'/playerinfo_killstats.php';
echo '</div>';
}
?>
</div>
<div class="block" style="clear:both;padding-top:12px;">
<div class="subblock">
<div style="float:left;">
Items marked "*" above are generated from the last <?php echo $g_options['DeleteDays']; ?> days.
</div>
<div style="float:right;">
<?php
if (isset($_SESSION['loggedin']))
{
echo 'Admin Options: <a href="'.$g_options['scripturl']."?mode=admin&amp;task=tools_editdetails_player&amp;id=$player\">Edit Player Details</a><br />";
}
?>
Go to: <a href="<?php echo $g_options['scripturl'] . "?mode=players&amp;game=$game"; ?>">Player Rankings</a>
</div>
</div>
</div>

View File

@ -0,0 +1,172 @@
<?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.');
}
flush();
$tblAliases = new Table
(
array
(
new TableColumn
(
'name',
'Name',
'width=21'
),
new TableColumn
(
'connection_time',
'Time',
'width=8&align=right&type=timestamp'
),
new TableColumn
(
'lastuse',
'Last Use',
'width=15'
),
new TableColumn
(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=11&align=right'
),
new TableColumn
(
'headshots',
'Headshots',
'width=8&align=right'
),
new TableColumn
(
'hpk',
'HS:K',
'width=6&align=right'
),
new TableColumn
(
'suicides',
'Suicides',
'width=6&align=right'
),
new TableColumn
(
'acc',
'Accuracy',
'width=6&align=right&append=' . urlencode('%')
)
),
'name',
'lastuse',
'name',
true,
20,
'aliases_page',
'aliases_sort',
'aliases_sortorder',
'tabteams',
'desc',
true
);
$result = $db->query
("
SELECT
hlstats_PlayerNames.name,
hlstats_PlayerNames.connection_time,
hlstats_PlayerNames.lastuse,
hlstats_PlayerNames.numuses,
hlstats_PlayerNames.kills,
hlstats_PlayerNames.deaths,
IFNULL(ROUND(hlstats_PlayerNames.kills / IF(hlstats_PlayerNames.deaths = 0, 1, hlstats_PlayerNames.deaths), 2), '-') AS kpd,
hlstats_PlayerNames.headshots,
IFNULL(ROUND(hlstats_PlayerNames.headshots / hlstats_PlayerNames.kills, 2), '-') AS hpk,
hlstats_PlayerNames.suicides,
IFNULL(ROUND(hlstats_PlayerNames.hits / hlstats_PlayerNames.shots * 100, 1), 0.0) AS acc
FROM
hlstats_PlayerNames
WHERE
hlstats_PlayerNames.playerId = $player
ORDER BY
$tblAliases->sort $tblAliases->sortorder
LIMIT
$tblAliases->startitem,
$tblAliases->numperpage
");
$resultCount = $db->query
("
SELECT
COUNT(*)
FROM
hlstats_PlayerNames
WHERE
hlstats_PlayerNames.playerId = $player
");
list($numitems) = $db->fetch_row($resultCount);
if ($numitems > 1)
{
?>
<div style="clear:both;padding-top:24px;"></div>
<?php
printSectionTitle('Aliases');
if ($numitems > 0)
{
$tblAliases->draw($result, $numitems, 95);
}
?>
<br /><br />
<?php
}
?>

View File

@ -0,0 +1,993 @@
<?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.');
}
?>
<?php printSectionTitle('Player Information'); ?>
<div class="subblock">
<div style="float:left;vertical-align:top;width:48.5%;">
<table class="data-table">
<tr class="data-table-head">
<td style="vertical-align:top;">Player Profile<br /><br /></td>
<td style="text-align:center; vertical-align:middle;" rowspan="7" id="player_avatar">
<?php
$db->query
("
SELECT
hlstats_PlayerUniqueIds.uniqueId,
CAST(LEFT(hlstats_PlayerUniqueIds.uniqueId,1) AS unsigned) + CAST('76561197960265728' AS unsigned) + CAST(MID(hlstats_PlayerUniqueIds.uniqueId, 3,10)*2 AS unsigned) AS communityId
FROM
hlstats_PlayerUniqueIds
WHERE
hlstats_PlayerUniqueIds.playerId = '$player'
");
list($uqid, $coid) = $db->fetch_row();
function fetchpage($page)
{
$domain="steamcommunity.com";
$indata="";
// $data=file_get_contents($page);
$fsock=fsockopen($domain, 80, $errno, $errstr,2);
if(!$fsock)
{
echo "Error: $errstr";
}
else
{
$request=sprintf("GET %s HTTP/1.1\r\nHost: %s\r\nConnection: Close\r\n\r\n",$page,$domain);
fwrite($fsock, $request);
while(!feof($fsock))
{
$indata.=fgets($fsock,1024);
}
fclose($fsock);
return $indata;
}
}
$page = "/profiles/$coid?xml=1";
$pagedata=fetchpage($page);
if( preg_match('/Location: (.*)/', $pagedata, $location) )
{
$page = trim($location[1]) . "?xml=1";
$pagedata = fetchpage($page);
}
preg_match('/<onlineState>(.*?)<\/onlineState>/', $pagedata, $results);
preg_match('/<avatarFull><!\[CDATA\[(.*?)\]\]><\/avatarFull>/', $pagedata, $results2);
$status = ucwords($results[1]);
$avatar_full = $results2[1];
$avimg = getImage("/avatars/$player");
if ($avimg)
{
$avatar_full = $avimg['url'];
}
else if ($avatar_full == '' || $playerdata['blockavatar'] == '1')
{
$avatar_full = IMAGE_PATH."/unknown.jpg";
}
if ($status == '')
$status = '(Unknown)';
echo("<img src=\"$avatar_full\" style=\"height:158px;width:158px;\" alt=\"Steam Community Avatar\" />");
?>
</td>
</tr>
<tr class="bg2">
<td>
<?php
echo '<img src="'.getFlag($playerdata['flag']).'" alt="'.$playerdata['country'].'" title="'.$playerdata['country'].'" />&nbsp;';
echo '<strong>' . htmlspecialchars($playerdata['lastName'], ENT_COMPAT) . ' </strong>';
?>
</td>
</tr>
<tr class="bg1">
<td>
<?php
if ($playerdata['country'])
{
echo 'Location: ';
if ($playerdata['city']) {
echo htmlspecialchars($playerdata['city'], ENT_COMPAT) . ', ';
}
echo '<a href="'.$g_options['scripturl'].'?mode=countryclansinfo&amp;flag='.$playerdata['flag']."&amp;game=$game\">" . $playerdata['country'] . '</a>';
}
else
{
echo 'Location: (Unknown)';
}
?>
</td>
</tr>
<tr class="bg2">
<td>
<?php
$prefix = ((!preg_match('/^BOT/i',$uqid)) && $g_options['Mode'] == 'Normal') ? 'STEAM_0:' : '';
echo "Steam: <a href=\"http://steamcommunity.com/profiles/$coid\" target=\"_blank\">$prefix" . "$uqid</a>";
?>
</td>
</tr>
<tr class="bg1">
<td>Status: <strong><?php echo $status; ?></strong></td>
</tr>
<tr class="bg2">
<td>
<a href="steam://friends/add/<?php echo($coid); ?>" target="_blank">Click here to add as friend</a>
</td>
</tr>
<tr class="bg1">
<td><?php echo "Karma: $statusmsg"; ?></td>
</tr>
<tr class="bg2">
<td style="width:50%;">Member of Clan:</td>
<td style="width:50%;">
<?php
if ($playerdata['clan'])
{
echo '&nbsp;<a href="' . $g_options['scripturl'] . '?mode=claninfo&amp;clan=' . $playerdata['clan'] . '">' . htmlspecialchars($playerdata['clan_name'], ENT_COMPAT) . '</a>';
}
else
echo '(None)';
?>
</td>
</tr>
<tr class="bg1">
<td>Real Name:</td>
<td>
<?php
if ($playerdata['fullName'])
{
echo '<b>' . htmlspecialchars($playerdata['fullName'], ENT_COMPAT) . '</b>';
}
else
echo "(<a href=\"" . $g_options['scripturl'] . '?mode=help#set"><em>Not Specified</em></a>)';
?>
</td>
</tr>
<tr class="bg2">
<td>E-mail Address:</td>
<td>
<?php
if ($email = getEmailLink($playerdata['email']))
{
echo $email;
}
else
echo "(<a href=\"" . $g_options['scripturl'] . '?mode=help#set"><em>Not Specified</em></a>)';
?>
</td>
</tr>
<tr class="bg1">
<td>Home Page:</td>
<td>
<?php
if ($playerdata['homepage'])
{
echo getLink($playerdata['homepage']);
}
else
echo "(<a href=\"" . $g_options['scripturl'] . '?mode=help#set"><em>Not Specified</em></a>)';
?>
</td>
</tr>
<tr class="bg2">
<td>Last Connect:*</td>
<td>
<?php
$db->query
("
SELECT
DATE_FORMAT(eventTime, '%a. %b. %D, %Y @ %T')
FROM
hlstats_Events_Connects
WHERE
hlstats_Events_Connects.playerId = '$player'
ORDER BY
id desc
LIMIT
1
");
list($lastevent) = $db->fetch_row();
if ($lastevent)
echo $lastevent;
else
echo '(Unknown)';
?>
</td>
</tr>
<tr class="bg1">
<td>Total Connection Time:</td>
<td>
<?php echo timestamp_to_str($playerdata['connection_time']); ?>
</td>
</tr>
<tr class="bg2">
<td>Average Ping:*</td>
<td>
<?php
$db->query
("
SELECT
ROUND(SUM(hlstats_Events_Latency.ping) / COUNT(hlstats_Events_Latency.ping), 0) AS av_ping,
ROUND(ROUND(SUM(hlstats_Events_Latency.ping) / COUNT(ping), 0) / 2, 0) AS av_latency
FROM
hlstats_Events_Latency
WHERE
hlstats_Events_Latency.playerId = '$player'
");
list($av_ping, $av_latency) = $db->fetch_row();
if ($av_ping)
echo $av_ping." ms (Latency: $av_latency ms)";
else
echo '-';
?>
</td>
</tr>
<tr class="bg1">
<td>Favorite Server:*</td>
<td>
<?php
// leave this one
$db->query
("
SELECT
hlstats_Events_Entries.serverId,
hlstats_Servers.name,
COUNT(hlstats_Events_Entries.serverId) AS cnt
FROM
hlstats_Events_Entries
INNER JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = hlstats_Events_Entries.serverId
WHERE
hlstats_Events_Entries.playerId = '$player'
GROUP BY
hlstats_Events_Entries.serverId
ORDER BY
cnt DESC
LIMIT
1
");
list($favServerId, $favServerName) = $db->fetch_row();
echo "<a href='hlstats.php?game=$game&amp;mode=servers&amp;server_id=$favServerId'> $favServerName </a>";
?>
</td>
</tr>
<tr class="bg2">
<td>Favorite Map:*</td>
<td>
<?php
$db->query
("
SELECT
hlstats_Events_Entries.map,
COUNT(map) AS cnt
FROM
hlstats_Events_Entries
WHERE
hlstats_Events_Entries.playerId = '$player'
GROUP BY
hlstats_Events_Entries.map
ORDER BY
cnt DESC
LIMIT
1
");
list($favMap) = $db->fetch_row();
echo "<a href=\"hlstats.php?game=$game&amp;mode=mapinfo&amp;map=$favMap\"> $favMap </a>";
?>
</td>
</tr>
<tr class="bg1">
<td>Favorite Weapon:*</td>
<?php
$result = $db->query("
SELECT
hlstats_Events_Frags.weapon,
hlstats_Weapons.name,
COUNT(hlstats_Events_Frags.weapon) AS kills,
SUM(hlstats_Events_Frags.headshot=1) as headshots
FROM
hlstats_Events_Frags
LEFT JOIN
hlstats_Weapons
ON
hlstats_Weapons.code = hlstats_Events_Frags.weapon
WHERE
hlstats_Events_Frags.killerId=$player
GROUP BY
hlstats_Events_Frags.weapon
ORDER BY
kills desc, headshots desc
LIMIT
1
");
while ($rowdata = $db->fetch_row($result))
{
$fav_weapon = $rowdata[0];
$weap_name = htmlspecialchars($rowdata[1]);
}
if ($fav_weapon == '')
$fav_weapon = 'Unknown';
$image = getImage("/games/$game/weapons/$fav_weapon");
// Check if image exists
$weaponlink = "<a href=\"hlstats.php?mode=weaponinfo&amp;weapon=$fav_weapon&amp;game=$game\">";
if ($image)
{
$cellbody = "\t\t\t\t\t<td style=\"text-align: center\">$weaponlink<img src=\"" . $image['url'] . "\" alt=\"$weap_name\" title=\"$weap_name\" />";
}
else
{
$cellbody = "\t\t\t\t\t<td><strong> $weaponlink$weap_name</strong>";
}
$cellbody .= "</a>";
echo $cellbody;
?>
</td>
</tr>
</table><br />
</div>
<div style="float:right;vertical-align:top;width:48.5%;">
<table class="data-table">
<tr class="data-table-head">
<td style="vertical-align:top;" colspan="3">Statistics Summary<br /><br /></td>
</tr>
<tr class="bg1">
<td style="width:50%;">Activity:</td>
<td style="width:35%;">
<?php
$width = sprintf("%d%%", $playerdata['activity'] + 0.5);
$bar_type = 1;
if ($playerdata['activity'] > 40)
$bar_type = "6";
elseif ($playerdata['activity'] > 30)
$bar_type = "5";
elseif ($playerdata['activity'] > 20)
$bar_type = "4";
elseif ($playerdata['activity'] > 10)
$bar_type = "3";
elseif ($playerdata['activity'] > 5)
$bar_type = "2";
echo "<img src=\"" . IMAGE_PATH . "/bar$bar_type.gif\" style=\"width:$width;height:10px;border:0;\" alt=\"".$playerdata['activity'].'%" />';
?>
</td>
<td style="width:15%;"><?php echo $playerdata['activity'].'%'; ?></td>
</tr>
<tr class="bg2">
<td>Points:</td>
<td style="width:55%;" colspan="2">
<?php
echo '<b>' . number_format($playerdata['skill']) . '</b>';
?>
</td>
</tr>
<tr class="bg1">
<td style="width:45%;">Rank:</td>
<td style="width:55%;" colspan="2">
<?php
if (($playerdata['activity'] > 0) && ($playerdata['hideranking'] == 0))
{
$rank = get_player_rank($playerdata);
}
else
{
if ($playerdata['hideranking'] == 1)
{
$rank = "Hidden";
}
elseif ($playerdata['hideranking'] == 2)
{
$rank = "<span style=\"color:red;\">Banned</span>";
}
else
{
$rank = 'Not active';
}
}
if (is_numeric($rank))
{
echo '<b>' . number_format($rank) . '</b>';
}
else
{
echo "<b> $rank</b>";
}
?>
</td>
</tr>
<tr class="bg2">
<td style="width:45%;">Kills per Minute:</td>
<td style="width:55%;" colspan="2">
<?php
if ($playerdata['connection_time'] > 0)
{
echo sprintf('%.2f', ($playerdata['kills'] / ($playerdata['connection_time'] / 60)));
}
else
{
echo '-';
}
?>
</td>
</tr>
<tr class="bg1">
<td style="width:45%;">Kills per Death:</td>
<td style="width:55%;" colspan="2">
<?php
$db->query
("
SELECT
IFNULL(ROUND(SUM(hlstats_Events_Frags.killerId = '$player') / IF(SUM(hlstats_Events_Frags.victimId = '$player') = 0, 1, SUM(hlstats_Events_Frags.victimId = '$player')), 2), '-')
FROM
hlstats_Events_Frags
WHERE
(
hlstats_Events_Frags.killerId = '$player'
OR hlstats_Events_Frags.victimId = '$player'
)
");
list($realkpd) = $db->fetch_row();
echo $playerdata['kpd'];
echo " ($realkpd*)";
?>
</td>
</tr>
<tr class="bg2">
<td style="width:45%;">Headshots per Kill:</td>
<td style="width:55%;" colspan="2">
<?php
$db->query
("
SELECT
IFNULL(SUM(hlstats_Events_Frags.headshot=1) / COUNT(*), '-')
FROM
hlstats_Events_Frags
WHERE
hlstats_Events_Frags.killerId = '$player'
");
list($realhpk) = $db->fetch_row();
echo $playerdata['hpk'];
echo " ($realhpk*)";
?>
</td>
</tr>
<tr class="bg1">
<td style="width:45%;">Shots per Kill:</td>
<td style="width:55%;" colspan="2">
<?php
$db->query
("
SELECT
IFNULL(ROUND((SUM(hlstats_Events_Statsme.hits) / SUM(hlstats_Events_Statsme.shots) * 100), 2), 0.0) AS accuracy,
SUM(hlstats_Events_Statsme.shots) AS shots,
SUM(hlstats_Events_Statsme.hits) AS hits,
SUM(hlstats_Events_Statsme.kills) AS kills
FROM
hlstats_Events_Statsme
WHERE
hlstats_Events_Statsme.playerId='$player'
");
list($playerdata['accuracy'], $sm_shots, $sm_hits, $sm_kills) = $db->fetch_row();
if ($sm_kills > 0)
{
echo sprintf('%.2f', ($sm_shots / $sm_kills));
}
else
{
echo '-';
}
?>
</td>
</tr>
<tr class="bg2">
<td style="width:45%;">Weapon Accuracy:</td>
<td style="width:55%;" colspan="2">
<?php
echo $playerdata['acc'] . '%';
echo " (".sprintf('%.0f', $playerdata['accuracy']).'%*)';
?>
</td>
</tr>
<tr class="bg1">
<td style="width:45%;">Headshots:</td>
<td style="width:55%;" colspan="2">
<?php
if ($playerdata['headshots']==0)
echo number_format($realheadshots);
else
echo number_format($playerdata['headshots']);
echo ' ('.number_format($realheadshots).'*)';
?>
</td>
</tr>
<tr class="bg2">
<td style="width:45%;">Kills:</td>
<td style="width:55%;" colspan="2">
<?php
echo number_format($playerdata['kills']);
echo ' ('.number_format($realkills).'*)';
?>
</td>
</tr>
<tr class="bg1">
<td style="width:45%;">Deaths:</td>
<td style="width:55%;" colspan="2">
<?php
echo number_format($playerdata['deaths']);
echo ' ('.number_format($realdeaths).'*)';
?>
</td>
</tr>
<tr class="bg2">
<td style="width:45%;">Longest Kill Streak:</td>
<td style="width:55%;" colspan="2">
<?php
$db->query
("
SELECT
hlstats_Players.kill_streak
FROM
hlstats_Players
WHERE
hlstats_Players.playerId = '$player'
");
list($kill_streak) = $db->fetch_row();
echo number_format($kill_streak);
?>
</td>
</tr>
<tr class="bg1">
<td style="width:45%;">Longest Death Streak:</td>
<td style="width:55%;" colspan="2">
<?php
$db->query
("
SELECT
hlstats_Players.death_streak
FROM
hlstats_Players
WHERE
hlstats_Players.playerId = '$player'
");
list($death_streak) = $db->fetch_row();
echo number_format($death_streak);
?>
</td>
</tr>
<tr class="bg2">
<td style="width:45%;">Suicides:</td>
<td style="width:55%;" colspan="2">
<?php echo number_format($playerdata['suicides']); ?>
</td>
</tr>
<tr class="bg1">
<td style="width:45%;">Teammate Kills:</td>
<td style="width:55%;" colspan="2">
<?php
echo number_format($playerdata['teamkills']);
echo ' ('.number_format($realteamkills).'*)';
?>
</td>
</tr>
</table><br />
<?php
echo '&nbsp;&nbsp;<img src="' . IMAGE_PATH . '/history.gif" style="padding-left:3px;padding-right:3px;" alt="History" />&nbsp;<b>'
. htmlspecialchars($playerdata['lastName'], ENT_COMPAT) . '</b>\'s History:<br />';
echo '&nbsp;&nbsp;<a href="' . $g_options['scripturl'] . "?mode=playerhistory&amp;player=$player\">Events</a>&nbsp;|&nbsp;";
echo '<a href="' . $g_options['scripturl'] . "?mode=playersessions&amp;player=$player\">Sessions</a>&nbsp;|&nbsp;";
$resultCount = $db->query
("
SELECT
COUNT(*)
FROM
hlstats_Players_Awards
WHERE
hlstats_Players_Awards.playerId = $player
");
list($numawards) = $db->fetch_row($resultCount);
echo "<a href=\"" . $g_options['scripturl'] . "?mode=playerawards&amp;player=$player\">Awards&nbsp;($numawards)</a>&nbsp;|&nbsp;";
if ($g_options["nav_globalchat"] == 1)
{
echo "<a href=\"" . $g_options['scripturl'] . "?mode=chathistory&amp;player=$player\">Chat</a>";
}
?>
<br />&nbsp;&nbsp;<a href="<?php echo $g_options['scripturl']; ?>?mode=search&amp;st=player&amp;q=<?php echo $pl_urlname; ?>"><img src="<?php echo IMAGE_PATH; ?>/search.gif" style="margin-left:3px;margin-right:3px;" alt="Search" />&nbsp;Find other players with the same name</a>
</div>
</div>
<br /><br />
<div style="clear:both;padding-top:24px;"></div>
<?php printSectionTitle('Miscellaneous Statistics'); ?>
<div class="subblock">
<div style="float:left;vertical-align:top;width:48.5%;">
<table class="data-table">
<tr class="data-table-head">
<td>Player Trend</td>
</tr>
<tr class="bg1">
<td style="text-align:center;">
<?php echo "<img src=\"trend_graph.php?bgcolor=".$g_options['graphbg_trend'].'&amp;color='.$g_options['graphtxt_trend']."&amp;player=$player\" alt=\"Player Trend Graph\" />"; ?>
</td>
</tr>
</table>
</div>
<div style="float:right;vertical-align:top;width:48.5%;">
<table class="data-table">
<tr class="data-table-head">
<td colspan="2">Forum Signature</td>
</tr>
<tr class="bg1">
<td style="text-align:center;">
<br /><br />
<?php
if ($g_options['modrewrite'] == 0)
{
$imglink = $siteurlneo.'sig.php?player_id='.$player.'&amp;background='.$g_options['sigbackground'];
$jimglink = $siteurlneo.'sig.php?player_id='.$player.'&background='.$g_options['sigbackground'];
}
else
{
$imglink = $siteurlneo.'sig-'.$player.'-'.$g_options['sigbackground'].'.png';
$jimglink = $imglink;
}
echo "<img src=\"$imglink\" title=\"Copy &amp; Paste the whole URL below in your forum signature\" alt=\"forum sig image\"/>";
$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']));
$script_path = preg_replace('/\/$/','',$script_path);
?>
<br /><br />
<script type="text/javascript">
/* <![CDATA[ */
function setForumText(val)
{
var txtArea = document.getElementById('siglink');
switch(val)
{
case 0:
<?php echo "txtArea.value = '$jimglink'\n"; ?>
break;
case 1:
<?php echo "txtArea.value = '[url=$script_path/hlstats.php?mode=playerinfo&player=$player"."][img]$jimglink"."[/img][/url]'\n"; ?>
break;
case 2:
<?php echo "txtArea.value = '[url=\"$script_path/hlstats.php?mode=playerinfo&player=$player\"][img]$jimglink"."[/img][/url]'\n"; ?>
break;
}
}
/* ]]> */
</script>
<a href="" onclick="setForumText(1);return false">
bbCode 1 (phpBB, SMF)</a>&nbsp;|&nbsp;<a href="" onclick="setForumText(2);return false">bbCode 2 (IPB)</a>&nbsp;|&nbsp;<a href="" onclick="setForumText(0);return false">Direct Image
</a>
<?php echo '<textarea style="width: 95%; height: 50px;" rows="2" cols="70" id="siglink" readonly="readonly" onclick="document.getElementById(\'siglink\').select();">[url='."$script_path/hlstats.php?mode=playerinfo&amp;player=$player"."][img]$imglink".'[/img][/url]</textarea>'; ?>
</td>
</tr>
</table>
</div>
</div>
<br /><br />
<?php
// Current rank & rank history
$db->query
("
SELECT
hlstats_Ranks.rankName,
hlstats_Ranks.image,
hlstats_Ranks.minKills
FROM
hlstats_Ranks
WHERE
hlstats_Ranks.minKills <= ".$playerdata['kills']."
AND hlstats_Ranks.game = '$game'
ORDER BY
hlstats_Ranks.minKills DESC
LIMIT
1
");
$result = $db->fetch_array();
$rankimage = getImage('/ranks/'.$result['image']);
$rankName = $result['rankName'];
$rankCurMinKills = $result['minKills'];
$db->query
("
SELECT
hlstats_Ranks.rankName,
hlstats_Ranks.minKills
FROM
hlstats_Ranks
WHERE
hlstats_Ranks.minKills > ".$playerdata['kills']."
AND hlstats_Ranks.game = '$game'
ORDER BY
hlstats_Ranks.minKills
LIMIT
1
");
if ($db->num_rows() == 0)
{
$rankKillsNeeded = 0;
$rankPercent = 0;
}
else
{
$result = $db->fetch_array();
$rankKillsNeeded = $result['minKills'] - $playerdata['kills'];
$rankPercent = ($playerdata['kills'] - $rankCurMinKills) * 100 / ($result['minKills'] - $rankCurMinKills);
}
$db->query
("
SELECT
hlstats_Ranks.rankName,
hlstats_Ranks.image
FROM
hlstats_Ranks
WHERE
hlstats_Ranks.minKills <= ".$playerdata['kills']."
AND hlstats_Ranks.game = '$game'
ORDER BY
hlstats_Ranks.minKills
");
for ($i=1;$i<($db->num_rows());$i++)
{
$result = $db->fetch_array();
$histimage = getImage('/ranks/'.$result['image'].'_small');
$rankHistory .= '<img src="'.$histimage['url'].'" title="'.$result['rankName'].'" alt="'.$result['rankName'].'" /> ';
}
?>
<div style="clear:both;padding-top:24px;"></div>
<?php printSectionTitle('Ranks'); ?>
<div class="subblock">
<div style="float:left;vertical-align:top;width:48.5%;">
<table class="data-table">
<tr class="data-table-head">
<td colspan="2">
Current rank: <b><?php echo htmlspecialchars($rankName, ENT_COMPAT); ?></b>
</td>
</tr>
<tr class="bg1">
<td style="text-align:center;" colspan="2">
<?php echo '<img src="'.$rankimage['url']."\" alt=\"$rankName\" title=\"$rankName\" />"; ?>
</td>
</tr>
<tr class="data-table-head">
<td style="width:60%;">
<?php
$cellbody = '<img src="' . IMAGE_PATH . '/bar6.gif" width="';
if ($rankPercent < 1)
$cellbody .= '1%';
elseif ($rankPercent > 100)
$cellbody .= '100%';
else
$cellbody .= sprintf('%d%%', $rankPercent + 0.5);
$cellbody .= "\" style=\"height:10px;border:0;\" alt=\"$rankPercent%\" />";
echo $cellbody;
?>
</td>
<td style="width:40%;">
Kills needed: <b><?php echo "$rankKillsNeeded (".number_format($rankPercent, 0, '.', '');?>%)</b>
</td>
</tr>
</table>
</div>
<div style="float:right;vertical-align:top;width:48.5%;">
<table class="data-table">
<tr class="data-table-head">
<td>Rank history</td>
</tr>
<tr class="bg1">
<td style="text-align:center;"><?php echo $rankHistory; ?></td>
</tr>
</table>
</div>
</div>
<br /><br />
<?php
// Awards
$numawards = $db->query
("
SELECT
hlstats_Ribbons.awardCode,
hlstats_Ribbons.image
FROM
hlstats_Ribbons
WHERE
hlstats_Ribbons.game = '$game'
AND
(
hlstats_Ribbons.special = 0
OR hlstats_Ribbons.special = 2
)
GROUP BY
hlstats_Ribbons.awardCode
");
$res = $db->query
("
SELECT
hlstats_Ribbons.awardCode AS ribbonCode,
hlstats_Ribbons.ribbonName AS ribbonName,
IF(ISNULL(hlstats_Players_Ribbons.playerId), 'noaward.png', hlstats_Ribbons.image) AS image,
hlstats_Ribbons.special,
hlstats_Ribbons.image AS imagefile,
hlstats_Ribbons.awardCount
FROM
hlstats_Ribbons
LEFT JOIN
(
SELECT
hlstats_Players_Ribbons.playerId,
hlstats_Ribbons.awardCode,
hlstats_Players_Ribbons.ribbonId
FROM
hlstats_Players_Ribbons
INNER JOIN
hlstats_Ribbons
ON
hlstats_Ribbons.ribbonId = hlstats_Players_Ribbons.ribbonId
AND hlstats_Ribbons.game = hlstats_Players_Ribbons.game
WHERE
hlstats_Players_Ribbons.playerId = ".$playerdata['playerId']."
AND hlstats_Players_Ribbons.game = '$game'
ORDER BY
hlstats_Ribbons.awardCount DESC
) AS hlstats_Players_Ribbons
ON
hlstats_Players_Ribbons.ribbonId = hlstats_Ribbons.ribbonId
WHERE
hlstats_Ribbons.game = '$game'
AND
(
ISNULL(hlstats_Players_Ribbons.playerId)
OR hlstats_Players_Ribbons.playerId = ".$playerdata['playerId']."
)
ORDER BY
hlstats_Ribbons.awardCode,
hlstats_Players_Ribbons.playerId DESC,
hlstats_Ribbons.special,
hlstats_Ribbons.awardCount DESC
");
$ribbonList = '';
$lastImage = '';
$awards_done = array ();
while ($result = $db->fetch_array($res))
{
$ribbonCode=$result['ribbonCode'];
$ribbonName=$result['ribbonName'];
if(!isset($awards_done[$ribbonCode]))
{
if (file_exists(IMAGE_PATH."/games/$game/ribbons/".$result['image']))
{
$image = IMAGE_PATH."/games/$game/ribbons/".$result['image'];
}
elseif (file_exists(IMAGE_PATH."/games/$realgame/ribbons/".$result['image']))
{
$image = IMAGE_PATH."/games/$realgame/ribbons/".$result['image'];
}
else
{
$image = IMAGE_PATH."/award.png";
}
$ribbonList .= '<img src="'.$image.'" style="border:0px;" alt="'.$result['ribbonName'].'" title="'.$result["ribbonName"].'" /> ';
$awards_done[$ribbonCode]=$ribbonCode;
}
}
$awards = array ();
$res = $db->query
("
SELECT
hlstats_Awards.awardType,
hlstats_Awards.code,
hlstats_Awards.name
FROM
hlstats_Awards
WHERE
hlstats_Awards.game = '$game'
AND hlstats_Awards.g_winner_id = $player
ORDER BY
hlstats_Awards.name;
");
while ($r1=$db->fetch_array())
{
unset($tmp);
$tmp->aType = $r1['awardType'];
$tmp->code = $r1['code'];
$tmp->ribbonName = $r1['name'];
if ($id == 0)
{
$tmp->playerName = $r1['lastname'];
$tmp->flag = $r1['flag'];
$tmp->playerId = $r1['g_winner_id'];
$tmp->kills = $r1['g_winner_count'];
$tmp->verb = $r1['verb'];
}
array_push($awards,$tmp);
}
$GlobalAwardsList = '';
foreach ($awards as $a)
{
if ($image = getImage("/games/$game/gawards/".strtolower($a->aType."_$a->code")))
{
$image = $image['url'];
}
elseif ($image = getImage("/games/$realgame/gawards/".strtolower($a->aType."_$a->code")))
{
$image = $image['url'];
}
else
{
$image = IMAGE_PATH."/award.png";
}
$GlobalAwardsList .= "<img src=\"$image\" alt=\"$a->ribbonName\" title=\"$a->ribbonName\" /> ";
}
if ($ribbonList != '' || $GlobalAwardsList != '')
{
?>
<div style="clear:both;padding-top:24px;"></div>
<?php printSectionTitle('Awards (hover over image to see name)'); ?>
<div class="subblock">
<div style="float:left;vertical-align:top;width:68.5%;">
<table class="data-table">
<tr class="data-table-head">
<td>Ribbons</td>
</tr>
<tr class="bg1">
<td style="text-align:center;"><?php echo $ribbonList; ?></td>
</tr>
</table>
</div>
<div style="float:right;vertical-align:top;width:28.5%;">
<table class="data-table">
<tr class="data-table-head">
<td colspan="2">Global Awards</td>
</tr>
<tr class="bg1">
<td style="text-align:center;"><?php echo $GlobalAwardsList; ?></td>
</tr>
</table>
</div>
</div>
<br /><br />
<?php
}
?>

View File

@ -0,0 +1,278 @@
<?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.');
}
// Player Kill Statistics
flush();
$tblPlayerKillStats = new Table
(
array
(
new TableColumn
(
'name',
'Victim',
'width=21&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn
(
'kills',
'Kills',
'width=6&align=right'
),
new TableColumn
(
'kpercent',
'%',
'width=7&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'kpercent',
'Ratio',
'width=7&sort=no&type=bargraph'
),
new TableColumn
(
'deaths',
'Deaths',
'width=6&align=right'
),
new TableColumn
(
'dpercent',
'%',
'width=7&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'dpercent',
'Ratio',
'width=7&sort=no&type=bargraph'
),
new TableColumn
(
'kpd',
'K:D',
'width=7&align=right'
),
new TableColumn
(
'headshots',
'Headshots',
'width=6&align=right'
),
new TableColumn
(
'hpercent',
'%',
'width=7&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'hpercent',
'Ratio',
'width=7&sort=no&type=bargraph'
),
new TableColumn
(
'hpk',
'HS:K',
'width=7&align=right'
)
),
'victimId',
'kills',
'deaths',
true,
50,
'playerkills_page',
'playerkills_sort',
'playerkills_sortorder',
'tabkills',
'desc',
true
);
// This would be better done with a UNION query, I think, but MySQL doesn't
// support them yet. (NOTE you need MySQL 3.23 for temporary table support.)
$db->query
("
DROP TABLE IF EXISTS
hlstats_Frags_Kills
");
$db->query
("
CREATE TEMPORARY TABLE
hlstats_Frags_Kills
(
playerId INT(10),
kills INT(10),
deaths INT(10),
headshot INT(10),
country varchar(128),
flag char(2)
)
");
$db->query
("
INSERT INTO
hlstats_Frags_Kills
(
playerId,
kills,
headshot
)
SELECT
hlstats_Events_Frags.victimId,
hlstats_Events_Frags.killerId,
hlstats_Events_Frags.headshot
FROM
hlstats_Events_Frags
WHERE
hlstats_Events_Frags.killerId = $player
GROUP BY
hlstats_Events_Frags.id
");
$db->query
("
INSERT INTO
hlstats_Frags_Kills
(
playerId,
deaths
)
SELECT
hlstats_Events_Frags.killerId,
hlstats_Events_Frags.victimId
FROM
hlstats_Events_Frags
WHERE
hlstats_Events_Frags.victimId = $player
");
$result = $db->query
("
SELECT
SUM(hlstats_Frags_Kills.headshot) AS headshots
FROM
hlstats_Frags_Kills
GROUP BY
hlstats_Frags_Kills.playerId
HAVING
COUNT(hlstats_Frags_Kills.kills) >= $killLimit
");
$realheadshots = 0;
while ($rowdata = $db->fetch_array($result))
{
$realheadshots += $rowdata['headshots'];
}
$db->query
("
SELECT
hlstats_Players.lastName AS name
FROM
hlstats_Frags_Kills,
hlstats_Players
WHERE
hlstats_Frags_Kills.playerId = hlstats_Players.playerId
GROUP BY
hlstats_Frags_Kills.playerId
HAVING
COUNT(hlstats_Frags_Kills.kills) >= $killLimit
");
$numitems = $db->num_rows();
$result = $db->query
("
SELECT
hlstats_Players.lastName AS name,
hlstats_Players.flag AS flag,
hlstats_Players.country AS country,
COUNT(hlstats_Frags_Kills.kills) AS kills,
COUNT(hlstats_Frags_Kills.deaths) AS deaths,
ROUND(COUNT(hlstats_Frags_Kills.kills) / $realkills * 100, 2) AS kpercent,
ROUND(COUNT(hlstats_Frags_Kills.deaths) / $realdeaths * 100, 2) AS dpercent,
hlstats_Frags_Kills.playerId AS victimId,
ROUND(COUNT(hlstats_Frags_Kills.kills) / IF(COUNT(hlstats_Frags_Kills.deaths) = 0, 1, COUNT(hlstats_Frags_Kills.deaths)), 2) AS kpd,
SUM(hlstats_Frags_Kills.headshot = 1) AS headshots,
ROUND(SUM(hlstats_Frags_Kills.headshot = 1) / IF(COUNT(hlstats_Frags_Kills.kills) = 0, 1, COUNT(hlstats_Frags_Kills.kills)), 2) AS hpk,
ROUND(SUM(hlstats_Frags_Kills.headshot = 1) / $realheadshots * 100, 2) AS hpercent
FROM
hlstats_Frags_Kills,
hlstats_Players
WHERE
hlstats_Frags_Kills.playerId = hlstats_Players.playerId
GROUP BY
hlstats_Frags_Kills.playerId
HAVING
Count(hlstats_Frags_Kills.kills) >= $killLimit
ORDER BY
$tblPlayerKillStats->sort $tblPlayerKillStats->sortorder,
$tblPlayerKillStats->sort2 $tblPlayerKillStats->sortorder
LIMIT $tblPlayerKillStats->startitem,$tblPlayerKillStats->numperpage
");
if ($numitems > 0)
{
printSectionTitle('Player Kill Statistics *');
$tblPlayerKillStats->draw($result, $numitems, 95); ?>
<br /><br />
<div class="subblock">
<form method="get" action="<?php echo $g_options['scripturl']; ?>">
<strong>&#8226;</strong> Show only victims this person has killed
<select name="killLimit" onchange="Tabs.refreshTab({'killLimit': this.options[this.selectedIndex].value, 'playerkills_page': 1})">
<?php
for($j = 0; $j < 16; $j++)
{
echo "<option value=\"$j\"";
if ($killLimit == $j)
{
echo ' selected="selected"';
}
echo ">$j</option>";
}
?>
</select>
or more times
</form>
</div>
<br /><br />
<?php
}
?>

View File

@ -0,0 +1,168 @@
<?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.');
}
flush();
$tblMaps = new Table(
array
(
new TableColumn
(
'map',
'Map',
'width=22&align=left&link=' . urlencode("mode=mapinfo&amp;map=%k&amp;game=$game")
),
new TableColumn
(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'kpercent',
'%',
'width=6&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'kpercent',
'Ratio',
'width=8&sort=no&type=bargraph'
),
new TableColumn
(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn
(
'dpercent',
'%',
'width=6&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'dpercent',
'Ratio',
'width=8&sort=no&type=bargraph'
),
new TableColumn
(
'kpd',
'K:D',
'width=5&align=right'
),
new TableColumn
(
'headshots',
'Headshots',
'width=7&align=right'
),
new TableColumn
(
'hpercent',
'%',
'width=6&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'hpercent',
'Ratio',
'width=8&sort=no&type=bargraph'
),
new TableColumn
(
'hpk',
'HS:K',
'width=5&align=right'
)
),
'map',
'kpd',
'kills',
true,
9999,
'maps_page',
'maps_sort',
'maps_sortorder',
'tabmaps',
'desc',
true
);
$result = $db->query
("
SELECT
IF(hlstats_Events_Frags.map='', '(Unaccounted)', hlstats_Events_Frags.map) AS map,
SUM(hlstats_Events_Frags.killerId = $player) AS kills,
SUM(hlstats_Events_Frags.victimId = $player) AS deaths,
IFNULL(ROUND(SUM(hlstats_Events_Frags.killerId = $player) / IF(SUM(hlstats_Events_Frags.victimId = $player) = 0, 1, SUM(hlstats_Events_Frags.victimId = $player)), 2), '-') AS kpd,
ROUND(CONCAT(SUM(hlstats_Events_Frags.killerId = $player)) / $realkills * 100, 2) AS kpercent,
ROUND(CONCAT(SUM(hlstats_Events_Frags.victimId = $player)) / $realdeaths * 100, 2) AS dpercent,
SUM(hlstats_Events_Frags.killerId = $player AND hlstats_Events_Frags.headshot = 1) AS headshots,
IFNULL(ROUND(SUM(hlstats_Events_Frags.killerId = $player AND hlstats_Events_Frags.headshot = 1) / SUM(hlstats_Events_Frags.killerId = $player), 2),'-') AS hpk,
ROUND(CONCAT(SUM(hlstats_Events_Frags.killerId = $player AND hlstats_Events_Frags.headshot = 1)) / $realheadshots * 100, 2) AS hpercent
FROM
hlstats_Events_Frags
WHERE
hlstats_Events_Frags.killerId = '$player'
OR hlstats_Events_Frags.victimId = '$player'
GROUP BY
hlstats_Events_Frags.map
ORDER BY
$tblMaps->sort $tblMaps->sortorder,
$tblMaps->sort2 $tblMaps->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
?>
<div style="clear:both;padding-top:20px;"></div>
<?php
printSectionTitle('Map Performance *');
$tblMaps->draw($result, $numitems, 95);
?>
<br /><br />
<?php
}
?>

View File

@ -0,0 +1,203 @@
<?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.');
}
flush();
$tblPlayerActions = new Table
(
array(
new TableColumn
(
'description',
'Action',
'width=45&link=' . urlencode("mode=actioninfo&amp;action=%k&amp;game=$game")
),
new TableColumn
(
'obj_count',
'Earned',
'width=25&align=right&append=+times'
),
new TableColumn
(
'obj_bonus',
'Accumulated Points',
'width=25&align=right'
)
),
'code',
'obj_count',
'description',
true,
9999,
'obj_page',
'obj_sort',
'obj_sortorder',
'tabteams',
'desc',
true
);
$result = $db->query
("
(
SELECT
hlstats_Actions.code,
hlstats_Actions.description,
COUNT(hlstats_Events_PlayerActions.id) AS obj_count,
SUM(hlstats_Events_PlayerActions.bonus) AS obj_bonus
FROM
hlstats_Actions
LEFT JOIN
hlstats_Events_PlayerActions
ON
hlstats_Events_PlayerActions.actionId = hlstats_Actions.id
WHERE
hlstats_Events_PlayerActions.playerId = $player
GROUP BY
hlstats_Actions.id
)
UNION ALL
(
SELECT
hlstats_Actions.code,
hlstats_Actions.description,
COUNT(hlstats_Events_PlayerPlayerActions.id) AS obj_count,
SUM(hlstats_Events_PlayerPlayerActions.bonus) AS obj_bonus
FROM
hlstats_Actions
LEFT JOIN
hlstats_Events_PlayerPlayerActions
ON
hlstats_Events_PlayerPlayerActions.actionId = hlstats_Actions.id
WHERE
hlstats_Events_PlayerPlayerActions.playerId = $player
GROUP BY
hlstats_Actions.id
)
ORDER BY
$tblPlayerActions->sort $tblPlayerActions->sortorder,
$tblPlayerActions->sort2 $tblPlayerActions->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
?>
<div style="clear:both;padding-top:20px;"></div>
<?php
printSectionTitle('Player Actions *');
$tblPlayerActions->draw($result, $numitems, 95);
?>
<br /><br />
<?php
}
$tblPlayerPlayerActionsV = new Table
(
array
(
new TableColumn
(
'description',
'Action',
'width=45&link=' . urlencode("mode=actioninfo&amp;action=%k&amp;game=$game#victims")
),
new TableColumn
(
'obj_count',
'Earned Against',
'width=25&align=right&append=+times'
),
new TableColumn
(
'obj_bonus',
'Accumulated Points',
'width=25&align=right'
)
),
'code',
'obj_count',
'description',
true,
9999,
'ppa_page',
'ppa_sort',
'ppa_sortorder',
'tabteams',
'desc',
true
);
$result = $db->query
("
SELECT
hlstats_Actions.code,
hlstats_Actions.description,
COUNT(hlstats_Events_PlayerPlayerActions.id) AS obj_count,
SUM(hlstats_Events_PlayerPlayerActions.bonus) * -1 AS obj_bonus
FROM
hlstats_Actions
LEFT JOIN
hlstats_Events_PlayerPlayerActions
ON
hlstats_Events_PlayerPlayerActions.actionId = hlstats_Actions.id
WHERE
hlstats_Events_PlayerPlayerActions.victimId = $player
GROUP BY
hlstats_Actions.id
ORDER BY
$tblPlayerPlayerActionsV->sort $tblPlayerPlayerActionsV->sortorder,
$tblPlayerPlayerActionsV->sort2 $tblPlayerPlayerActionsV->sortorder
");
$numitemsv = $db->num_rows($result);
if ($numitemsv > 0)
{
if ($numitems == 0)
{
?>
<div style="clear:both;padding-top:20px;"></div>
<?php
}
printSectionTitle('Victims of Player-Player Actions *');
$tblPlayerPlayerActionsV->draw($result, $numitems, 95);
?>
<br /><br />
<?php
}
?>

View File

@ -0,0 +1,155 @@
<?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.');
}
flush();
$tblServers = new Table
(
array
(
new TableColumn
(
'server',
'Server',
'width=26&align=left'
),
new TableColumn
(
'kills',
'Kills',
'width=6&align=right'
),
new TableColumn
(
'kpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'kpercent',
'Ratio',
'width=15&sort=no&type=bargraph'
),
new TableColumn
(
'deaths',
'Deaths',
'width=6&align=right'
),
new TableColumn(
'kpd',
'K:D',
'width=5&align=right'
),
new TableColumn(
'headshots',
'Headshots',
'width=6&align=right'
),
new TableColumn(
'hpercent',
'Percentage of Headshots',
'width=16&sort=no&type=bargraph'
),
new TableColumn(
'hpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn(
'hpk',
'HS:K',
'width=5&align=right'
)
),
'server',
'kills',
'kills',
true,
9999,
'server_page',
'server_sort',
'server_sortorder',
'tabmaps',
'desc',
true
);
// leave the join on this one, we do groupings..
$result = $db->query("
SELECT
hlstats_Servers.name AS server,
SUM(hlstats_Events_Frags.killerId = $player) AS kills,
SUM(hlstats_Events_Frags.victimId = $player) AS deaths,
SUM(hlstats_Events_Frags.killerId = $player) / IF(SUM(hlstats_Events_Frags.victimId = $player) = 0, 1, SUM(hlstats_Events_Frags.victimId = $player)) AS kpd,
ROUND(SUM(hlstats_Events_Frags.killerId = $player) / $realkills * 100, 2) AS kpercent,
ROUND(SUM(hlstats_Events_Frags.victimId = $player) / $realdeaths * 100, 2) AS dpercent,
SUM(hlstats_Events_Frags.killerId = $player AND hlstats_Events_Frags.headshot = 1) AS headshots,
IFNULL(SUM(hlstats_Events_Frags.killerId = $player AND hlstats_Events_Frags.headshot = 1) / SUM(hlstats_Events_Frags.killerId = $player), '-') AS hpk,
ROUND(SUM(hlstats_Events_Frags.killerId = $player AND hlstats_Events_Frags.headshot = 1) / $realheadshots * 100, 2) AS hpercent
FROM
hlstats_Events_Frags
LEFT JOIN
hlstats_Servers
ON
hlstats_Servers.serverId = hlstats_Events_Frags.serverId
WHERE
hlstats_Servers.game = '$game'
AND hlstats_Events_Frags.killerId = '$player'
OR hlstats_Events_Frags.victimId = '$player'
GROUP BY
hlstats_Servers.name
ORDER BY
$tblServers->sort $tblServers->sortorder,
$tblServers->sort2 $tblServers->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
printSectionTitle('Server Activity *');
$tblServers->draw($result, $numitems, 95);
?>
<br /><br />
<?php
}
?>

View File

@ -0,0 +1,351 @@
<?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.');
}
flush();
$tblTeams = new Table
(
array
(
new TableColumn
(
'name',
'Team',
'width=35'
),
new TableColumn
(
'teamcount',
'Joined',
'width=10&align=right&append=+times'
),
new TableColumn
(
'percent',
'%',
'width=10&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'percent',
'Ratio',
'width=40&sort=no&type=bargraph'
)
),
'name',
'teamcount',
'name',
true,
9999,
'teams_page',
'teams_sort',
'teams_sortorder',
'tabteams',
'desc',
true
);
$db->query
("
SELECT
COUNT(*)
FROM
hlstats_Events_ChangeTeam
WHERE
hlstats_Events_ChangeTeam.playerId = $player
");
list($numteamjoins) = $db->fetch_row();
if($numteamjoins == 0) {
$numteamjoins = 1;
}
$result = $db->query
("
SELECT
IFNULL(hlstats_Teams.name, hlstats_Events_ChangeTeam.team) AS name,
COUNT(hlstats_Events_ChangeTeam.id) AS teamcount,
ROUND((COUNT(hlstats_Events_ChangeTeam.id) / $numteamjoins) * 100, 2) AS percent
FROM
hlstats_Events_ChangeTeam
LEFT JOIN
hlstats_Teams
ON
hlstats_Events_ChangeTeam.team = hlstats_Teams.code
WHERE
hlstats_Teams.game = '$game'
AND hlstats_Events_ChangeTeam.playerId = $player
AND
(
hidden <> '1'
OR hidden IS NULL
)
GROUP BY
hlstats_Events_ChangeTeam.team
ORDER BY
$tblTeams->sort $tblTeams->sortorder,
$tblTeams->sort2 $tblTeams->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
printSectionTitle('Team Selection *');
$tblTeams->draw($result, $numitems, 95);
?>
<br /><br />
<?php
}
flush();
$result = $db->query
("
SELECT
hlstats_Roles.code,
hlstats_Roles.name
FROM
hlstats_Roles
WHERE
hlstats_Roles.game = '$game'
");
while ($rowdata = $db->fetch_row($result))
{
$code = preg_replace("/[ \r\n\t]+/", "", $rowdata[0]);
$fname[strToLower($code)] = htmlspecialchars($rowdata[1]);
}
$tblRoles = new Table
(
array
(
new TableColumn
(
'code',
'Role',
'width=25&type=roleimg&align=left&link=' . urlencode("mode=rolesinfo&amp;role=%k&amp;game=$game"),
$fname
),
new TableColumn
(
'rolecount',
'Joined',
'width=10&align=right&append=+times'
),
new TableColumn
(
'percent',
'%',
'width=10&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'percent',
'Ratio',
'width=20&sort=no&type=bargraph'
),
new TableColumn
(
'killsTotal',
'Kills',
'width=10&align=right'
),
new TableColumn
(
'deathsTotal',
'Deaths',
'width=10&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=10&align=right'
)
),
'code',
'rolecount',
'name',
true,
9999,
'roles_page',
'roles_sort',
'roles_sortorder',
'roles',
'desc',
true
);
$db->query
("
DROP TABLE IF EXISTS
hlstats_Frags_as
");
$db->query
("
CREATE TEMPORARY TABLE
hlstats_Frags_as
(
playerId INT(10),
kills INT(10),
deaths INT(10),
role varchar(128) NOT NULL default ''
)
");
$db->query
("
INSERT INTO
hlstats_Frags_as
(
playerId,
kills,
role
)
SELECT
hlstats_Events_Frags.victimId,
hlstats_Events_Frags.killerId,
hlstats_Events_Frags.killerRole
FROM
hlstats_Events_Frags
WHERE
hlstats_Events_Frags.killerId = $player
");
$db->query
("
INSERT INTO
hlstats_Frags_as
(
playerId,
deaths,
role
)
SELECT
hlstats_Events_Frags.killerId,
hlstats_Events_Frags.victimId,
hlstats_Events_Frags.victimRole
FROM
hlstats_Events_Frags
WHERE
hlstats_Events_Frags.victimId = $player
");
$db->query
("
DROP TABLE IF EXISTS
hlstats_Frags_as_res
");
$db->query
("
CREATE TEMPORARY TABLE
hlstats_Frags_as_res
(
killsTotal INT(10),
deathsTotal INT(10),
role varchar(128) NOT NULL default ''
)
");
$db->query
("
INSERT INTO
hlstats_Frags_as_res
(
killsTotal,
deathsTotal,
role
)
SELECT
COUNT(hlstats_Frags_as.kills) AS kills,
COUNT(hlstats_Frags_as.deaths) AS deaths,
hlstats_Frags_as.role
FROM
hlstats_Frags_as
GROUP BY
hlstats_Frags_as.role
");
$db->query
("
SELECT
COUNT(*)
FROM
hlstats_Events_ChangeRole
WHERE
hlstats_Events_ChangeRole.playerId = $player
");
list($numrolejoins) = $db->fetch_row();
$result = $db->query
("
SELECT
IFNULL(hlstats_Roles.name, hlstats_Events_ChangeRole.role) AS name,
IFNULL(hlstats_Roles.code, hlstats_Events_ChangeRole.role) AS code,
COUNT(hlstats_Events_ChangeRole.id) AS rolecount,
ROUND(COUNT(hlstats_Events_ChangeRole.id) / IF($numrolejoins = 0, 1, $numrolejoins) * 100, 2) AS percent,
hlstats_Frags_as_res.killsTotal,
hlstats_Frags_as_res.deathsTotal,
ROUND(hlstats_Frags_as_res.killsTotal / IF(hlstats_Frags_as_res.deathsTotal = 0, 1, hlstats_Frags_as_res.deathsTotal), 2) AS kpd
FROM
hlstats_Events_ChangeRole
LEFT JOIN
hlstats_Roles
ON
hlstats_Events_ChangeRole.role = hlstats_Roles.code
LEFT JOIN
hlstats_Frags_as_res
ON
hlstats_Frags_as_res.role = hlstats_Events_ChangeRole.role
WHERE
hlstats_Events_ChangeRole.playerId = $player
AND
(
hidden <> '1'
OR hidden IS NULL
)
AND hlstats_Roles.game = '$game'
GROUP BY
hlstats_Events_ChangeRole.role
ORDER BY
$tblRoles->sort $tblRoles->sortorder,
$tblRoles->sort2 $tblRoles->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
printSectionTitle('Role Selection *');
$tblRoles->draw($result, $numitems, 95);
?>
<br /><br />
<?php
}
?>

View File

@ -0,0 +1,688 @@
<?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.');
}
flush();
$realgame = getRealGame($game);
$result = $db->query
("
SELECT
hlstats_Weapons.code,
hlstats_Weapons.name
FROM
hlstats_Weapons
WHERE
hlstats_Weapons.game = '$game'
");
while ($rowdata = $db->fetch_row($result))
{
$code = $rowdata[0];
$fname[$code] = htmlspecialchars($rowdata[1]);
}
$tblWeapons = new Table
(
array
(
new TableColumn
(
'weapon',
'Weapon',
'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&amp;weapon=%k&amp;game=$game"),
$fname
),
new TableColumn
(
'modifier',
'Modifier',
'width=10&align=right'
),
new TableColumn
(
'kills',
'Kills',
'width=11&align=right'
),
new TableColumn
(
'kpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'kpercent',
'Ratio',
'width=18&sort=no&type=bargraph'
),
new TableColumn
(
'headshots',
'Headshots',
'width=8&align=right'
),
new TableColumn
(
'hpercent',
'%',
'width=5&sort=no&align=right&append=' . urlencode('%')
),
new TableColumn
(
'hpercent',
'Ratio',
'width=18&sort=no&type=bargraph'
),
new TableColumn
(
'hpk',
'HS:K',
'width=5&align=right'
)
),
'weapon',
'kills',
'weapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'tabweapons',
'desc',
true
);
$result = $db->query
("
SELECT
hlstats_Events_Frags.weapon,
IFNULL(hlstats_Weapons.modifier, 1.00) AS modifier,
COUNT(hlstats_Events_Frags.weapon) AS kills,
ROUND(COUNT(hlstats_Events_Frags.weapon) / $realkills * 100, 2) AS kpercent,
SUM(hlstats_Events_Frags.headshot = 1) AS headshots,
ROUND(SUM(hlstats_Events_Frags.headshot = 1) / IF(COUNT(hlstats_Events_Frags.weapon) = 0, 1, COUNT(hlstats_Events_Frags.weapon)), 2) AS hpk,
ROUND(SUM(hlstats_Events_Frags.headshot = 1) / $realheadshots * 100, 2) AS hpercent
FROM
hlstats_Events_Frags
LEFT JOIN
hlstats_Weapons
ON
hlstats_Weapons.code = hlstats_Events_Frags.weapon
WHERE
hlstats_Events_Frags.killerId = $player
AND
(
hlstats_Weapons.game = '$game'
OR hlstats_Weapons.weaponId IS NULL
)
GROUP BY
hlstats_Events_Frags.weapon
ORDER BY
$tblWeapons->sort $tblWeapons->sortorder,
$tblWeapons->sort2 $tblWeapons->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
printSectionTitle('Weapon Usage *');
$tblWeapons->draw($result, $numitems, 95); ?>
<br /><br />
<?php
}
?>
<!-- Begin of StatsMe Addon 1.0 by JustinHoMi@aol.com -->
<?php
flush();
$tblWeaponstats = new Table
(
array
(
new TableColumn
(
'smweapon',
'Weapon',
'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&amp;weapon=%k&amp;game=$game"),
$fname
),
new TableColumn
(
'smshots',
'Shots',
'width=8&align=right'
),
new TableColumn
(
'smhits',
'Hits',
'width=8&align=right'
),
new TableColumn
(
'smdamage',
'Damage',
'width=8&align=right'
),
new TableColumn
(
'smheadshots',
'Headshots',
'width=8&align=right'
),
new TableColumn
(
'smkills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'smkdr',
'K:D',
'width=12&align=right'
),
new TableColumn
(
'smaccuracy',
'Accuracy',
'width=8&align=right&append=' . urlencode('%')
),
new TableColumn
(
'smdhr',
'Damage per Hit',
'width=10&align=right'
),
new TableColumn(
'smspk',
'Shots per Kill',
'width=11&align=right'
)
),
'smweapon',
'smkills',
'smweapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'tabweapons',
'desc',
true
);
$result = $db->query("
SELECT
hlstats_Events_Statsme.weapon AS smweapon,
SUM(hlstats_Events_Statsme.kills) AS smkills,
SUM(hlstats_Events_Statsme.hits) AS smhits,
SUM(hlstats_Events_Statsme.shots) AS smshots,
SUM(hlstats_Events_Statsme.headshots) AS smheadshots,
SUM(hlstats_Events_Statsme.deaths) AS smdeaths,
SUM(hlstats_Events_Statsme.damage) AS smdamage,
ROUND((SUM(hlstats_Events_Statsme.damage) / (IF(SUM(hlstats_Events_Statsme.hits) = 0, 1, SUM(hlstats_Events_Statsme.hits) ))), 1) as smdhr,
SUM(hlstats_Events_Statsme.kills) / IF((SUM(hlstats_Events_Statsme.deaths) = 0), 1, (SUM(hlstats_Events_Statsme.deaths))) AS smkdr,
ROUND((SUM(hlstats_Events_Statsme.hits) / SUM(hlstats_Events_Statsme.shots) * 100), 1) AS smaccuracy,
ROUND(((IF(SUM(hlstats_Events_Statsme.kills) = 0, 0, SUM(hlstats_Events_Statsme.shots))) / (IF(SUM(hlstats_Events_Statsme.kills) = 0, 1, SUM(hlstats_Events_Statsme.kills) ))), 1) as smspk
FROM
hlstats_Events_Statsme
WHERE
hlstats_Events_Statsme.PlayerId = $player
GROUP BY
hlstats_Events_Statsme.weapon
HAVING
SUM(hlstats_Events_Statsme.shots) > 0
ORDER BY
$tblWeaponstats->sort $tblWeaponstats->sortorder,
$tblWeaponstats->sort2 $tblWeaponstats->sortorder
");
$numitems = $db->num_rows($result);
if ($numitems > 0)
{
printSectionTitle('Weapon Statistics *');
$tblWeaponstats->draw($result, $dnumitems, 95); ?>
<br /><br />
<!-- End of StatsMe Addon 1.0 by JustinHoMi@aol.com -->
<?php
}
flush();
if ($g_options['show_weapon_target_flash'] == 1)
{
$tblWeaponstats2 = new Table
(
array
(
new TableColumn
(
'smweapon',
'Weapon',
'width=35&type=weaponimg&align=center&link='.urlencode("javascript:switch_weapon('%k');"),
$fname
),
new TableColumn
(
'smhits',
'Hits',
'width=15&align=right'
),
new TableColumn
(
'smleft',
'Left',
'width=15&align=right&append=' . urlencode('%')
),
new TableColumn
(
'smmiddle',
'Middle',
'width=15&align=right&append=' . urlencode('%')
),
new TableColumn
(
'smright',
'Right',
'width=15&align=right&append=' . urlencode('%')
)
),
'smweapon',
'smhits',
'smweapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'tabweapons',
'desc',
true
);
}
else
{
$tblWeaponstats2 = new Table
(
array(
new TableColumn
(
'smweapon',
'Weapon',
'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&amp;weapon=%k&amp;game=$game"),
$fname
),
new TableColumn
(
'smhits',
'Hits',
'width=7&align=right'
),
new TableColumn
(
'smhead',
'Head',
'width=7&align=right'
),
new TableColumn
(
'smchest',
'Chest',
'width=7&align=right'
),
new TableColumn
(
'smstomach',
'Stomach',
'width=7&align=right'
),
new TableColumn
(
'smleftarm',
'Left Arm',
'width=7&align=right'
),
new TableColumn
(
'smrightarm',
'Right Arm',
'width=7&align=right'
),
new TableColumn
(
'smleftleg',
'Left Leg',
'width=7&align=right'
),
new TableColumn
(
'smrightleg',
'Right Leg',
'width=7&align=right'
),
new TableColumn
(
'smleft',
'Left',
'width=8&align=right&append=' . urlencode('%')
),
new TableColumn
(
'smmiddle',
'Middle',
'width=8&align=right&append=' . urlencode('%')
),
new TableColumn
(
'smright',
'Right',
'width=8&align=right&append=' . urlencode('%')
)
),
'smweapon',
'smhits',
'smweapon',
true,
9999,
'weap_page',
'weap_sort',
'weap_sortorder',
'weaponstats2',
'desc',
true
);
}
$query = "
SELECT
hlstats_Events_Statsme2.weapon AS smweapon,
SUM(hlstats_Events_Statsme2.head) AS smhead,
SUM(hlstats_Events_Statsme2.chest) AS smchest,
SUM(hlstats_Events_Statsme2.stomach) AS smstomach,
SUM(hlstats_Events_Statsme2.leftarm) AS smleftarm,
SUM(hlstats_Events_Statsme2.rightarm) AS smrightarm,
SUM(hlstats_Events_Statsme2.leftleg) AS smleftleg,
SUM(hlstats_Events_Statsme2.rightleg) AS smrightleg,
SUM(hlstats_Events_Statsme2.head)
+ SUM(hlstats_Events_Statsme2.chest)
+ SUM(hlstats_Events_Statsme2.stomach)
+ SUM(hlstats_Events_Statsme2.leftarm)
+ SUM(hlstats_Events_Statsme2.rightarm)
+ SUM(hlstats_Events_Statsme2.leftleg)
+ SUM(hlstats_Events_Statsme2.rightleg) AS smhits,
IFNULL(ROUND((SUM(hlstats_Events_Statsme2.leftarm) + SUM(hlstats_Events_Statsme2.leftleg)) / (SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach) + SUM(hlstats_Events_Statsme2.leftarm ) + SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.leftleg) + SUM(hlstats_Events_Statsme2.rightleg)) * 100, 1), 0.0) AS smleft,
IFNULL(ROUND((SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.rightleg)) / (SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach) + SUM(hlstats_Events_Statsme2.leftarm ) + SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.leftleg) + SUM(hlstats_Events_Statsme2.rightleg)) * 100, 1), 0.0) AS smright,
IFNULL(ROUND((SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach)) / (SUM(hlstats_Events_Statsme2.head) + SUM(hlstats_Events_Statsme2.chest) + SUM(hlstats_Events_Statsme2.stomach) + SUM(hlstats_Events_Statsme2.leftarm ) + SUM(hlstats_Events_Statsme2.rightarm) + SUM(hlstats_Events_Statsme2.leftleg) + SUM(hlstats_Events_Statsme2.rightleg)) * 100, 1), 0.0) AS smmiddle
FROM
hlstats_Events_Statsme2
WHERE
hlstats_Events_Statsme2.PlayerId = $player
GROUP BY
hlstats_Events_Statsme2.weapon
HAVING
smhits > 0
ORDER BY
$tblWeaponstats2->sort $tblWeaponstats2->sortorder,
$tblWeaponstats2->sort2 $tblWeaponstats2->sortorder
";
$result = $db->query($query);
if ($db->num_rows($result) != 0)
{
printSectionTitle('Weapon Targets *');
if ($g_options['show_weapon_target_flash'] == 1)
{
?>
<div class="subblock">
<div style="float:left;vertical-align:top;width:52%;">
<script type="text/javascript">
/* <![CDATA[ */
<?php
$weapon_data = array ();
$css_models = array ('ct', 'ct2', 'ct3', 'ct4', 'ts', 'ts2', 'ts3', 'ts4');
$css_ct_weapons = array ('usp', 'tmp', 'm4a1', 'aug', 'famas', 'sig550');
$css_ts_weapons = array ('glock', 'elite', 'mac10', 'ak47', 'sg552', 'galil', 'g3sg1');
$css_random_weapons = array ('knife', 'deagle', 'p228', 'm3', 'xm1014', 'mp5navy', 'p90', 'scout', 'awp', 'm249', 'hegrenade', 'flashbang', 'ump45', 'smokegrenade_projectile');
$dods_models = array ('allies', 'axis');
$dods_allies_weapons = array ('thompson', 'colt', 'spring', 'garand', 'riflegren_us', 'm1carbine', 'bar', 'amerknife', '30cal', 'bazooka', 'frag_us', 'riflegren_us', 'smoke_us');
$dods_axis_weapons = array ('spade', 'riflegren_ger', 'k98', 'mp40', 'p38', 'frag_ger', 'smoke_ger', 'mp44', 'k98_scoped', 'mg42', 'pschreck', 'c96');
$l4d_models = array ('zombie1', 'zombie2', 'zombie3');
$insmod_models = array ('insmod1', 'insmod2');
$fof_models = array ('fof1', 'fof2');
$ges_models = array ('ges-bond', 'ges-boris');
$dinodday_models = array('ddd_allies', 'ddd_axis');
$dinodday_allies_weapons = array('garand', 'greasegun', 'thompson', 'shotgun', 'sten', 'carbine', 'bar', 'mosin', 'p38', 'piat', 'nagant', 'flechette', 'pistol', 'trigger');
$dinodday_axis_weapons = array('mp40', 'k98', 'mp44', 'k98sniper', 'luger', 'stygimoloch', 'mg42', 'trex');
while ($rowdata = $db->fetch_array())
{
$weapon_data['total']['head'] += $rowdata['smhead'];
$weapon_data['total']['leftarm'] += $rowdata['smleftarm'];
$weapon_data['total']['rightarm'] += $rowdata['smrightarm'];
$weapon_data['total']['chest'] += $rowdata['smchest'];
$weapon_data['total']['stomach'] += $rowdata['smstomach'];
$weapon_data['total']['leftleg'] += $rowdata['smleftleg'];
$weapon_data['total']['rightleg'] += $rowdata['smrightleg'];
$weapon_data[$rowdata['smweapon']]['head'] = $rowdata['smhead'];
$weapon_data[$rowdata['smweapon']]['leftarm'] = $rowdata['smleftarm'];
$weapon_data[$rowdata['smweapon']]['rightarm'] = $rowdata['smrightarm'];
$weapon_data[$rowdata['smweapon']]['chest'] = $rowdata['smchest'];
$weapon_data[$rowdata['smweapon']]['stomach'] = $rowdata['smstomach'];
$weapon_data[$rowdata['smweapon']]['leftleg'] = $rowdata['smleftleg'];
$weapon_data[$rowdata['smweapon']]['rightleg'] = $rowdata['smrightleg'];
switch ($realgame)
{
case 'dods':
$weapon_data[$rowdata['smweapon']]['model'] = 'allies';
break;
case 'l4d':
$weapon_data[$rowdata['smweapon']]['model'] = 'zombie1';
break;
case 'hl2mp':
$weapon_data[$rowdata["smweapon"]]['model'] = 'alyx';
break;
case 'insmod':
$weapon_data[$rowdata['smweapon']]['model'] = 'insmod1';
break;
case 'zps':
$weapon_data[$rowdata["smweapon"]]['model'] = 'zps1';
break;
case 'ges':
$weapon_data[$rowdata['smweapon']]['model'] = 'ges-bond';
break;
case 'tfc':
$weapon_data[$rowdata["smweapon"]]['model'] = 'pyro';
break;
case 'fof':
$weapon_data[$rowdata['smweapon']]['model'] = 'fof1';
break;
case 'dinodday':
$weapon_data[$rowdata['smweapon']]['model'] = 'ddd_allies';
break;
default:
$weapon_data[$rowdata['smweapon']]['model'] = 'ct';
}
if ($realgame == 'css' || $realgame == 'cstrike')
{
if (in_array($rowdata['smweapon'], $css_random_weapons))
{
$weapon_data[$rowdata['smweapon']]['model'] = $css_models[array_rand($css_models)];
}
elseif (in_array($rowdata['smweapon'], $css_ct_weapons))
{
$weapon_data[$rowdata['smweapon']]['model'] = $css_models[rand(0, 2) + 3];
}
elseif (in_array($rowdata['smweapon'], $css_ts_weapons))
{
$weapon_data[$rowdata['smweapon']]['model'] = $css_models[rand(0, 2)];
}
}
elseif ($realgame == 'dods')
{
if (in_array($rowdata['smweapon'], $dods_allies_weapons))
{
$weapon_data[$rowdata['smweapon']]['model'] = $dods_models[1];
}
elseif (in_array($rowdata['smweapon'], $dods_axis_weapons))
{
$weapon_data[$rowdata['smweapon']]['model'] = $dods_models[0];
}
}
elseif ($realgame == 'dinodday')
{
if (in_array($rowdata['smweapon'], $dinodday_allies_weapons))
{
$weapon_data[$rowdata['smweapon']]['model'] = $dinodday_models[1];
}
elseif (in_array($rowdata['smweapon'], $dinodday_axis_weapons))
{
$weapon_data[$rowdata['smweapon']]['model'] = $dinodday_models[0];
}
}
}
switch ($realgame)
{
case 'dods':
$start_model = $dods_models[array_rand($dods_models)];
break;
case 'l4d':
$start_model = $l4d_models[array_rand($l4d_models)];
break;
case 'hl2mp':
$start_model = 'alyx';
break;
case 'insmod':
$start_model = $insmod_models[array_rand($insmod_models)];
break;
case 'zps':
$start_model = 'zps1';
break;
case 'ges':
$start_model = $ges_models[array_rand($ges_models)];
break;
case 'tfc':
$start_model = 'pyro';
break;
case 'fof':
$start_model = $fof_models[array_rand($fof_models)];
break;
case 'dinodday':
$start_model = $dinodday_models[array_rand($dinoday_models)];
break;
default:
$start_model = $css_models[array_rand($css_models)];
}
$weapon_data['total']['model'] = $start_model;
echo "var data_array = new Array();\n";
$i = 1;
foreach ($weapon_data as $key => $entry)
{
if ($key == 'total')
$key = 'All Weapons';
echo "data_array['$key'] = ['".ucfirst($key)."',".$entry['head'].",".$entry['leftarm'].",".$entry['rightarm'].",".$entry['chest'].",".$entry['stomach'].",".$entry['leftleg'].",".$entry['rightleg'].",'".$entry['model']."'];\n";
$i++;
}
$result = $db->query($query);
?>
function switch_weapon(weapon)
{
if (document.embeds && document.embeds.hitbox)
{
if (document.embeds.hitbox.LoadMovie)
{
document.embeds.hitbox.LoadMovie(0, '<?php echo IMAGE_PATH; ?>/hitbox.swf?wname='+data_array[weapon][0]
+'&head='+data_array[weapon][1]+'&rightarm='+data_array[weapon][2]
+'&leftarm='+data_array[weapon][3]+'&chest='+data_array[weapon][4]
+'&stomach='+data_array[weapon][5]+'&rightleg='+data_array[weapon][6]
+'&leftleg='+data_array[weapon][7]+'&model='+data_array[weapon][8]
+'&numcolor_num=#<?php echo $g_options['graphtxt_load'] ?>&numcolor_pct=#<?php echo $g_options['graphtxt_load'] ?>&linecolor=#<?php echo $g_options['graphtxt_load'] ?>&barcolor=#FFFFFF&barbackground=#000000&textcolor=#FFFFFF&captioncolor=#FFFFFF&textcolor_total=#FFFFFF');
}
}
else if (document.getElementById)
{
var obj = document.getElementById('hitbox');
if (typeof obj.LoadMovie != 'undefined')
{
obj.LoadMovie(0, '<?php echo IMAGE_PATH; ?>/hitbox.swf?wname='+data_array[weapon][0]
+'&head='+data_array[weapon][1]+'&rightarm='+data_array[weapon][2]
+'&leftarm='+data_array[weapon][3]+'&chest='+data_array[weapon][4]
+'&stomach='+data_array[weapon][5]+'&rightleg='+data_array[weapon][6]
+'&leftleg='+data_array[weapon][7]+'&model='+data_array[weapon][8]
+'&numcolor_num=#<?php echo $g_options['graphtxt_load'] ?>&numcolor_pct=#<?php echo $g_options['graphtxt_load'] ?>&linecolor=#<?php echo $g_options['graphtxt_load'] ?>&barcolor=#FFFFFF&barbackground=#000000&textcolor=#FFFFFF&captioncolor=#FFFFFF&textcolor_total=#FFFFFF');
}
}
}
/* ]]> */
</script>
<?php
$tblWeaponstats2->draw($result, $db->num_rows($result), 100);
$flashlink = IMAGE_PATH.'/hitbox.swf?wname=All+Weapons&amp;head='.$weapon_data['total']['head'].'&amp;rightarm='.$weapon_data['total']['leftarm'].'&amp;leftarm='.$weapon_data['total']['rightarm'].'&amp;chest='.$weapon_data['total']['chest'].'&amp;stomach='.$weapon_data['total']['stomach'].'&amp;rightleg='.$weapon_data['total']['leftleg'].'&amp;leftleg='.$weapon_data['total']['rightleg'].'&amp;model='.$start_model.'&amp;numcolor_num=#'.$g_options['graphtxt_load'].'&amp;numcolor_pct=#'.$g_options['graphtxt_load'].'&amp;linecolor=#'.$g_options['graphtxt_load'].'&amp;barcolor=#FFFFFF&amp;barbackground=#000000&amp;textcolor=#FFFFFF&amp;captioncolor=#FFFFFF&amp;textcolor_total=#FFFFFF';
?>
</div>
<div style="float:right;vertical-align:top;width:480px;">
<table class="data-table">
<tr class="data-table-head">
<td style="text-align:center;">Targets</td>
</tr>
<tr class="bg1">
<td style="text-align:center;">
<object width="470" height="360" align="middle" id="hitbox" data="<?php echo $flashlink; ?>" type="application/x-shockwave-flash">
<param name="movie" value="<?php echo $flashlink; ?>" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="bgcolor" value="#<?php echo $g_options['graphbg_load'] ?>" />
The hitbox display requires <a href="http://www.adobe.com" target="_blank">Adobe Flash Player</a> to view.
</object>
</td>
</tr>
<tr class="bg2">
<td style="text-align:center;">
<a href="javascript:switch_weapon('All Weapons');">Show total target statistics</a>
</td>
</tr>
</table>
</div>
<?php
}
else
{
$tblWeaponstats2->draw($result, $db->num_rows($result), 95);
}
?>
<br /><br />
<?php
}
?>

414
web/pages/players.php Normal file
View File

@ -0,0 +1,414 @@
<?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.');
}
// Player Rankings
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() < 1) error("No such game '$game'.");
list($gamename) = $db->fetch_row();
$db->free_result();
if (isset($_GET['minkills']))
{
$minkills = valid_request($_GET['minkills'], 1);
}
else
{
$minkills = 1;
}
pageHeader
(
array ($gamename, 'Player Rankings'),
array ($gamename=>"%s?game=$game", 'Player Rankings'=>'')
);
$rank_type = 0;
if (isset($_GET['rank_type']))
$rank_type = valid_request(strval($_GET['rank_type']), 0);
// Autocomplete function below implemented by KingJ. Heavy modified to use HTML request instead of JSON.
?>
<div class="block">
<?php printSectionTitle('Player Rankings'); ?>
<div class="subblock">
<div style="float:left;">
<script type="text/javascript" src="<?php echo INCLUDE_PATH; ?>/js/Observer.js"></script>
<script type="text/javascript" src="<?php echo INCLUDE_PATH; ?>/js/Autocompleter.js"></script>
<script type="text/javascript" src="<?php echo INCLUDE_PATH; ?>/js/Autocompleter.Request.js"></script>
<script type="text/javascript">
document.addEvent('domready', function() {
new Autocompleter.Request.HTML('playersearch', 'autocomplete.php?game=<?php echo $game; ?>', {
'indicatorClass': 'autocompleter-loading'
});
});
</script>
<form method="get" action="<?php echo $g_options['scripturl']; ?>" style="margin:0px;padding:0px;">
<input type="hidden" name="mode" value="search" />
<input type="hidden" name="game" value="<?php echo $game; ?>" />
<input type="hidden" name="st" value="player" />
<strong>&#8226;</strong> Find a player:
<input type="text" name="q" size="20" maxlength="64" class="textbox" id="playersearch" />
<input type="submit" value="Search" class="smallsubmit" />
</form>
</div>
<div style="float:right;">
<form method="get" action="<?php echo $g_options['scripturl']; ?>" style="margin:0px;padding:0px;">
<input type="hidden" name="mode" value="players" />
<input type="hidden" name="game" value="<?php echo $game; ?>" />
<strong>&#8226;</strong> Ranking View
<?php
$result = $db->query
("
SELECT
hlstats_Players_History.eventTime
FROM
hlstats_Players_History
GROUP BY
hlstats_Players_History.eventTime
ORDER BY
hlstats_Players_History.eventTime DESC
LIMIT
0,
50
");
echo '<select name="rank_type"><option value="0">Total Ranking</option>';
echo '<option value="-1">Last Week</option>';
echo '<option value="-2">Last Month</option>';
$i = 1;
$dates = array ();
while ($rowdata = $db->fetch_array())
{
$dates[] = $rowdata;
if ($rank_type == $i)
echo '<option value="'.$i.'" selected>'.$rowdata['eventTime'].'</option>';
else
echo '<option value="'.$i.'">'.$rowdata['eventTime'].'</option>';
$i++;
}
echo '</select>';
?>
<input type="submit" value="View" class="smallsubmit" />
</form>
</div>
<div style="clear:both;"></div><br /><br />
</div>
<?php
if ($g_options['rankingtype']!='kills')
{
$table = new Table
(
array
(
new TableColumn
(
'lastName',
'Player',
'width=30&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn
(
'skill',
'Points',
'width=7&align=right&skill_change=1'
),
new TableColumn
(
'activity',
'Activity',
'width=10&sort=no&type=bargraph'
),
new TableColumn
(
'connection_time',
'Connection Time',
'width=10&align=right&type=timestamp'
),
new TableColumn
(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=6&align=right'
),
new TableColumn
(
'headshots',
'Headshots',
'width=6&align=right'
),
new TableColumn
(
'hpk',
'HS:K',
'width=6&align=right'
),
new TableColumn
(
'acc',
'Accuracy',
'width=6&align=right&append=' . urlencode('%')
)
),
'playerId',
$g_options['rankingtype'],
'kpd',
true
);
}
else
{
$table = new Table
(
array
(
new TableColumn
(
'lastName',
'Player',
'width=30&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')
),
new TableColumn
(
'activity',
'Activity',
'width=10&sort=no&type=bargraph'
),
new TableColumn
(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=6&align=right'
),
new TableColumn
(
'headshots',
'Headshots',
'width=6&align=right'
),
new TableColumn
(
'hpk',
'HS:K',
'width=6&align=right'
),
new TableColumn
(
'acc',
'Accuracy',
'width=6&align=right&append=' . urlencode('%')
),
new TableColumn
(
'skill',
'Points',
'width=7&align=right&skill_change=1'
),
new TableColumn
(
'connection_time',
'Connection Time',
'width=10&align=right&type=timestamp'
)
),
'playerId',
$g_options['rankingtype'],
'kpd',
true
);
}
if ($rank_type == "0")
{
$result = $db->query
("
SELECT
SQL_CALC_FOUND_ROWS
hlstats_Players.playerId,
hlstats_Players.connection_time,
unhex(replace(hex(hlstats_Players.lastName), 'E280AE', '')) as lastName,
hlstats_Players.flag,
hlstats_Players.country,
hlstats_Players.skill,
hlstats_Players.kills,
hlstats_Players.deaths,
hlstats_Players.last_skill_change,
ROUND(hlstats_Players.kills/(IF(hlstats_Players.deaths=0, 1, hlstats_Players.deaths)), 2) AS kpd,
hlstats_Players.headshots,
ROUND(hlstats_Players.headshots/(IF(hlstats_Players.kills=0, 1, hlstats_Players.kills)), 2) AS hpk,
IFNULL(ROUND((hlstats_Players.hits / hlstats_Players.shots * 100), 1), 0) AS acc,
activity
FROM
hlstats_Players
WHERE
hlstats_Players.game = '$game'
AND hlstats_Players.hideranking = 0
AND hlstats_Players.kills >= $minkills
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder,
hlstats_Players.lastName ASC
LIMIT
$table->startitem,
$table->numperpage
");
$resultCount = $db->query("SELECT FOUND_ROWS()");
list($numitems) = $db->fetch_row($resultCount);
}
else
{
if ($rank_type == "-1")
{
$maxEvent = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$minEvent = $maxEvent - (86400 * 7);
}
if ($rank_type == "-2")
{
$maxEvent = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$minEvent = $maxEvent - (86400 * 30);
}
if (!isset($minEvent))
{
$minEvent = split("-", $dates[$rank_type-1]['eventTime']);
$minEvent = mktime(0, 0, 0, $minEvent[1], $minEvent[2], $minEvent[0]);
$maxEvent = $minEvent + 86400;
}
$result = $db->query
("
SELECT
SQL_CALC_FOUND_ROWS
hlstats_Players_History.playerId,
hlstats_Players.lastName,
hlstats_Players.flag,
hlstats_Players.country,
SUM(hlstats_Players_History.connection_time) AS connection_time,
SUM(hlstats_Players_History.skill_change) AS skill,
SUM(hlstats_Players_History.skill_change) AS skill_change,
SUM(hlstats_Players_History.skill_change) AS last_skill_change,
SUM(hlstats_Players_History.kills) AS kills,
SUM(hlstats_Players_History.deaths) AS deaths,
ROUND(SUM(hlstats_Players_History.kills) / IF(SUM(hlstats_Players_History.deaths) = 0, 1, SUM(hlstats_Players_History.deaths)), 2) AS kpd,
SUM(hlstats_Players_History.headshots) AS headshots,
ROUND(SUM(hlstats_Players_History.headshots) / SUM(hlstats_Players_History.kills), 2) AS hpk,
IFNULL(ROUND((SUM(hlstats_Players_History.hits) / SUM(hlstats_Players_History.shots) * 100), 1), 0) AS acc,
activity
FROM
hlstats_Players_History
INNER JOIN
hlstats_Players
ON
hlstats_Players_History.playerId = hlstats_Players.playerId
WHERE
hlstats_Players_History.game = '$game'
AND hlstats_Players.hideranking = 0
AND activity > 0
AND UNIX_TIMESTAMP(hlstats_Players_History.eventTime) >= $minEvent
AND UNIX_TIMESTAMP(hlstats_Players_History.eventTime) <= $maxEvent
GROUP BY
hlstats_Players_History.playerId
HAVING
SUM(hlstats_Players_History.kills) >= $minkills
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder,
hlstats_Players.lastName ASC
LIMIT
$table->startitem,
$table->numperpage
");
$resultCount = $db->query("SELECT FOUND_ROWS()");
list($numitems) = $db->fetch_row($resultCount);
}
$table->draw($result, $numitems, 95);
?><br /><br />
<div class="subblock">
<div style="float:left;">
<form method="get" action="<?php echo $g_options['scripturl']; ?>">
<?php
foreach ($_GET as $k=>$v)
{
$v = valid_request($v, 0);
if ($k != 'minkills')
{
echo "<input type=\"hidden\" name=\"" . htmlspecialchars($k) . "\" value=\"" . htmlspecialchars($v) . "\" />\n";
}
}
?>
<strong>&#8226;</strong> Only show players with
<input type="text" name="minkills" size="4" maxlength="2" value="<?php echo $minkills; ?>" class="textbox" /> or more kills.
<input type="submit" value="Apply" class="smallsubmit" />
</form>
</div>
<div style="float:right;">
Go to: <a href="<?php echo $g_options["scripturl"] . "?mode=clans&amp;game=$game"; ?>">Clan Rankings</a>
</div>
</div>
</div>

View File

@ -0,0 +1,258 @@
<?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.');
}
// Player History -> Sessions & Skill change
$player = valid_request(intval($_GET["player"]), 1)
or error("No player ID specified.");
$db->query
("
SELECT
hlstats_Players.lastName,
hlstats_Players.game
FROM
hlstats_Players
WHERE
playerId = $player
");
if ($db->num_rows() != 1)
{
error("No such player '$player'.");
}
$playerdata = $db->fetch_array();
$pl_name = $playerdata['lastName'];
if (strlen($pl_name) > 10)
{
$pl_shortname = substr($pl_name, 0, 8) . '...';
}
else
{
$pl_shortname = $pl_name;
}
$pl_name = htmlspecialchars($pl_name, ENT_COMPAT);
$pl_shortname = htmlspecialchars($pl_shortname, ENT_COMPAT);
$game = $playerdata['game'];
$db->query
("
SELECT
hlstats_Games.name
FROM
hlstats_Games
WHERE
hlstats_Games.code = '$game'
");
if ($db->num_rows() != 1)
{
$gamename = ucfirst($game);
}
else
{
list($gamename) = $db->fetch_row();
}
pageHeader
(
array ($gamename, 'Session History', $pl_name),
array
(
$gamename => $g_options['scripturl']."?game=$game",
'Player Rankings' => $g_options['scripturl']."?mode=players&game=$game",
'Player Details' => $g_options['scripturl']."?mode=playerinfo&player=$player",
'Session History' => ''
),
$playername
);
flush();
$table = new Table
(
array
(
new TableColumn
(
'eventTime',
'Date',
'width=11'
),
new TableColumn
(
'skill_change',
'Skill Change',
'width=10&align=right&skill_change=1'
),
new TableColumn
(
'skill',
'Points',
'width=10&align=right'
),
new TableColumn
(
'connection_time',
'Time',
'width=13&align=right&type=timestamp'
),
new TableColumn
(
'kills',
'Kills',
'width=7&align=right'
),
new TableColumn
(
'deaths',
'Deaths',
'width=7&align=right'
),
new TableColumn
(
'kpd',
'K:D',
'width=7&align=right'
),
new TableColumn
(
'headshots',
'HS',
'width=7&align=right'
),
new TableColumn
(
'hpk',
'HS:K',
'width=7&align=right'
),
new TableColumn
(
'suicides',
'Suicides',
'width=7&align=right'
),
new TableColumn
(
'teamkills',
'TKs',
'width=7&align=right'
),
new TableColumn
(
'kill_streak',
'Kill Strk',
'width=7&align=right'
),
),
'eventTime',
'eventTime',
'skill_change',
false,
50,
'page',
'sort',
'sortorder'
);
$surl = $g_options['scripturl'];
$result = $db->query
("
SELECT
hlstats_Players_History.eventTime,
hlstats_Players_History.skill_change,
hlstats_Players_History.skill,
hlstats_Players_History.kills,
hlstats_Players_History.deaths,
hlstats_Players_History.headshots,
hlstats_Players_History.suicides,
hlstats_Players_History.connection_time,
ROUND(hlstats_Players_History.kills/(IF(hlstats_Players_History.deaths = 0, 1, hlstats_Players_History.deaths)), 2) AS kpd,
ROUND(hlstats_Players_History.headshots/(IF(hlstats_Players_History.kills = 0, 1, hlstats_Players_History.kills)), 2) AS hpk,
hlstats_Players_History.teamkills,
hlstats_Players_History.kill_streak,
hlstats_Players_History.death_streak,
hlstats_Players_History.skill_change AS last_skill_change
FROM
hlstats_Players_History
WHERE
hlstats_Players_History.playerId = $player
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
LIMIT
$table->startitem,
$table->numperpage
");
$resultCount = $db->query
("
SELECT
COUNT(*)
FROM
hlstats_Players_History
WHERE
hlstats_Players_History.playerId = $player
");
list($numitems) = $db->fetch_row($resultCount);
?>
<div class="block">
<?php
printSectionTitle('Player Session History');
if ($numitems > 0)
{
$table->draw($result, $numitems, 95);
}
?><br /><br />
<div class="subblock">
<div style="float:left;">
Items above are generated from the last <?php echo $g_options['DeleteDays']; ?> days.
</div>
<div style="float:right;">
<?php
$db->query
("
SELECT
hlstats_Players.lastName
FROM
hlstats_Players
WHERE
hlstats_Players.playerId = '$player'
");
list($lastName) = $db->fetch_row();
?>
Go to: <a href="<?php echo $g_options['scripturl'] . "?mode=playerinfo&amp;player=$player"; ?>"><?php echo $lastName; ?>'s Statistics</a>
</div>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More