[Preview]Crossfire Stats Signature
Self explanatory, and if not, here's the preview.
At the moment, it's going through the coding and will become available pretty soon for your private use on third party sites or etc.
It's an English one, slightly based on the one available from the German Crossfire Fansite.
But while it's still in preproduction, feedback is welcomed.
At the moment, it's going through the coding and will become available pretty soon for your private use on third party sites or etc.

It's an English one, slightly based on the one available from the German Crossfire Fansite.
But while it's still in preproduction, feedback is welcomed.
Comments
-
Hand written code, all this code does is freakin' retrieve the info, took a while to get it right. It's really messy and it could've been done better with simpler functions, but w/e.
<?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']; $style = $_GET['style']; if(!$id) { $id = "ID NOT ENTERED"; } $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 $Pmplayed_start = strpos($content,'<span id="ctl00_Main_lbl_play_cnt">'); $Pmplayed_end = strpos($content,'</span>',$Pmplayed_start); $Pmplayed = substr($content,$Pmplayed_start,$Pmplayed_end-$Pmplayed_start); // Wins $Pwins_start = strpos($content,'<span id="ctl00_Main_lbl_win_cnt">');$Pwins_end = strpos($content,'</span>',$Pwins_start); $Pwins = substr($content,$Pwins_start,$Pwins_end-$Pwins_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); // Kill/death Ratio preg_match_all ('|<[^>]+>(.*)|',$Pmplayed, $mplayed); preg_match_all ('|<[^>]+>(.*)|',$Pwins, $wins); preg_match_all ('|<[^>]+>(.*)|',$Plosses, $losses); preg_match_all ('|<[^>]+>(.*)|',$Pkills, $kills); preg_match_all ('|<[^>]+>(.*)|',$Pdeaths, $deaths); preg_match_all ('|<[^>]+>(.*)|',$Pexp, $exp); preg_match_all ('|<[^>]+>(.*)|',$Pheadshots, $headshots); preg_match_all ('|<[^>]+>(.*)|',$Ptk, $tk); preg_match_all ('|<[^>]+>(.*)|',$Pdesert, $desert); preg_match_all ('|<[^>]+>(.*)|',$Pclan, $clan); preg_match_all ('|<[^>]+>(.*)|',$Ppname, $pname); $kdratio = $kills[1][0] / $deaths[1][0]; echo "<b>Matches Played: </b>".$mplayed[1][0]."</br>"; echo "<b>Wins: </b>".$wins[1][0]."</br>"; echo "<b>Losses: </b>".$losses[1][0]."</br>"; echo "<b>Kills: </b>".$kills[1][0]."</br>"; echo "<b>Deaths: </b>".$deaths[1][0]."</br>"; echo "<b>Exp: </b>".$exp[1][0]."</br>"; echo "<b>Headshots: </b>".$headshots[1][0]."</br>"; echo "<b>Teamkills: </b>".$tk[1][0]."</br>"; echo "<b>Desertions: </b>".$desert[1][0]."</br>"; echo "<b>Clan: </b>".$clan[1][0]."</br>"; echo "<b>Name: </b>".$pname[1][0]."</br>"; echo "<b>KDR: </b>".round($kdratio, 2); ?>
With this code you can completely get everything about a person via the clan page. For anyone wondering, this code just page scraps.
Anywho, now we can move onto the simple stuff.
P.S anyone is free to use the code displayed above, however, credit me yo. -
Script is almost finished and works somewhat. Except for two things, one being the math to figure out the KDR and second being the code to add the rank image to the .php, to be honest. I got no clue on how to add that in, so if there's anyone out here who's willing to help, that would be great.
<?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 $clan = $_GET['clan']; $id = $_GET['id']; $style = $_GET['style']; if(!$id) { $id = "ID NOT ENTERED"; } $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 = "img1.png";} if($style == 3) {$image_URL = "img1.png";} if($style == 4) {$image_URL = "img1.png";} if($style == 5) {$image_URL = "img1.png";} if($style == 6) {$image_URL = "img1.png";} if($style == 7) {$image_URL = "img1.png";} if($style == 8) {$image_URL = "img1.png";} if($style == 9) {$image_URL = "img1.png";} if($style == 10) {$image_URL = "img1.png";} else{$image_URL = "img1.png";} $font = 'verdana.ttf'; $image = imagecreatefrompng($image_URL); $text_colour = imagecolorallocate($image,215,213,220); $white = imagecolorallocate($image,255,255,255); // RANK IMAGE // 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,"N/A"); // 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); ?>
Here we are, a working previewhttp://ixiongames.com/cfstat/stat.php?id=6288268&clan=K.Y.R
[img]http://ixiongames.com/cfstat/stat.php?id=3279888&clan=No.1™[/img]http://ixiongames.com/cfstat/stat.php?id=3279888&clan=No.1™
[img]http://ixiongames.com/cfstat/stat.php?id=5415790&clan=Carry Out[/img]http://ixiongames.com/cfstat/stat.php?id=5415790&clan=Carry Out
More styles will be coming, I just want to get the thing full working before hand though.
Edit: Just made the damn KDR work. simple math indeed, so now everything works except the rank image. I suppose, I know a way to do it but it'll take way to long on my part so I just won't do that. -
I went to your signature thinking that was the site for this. All that site was a bunch of colors flashing and playing some music. I thought there was a surprise at the end. Then I remembered you can make an "at-home" stroke from watching multiple colors flash on and off. I guess that's the surprise? Trying to kill me I see =.=yo.
Any waysssss, great job. Can't wait for it to be released. -
HellsAngel11 wrote: »I went to your signature thinking that was the site for this. All that site was a bunch of colors flashing and playing some music. I thought there was a surprise at the end. Then I remembered you can make an "at-home" stroke from watching multiple colors flash on and off. I guess that's the surprise? Trying to kill me I see =.=
Any waysssss, great job. Can't wait for it to be released.
Well you know, fletchowns is where it's at man. -
Script is up for testing.
http://ixiongames.com/cfstat/index.php
Go give it a run!
Note, don't type in "STYLE 3", only "3"
If you did it right, you'll get this > http://ixiongames.com/cfstat/yoursig.php?id=12013812&clan=3%24S&style=8 -
Sorry, my english isn't good.
Hi .. iPhoenixi, this is my new name on forum ;p
Only why this $_GET ?
I can make it on your template..
Real
Yes, I'll see if I can switch and remove the need for $_GET. You're free to come up with a better replacement code and contribute to the project. Credits will be given and what not.
Also,
http://ixiongames.com/cfstat/yoursig.php?id=6518220&clan=%09%C6%92inlan%C3%90%E2%84%A2&style=1
You don't put your ingame name, you put your USN.
Here is where the USN is:
P.S My fav is Style 3! I'd do Pandora any day of the week!
Categories
- All Categories
- Z8Games
- Off-Topic - Go To Game OT Forums
- 1 Z8 Forum Discussion & Suggestions
- 16 Z8Games Announcements
- Rules & Conduct
- 5.2K CrossFire
- 955 CrossFire Announcements
- 945 Previous Announcements
- 2 Previous Patch Notes
- 1.4K Community
- 122 Modes
- 602 Suggestions
- 85 Clan Discussion and Recruitment
- 274 CF Competitive Forum
- 19 CFCL
- 26 Looking for a Team?
- 705 CrossFire Support
- 52 Suggestion
- 116 Bugs
- 29 CrossFire Guides
- 166 Technical Issues
- 47 CrossFire Off Topic