    php Battlefield 2 sig script
  * Copyright 2005, Nathan Lockett
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version, and provided that the above
  * copyright and permission notice is included with all distributed
  * copies of this or derived software.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * A copy of the GNU General Public License is available from the GNU
  * website at the following URL: http://www.gnu.org/licenses/gpl.txt
**************************************************************************************
Modified by MrNiceGuy for compability with BF2Statistics and www.bf2statistics.com
**************************************************************************************
Installation instructions:

before uploading the files extract them into a subfolder somewhere so you can edit them. after making all the changes needed below then upload everything in the subfolder you extracted the files in to your server.

Make sure the statsxml folder has READ/WRITE permission (it needs it because this is where the script read/writes all the cached info to/from files).
If you get an error reading or writing a file, then this is the cause of your problem, CHMOD the statsxmlfolder (and any files that you may already have in it) to have read and write permission

the you will definately want to change the settings in config.php. this file controls what pid it uses if none is specified and what pids to allow because you can go to sig.php?id=xxxxxxx where xxxxxx is your pid and it will show that persons pid. (or an error not authorized if they arent allowed). make sure you allow your pid or you will get the error. it also has how long to wait before getting new stats, and where to save the cached stats.
You probably want to change the $infotoget variable as well, this is the stats that the sig gets, see the scrollable box at the bottom of this post for a list of all the choices and what they are. if you cahnge this then you will need to change the theme.php to make it show these new stats that you are getting, and hid the ones that you dont want anymore.

you will probably also want to change theme.php that is in themes/default folder. this file controls the positioning of the stats and color/weight ect of the text, and what stats to show (if you change what stats the script gets, you will want to change what stats the script shows in this file)

the image it uses for your sig background is normal.png in the themes/default folder.

If bf2web is down, it will read from the cached file even if it has been longer than whatever $cachetime is set to. the only exception to this rule is that if bf2web is down AND there is no cache file for the player, then there will be an error informing that bf2web is down and no cache file exists.

i included the .htaccess file i use to make it so you can go to www.yourwebsite.com/xxxxxxx.png where xxxxxxx is your pid # and it will show it for you (for the forums that dont allow images with php extensions. if for some reason you dont want this function you can delete the httaccess file and it will still function properly but only work with sig.php?id=XXXXXXX)

If you have the script in a subdirectory, you will want to modify line 3 in the .htaccess file to point to that directory the sig.php is located in.
example below:
RewriteRule ^([0-9]*)\.png$ /subdirectoryname/sig.php?id=$1 [NC] 

*UPDATE 8-27*
The .htaccess still works the same was as before, however i added in a line to support themes.
still works(Assumes default theme) - http://www.kastechnology.com/44487783.png
giving it the theme name(in this case plain) - http://www.kastechnology.com/44487783|plain.png
some notes about theme names, the folder can only have A-Z, 0-9, _, and - in it. spaces or other characters wont work(but you could edit the .htaccess to change it if this was neccessary)

You can get other stats then the ones it is set up to get by default, you just need to edit $infotoget which is in config.php and also edit the theme.php to change what variables its showing and what it says before them.

Below is a list of all the different stats you can get from the bf2web stats. It is in a code box to make it not take up the whole page, you will have use the scroll on the box to see all of it.
   Code
 Meaning

ban
 # times banned 
 
bbrs
 Best round score 
 
bksk
 Best kill streak 
 
bmap
 Best round map 
 
cacp
 # assists capturing control point 
 
cdsc
 Commander score 
 
cmsc
 Combat score 
 
cpcp
 # times captured control point 
 
deth
 # deaths 
 
dfcp
 # times defended control point 
 
dkas
 # kill assists as driver 
 
dsab
 Driver special ability 
 
dtpm
 # deaths/minute 
 
dtpr
 # deaths/round played 
 
fkit
 Favorite kit 
 
fmap
 Favorite map 
 
fveh
 Favorite vehicle 
 
fwea
 Favorite weapon 
 
heal
 # heals 
 
jond
 Date joined 
 
kick
 # times kicked 
 
kila
 # kill assists 
 
kill
 # kills 
 
klpm
 # kills/minute 
 
klpr
 # kills/round played 
 
klsc
 Kill score 
 
loss
 # losses 
 
mode0
 Game mode 0 
 
mode1
 Game mode 1 
 
mode2
 Game mode 2 
 
osaa
 Overall small-arms accuracy 
 
ospm
 Overall score/minute 
 
pkas
 # kill assists as passenger 
 
rank
 Rank 
 
rpar
 # repairs 
 
rsup
 # resupplies 
 
rviv
 # revives 
 
scor
 Global score 
 
smoc
 Rank = SgtMaj of the Corps? 
 
suic
 # suicides 
 
tcdr
 Time as commander 
 
tsql
 Time as squad leader 
 
tsqm
 Time as squad member 
 
tlwf
 Time as lone wolf 
 
tgte
 # times targeted enemy 
 
time
 Total time played 
 
topr
 Top opponent in round 
 
tvcr
 Top victim in round 
 
twsc
 Teamwork score 
 
wdsk
 Worst death streak 
 
wins
 # wins 
 
lbtl
 Last battle time 
 
vacc
 Vehicle accuracy 
 
tkil
 Team Kill 
 
tdmg
 Team Damage 
 
tvdm
 Team Vehicle Damage 
 
vrk
 Road kill with vehicle 
 
mvns
 Top victim name 
 
mvrs
 Top victim rank 
 
mvks
 Top victim kills 
 
vmns
 Top opponent's name 
 
vmrs
 Top opponent's rank 
 
vmks
 Top opponent's kills 
 
abr-
 Best round score in army 
 
awr-
 Worst round score in army 
 
alo-
 # losses in army 
 
atm-
 Time in army 
 
awn-
 # wins in army 
 
kdt-
 # deaths using kit 
 
kkd-
 Kill:death ratio using kit 
 
kkl-
 # kills using kit 
 
ktm-
 Time playing kit 
 
mbr-
 Best round score on this map 
 
mcm-
 # completed on this map 
 
mic-
 # incomplete on this map 
 
mls-
 # losses on this map 
 
mtm-
 Time on this map 
 
mwn-
 # wins on this map 
 
svr-
 Server IP or name (svr-0 is the most recently used) 
 
vdt-
 # deaths by vehicle 
 
vkl-
 # kills with vehicle 
 
vkr-
 # roadkills with vehicle 
 
vtm-
 Time using vehicle 
 
vac-
 Accuracy with vehicle 
 
vkd-
 Kill:death ratio using vehicle 
 
wac-
 Accuracy with weapon 
 
wdt-
 # deaths by weapon 
 
wkl-
 # kills with weapon 
 
wtm-
 Time using weapon 
 
wkd-
 Kill:death ration using weapon 