Theme variable notes. This file is NOT meant to be the real documentation for the PsychoStats themes. These are simply notes that I've put together to help me later create the real DOCs, which will be HTML hyperlinked, etc. These notes are NOT COMPLETE! Variables are listed first. Sorted by the location in which the variable can be used (some of the detail of where certain variables can be used is still undocumented here). And the next section lists all of the LOOPING commands sectioned by each type of theme file. ------------------------------------------------------------------------------- GLOBAL VARS ------------ Global variables can be placed anywhere within any theme file. $ Any option within the stats.cfg file can be referenced in a theme. Just prefix the variable name with a dollar sign "$". Some options aren't relevant. Examples: $servername $adminname $adminemail Notes: This also means you can create NEW variable names in the stats.cfg file and reference them within a theme. $ Same as the stats.cfg file. Any variable in the theme.cfg file can be referenced as a "$variable" in a theme. And new variables can be created and referenced within the theme. $logsize Total size in Bytes/KB/MB of all log files parsed. $elaspedtime Total time elasped since the stats update began. Its useful to put this variable at the bottom of the index.* theme files to get a general idea of how long it took the update to occur. Note that each time you use this variable the time returned will be a little more then the last time (since time is constantly moving) $logstartdate $logenddate Starting/Ending log date to gather logs from. This is the time period in which logs were searched for to parse. Note, the logstartdate is actually going to be the most RECENT date and the logenddate will be the furthest date in the PAST logs will be searched. logstartdate will always be more recent then logenddate. Some think this is backwards. But its not, since PsychoStats is not limited to only parsing the most recent logs. You can specify a 'startdate' on the comand line to the 'stats' program. This is useful if you wanted to have a page that showed 'last months' stats, etc. Formated according to the 'format_time' and 'format_date' options in the theme.cfg. $todaystime $todaysdate Date and Time at which the stats update was last run/started. Formated according to the 'format_time' and 'format_date' options in the theme.cfg. $mapalltotal Total # of differnt maps played. $mapalltotalCTwins $mapalltotalTERRORISTwins $mapalltotalwins Total wins for all maps for each team specified. (where is any team for the MOD scanned) $mapalltotalplayed Total games played for all maps. The 'game' total is incremented everytime a new map is loaded. $mapalltotalrounds Total rounds played for all maps. $idx (used only in loops) 'idx' is only used within looping sections in the theme. 'idx' is the current count of the loop and always starts a 1. $includefile_filename_ext Specifies an external filename to insert into the current file. = first of filename ("_" is required AFTER the filename and is treated as a dot ".") = extension of the filename. Example: $includefile_banner_html The above variable would include the file "banner.html" into the current file. Any GLOBAL variable can be used within the filename specified. $indexhtml $awardshtml $weaponshtml $mapshtml $clanshtml Each variable will return the FIRST filename specified in the theme.cfg for the current theme. Its usefull to reference these variables when creating new themes, as it cuts down the amount of work required if theme filenames need to be changed, etc. $srvtotalconnects Total number of player connect events in the logs. $srvtotalcrashes Total times the server crashed (detected if a log file is not properly closed. $srvtotalrcon Total times an RCON command was issued. $srvtotalbadrcon Total times a bad RCON command was issued. ------------------------------------------------------------------------------- AWARD VARIABLES ---------------- Award variables can be used within 'index.html', 'award.html' and 'weapons.html' theme files. $awardweaponshortname $awardweaponname $awardweaponimg Current weapon award name. 'shortname' would return the name listed in the log file. IE: 'mp5navy', 'knife', 'scout', etc... 'name' would return the 'real' name for the weapon, as defined in the weapons.cfg file. 'img' would return an image tag for the weapon. ('link' can be added to the end of the variable to have a link returned as well, which points to the weapons page for the weapon) $awardweaponkills (inside awards loop within weapons.html only) Total kills for the current player and the current weapon in the awards loop. ('pct' can be used at the end of the variable and the percentage of ALL kills with this weapon will be returned) $awardweaponallkills Total kills for the weapon (all players combined). $awardweapontopkills Total kills for the #1 ranked player with the weapon. ('pct' can be used at the end of the variable and the percentage of ALL kills with this weapon will be returned) $awardtaskname Current award name. These awards are the tasks that players complete ingame, such as saving hostages or bombing targets, etc. Just like with the 'weapon' awards. 'link' can be added to the end of the variable to return a link to the awards HTML page. $awardtasktotal (inside awards loop within awards.html only) Total value for the current player and the current award. $awardtaskalltotal Total value for the award (all players combined). $awardtasktoptotal Total value for the #1 ranked player with the award. $awardweaponplrname $awardtaskplrname Player name of the current award or weapon. ('link' can be added to the end of the variable to have a link returned as well, which points to the players page, if ranked) $awardweapontopplrname $awardtasktopplrname #1 ranked player with the current award or weapon. ('link' can be added to the end of the variable to have a link returned as well, which points to the players page, if ranked) $awardtaskbonusvalue (inside awards loop within awards.html only) $awardtaskbonustype (inside awards loop within awards.html only) Bonus value awarded to players when they achieve something. The bonustype variable shows if the award is 'all', 'top' or 'none'. ------------------------------------------------------------------------------- PLAYER VARIABLES ----------------- These variables can be used within any 'player.html' theme file (as specified in the theme.cfg). These variables can also be used within some looping sections like within the main player listing on the index page. $plrname $plrnamelink The players name. 'link' will create an link for the players HTML page (or no link if the player is not ranked). $plrhtml The players HTML file. This can be used to manually create your own links using the players HTML page. Only the path/filename to the players HTML file is returned. 'quote' can be added to the end of the variable name to have all non alphanumeric characters quoted in the string. This is useful when using a theme that does server side parsing (like PHP). $plraliases $plrwonids $plripds Outputs the players aliases, wonids or IP's as a single line string seperated by tabs. 'quote' can be added to the end of the variable name to have all non alphanumeric characters quoted in the string. This is useful when using a theme that does server side parsing (like PHP). $plrclan (depreciated) $plrclantag $plrclanname $plrclanlink The players clan tag or clan name (if present in the clannames.cfg). If the player does not have a clantag then 'str_noclan' string from the theme.cfg will be returned instead. If there's no name for the clan, then the tag will be used instead. If 'link' is used then an link will be returned pointing to the players clanpage. 'quote' can be added to the end of the variable name to have all non alphanumeric characters quoted in the string. This is useful when using a theme that does server side parsing (like PHP). $plrlogo The players logo, if one is specified in the playerlogos.cfg file. If no logo exists for the player then the default logo in the playerlogos.cfg will be used. $plrlastdate $plrlasttime Last date and time the player connected to the server. formatted according to format_plrtime in theme.cfg. $plrlongesttime Longest time the player stayed connected to the server. $plrtotaltime Total time spent on the server by the player. $plrtotalvictims Total number of unique victims the player has killed. $plrct $plrterrorist $plrallies $plraxis Total times player has joined each team. Note, the variable name will represent the team name in the logs. Thus ANY mod can use a variable like this. IE: $plrblue for TFC. $plrdefusedpct Percentage of successful bomb defusals player has had. $plrbombedpct Percentage of successful bombings player has had. $plrsavedhostagepct Percentage of hostages player has saved/rescued. $plr If you look in the source code. Near the top you'll see a record template of all the variables used for a player. Any variable in the first 'tree' of that listing can be used for other player variables. I'll create a full listing in the DOC's at some point. ------------------------------------------------------------------------------- PLAYER MAP VARS ---------------- These vars are also located with the 'player.html' theme files. But are only located from within a player map loop. $plrmaptotaltime Total time the player has played on the current map. $plrmaptotal Total # of times the player has played the current map. $plrmapterrorist $plrmapct Total # of times the player has played as each team on the current map. $plrmapfavweaponshortname $plrmapfavweaponname $plrmapfavweaponimg Most used weapon on the map by the player. 'shortname' returns a name like: 'm4a1', or 'sg552' 'name' returns the long name found in the weapons.cfg file. 'img' returns a small image for the weapon. ('link' at the end of any of these variables will return a link for the current weapon awards page) $plrmaptotalkills $plrmaptotaldeaths Total kills or deaths the player had on the current map. ('pct' at the end of these variables will return a percentage reflecting the total for all kills or deaths for the player). $plrmapkdr Kill:Death ratio for the player on the current map. ------------------------------------------------------------------------------- PLAYER VICTIM VARS ------------------- These vars are also located with the 'player.html' theme files. But are only located from within a player victim lineup loop. $plrvictim $plrvictimlink Current victim name. 'link' will return a link to the victims HTML page if the victim ranked. $plrvictimtotalkills Total times the player has killed the victim. $plrvictimtotaldeaths Total times the victim has killed the player. $plrvictimrank Rank of the current victim $plrvictimkdr Kill:Death ratio of the player against the victim. $plrvictimfavweaponshortname $plrvictimfavweaponname $plrvictimfavweaponimg Most used weapon to kill the victim. 'shortname' returns a name like: 'm4a1', or 'sg552' 'name' returns the long name found in the weapons.cfg file. 'img' returns a small image for the weapon. ('link' at the end of any of these variables will return a link for the current weapon awards page) $plrvictimfavmapname $plrvictimfavmapimg Map played with the most kills against the victim. $plrvictimfavmaptotalkills Total kills on the map against the victim. ------------------------------------------------------------------------------- PLAYER IP, WONID and ALIAS VARS ----------------------- These vars are also located with the 'player.html' theme files. But are only located from within a plrwonids, plrips, or plraliases loop. $plralias (plraliases loop only) Current player alias that the player was seen using. $plraliastotal Total times the alias was seen. ('pct' at the end of this variable will return a percentage reflecting the total of all aliases for the player) $plripaddr (plripaddrs loop only) Current IP address that the player was seen using. $plripaddrtotal Total times the IP address was seen. ('pct' at the end of this variable will return a percentage reflecting the total of all IPs for the player) $plrwonid (plrwonids loop only) Current WONID that the player was seen using. $plrwonidtotal Total times the WONID was seen. ('pct' at the end of this variable will return a percentage reflecting the total of all WONIDs for the player) ------------------------------------------------------------------------------- CLANS VARS ----------- These variables are located within the 'clanpage.html' theme pages. $clantotalranked $clantotalrankedpct Total # of members that rank. 'pct' returns the percentage. $clankdr Clans combined Kill:Death ratio. $clanrank Clans average rank. $clanskill Clans average skill. $clantag Clantag for the clan. ie: [myclan] $clanname Clan NAME for the clan (specified in clannames.cfg). If no name exists, the actual clantag will be returned instead. $clanhtml Clans HTML page filename. $clanlogo Clans logo as defined in the clanlogos.cfg file. or the default if one does not exist. $clantotalkills $clantotaldeaths Clans combined total kills or deaths. $clantotalmembers Total # of members in the clan. $clantotalawards Total # of awards the clan has. ------------------------------------------------------------------------------- MAP VARS --------- These variables are located with the 'maps.html' theme files. $mapname $mapimg The name or image of the current map. ('link' can be added to the end of the variable to create a link to the maps detailed stats page) ('dllink' can be added to the end of the variable and if a downloadable ZIP type of file is available for this map, as specified in the stats.cfg file, a link will point to it) $mapavground Average round time for the map. formated as a compact time: '1m1s' $maptotalgametime Total time the map has been played on. $maplastdate $maplasttime Last time or date the map was played. $maptotalplayed Total times the map has been loaded/played. If 'pct' is appended the percentage of all games played is returned. $maptotalrounds Total # of rounds the map has run. If 'pct' is appended the percentage of all rounds is returned. $maptotalterroristwins $maptotalctwins $maptotalwins (any team name will work) Total times each team has won on the map. If 'pct' is appended the percentage of all team wins is returned. $maptotalctkills $maptotalterroristkills $maptotalkills (any team name will work) Total kills for each team on the map. If 'pct' is appended the percentage of all team kills is returned. $maptotaldefusedwins $maptotalvipwins $maptotalhostagewins $maptotalbombedwins $maptotalvipkilledwins Total times a team won using each of the methods listed. If 'pct' is appended the percentage of all team wins (by the current method) is returned. ------------------------------------------------------------------------------- INDEX.HTML LOOPS ----------------- Loops through all players (or a range of players specified by the HTML variable "playerrange"). All player specific variables are allowed inside this loop. Loops through all weapons to allow you to produce a listing of all weapons and the #1 ranked player with each weapon Loops through all task awards to allow you to produce a listing of all tasks and the #1 ranked player with each award. Loops through the hours (0-23) or days (1-31) and allows you to display the total connection attempts for each hour/day, including percentages. The scale variable allows you to specify the pixel scale to use when you want to create graphs from the output. Any number above 1 is valid. -- $srvhour, $srvhourtotal, $srvhoursize, $srvhourpct -- $srvday, $srvdaytotal, $srvdaysize, $srvdaypct ------------------------------------------------------------------------------- PLAYER.HTML LOOPS ------------------ Loops through all of the current players weapons. Loops through all of the current players maps. Loops through all of the known WONIDs for the player. Loops through all of the known IPs for the player. Loops through all of the victims that the player has killed (or been killed by) ------------------------------------------------------------------------------- WEAPON.HTML LOOPS ------------------ Loops through all of the known weapon names. Loops through all of the players ranked with the current weapon. ------------------------------------------------------------------------------- AWARD.HTML LOOPS ----------------- Loops through all of the known award names. Loops through all of the players ranked with the current award. ------------------------------------------------------------------------------- MAPS.HTML LOOPS ----------------- Loops through all of the known maps from the server. ------------------------------------------------------------------------------- MAPPAGE.HTML LOOPS ----------------- Loops through all of the ranked players (upto MapAwardMax) for each of the specified stats. Note, most stats only work for CS and not DOD. ------------------------------------------------------------------------------- CLANPAGE.HTML LOOPS -------------------- Loops through all of the members of the clan. Any PLAYER variable can be used inside this loop. ------------------------------------------------------------------------------- CLANS.HTML LOOPS ----------------- Loops through all of the known clans from the server. -------------------------------------------------------------------------------