Well, I have that PHP function disabled on the host... And someone sent me a nice script for having an image with the update stats of an online game. I'm talking about this one:
http://ixiongames.com/cfstat/ (You can also see what happens when I test it in my website http://www.crossfire.es/cfstat/)
I have all the files.. but the problems is that when I want to include them, all seems fine... but when you try to get the data of the game database it doesn't get showed on the image... Someone told me its because my hosting doesn't accept file_get_contents function, and its very probable.
Is there any way to make it work evading that function? They can't enable it so I must search for any solution. Im going to paste the original scripts, (stat.php and yoursig.php files):
Stat.php
<?php
//***** Looks like this is going to be one hell of a ***** to work out. ****/
error_reporting(0); // DISABLE ERROR HANDLE FOR THE TIME BEING
$id = $_GET['id'];
$clan = $_GET['clan'];
$style = $_GET['style'];
$url = "http://clan.z8games.com/charstat_cf.aspx?usn=".$id;
$raw = file_get_contents($url);
$newlines = array("\t","\n","\r","\x20\x20","\0","\x0B");
$content = str_replace($newlines, "", html_entity_decode($raw));
// Matches Played
$mplayed_start = strpos($content,'<span id="ctl00_Main_lbl_play_cnt">');$mplayed_end = strpos($content,'</span>',$mplayed_start);
$Pmplayed = substr($content,$mplayed_start,$mplayed_end-$mplayed_start);
// Wins
$wins_start = strpos($content,'<span id="ctl00_Main_lbl_win_cnt">');$wins_end = strpos($content,'</span>',$wins_start);
$Pwins = substr($content,$wins_start,$wins_end-$wins_start);
// Losses
$losses_start = strpos($content,'<span id="ctl00_Main_lbl_lose_cnt">');$losses_end = strpos($content,'</span>',$losses_start);
$Plosses = substr($content,$losses_start,$losses_end-$losses_start);
// Kills
$kills_start = strpos($content,'<span id="ctl00_Main_lbl_enemy_kill_cnt">');$kills_end = strpos($content,'</span>',$kills_start);
$Pkills = substr($content,$kills_start,$kills_end-$kills_start);
// Deaths
$deaths_start = strpos($content,'<span id="ctl00_Main_lbl_death_cnt">');$deaths_end = strpos($content,'</span>',$deaths_start);
$Pdeaths = substr($content,$deaths_start,$deaths_end-$deaths_start);
// Exp.
$exp_start = strpos($content,'<span id="ctl00_Main_lbl_exp">');$exp_end = strpos($content,'</span>',$exp_start);
$Pexp = substr($content,$exp_start,$exp_end-$exp_start);
// Headshots
$headshots_start = strpos($content,'<span id="ctl00_Main_lbl_headshot_kill_cnt">');$headshots_end = strpos($content,'</span>',$headshots_start);
$Pheadshots = substr($content,$headshots_start,$headshots_end-$headshots_start);
// Team Kill
$tk_start = strpos($content,'<span id="ctl00_Main_lbl_friend_kill_cnt">');$tk_end = strpos($content,'</span>',$tk_start);
$Ptk = substr($content,$tk_start,$tk_end-$tk_start);
// Desertion
$desert_start = strpos($content,'<span id="ctl00_Main_lbl_escape_cnt">');$desert_end = strpos($content,'</span>',$desert_start);
$Pdesert = substr($content,$desert_start,$desert_end-$desert_start);
// Clan
$clan_start = strpos($content,'<a id="ctl00_Main_lb_myclan"');$clan_end = strpos($content,'</a><span id="ctl00_Main_lbl_noclan">',$clan_start);
$Pclan = substr($content,$clan_start,$clan_end-$clan_start);
// Player Name
$pname_start = strpos($content,'<span id="ctl00_Main_lbl_charactername">');$pname_end = strpos($content,'</span>',$pname_start);
$Ppname = substr($content,$pname_start,$pname_end-$pname_start);
// Get Rank Image.1
$ranking_start = strpos($content,'<img src="images/RANKINGICON_BIG/');$ranking_end = strpos($content,'" width="92" height="92" />',$ranking_start);
$Pranking = substr($content,$ranking_start,$ranking_end-$ranking_start);
// Kill/death Ratio
$mplayed = str_replace('<span id="ctl00_Main_lbl_play_cnt">', '', $Pmplayed);
$wins = str_replace('<span id="ctl00_Main_lbl_win_cnt">', '', $Pwins);
$losses = str_replace('<span id="ctl00_Main_lbl_lose_cnt">', '', $Plosses);
$kills = str_replace('<span id="ctl00_Main_lbl_enemy_kill_cnt">', '', $Pkills);
$deaths = str_replace('<span id="ctl00_Main_lbl_death_cnt">', '', $Pdeaths);
$exp = str_replace('<span id="ctl00_Main_lbl_exp">', '', $Pexp);
$headshots = str_replace('<span id="ctl00_Main_lbl_headshot_kill_cnt">', '', $Pheadshots);
$tk = str_replace('<span id="ctl00_Main_lbl_friend_kill_cnt">', '', $Ptk);
$desert = str_replace('<span id="ctl00_Main_lbl_escape_cnt">', '', $Pdesert);
$rrromg = str_replace('<img src="images/RANKINGICON_BIG/', '', $Pranking);
$name = str_replace('<span id="ctl00_Main_lbl_charactername">', '', $Ppname);
$rankimg1 = "http://clan.z8games.com/images/RANKINGICON_BIG/".$rrromg;
if($style == 1) {$image_URL = "img1.png";}
if($style == 2) {$image_URL = "img2.png";}
if($style == 3) {$image_URL = "img3.png";}
if($style == 4) {$image_URL = "img4.png";}
if($style == 5) {$image_URL = "img5.png";}
if($style == 6) {$image_URL = "img6.png";}
if($style == 7) {$image_URL = "img7.png";}
if($style == 8) {$image_URL = "img8.png";}
if($style == 9) {$image_URL = "img9.png";}
if($style == 10) {$image_URL = "img10.png";}
if($style == 11) {$image_URL = "img11.png";}
if($style == 12) {$image_URL = "img12.png";}
if($style == 13) {$image_URL = "img13.png";}
if($style == 14) {$image_URL = "img14.png";}
if($style == 15) {$image_URL = "img15.png";}
$font = 'verdana.ttf';
$image = imagecreatefrompng($image_URL);
$text_colour = imagecolorallocate($image,215,213,220);
$white = imagecolorallocate($image,255,255,255);
// RANK IMAGE
$kdratio = $kills / $deaths;
$roundkdr = round($kdratio, 2);
// LEFT
imagettftext($image,7,0,57,41,$text_colour,$font,$kills);
imagettftext($image,7,0,57,56,$text_colour,$font,$deaths);
imagettftext($image,7,0,57,71,$text_colour,$font,$roundkdr);
// MIDDLE
imagettftext($image,7,0,156,41,$text_colour,$font,$wins);
imagettftext($image,7,0,156,56,$text_colour,$font,$losses);
imagettftext($image,7,0,156,71,$text_colour,$font,$exp);
// RIGHT
imagettftext($image,7,0,276,41,$text_colour,$font,$headshots);
imagettftext($image,7,0,276,56,$text_colour,$font,$tk);
imagettftext($image,7,0,276,71,$text_colour,$font,$desert);
// USERNAME
imagettftext($image,14,0,40,19,$white,$font,$name);
// CLAN
imagettftext($image,8,0,170,19,$white,$font,$clan);
header( "Content-type: image/png" );
imagepng($image);
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy($image);
?>
The data is located in "http://clan.z8games.com/charstat_cf.aspx?usn=", the script cannot retrieve the info from that website.. thats the unique problem. Btw, I think cURL is disabled too... Im using a free hosting and it is very limited.
I hope there's some way to make it... if not, thank you anyway XD