View Single Post
midnight9
Senior Member
Join Date: Nov 2012
Old 04-22-2018 , 04:59   Re: Player avatars broken again?
Reply With Quote #4

Quote:
Originally Posted by pizzahut View Post
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.
Works for me. Thanks
midnight9 is offline