Reupload after bitbucket wipe
This commit is contained in:
1
web/pages/ingame/.htaccess
Normal file
1
web/pages/ingame/.htaccess
Normal file
@ -0,0 +1 @@
|
||||
deny from all
|
215
web/pages/ingame/accuracy.php
Normal file
215
web/pages/ingame/accuracy.php
Normal 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);
|
||||
}
|
||||
|
||||
?>
|
181
web/pages/ingame/actioninfo.php
Normal file
181
web/pages/ingame/actioninfo.php
Normal 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&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');
|
||||
?>
|
114
web/pages/ingame/actions.php
Normal file
114
web/pages/ingame/actions.php
Normal 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&action=%k&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
140
web/pages/ingame/bans.php
Normal 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&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);
|
||||
?>
|
275
web/pages/ingame/claninfo.php
Normal file
275
web/pages/ingame/claninfo.php
Normal 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(' ', ' ', htmlspecialchars($clandata['name']));
|
||||
$cl_tag = preg_replace(' ', ' ', 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&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
177
web/pages/ingame/clans.php
Normal 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&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);
|
||||
?>
|
57
web/pages/ingame/footer.php
Normal file
57
web/pages/ingame/footer.php
Normal 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>
|
75
web/pages/ingame/header.php
Normal file
75
web/pages/ingame/header.php
Normal 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; ?>">« Go Back</a>
|
||||
</div>
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
243
web/pages/ingame/help.php
Normal file
243
web/pages/ingame/help.php
Normal 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> <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"> 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"> 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"> 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"> Participating Servers</td>
|
||||
<td style="width:23%;" class="fSmall"> Address</td>
|
||||
<td style="width:6%;text-align:center" class="fSmall"> Map</td>
|
||||
<td style="width:6%;text-align:center" class="fSmall"> Played</td>
|
||||
<td style="width:10%;text-align:center" class="fSmall"> 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
306
web/pages/ingame/kills.php
Normal 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
87
web/pages/ingame/load.php
Normal 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&width=870&height=200&server_id=<?php echo $server_id ?>&bgcolor=<?php echo $g_options['graphbg_load']; ?>&color=<?php echo $g_options['graphtxt_load']; ?>" style="border:0px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
124
web/pages/ingame/mapinfo.php
Normal file
124
web/pages/ingame/mapinfo.php
Normal 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&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
237
web/pages/ingame/maps.php
Normal 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
289
web/pages/ingame/motd.php
Normal 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&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&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"> Participating Servers</td>
|
||||
<td style="width:20%;" class="fSmall"> Address</td>
|
||||
<td style="width:10%;text-align:center;" class="fSmall"> Map</td>
|
||||
<td style="width:10%;text-align:center;" class="fSmall"> Played</td>
|
||||
<td style="width:10%;" class="fSmall"> 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 } ?>
|
244
web/pages/ingame/players.php
Normal file
244
web/pages/ingame/players.php
Normal 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&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&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);
|
||||
?>
|
123
web/pages/ingame/servers.php
Normal file
123
web/pages/ingame/servers.php
Normal 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"> Participating Servers</td>
|
||||
<td style="width:23%;" class="fSmall"> Address</td>
|
||||
<td style="width:6%;text-align:center;" class="fSmall"> Map</td>
|
||||
<td style="width:6%;text-align:center;" class="fSmall"> Played</td>
|
||||
<td style="width:10%;text-align:center;" class="fSmall"> 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>
|
358
web/pages/ingame/statsme.php
Normal file
358
web/pages/ingame/statsme.php
Normal 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']).'"> ';
|
||||
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 ' <a href="' . $g_options['scripturl']
|
||||
. '?mode=claninfo&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
166
web/pages/ingame/status.php
Normal 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"> Server</td>
|
||||
<td style="width:23%;" class="fSmall"> Address</td>
|
||||
<td style="width:6%;text-align:center;" class="fSmall"> Map</td>
|
||||
<td style="width:6%;text-align:center;" class="fSmall"> Played</td>
|
||||
<td style="width:10%;text-align:center;" class="fSmall"> Players</td>
|
||||
<td style="width:6%;text-align:center;" class="fSmall"> Kills</td>
|
||||
<td style="width:6%;text-align:center;" class="fSmall"> Headshots</td>
|
||||
<td style="width:6%;text-align:center;" class="fSmall"> 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
|
||||
?>
|
230
web/pages/ingame/targets.php
Normal file
230
web/pages/ingame/targets.php
Normal 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);
|
||||
}
|
||||
?>
|
128
web/pages/ingame/weaponinfo.php
Normal file
128
web/pages/ingame/weaponinfo.php
Normal 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&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);
|
||||
?>
|
233
web/pages/ingame/weapons.php
Normal file
233
web/pages/ingame/weapons.php
Normal 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);
|
||||
?>
|
Reference in New Issue
Block a user