I've used the website bf2stats.com a few times, as I'm now playing Battlefield 2. In the discussion forums I've seen these cool signatures where people show off their scores. Because EA-Games blocked the access to the statistics from other websites, I decided to have a go at it myself. See the text under Read more for the script and a sample.

The script is of course built on parts that were made by others. The script retreives the statistics and generates a picture. It pretends to be gamespy, so for now it is not blocked by EA-games. With a simple Rewrite rule like
RewriteRule ^bf2statistics-([0-9]*).png /bf2statistics/image.php?nick=$1 [L]
you would be able to generate a link like

http://yourserver.com/bf2statistics-nickname.png

that would deliver your picture, or in fact anyone's picture. Be carefull, general access would cause a lot of traffic !

Requirements:

  • webserver
  • php with gd-library
  • internet-access (duh)
  • and the scripts including the pictures.

    Make sure you change the default username in the 21st line of the script 'image.php'. The script must be placed in a directory that is writable, so a file can be placed there to prevent excessive retreival of statistics for the same person, the script retreives the statistics just once per hour per person. The script accepts a parameter , so you can call it like http://yourserver.com/bf2statistics/image.php?nick=nickname . Sample output, the nick is just one I found with Google, it is not me:



    Anything can be changed, you could create the background by starting with a simple picture by replacing the function imagecreatetruecolor by imagecreatefromjpeg. Extra fields can be added by means of this legenda: (output from some other script, the nick is just one I found with Google, it is not me)

    0 - H D
    1 - pid 33526355 Account ID: : {0}
    2 - nick rmiller Account name: {0}
    3 - scor 4247 Global score: {0}
    4 - jond 1119542580 Date joined: {0}
    5 - wins 103 Wins: {0}
    6 - loss 77 Losses: : {0}
    7 - mode0 180 Game mode 0: {0}
    8 - mode1 0 Game mode 1: {0}
    9 - mode2 0 Game mode 2: {0}
    10 - time 167404 Total time played: {0}
    11 - smoc 0 {0,choice,0#Not |0 12 - fkit 3 Favorite kit: {0}
    13 - fmap 103 Favorite map: {0}
    14 - fveh 0 Favorite vehicle: {0}
    15 - fwea 0 Favorite weapon: : {0}
    16 - atm-0 74199 Time played (USA): {0}
    17 - atm-1 49027 Time played (MEC): {0}
    18 - atm-2 44175 Time played (China): {0}
    19 - awn-0 46 Wins (USA): {0}
    20 - awn-1 30 Wins (MEC): {0}
    21 - awn-2 27 Wins (China): {0}
    22 - alo-0 35 losses (USA): {0}
    23 - alo-1 22 losses (MEC): {0}
    24 - alo-2 20 losses (China): {0}
    25 - abr-0 70 Best round score (USA): {0}
    26 - abr-1 86 Best round score (MEC): {0}
    27 - abr-2 81 Best round score (China): {0}
    28 - ktm-0 25849 Time played while anti-tank: {0}
    29 - ktm-1 5785 Time played while assault: {0}
    30 - ktm-2 22021 Time played while engineer: {0}
    31 - ktm-3 61084 Time played while medic: {0}
    32 - ktm-4 5486 Time played while spec-ops: {0}
    33 - ktm-5 21587 Time played while support: {0}
    34 - ktm-6 17908 Time played while sniper: {0}
    35 - kkl-0 300 Kills while anti-tank: {0}
    36 - kkl-1 58 Kills while assault: {0}
    37 - kkl-2 245 Kills while engineer: {0}
    38 - kkl-3 555 Kills while medic: {0}
    39 - kkl-4 36 Kills while spec-ops: {0}
    40 - kkl-5 197 Kills while support: {0}
    41 - kkl-6 140 Kills while sniper: {0}
    42 - kdt-0 283 Deaths while anti-tank: {0}
    43 - kdt-1 52 Deaths while assault: {0}
    44 - kdt-2 198 Deaths while engineer: {0}
    45 - kdt-3 460 Deaths while medic: {0}
    46 - kdt-4 47 Deaths while spec-ops: {0}
    47 - kdt-5 154 Deaths while support: {0}
    48 - kdt-6 87 Deaths while sniper: {0}
    49 - kkd-0 300:283 Kill:death ratio while anti-tank: {0}
    50 - kkd-1 29:26 Kill:death ratio while assault: {0}
    51 - kkd-2 245:198 Kill:death ratio while engineer: {0}
    52 - kkd-3 111:92 Kill:death ratio while medic: {0}
    53 - kkd-4 36:47 Kill:death ratio while spec-ops: {0}
    54 - kkd-5 197:154 Kill:death ratio while support: {0}
    55 - kkd-6 140:87 Kill:death ratio while sniper: {0}
    56 - vtm-0 20271 Time using armor: {0}
    57 - vtm-1 6035 Time using aviator: {0}
    58 - vtm-2 6839 Time using air defense: {0}
    59 - vtm-3 19307 Time using helicopter: {0}
    60 - vtm-4 16473 Time using transport: {0}
    61 - vtm-5 0 Time using artillery: {0}
    62 - vtm-6 6366 Time using ground defense: {0}
    63 - vkl-0 322 Kills with armor: {0}
    64 - vkl-1 80 Kills with aviator: {0}
    65 - vkl-2 95 Kills with air defense: {0}
    66 - vkl-3 133 Kills with helicopter: {0}
    67 - vkl-4 175 Kills with transport: {0}
    68 - vkl-5 0 Kills with artillery: {0}
    69 - vkl-6 116 Kills with ground defense: {0}
    70 - vdt-0 92 Deaths by armor: {0}
    71 - vdt-1 51 Deaths by aviator: {0}
    72 - vdt-2 42 Deaths by air defense: {0}
    73 - vdt-3 112 Deaths by helicopter: {0}
    74 - vdt-4 109 Deaths by transport: {0}
    75 - vdt-5 0 Deaths by artillery: {0}
    76 - vdt-6 58 Deaths by ground defense: {0}
    77 - vac-0 0 Accuracy with armor: {0}%
    78 - vac-1 0 Accuracy with aviator: {0}%
    79 - vac-2 0 Accuracy with air defense: {0}%
    80 - vac-3 0 Accuracy with helicopter: {0}%
    81 - vac-4 0 Accuracy with transport: {0}%
    82 - vac-5 0 Accuracy with artillery: {0}%
    83 - vac-6 0 Accuracy with ground defense: {0}%
    84 - vkr-0 26 # roadkills with armor: {0}
    85 - vkr-1 15 # roadkills with aviator: {0}
    86 - vkr-2 8 # roadkills with air defense: {0}
    87 - vkr-3 27 # roadkills with helicopter: {0}
    88 - vkr-4 28 # roadkills with transport: {0}
    89 - vkr-5 0 # roadkills with artillery: {0}
    90 - vkr-6 17 # roadkills with ground defense: {0}
    91 - vrk 0 Road kills: {0}
    92 - wtm-0 27283 Time using assault rifles: {0}
    93 - wtm-1 118 Time using assault w/ grenade launcher: {0}
    94 - wtm-2 3314 Time using carbines: {0}
    95 - wtm-3 9478 Time using light machine guns: {0}
    96 - wtm-4 13089 Time using sniper rifles: {0}
    97 - wtm-5 881 Time using pistols: {0}
    98 - wtm-6 3606 Time using AT/AA: {0}
    99 - wtm-7 10692 Time using submachine guns: {0}
    100 - wtm-8 8085 Time using shotguns: {0}
    101 - wtm-9 71 Time using knife: {0}
    102 - wtm-10 793 Time using defibrillator: {0}
    103 - wtm-11 1328 Time using explosives (C4; claymore; AT mine): {0}
    104 - wtm-12 1028 Time using hand grenade: {0}
    105 - wkl-0 193 Kills with assault rifles: {0}
    106 - wkl-1 0 Kills with assault w/ grenade launcher: {0}
    107 - wkl-2 20 Kills with carbines: {0}
    108 - wkl-3 84 Kills with light machine guns: {0}
    109 - wkl-4 48 Kills with sniper rifles: {0}
    110 - wkl-5 13 Kills with pistols: {0}
    111 - wkl-6 31 Kills with AT/AA: {0}
    112 - wkl-7 66 Kills with submachine guns: {0}
    113 - wkl-8 37 Kills with shotguns: {0}
    114 - wkl-9 12 Kills with knife: {0}
    115 - wkl-10 0 Kills with defibrillator: {0}
    116 - wkl-11 28 Kills with explosives (C4; claymore; AT mine): {0}
    117 - wkl-12 12 Kills with hand grenade: {0}
    118 - wdt-0 248 Deaths by assault rifles: {0}
    119 - wdt-1 3 Deaths by assault w/ grenade launcher: {0}
    120 - wdt-2 32 Deaths by carbines: {0}
    121 - wdt-3 88 Deaths by light machine guns: {0}
    122 - wdt-4 50 Deaths by sniper rifles: {0}
    123 - wdt-5 20 Deaths by pistols: {0}
    124 - wdt-6 69 Deaths by AT/AA: {0}
    125 - wdt-7 127 Deaths by submachine guns: {0}
    126 - wdt-8 81 Deaths by shotguns: {0}
    127 - wdt-9 4 Deaths by knife: {0}
    128 - wdt-10 25 Deaths by defibrillator: {0}
    129 - wdt-11 36 Deaths by explosives (C4; claymore; AT mine): {0}
    130 - wdt-12 23 Deaths by hand grenade: {0}
    131 - wac-0 17 Accuracy with assault rifles: {0}%
    132 - wac-1 64 Accuracy with assault w/ grenade launcher: {0}%
    133 - wac-2 16 Accuracy with carbines: {0}%
    134 - wac-3 17 Accuracy with light machine guns: {0}%
    135 - wac-4 33 Accuracy with sniper rifles: {0}%
    136 - wac-5 29 Accuracy with pistols: {0}%
    137 - wac-6 48 Accuracy with AT/AA: {0}%
    138 - wac-7 14 Accuracy with submachine guns: {0}%
    139 - wac-8 18 Accuracy with shotguns: {0}%
    140 - wac-9 34 Accuracy with knife: {0}%
    141 - wac-10 61 Accuracy with defibrillator: {0}%
    142 - wac-11 21 Accuracy with explosives (C4; claymore; AT mine): {0}%
    143 - wac-12 45 Accuracy with hand grenade: {0}%
    144 - twsc 869 Teamwork score: {0}
    145 - cpcp 399 Captures: {0}
    146 - cacp 160 capturing assists: {0}
    147 - dfcp 96 Defended: {0}
    148 - heal 65 Heals: {0}
    149 - rviv 102 Revives: {0}
    150 - rsup 30 Resupplies: {0}
    151 - rpar 14 Repairs: {0}
    152 - tgte 0 Enemies targeted: {0}
    153 - dsab 85 Driver special ability: {0}
    154 - dkas 0 Driver kill assists: {0}
    155 - pkas 208 Passenger kill assists: {0}
    156 - cmsc 3062 Combat score: {0}
    157 - osaa 19 small-arms accuracy: {0}%
    158 - kill 1531 Kills: {0}
    159 - kila 208 Kill assists: : {0}
    160 - deth 1281 Deaths: {0}
    161 - suic 22 Suicides: {0}
    162 - bksk 14 Kill streak: {0}
    163 - wdsk 9 Death streak: {0}
    164 - tvcr 43895737 Top victim in round: {0}
    165 - topr 44308215 Top opponent in round: {0}
    166 - klpm 0.55 Kills/minute: : {0}
    167 - dtpm 0.46 Deaths/minute: {0}
    168 - ospm 1.52 Overall score/minute: {0}
    169 - klpr 8.51 Kills/round: : {0}
    170 - dtpr 7.12 Deaths/round: {0}
    171 - cdsc 2091 Commander score: {0}
    172 - tcdr 70640 Time as commander: {0}
    173 - bmap 6 Best round map: {0}
    174 - bbrs 86 Best round score: {0}
    175 - mbr-0 66 Best round score on Kubra Dam: {0}
    176 - mbr-1 49 Best round score on Mashtuur City: {0}
    177 - mbr-2 59 Best round score on Operation Clean Sweep: {0}
    178 - mbr-3 75 Best round score on Zatar Wetlands: {0}
    179 - mbr-4 70 Best round score on Strike at Karkand: {0}
    180 - mbr-5 53 Best round score on Sharqi Peninsula: {0}
    181 - mbr-6 86 Best round score on Gulf of Oman: {0}
    182 - mbr-100 47 Best round score on Daqing Oilfields: {0}
    183 - mbr-101 48 Best round score on Dalian Plant: {0}
    184 - mbr-102 81 Best round score on Dragon Valley: {0}
    185 - mbr-103 71 Best round score on FuShe Pass (The Glowing Pass?): {0}
    186 - mbr-104 0 Best round score on Dalian Plant (Hingan Hills?): {0}
    187 - mbr-105 56 Best round score on Songhua Stalemate: {0}
    188 - mwn-0 16 Wins on Kubra Dam: {0}
    189 - mwn-1 9 Wins on Mashtuur City: {0}
    190 - mwn-2 9 Wins on Operation Clean Sweep: {0}
    191 - mwn-3 6 Wins on Zatar Wetlands: {0}
    192 - mwn-4 6 Wins on Strike at Karkand: {0}
    193 - mwn-5 3 Wins on Sharqi Peninsula: {0}
    194 - mwn-6 10 Wins on Gulf of Oman: {0}
    195 - mwn-100 9 Wins on Daqing Oilfields: {0}
    196 - mwn-101 9 Wins on Dalian Plant: {0}
    197 - mwn-102 10 Wins on Dragon Valley: {0}
    198 - mwn-103 11 Wins on FuShe Pass (The Glowing Pass?): {0}
    199 - mwn-104 0 Wins on Dalian Plant (Hingan Hills?): {0}
    200 - mwn-105 5 Wins on Songhua Stalemate: {0}
    201 - mls-0 6 Losses on Kubra Dam: {0}
    202 - mls-1 10 Losses on Mashtuur City: {0}
    203 - mls-2 5 Losses on Operation Clean Sweep: {0}
    204 - mls-3 7 Losses on Zatar Wetlands: {0}
    205 - mls-4 6 Losses on Strike at Karkand: {0}
    206 - mls-5 10 Losses on Sharqi Peninsula: {0}
    207 - mls-6 3 Losses on Gulf of Oman: {0}
    208 - mls-100 1 Losses on Daqing Oilfields: {0}
    209 - mls-101 8 Losses on Dalian Plant: {0}
    210 - mls-102 4 Losses on Dragon Valley: {0}
    211 - mls-103 12 Losses on FuShe Pass (The Glowing Pass?) {0}
    212 - mls-104 0 Losses on Dalian Plant (Hingan Hills?): {0}
    213 - mls-105 5 Losses on Songhua Stalemate: {0}
    214 - mtm-0 23462 Time on Kubra Dam: {0}
    215 - mtm-1 12067 Time on Mashtuur City: {0}
    216 - mtm-2 12445 Time on Operation Clean Sweep: {0}
    217 - mtm-3 13446 Time on Zatar Wetlands: {0}
    218 - mtm-4 11814 Time on Strike at Karkand: {0}
    219 - mtm-5 10106 Time on Sharqi Peninsula: {0}
    220 - mtm-6 14778 Time on Gulf of Oman: {0}
    221 - mtm-100 7798 Time on Daqing Oilfields: {0}
    222 - mtm-101 13332 Time on Dalian Plant: {0}
    223 - mtm-102 14344 Time on Dragon Valley: {0}
    224 - mtm-103 27243 Time on FuShe Pass (The Glowing Pass?): {0}
    225 - mtm-104 0 Time on Dalian Plant (Hingan Hills?): {0}
    226 - mtm-105 6569 Time on Songhua Stalemate: {0}
    227 - mcm-0 13 Completed on Kubra Dam: {0}
    228 - mcm-1 13 Completed on Mashtuur City: {0}
    229 - mcm-2 7 Completed on Operation Clean Sweep: {0}
    230 - mcm-3 9 Completed on Zatar Wetlands: {0}
    231 - mcm-4 7 Completed on Strike at Karkand: {0}
    232 - mcm-5 7 Completed on Sharqi Peninsula: {0}
    233 - mcm-6 9 Completed on Gulf of Oman: {0}
    234 - mcm-100 4 Completed on Daqing Oilfields: {0}
    235 - mcm-101 9 Completed on Dalian Plant: {0}
    236 - mcm-102 8 Completed on Dragon Valley: {0}
    237 - mcm-103 12 Completed on FuShe Pass (The Glowing Pass?): {0}
    238 - mcm-104 0 Completed on Dalian Plant (Hingan Hills?): {0}
    239 - mcm-105 4 Completed on Songhua Stalemate: {0}
    240 - mic-0 9 Incomplete on Kubra Dam: {0}
    241 - mic-1 6 Incomplete on Mashtuur City: {0}
    242 - mic-2 7 Incomplete on Operation Clean Sweep: {0}
    243 - mic-3 4 Incomplete on Zatar Wetlands: {0}
    244 - mic-4 5 Incomplete on Strike at Karkand: {0}
    245 - mic-5 6 Incomplete on Sharqi Peninsula: {0}
    246 - mic-6 4 Incomplete on Gulf of Oman: {0}
    247 - mic-100 6 Incomplete on Daqing Oilfields: {0}
    248 - mic-101 8 Incomplete on Dalian Plant: {0}
    249 - mic-102 6 Incomplete on Dragon Valley: {0}
    250 - mic-103 11 Incomplete on FuShe Pass (The Glowing Pass?): {0}
    251 - mic-104 0 Incomplete on Dalian Plant (Hingan Hills?): {0}
    252 - mic-105 6 Incomplete on Songhua Stalemate: {0}
    253 - svr-0 0 0 Server IP or name: {0}
    254 - svr-1 0 1 Server IP or name: {0}
    255 - svr-2 0 2 Server IP or name: {0}
    256 - svr-3 0 3 Server IP or name: {0}
    257 - svr-4 0 4 Server IP or name: {0}
    258 - svr-5 0 5 Server IP or name: {0}
    259 - svr-6 0 6 Server IP or name: {0}
    260 - svr-7 0 7 Server IP or name: {0}
    261 - svr-8 0 8 Server IP or name: {0}
    262 - svr-9 0 9 Server IP or name: {0}
    263 - kick 3 Kicked: {0}
    264 - ban 0 Banned: {0}