Raised This Month: $123 Target: $400
 30% 

Player avatars broken again?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pizzahut
Senior Member
Join Date: Oct 2004
Old 04-09-2018 , 21:00   Player avatars broken again?
Reply With Quote #1

Not running hlstatsx myself, but from what I've seen, Steam is now using https for the xml profile data. The function "fetchpage" in file "playerinfo_general.php" needs to be changed accordingly to retrieve the Steam avatar URL and online status.

Original "playerinfo_general.php":
https://bitbucket.org/Maverick_of_UC...e-view-default

Using curl:
https://stackoverflow.com/questions/...-https-content

Using fsockopen and fgets:
http://php.net/manual/function.fsockopen.php#34887
http://php.net/manual/openssl.installation.php

Last edited by pizzahut; Today at 14:40.
pizzahut is offline
Phorce_Phed
Member
Join Date: Jun 2006
Old 04-19-2018 , 11:46   Re: Player avatars broken again?
Reply With Quote #2

Does anyone have a drop-in fix for this?
Phorce_Phed is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old Today , 14:22   Re: Player avatars broken again?
Reply With Quote #3

Quote:
Originally Posted by Phorce_Phed View Post
Does anyone have a drop-in fix for this?
This quick fix by Master works, though I later found out that https is possible using fsockopen as well. Also, there is no error checking done in the quick fix.

So you can use this, but it's probably better to continue using fsockopen instead, just with SSL as described in the docu linked above.

As mentioned, I'm not running hlstatsx myself atm, so can't do any testing.

You can comment out the original function using /* and */ .
PHP Code:
function fetchpage ($page)
{
    
$url "https://steamcommunity.com";
    
$ch curl_init();
    
curl_setopt($chCURLOPT_URL$url."/".$page);
    
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    
curl_setopt($chCURLOPT_HEADER0);
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    
$html_content curl_exec($ch);
    
curl_close($ch);
    return 
$html_content;

Looking at the code, ."/" is probably redundant. I think $page usually starts with a slash already, though not sure if this is always the case.

Last edited by pizzahut; Today at 14:50.
pizzahut is offline
Reply


Thread Tools
Display Modes

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 15:34.


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