Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] Custom Player Stats v1.4B121


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dude
Junior Member
Join Date: Dec 2010
Old 01-05-2011 , 06:16   Player steam avatar on stats site (WEB! not game!)
Reply With Quote #11

Hi all!

I thank the author for this great addition (stats)!

If you want players steamcommunity avatars, ranking etc. on your own stats web site like this:

player php sample

find in player.php this:

PHP Code:
if (mysql_num_rows($result) > 0)
{
    
$playername htmlentities($row['name'], ENT_COMPAT"UTF-8");
    
    
$timesrow mysql_fetch_array(mysql_query("SELECT COUNT(*) AS times FROM " $mysql_tableprefix "timedmaps WHERE steamid = '" $id "'"));
    
$times $timesrow['times']; 
and just after put this code:
PHP Code:
$xml simplexml_load_file('http://steamcommunity.com/profiles/'.getfriendid($row['steamid']).'?xml=1');

foreach (
$xml->avatarMedium as $foo
    {
    
$Avatar "<img src=".$foo."> ";
    }

foreach (
$xml->steamRating as $foo
    {
    
$SRank "</br><small><small><b>Steam Rating:</b> $foo </small></small>";
    }
    
$xml simplexml_load_file('http://steamcommunity.com/profiles/'.getfriendid($row['steamid']).'/stats/L4D2/?xml=1');

foreach (
$xml->stats->lifetime as $foo
    {
    
$TTima "&nbsp;&nbsp;<small><small><b>Total time played:</b> $foo->timeplayed</small></small>";
    }

foreach (
$xml->stats->lifetime as $foo
    {
    
$PHour "&nbsp;&nbsp;<small><small><b>Kills per hour:</b> $foo->killsperhour</small></small>";
    } 

then replace lines:

PHP Code:
    $tpl->set("title""Viewing Player: " $playername); // Window title
    
$tpl->set("page_heading""Viewing Player: " $playername); // Page header 
with this:
PHP Code:
    $tpl->set("title""Viewing Player: " $playername); // Window title
    
$tpl->set("page_heading""" $Avatar $playername $SRank $TTima $PHour); // Page header 
Enjoy!
__________________
Gamers Community: gamesteams.com/Dude.html
Dudeists Steam Gropup server with stats http://left4bowl.clanservers.com

Last edited by Dude; 01-05-2011 at 06:25.
Dude is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode