$$include templatevariables.include$$
$$MinPlayersInRound=ReadConfig("/General/MinPlayersInRound")$$
$$MinRoundsPerPlayer=ReadConfig("/General/MinRoundsPerPlayer")$$
$$MAXMAINPAGEWEAPONS=ReadTemplateConfig("MAXMAINPAGEWEAPONS","10","Number of Weapons to display on the main page")$$
$$MAXMAINPAGECLASSES=ReadTemplateConfig("MAXMAINPAGECLASSES","10","Number of Player Classes to display on the main page")$$
$$MAXMAINPAGEMAPS=ReadTemplateConfig("MAXMAINPAGEMAPS","10","Number of Maps to display on the main page")$$
$$MAXMAINPAGEGAMETYPES=ReadTemplateConfig("MAXMAINPAGEGAMETYPES","10","Number of Game Types to display on the main page")$$
$$MAXMAINPAGELOCATIONS=ReadTemplateConfig("MAXMAINPAGELOCATIONS","10","Number of Kill Locations to display on the main page")$$
$$MAXAWARDPLAYERS=ReadTemplateConfig("AWARDPLAYERS","10","Number of players to display for each award")$$
$$MAXPLAYERLISTENTRIES=ReadTemplateConfig("MAXPLAYERLISTENTRIES","999","Maximum number of players to display on the Leaderboard")$$
$$MAXSPEECHLINES=ReadTemplateConfig("MAXSPEECHLINES","10","Number of speech entries to display on a players page")$$
$$MAXNEMESIS=ReadTemplateConfig("MAXNEMESIS","10","Number of enemies to display on a players page")$$
$$HOMEPAGEHREF=ReadTemplateConfig("HOMEPAGEHREF","http://www.statsgen.co.uk","Your home page html address")$$
$$HOMEPAGEBANNER=ReadTemplateConfig("HOMEPAGEBANNER","general/banner.jpg","A link to your clans banner image, displayed at the top of every stats page")$$
$$gameservertypes="COD4"$$
$$sortkey="skill"$$$$include playerlistallowed.include$$
$$sortkey="score"$$$$include playerlistallowed.include$$
$$sortkey="skillweighted"$$$$include playerlistallowed.include$$
$$sortkey="scoreweighted"$$$$include playerlistallowed.include$$
$$sortkey="kills"$$$$include playerlistallowed.include$$
$$sortkey="deaths"$$$$include playerlistallowed.include$$
$$sortkey="suicides"$$$$include playerlistallowed.include$$
$$sortkey="teamkills"$$$$include playerlistallowed.include$$
$$sortkey="teamwins"$$$$include playerlistallowed.include$$
$$sortkey="teamlosses"$$$$include playerlistallowed.include$$
$$sortkey="longestkillstreak"$$$$include playerlistallowed.include$$
$$sortkey="longestdeathstreak"$$$$include playerlistallowed.include$$
$$sortkey="longestteamkillstreak"$$$$include playerlistallowed.include$$
$$sortkey="duration"$$$$include playerlistallowed.include$$
$$sortkey="rounds"$$$$include playerlistallowed.include$$
$$include keytables.include$$
$$include keytableskills.include$$
$$updatestatus("Main Page")$$$$include mainpage.include$$
$$updatestatus("Awards Page")$$$$include awards.include$$
$$updatestatus("Ratio List")$$$$messagecentrekey="TopKillDeathRatio"$$$$title="^7Kill/Death Ratio"$$$$sortkey="ratio"$$$$include playerlists.include$$
$$updatestatus("Skill List")$$$$messagecentrekey="TopSkill"$$$$title="^7Skill"$$$$sortkey="skill"$$$$include playerlists.include$$
$$updatestatus("Score List")$$$$messagecentrekey="TopScore"$$$$title="^7Score"$$$$sortkey="score"$$$$include playerlists.include$$
$$updatestatus("Weighted Skill List")$$$$messagecentrekey="TopWeightedSkill"$$$$title="^7Skill Weighted "$$$$sortkey="skillweighted"$$$$include playerlists.include$$
$$updatestatus("Weighted Score List")$$$$messagecentrekey="TopWeightedScore"$$$$title="^7Score Weighted "$$$$sortkey="scoreweighted"$$$$include playerlists.include$$
$$updatestatus("Kill List")$$$$messagecentrekey="TopKills"$$$$title="^7Kills"$$$$sortkey="kills"$$$$include playerlists.include$$
$$updatestatus("Death List")$$$$messagecentrekey="TopDeaths"$$$$title="^7Deaths"$$$$sortkey="deaths"$$$$include playerlists.include$$
$$updatestatus("Team Kill List")$$$$messagecentrekey="TopTeamKills"$$$$title="^7Team Kills"$$$$sortkey="teamkills"$$$$include playerlists.include$$
$$updatestatus("Team Win List")$$$$messagecentrekey="TopTeamWins"$$$$title="^7Team Wins"$$$$sortkey="teamwins"$$$$include playerlists.include$$
$$updatestatus("Team Loss List")$$$$messagecentrekey="TopTeamLosses"$$$$title="^7Team Losses"$$$$sortkey="teamlosses"$$$$include playerlists.include$$
$$updatestatus("Kill Streak List")$$$$messagecentrekey="TopKillStreak"$$$$title="^7Kill Streak"$$$$sortkey="longestkillstreak"$$$$include playerlists.include$$
$$updatestatus("Team Kill Streak List")$$$$messagecentrekey="TopTeamKillStreak"$$$$title="^7Team Kill Streak"$$$$sortkey="longestteamkillstreak"$$$$include playerlists.include$$
$$updatestatus("Death Streak List")$$$$messagecentrekey="TopDeathStreak"$$$$title="^7Death Streak"$$$$sortkey="longestdeathstreak"$$$$include playerlists.include$$
$$updatestatus("Suicide List")$$$$messagecentrekey="TopSuicides"$$$$title="^7Suicides"$$$$sortkey="suicides"$$$$include playerlists.include$$
$$updatestatus("Time Played List")$$$$messagecentrekey="TopTimePlayed"$$$$title="^7Time Played"$$$$sortkey="duration"$$$$include playerlists.include$$
$$updatestatus("Rounds Played List")$$$$messagecentrekey="TopRoundsPlayed"$$$$title="^7Rounds"$$$$sortkey="rounds"$$$$include playerlists.include$$
$$sortkey="score"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="skill"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="skillweighted"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="scoreweighted"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="kills"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="deaths"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="ratio"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="teamkills"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="teamwins"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="teamlosses"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="longestkillstreak"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="longestteamkillstreak"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="longestdeathstreak"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="suicides"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="duration"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$sortkey="rounds"$$$$updatestatus("Clan List")$$$$include clanlist.include$$
$$updatestatus("Info Page")$$$$include info.include$$
$$updatestatus("Players")$$
$$playercount="0"$$
$$loop row as player index as index select count(*) as playercount from changedplayers$$$$playercount=player.playercount$$$$endloop playercount$$
$$loop row as player index as playerindex select *,coalesce(cast(kills as float)/cast(deaths as float),kills) as ratio from player where playerindex in (select idx from changedplayers) and dropped="N"$$
	$$updatestatus("Player %%playerindex%% of %%playercount%%")$$
	$$include player.include$$
$$endloop player$$