-
Notifications
You must be signed in to change notification settings - Fork 2
/
DefaultTemplate1.cpp
1890 lines (1890 loc) · 172 KB
/
DefaultTemplate1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include <wx/wx.h>
void ExportTemplateFile(wxString &directory,wxArrayString &fileLines,char *filename);
void ExportTemplateFull(wxString &directory)
{
wxString filename;
wxArrayString fileLines;
wxString fileLine;
fileLines.Clear();
fileLine="$$include templatevariables.include$$";fileLines.Add(fileLine);
fileLine="$$MinPlayersInRound=ReadConfig(\"/General/MinPlayersInRound\")$$";fileLines.Add(fileLine);
fileLine="$$MinRoundsPerPlayer=ReadConfig(\"/General/MinRoundsPerPlayer\")$$";fileLines.Add(fileLine);
fileLine="$$MAXMAINPAGEWEAPONS=ReadTemplateConfig(\"MAXMAINPAGEWEAPONS\",\"10\",\"Number of Weapons to display on the main page\")$$";fileLines.Add(fileLine);
fileLine="$$MAXMAINPAGECLASSES=ReadTemplateConfig(\"MAXMAINPAGECLASSES\",\"10\",\"Number of Player Classes to display on the main page\")$$";fileLines.Add(fileLine);
fileLine="$$MAXMAINPAGEMAPS=ReadTemplateConfig(\"MAXMAINPAGEMAPS\",\"10\",\"Number of Maps to display on the main page\")$$";fileLines.Add(fileLine);
fileLine="$$MAXMAINPAGEGAMETYPES=ReadTemplateConfig(\"MAXMAINPAGEGAMETYPES\",\"10\",\"Number of Game Types to display on the main page\")$$";fileLines.Add(fileLine);
fileLine="$$MAXMAINPAGELOCATIONS=ReadTemplateConfig(\"MAXMAINPAGELOCATIONS\",\"10\",\"Number of Kill Locations to display on the main page\")$$";fileLines.Add(fileLine);
fileLine="$$MAXAWARDPLAYERS=ReadTemplateConfig(\"AWARDPLAYERS\",\"10\",\"Number of players to display for each award\")$$";fileLines.Add(fileLine);
fileLine="$$MAXPLAYERLISTENTRIES=ReadTemplateConfig(\"MAXPLAYERLISTENTRIES\",\"1000\",\"Maximum number of players to display on the Leaderboard\")$$";fileLines.Add(fileLine);
fileLine="$$MAXSPEECHLINES=ReadTemplateConfig(\"MAXSPEECHLINES\",\"10\",\"Number of speech entries to display on a players page\")$$";fileLines.Add(fileLine);
fileLine="$$MAXNEMESIS=ReadTemplateConfig(\"MAXNEMESIS\",\"10\",\"Number of enemies to display on a players page\")$$";fileLines.Add(fileLine);
fileLine="$$HOMEPAGEHREF=ReadTemplateConfig(\"HOMEPAGEHREF\",\"http://www.statsgen.co.uk\",\"Your home page html address\")$$";fileLines.Add(fileLine);
fileLine="$$HOMEPAGEBANNER=ReadTemplateConfig(\"HOMEPAGEBANNER\",\"images/banner.jpg\",\"A link to your clans banner image, displayed at the top of every stats page\")$$";fileLines.Add(fileLine);
fileLine="$$gameservertypes=\"COD4\"$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"skill\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"score\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"skillweighted\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"scoreweighted\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"kills\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"deaths\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"suicides\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"teamkills\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"teamwins\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"teamlosses\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"longestkillstreak\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"longestdeathstreak\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"longestteamkillstreak\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"duration\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"rounds\"$$$$include playerlistallowed.include$$";fileLines.Add(fileLine);
fileLine="$$include keytables.include$$";fileLines.Add(fileLine);
fileLine="$$include keytableskills.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Main Page\")$$$$include mainpage.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Awards Page\")$$$$include awards.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Ratio List\")$$$$messagecentrekey=\"TopKillDeathRatio\"$$$$title=\"^7KILL : DEATH RATIO\"$$$$sortkey=\"ratio\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Skill List\")$$$$messagecentrekey=\"TopSkill\"$$$$title=\"^7SKILL\"$$$$sortkey=\"skill\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Score List\")$$$$messagecentrekey=\"TopScore\"$$$$title=\"^7SCORE\"$$$$sortkey=\"score\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Weighted Skill List\")$$$$messagecentrekey=\"TopWeightedSkill\"$$$$title=\"^7SKILL WEIGHTED \"$$$$sortkey=\"skillweighted\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Weighted Score List\")$$$$messagecentrekey=\"TopWeightedScore\"$$$$title=\"^7SCORE WEIGHTED \"$$$$sortkey=\"scoreweighted\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Kill List\")$$$$messagecentrekey=\"TopKills\"$$$$title=\"^7KILLS\"$$$$sortkey=\"kills\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Death List\")$$$$messagecentrekey=\"TopDeaths\"$$$$title=\"^7DEATHS\"$$$$sortkey=\"deaths\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Team Kill List\")$$$$messagecentrekey=\"TopTeamKills\"$$$$title=\"^7TEAM KILLS\"$$$$sortkey=\"teamkills\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Team Win List\")$$$$messagecentrekey=\"TopTeamWins\"$$$$title=\"^7TEAM WINS\"$$$$sortkey=\"teamwins\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Team Loss List\")$$$$messagecentrekey=\"TopTeamLosses\"$$$$title=\"^7TEAM LOSSES\"$$$$sortkey=\"teamlosses\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Kill Streak List\")$$$$messagecentrekey=\"TopKillStreak\"$$$$title=\"^7KILL STREAK\"$$$$sortkey=\"longestkillstreak\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Team Kill Streak List\")$$$$messagecentrekey=\"TopTeamKillStreak\"$$$$title=\"^7TEAM KILL STREAK\"$$$$sortkey=\"longestteamkillstreak\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Death Streak List\")$$$$messagecentrekey=\"TopDeathStreak\"$$$$title=\"^7DEATH STREAK\"$$$$sortkey=\"longestdeathstreak\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Suicide List\")$$$$messagecentrekey=\"TopSuicides\"$$$$title=\"^7SUICIDES\"$$$$sortkey=\"suicides\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Time Played List\")$$$$messagecentrekey=\"TopTimePlayed\"$$$$title=\"^7TIME PLAYED\"$$$$sortkey=\"duration\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Rounds Played List\")$$$$messagecentrekey=\"TopRoundsPlayed\"$$$$title=\"^7ROUNDS\"$$$$sortkey=\"rounds\"$$$$include playerlists.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"score\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"skill\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"skillweighted\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"scoreweighted\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"kills\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"deaths\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"ratio\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"teamkills\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"teamwins\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"teamlosses\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"longestkillstreak\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"longestteamkillstreak\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"longestdeathstreak\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"suicides\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"duration\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$sortkey=\"rounds\"$$$$updatestatus(\"Clan List\")$$$$include clanlist.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Info Page\")$$$$include info.include$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Players\")$$";fileLines.Add(fileLine);
fileLine="$$playercount=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$loop row as player index as index select count(*) as playercount from changedplayers$$$$playercount=player.playercount$$$$endloop playercount$$";fileLines.Add(fileLine);
fileLine="$$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\"$$";fileLines.Add(fileLine);
fileLine=" $$updatestatus(\"Player %%playerindex%% of %%playercount%%\")$$";fileLines.Add(fileLine);
fileLine=" $$include player.include$$";fileLines.Add(fileLine);
fileLine="$$endloop player$$";fileLines.Add(fileLine);
fileLine="$$updatestatus(\"Rounds\")$$$$include roundlist.include$$";fileLines.Add(fileLine);
fileLine="$$roundcount=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$loop row as round index as index select count(*) as roundcount from changedrounds$$$$roundcount=round.roundcount$$$$endloop roundcount$$";fileLines.Add(fileLine);
fileLine="$$loop row as round index as roundindex select * from rounds,servers where roundidx in (select idx from changedrounds) and dropped=\"N\" and rounds.serverindex=servers.serveridx$$";fileLines.Add(fileLine);
fileLine=" $$updatestatus(\"Round %%roundindex%% of %%roundcount%%\")$$";fileLines.Add(fileLine);
fileLine=" $$include round.include$$";fileLines.Add(fileLine);
fileLine="$$endloop round$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"full.template");
fileLines.Clear();
fileLine="$$ReadTemplateConfig(\"description_gametype_COD5_sd\",\"One side defends two sites while the other side tries to plant a bomb at either. Which do you defend? Which do you Attack?\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD5_tdm\",\"Two Teams, lots of bullets, whichever team gets the most kills wins.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD5_dom\",\"Capture and hold control points, the more control points you hold the more your team's score increases.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD5_sab\",\"Each side has a target to attack with a common bomb, constant respawning makes teamwork essential.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD5_dm\",\"Every soldier for themselves in an all out bloodfest.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD5_ctf\",\"Each team tries to capture the enemies flag while also defending their own.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD5_koth\",\"Locate and capture a target then defend it from the enemy for as long as possible.\")$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_outskirts\",\"Red Army vs Wehrmacht<br><br>A large map with a village on the side of a hill. Buildings everywhere mean that no place is safe. A large central clock tower looks a good sniping spot but isn't that too obvious?\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_seelow\",\"Red Army vs Wehrmacht<br><br>A large map set on a hillside with a central covered train line offering good shooting positions for both the top and bottom of the hill. Two large open tunnels under the train line offer quick, but dangerous routes between the top and bottom of the hill. One has a river flowing through it running next to a wheelhouse. A covered tunnel allows for a safer, but more obvious route.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_roundhouse\",\"Red Army vs Wehrmacht<br><br>A large engineering yard with a central wheel house surrounded by high vantage point walkways, towers and buildings\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_courtyard\",\"Imperial Army vs Marine Raiders<br><br>A medium sized flat map with lots of open topped corridors to navigate while trying to avoid being shot.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_asylum\",\"Red Army vs Wehrmacht<br><br>A cramped and claustrophic map set in an old destroyed insane asylum with a central courtyard overlooked by windows. The distant moans of previous inhabitants haunt the players as they attempt to stay alive.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_downfall\",\"Red Army vs Wehrmacht<br><br>The final battle of the German Reich. A long map with high steps on either side giving sniper and rifle vantage points over the middle of the map. Trenches on the left and right offer cover for shorter range fire. Three sets of central bunkers are separated by deadly open spaces.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_shrine\",\"Imperial Army vs Marine Raiders<br><br>A long map with an open central area leading into a Japanese shrine makes taking control of this map very difficult as there are lots of sniping and rifling positions on all sides.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_suburban\",\"Red Army vs Wehrmacht<br><br>A tight close quarters battle is guaranteed in this shattered village above a train line. Destroyed buildings and abandoned goods carriages offer protection and shooting strongholds.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_airfield\",\"Imperial Army vs Marine Raiders<br><br>A large open map with an underground tunnel partially connecting two halves. A crashed plane, boxes and destroyed vehicles offer cover for skilled riflers as well as several enclosed buildings.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_makin\",\"Imperial Army vs Marine Raiders<br><br>A Japanese fishing village at night on a beach at the edge of the jungle with the tide in gives lots of close quarter killing opportunities.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_makin_day\",\"Imperial Army vs Marine Raiders<br><br>A Japanese fishing village on a beach at the edge of the jungle while the tide has gone out gives lots of close quarter killing opportunities.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_hangar\",\"Imperial Army vs Marine Raiders<br><br>An aircraft hangar surrounded by multiple buildings. The hangar may see a safe place to hole up but getting trapped in there may be the last thing you do.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_castle\",\"Imperial Army vs Marine Raiders<br><br>Two high vantage points look down upon a central Japanese garden with cherry blossoms in full bloom.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_kneedeep\",\"Imperial Army vs Marine Raiders<br><br>A Japanese village set amongst a sprawling swamp. Many huts provide perfect hiding holes for cautious soldier.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_nachtfeuer\",\"Red Army vs Wehrmacht<br><br>Night, a city on fire, and soldiers fighting through the cramped conditions to become victorious.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_subway\",\"Red Army vs Wehrmacht<br><br>Two ends of an underground trainstation. Tunnels on either side give duplicate routes from one end to the other.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD5_mp_dome\",\"Red Army vs Wehrmacht<br><br>A close quarters battle atop the Reichstadt dome gives you know time to think but plenty of time to die.\")$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_backlot\",\"Opfor vs Marines<br><br>A destroyed town with many buildings surrounding a central area. A multi-floor factory offers many rifling points.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_bloc\",\"Spetsnaz vs S.A.S.<br><br>Eastern European block of flats surround each side of a courtyard with a central statue. A swimming pool to the rear provides a last stand hiding spot.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_bog\",\"Opfor vs Marines<br><br>A dirty, rainy, open piece of ground with an abandoned bus and multiple storage crates offering cover. Shops on the left give additional hiding spots.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_broadcast\",\"Opfor vs Marines<br><br>A television studio with many rooms offering close quarters combat. A central computer room with overlooking balcony offers a quick, but dangerous, route to the whole building. Roof access from the large carpark gives fast access to the interior.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_carentan\",\"Spetsnaz vs S.A.S.<br><br>An Asian take on an old favourite. A 3 story building in the center of the map gives control over most of the map and is essential to capture.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_cargoship\",\"Spetsnaz vs S.A.S.<br><br>Battle across the deck of a rain-drenched cargo ship. Storage crates offer cover and climing points for this close-quarter bloodfest.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_citystreets\",\"Opfor vs Marines<br><br>A market square surrounded by buildings with long streets down two sides. Don't fall down the well!\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_convoy\",\"Opfor vs Marines<br><br>A central road on a ridge separates two areas with many buildings which offer good rifling spots. Two sewer tunnels allow for hidden access from one side of the road to the other.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_countdown\",\"Spetsnaz vs S.A.S.<br><br>Missle silos and platforms fill the center of this map with multiple hangars around the edge.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_crash\",\"Opfor vs Marines<br><br>Black Hawk Down. A crashed helicopter in the center of a set of shops and houses with a tall multistory building with roof access overlooking the entire map\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_crash_snow\",\"Opfor vs Marines<br><br>Black Hawk Down, and Santa. A crashed helicopter in the center of a set of shops and houses with a tall multistory building with roof access overlooking the entire map\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_creek\",\"Spetsnaz vs S.A.S.<br><br>A deep ravine with a high ridge on either side provide the central point to this map. A tunnel allows access under the ridge into the ravine and houses at the top of one side of the ridge offer good sniping points.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_crossfire\",\"Opfor vs Marines<br><br>A long open street leads from top to bottom of this map. Snipers really make a casual stroll down the road possibly the last thing you do. Building access on either side offer a safer, but more convoluted route between the top and bottom.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_farm\",\"Spetsnaz vs S.A.S.<br><br>It's raining hard in this farmyard. Multiple greenhouses at one side. Building access on one side, grain silos on the other give access from top to bottom of the map.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_overgrown\",\"Spetsnaz vs S.A.S.<br><br>A central ravine with two bridges crossing it at the top and bottom giving the player access to either the street or the field side. Field side has a central farm house with attic access. A barnhouse also offers cover across most of the field making a walk through the hay a most dangerous prospect.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_pipeline\",\"Spetsnaz vs S.A.S.<br><br>Two multifloor factories form the main central area of this map. A train line on one side with abandoned carriages offering good hiding holes. A set of tunnels connect most parts of the map for that surprise attack.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_showdown\",\"Opfor vs Marines<br><br>A small square surrounded by second floor corridors. Fences block one side of the map to the other making it either - through the square or over the top.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_strike\",\"Opfor vs Marines<br><br>A central street surrounded on one one side by shops, one side a market square replete with statue. Overlooked by some multifloor buildings offering good rifling spots.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_map_COD4_mp_vacant\",\"Spetsnaz vs S.A.S.<br><br>A large open factory floor with multiple connected buildings. Outside the factory is a large area with many storage crates giving good cover.\")$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD4_sd\",\"One side defends two sites while the other side tries to plant a bomb at either. Which do you defend? Which do you Attack?\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD4_war\",\"Two Teams, lots of bullets, whichever team gets the most kills wins.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD4_dom\",\"Capture and hold control points, the more control points you hold the more your team's score increases.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD4_koth\",\"Locate and capture a target then defend it from the enemy for as long as possible.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD4_sab\",\"Each side has a target to attack with a common bomb, constant respawning makes teamwork essential.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD4_dm\",\"Every soldier for themselves in an all out bloodfest.\")$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD2_esd\",\"One side defends two sites while the other side tries to plant a bomb at either. Which do you defend? Which do you Attack? As dead players respawn teamwork is essential.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD2_ctf\",\"Each team tries to capture the enemies flag while also defending their own.\")$$";fileLines.Add(fileLine);
fileLine="$$ReadTemplateConfig(\"description_gametype_COD2_sd\",\"One side defends two sites while the other side tries to plant a bomb at either. Which do you defend? Which do you Attack?\")$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"templatevariables.include");
fileLines.Clear();
fileLine="$$%%sortkey%%allowed=\"N\"$$";fileLines.Add(fileLine);
fileLine="$$loop row as player index as index select max(%%sortkey%%) - min(%%sortkey%%) as difference from view_player$$";fileLines.Add(fileLine);
fileLine=" $$if (player.difference EQUALS \"0\")$$";fileLines.Add(fileLine);
fileLine=" $$%%sortkey%%allowed=\"N\"$$";fileLines.Add(fileLine);
fileLine=" $$else$$";fileLines.Add(fileLine);
fileLine=" $$%%sortkey%%allowed=\"Y\"$$";fileLines.Add(fileLine);
fileLine=" $$%%sortkey%%allowed=ReadTemplateConfig(\"Display_%%sortkey%%\",%%sortkey%%allowed,\"Turn on or off the %%sortkey%% column on the leaderboard\")$$";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine="$$endloop player$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"playerlistallowed.include");
fileLines.Clear();
fileLine="$$tablename=\"action\"$$$$include keytable.include$$";fileLines.Add(fileLine);
fileLine="$$tablename=\"class\"$$$$include keytable.include$$";fileLines.Add(fileLine);
fileLine="$$tablename=\"gametype\"$$$$include keytable.include$$";fileLines.Add(fileLine);
fileLine="$$tablename=\"location\"$$$$include keytable.include$$";fileLines.Add(fileLine);
fileLine="$$tablename=\"map\"$$$$include keytable.include$$";fileLines.Add(fileLine);
fileLine="$$tablename=\"team\"$$$$include keytable.include$$";fileLines.Add(fileLine);
fileLine="$$tablename=\"weapon\"$$$$include keytable.include$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"keytables.include");
fileLines.Clear();
fileLine="$$loop row as key index as index select * from %%tablename%%$$";fileLines.Add(fileLine);
fileLine=" $$%%tablename%%_%%key.idx%%_id=key.id$$";fileLines.Add(fileLine);
fileLine=" $$%%tablename%%_%%key.idx%%_realname=key.realname$$";fileLines.Add(fileLine);
fileLine=" $$%%tablename%%_%%key.idx%%_image=key.image$$";fileLines.Add(fileLine);
fileLine="$$endloop row$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"keytable.include");
fileLines.Clear();
fileLine="$$killstablename=\"gametype\"$$$$totalstable=\"killtotalgametypes\"$$$$include keytablekills.include$$";fileLines.Add(fileLine);
fileLine="$$killstablename=\"map\"$$$$totalstable=\"killtotalmaps\"$$$$include keytablekills.include$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"keytableskills.include");
fileLines.Clear();
fileLine="$$loop row as totalskey index as keyindex select * from %%killstablename%%$$";fileLines.Add(fileLine);
fileLine=" $$description=ReadTemplateConfig(\"description_%%killstablename%%_%%totalskey.id%%\",\"No description available\")$$";fileLines.Add(fileLine);
fileLine=" $$loop row as killscount index as countindex select sum(kills) as kills, sum(teamkills) as teamkills, sum(suicides) as suicides from %%totalstable%%$$";fileLines.Add(fileLine);
fileLine=" $$totalkills=killscount.kills$$";fileLines.Add(fileLine);
fileLine=" $$totalsuicides=killscount.suicides$$";fileLines.Add(fileLine);
fileLine=" $$totalteamkills=killscount.teamkills$$";fileLines.Add(fileLine);
fileLine=" $$endloop$$";fileLines.Add(fileLine);
fileLine=" $$openfile %%killstablename%%_%%totalskey.id%%.html$$$$updatestatus(\"%%killstablename%%_%%totalskey.id%%.html\")$$";fileLines.Add(fileLine);
fileLine=" $$include menu.include$$";fileLines.Add(fileLine);
fileLine=" <table border=0 valign=top>";fileLines.Add(fileLine);
fileLine=" <tr valign=top>";fileLines.Add(fileLine);
fileLine=" <td valign=top width=50%>";fileLines.Add(fileLine);
fileLine=" <table border=1 valign=top>";fileLines.Add(fileLine);
fileLine=" <tr valign=top>";fileLines.Add(fileLine);
fileLine=" <td valign=top>";fileLines.Add(fileLine);
fileLine=" $$if (%%killstablename%%_%%totalskey.idx%%_image !EQUALS \"\")$$";fileLines.Add(fileLine);
fileLine=" <img src=\"$$%%killstablename%%_%%totalskey.idx%%_image$$\"><br>";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" <td valign=top>";fileLines.Add(fileLine);
fileLine=" <table border=0 cellspacing=1 valign=top>";fileLines.Add(fileLine);
fileLine=" <tr><th align=left>Name</th><td>$$%%killstablename%%_%%totalskey.idx%%_realname$$</td></th></tr>";fileLines.Add(fileLine);
fileLine=" <tr><th align=left>Total Kills</th><td>$$totalkills$$</td></tr>";fileLines.Add(fileLine);
fileLine=" <tr><th align=left>Total Suicides</th><td>$$totalsuicides$$</td></tr>";fileLines.Add(fileLine);
fileLine=" <tr><th align=left>Total Teamkills</th><td>$$totalteamkills$$</td></tr>";fileLines.Add(fileLine);
fileLine=" <tr><td align=left colspan=2>$$description$$</td></tr>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" <td>";fileLines.Add(fileLine);
fileLine=" <table cellspacing=1 border=1 class=nameplate align=left>";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <th>#</th>";fileLines.Add(fileLine);
fileLine=" <th>Player</th>";fileLines.Add(fileLine);
fileLine=" <th>Kills</th>";fileLines.Add(fileLine);
fileLine=" <th>Deaths</th>";fileLines.Add(fileLine);
fileLine=" <th>Team Kills</th>";fileLines.Add(fileLine);
fileLine=" <th>Suicides</th>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" $$playerdisplaydropped=\"N\"$$";fileLines.Add(fileLine);
fileLine=" $$loop row as kills index as killsindex select player.playerindex as playeridx,name,dropped,itemindex,%%totalstable%%.kills as totalkills,%%totalstable%%.deaths as totaldeaths,%%totalstable%%.suicides as totalsuicides,%%totalstable%%.teamkills as totalteamkills from %%totalstable%%,player where itemindex='%%totalskey.idx%%' and dropped='N' and player.playerindex=%%totalstable%%.playerindex order by totalkills desc,totaldeaths asc$$";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <td>$$killsindex$$</td>";fileLines.Add(fileLine);
fileLine=" <td>$$playerdisplayplayerindex=kills.playeridx$$$$playerdisplayname=kills.name$$$$include playerdisplay.include$$</td>";fileLines.Add(fileLine);
fileLine=" <td>$$kills.totalkills$$</td>";fileLines.Add(fileLine);
fileLine=" <td>$$kills.totaldeaths$$</td>";fileLines.Add(fileLine);
fileLine=" <td>$$kills.totalteamkills$$</td>";fileLines.Add(fileLine);
fileLine=" <td>$$kills.totalsuicides$$</td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" $$endloop$$";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" $$closefile$$";fileLines.Add(fileLine);
fileLine="$$endloop$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"keytablekills.include");
fileLines.Clear();
fileLine="<head>";fileLines.Add(fileLine);
fileLine=" <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">";fileLines.Add(fileLine);
fileLine=" <script type=\"text/javascript\" src=\"dobuttons.js\">";fileLines.Add(fileLine);
fileLine=" </script>";fileLines.Add(fileLine);
fileLine=" <script type=\"text/javascript\" src=\"oodomimagerollover.js\">";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine=" /***********************************************";fileLines.Add(fileLine);
fileLine=" * DOM Image Rollover II- By Adam Smith (http://www.codevendor.com)";fileLines.Add(fileLine);
fileLine=" * script featured on and available at Dynamic Drive (http://www.dynamicdrive.com)";fileLines.Add(fileLine);
fileLine=" * Keep this notice intact for usage please";fileLines.Add(fileLine);
fileLine=" ***********************************************/";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine=" </script>";fileLines.Add(fileLine);
fileLine="</head>";fileLines.Add(fileLine);
fileLine="<body>";fileLines.Add(fileLine);
fileLine=" $$if (HOMEPAGEBANNER !EQUALS \"\")$$";fileLines.Add(fileLine);
fileLine=" <table bgcolor=\"#000000\" border=0 class=nameplate bordercolor=000000 cellspacing=0 align=center>";fileLines.Add(fileLine);
fileLine=" <tr align=\"center\"> ";fileLines.Add(fileLine);
fileLine=" <td><img src=\"$$HOMEPAGEBANNER$$\" align=center></td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" $$else$$";fileLines.Add(fileLine);
fileLine=" <table bgcolor=\"#000000\" border=0 class=nameplate bordercolor=000000 cellspacing=0 align=center>";fileLines.Add(fileLine);
fileLine=" <tr align=\"center\"> ";fileLines.Add(fileLine);
fileLine=" <td><img src=\"http://www.statsgen.co.uk/images/banner.gif\" align=center></td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine=" <table cellspacing=0 border=0 class=menustyle align=center>";fileLines.Add(fileLine);
fileLine=" <tr align=center>";fileLines.Add(fileLine);
fileLine=" <th id=index colspan=8><b>Last Updated: $$FormatDate(\"%A %d %B %Y %H:%M:%S\",ReadStatistic(\"starttime\"))$$<b></th>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" $$if (HOMEPAGEHREF !EQUALS \"\")$$ ";fileLines.Add(fileLine);
fileLine=" <td width=106px align=center><b><a href=\"$$HOMEPAGEHREF$$\" target=\"_blank\"><img src=\"images/home.gif\" srcover=\"images/homea.gif\" alt=\"Home\" border=\"0\"></a></b></td>";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine=" <td width=106px align=center><b><a href=\"index.html\"><img src=\"images/server.gif\" srcover=\"images/servera.gif\" alt=\"Server\" border=\"0\"></a></b></td>";fileLines.Add(fileLine);
fileLine=" <td width=106px align=center><b><a href=\"awardlist.html\"><img src=\"images/awards.gif\" srcover=\"images/awardsa.gif\" alt=\"Awards\" border=\"0\"></a></b></td>";fileLines.Add(fileLine);
fileLine=" <td width=106px align=center><b><a href=\"playerlist_kills.html\"><img src=\"images/leaderboard.gif\" srcover=\"images/leaderboarda.gif\" alt=\"Leaderboard\" border=\"0\"></a></b></td>";fileLines.Add(fileLine);
fileLine=" <td width=106px align=center><b><a href=\"clanlist_kills.html\"><img src=\"images/clans.gif\" srcover=\"images/clansa.gif\" alt=\"Clans\" border=\"0\"></a></b></td>";fileLines.Add(fileLine);
fileLine=" <td width=106px align=center><b><a href=\"roundlist.html\"><img src=\"images/rounds.gif\" srcover=\"images/roundsa.gif\" alt=\"Rounds\" border=\"0\"></a></b></td>";fileLines.Add(fileLine);
fileLine=" <td width=106px align=center><b><a href=\"info.html\"><img src=\"images/statsinfo.gif\" srcover=\"images/statsinfoa.gif\" alt=\"Stats Info\" border=\"0\"></a></b></td>";fileLines.Add(fileLine);
fileLine=" <td width=106px align=center><b><a href=\"http://www.statsgen.co.uk/\"><img src=\"images/statsgen.gif\" srcover=\"images/statsgena.gif\" alt=\"Statsgen\" border=\"0\"></a></b></td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine="</head>";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"menu.include");
fileLines.Clear();
fileLine="$$tablename=\"playerdataavatars\"$$$$include playerprofilecomponent.include$$";fileLines.Add(fileLine);
fileLine="$$if (playerdisplaydropped EQUALS \"Y\")$$";fileLines.Add(fileLine);
fileLine=" $$colouredtext2html(playerdisplayname)$$";fileLines.Add(fileLine);
fileLine=" $$if (playerdataavatars !EQUALS \"\")$$";fileLines.Add(fileLine);
fileLine=" <br>";fileLines.Add(fileLine);
fileLine=" <img src=\"$$playerdataavatars$$>";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine="$$else$$";fileLines.Add(fileLine);
fileLine=" <a href=\"player_$$hash(playerdisplayname)$$.html\">";fileLines.Add(fileLine);
fileLine=" $$colouredtext2html(playerdisplayname)$$";fileLines.Add(fileLine);
fileLine=" $$if (playerdataavatars !EQUALS \"\")$$";fileLines.Add(fileLine);
fileLine=" <br>";fileLines.Add(fileLine);
fileLine=" <img src=\"$$playerdataavatars$$\" width=200px>";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine=" </a>";fileLines.Add(fileLine);
fileLine="$$endif$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"playerdisplay.include");
fileLines.Clear();
fileLine="$$%%tablename%%=\"\"$$";fileLines.Add(fileLine);
fileLine="$$loop row as playerprofilecomponent index as playerprofilecomponentindex select * from %%tablename%% where playerindex='%%playerdataplayerindex%%'$$";fileLines.Add(fileLine);
fileLine=" $$%%tablename%%=playerprofilecomponent.playerdata$$";fileLines.Add(fileLine);
fileLine="$$endloop$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"playerprofilecomponent.include");
fileLines.Clear();
fileLine="$$openfile index.html$$";fileLines.Add(fileLine);
fileLine="$$pagetitle=\"%%gameservertypes%% Server Stats\"$$$$include menu.include$$";fileLines.Add(fileLine);
fileLine="$$loop row as server index as serverindex select * from servers$$";fileLines.Add(fileLine);
fileLine=" $$loop row as servervariable index as variableindex select * from servervariables where serveridx='%%server.serveridx%%'$$";fileLines.Add(fileLine);
fileLine=" $$%%lowercase(servervariable.variable)%%=servervariable.value$$";fileLines.Add(fileLine);
fileLine=" $$endloop servervariable$$";fileLines.Add(fileLine);
fileLine=" <table border=0 class=nameplate align=center>";fileLines.Add(fileLine);
fileLine=" <td width=699 height=99 background=\"images/nameplate4.jpg\">";fileLines.Add(fileLine);
fileLine=" <div align=\"center\">";fileLines.Add(fileLine);
fileLine=" $$colouredtext2html(sv_hostname)$$";fileLines.Add(fileLine);
fileLine=" </div>";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" <br> ";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine=" <table cellspacing=0 border=0 width=650px align=center class=style3> ";fileLines.Add(fileLine);
fileLine=" ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>IP</th><td height=27px width=150px>$$server.hostname$$$$if (server.gameport !EQUALS \"-1\")$$:$$server.gameport$$$$endif$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Logfile Size</th><td height=27px width=150px>$$server.logfilesize$$</td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Rounds to Register</th><td height=27px width=150px>$$MinRoundsPerPlayer$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Minimum Per Round</th><td height=27px width=150px>$$MinPlayersInRound$$</td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" $$include servervariables.include$$";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" <br>";fileLines.Add(fileLine);
fileLine="$$endloop server$$";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<tr>";fileLines.Add(fileLine);
fileLine=" <td>";fileLines.Add(fileLine);
fileLine=" <table align=center cellspacing=0 border=0> ";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <td valign=top>";fileLines.Add(fileLine);
fileLine=" <table class=style4>";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <td>";fileLines.Add(fileLine);
fileLine=" $$include mainpageweapons.include$$";fileLines.Add(fileLine);
fileLine=" $$include mainpageclasses.include$$";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" <td valign=top>";fileLines.Add(fileLine);
fileLine=" <table class=style4>";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <td>";fileLines.Add(fileLine);
fileLine=" $$include mainpagemaps.include$$";fileLines.Add(fileLine);
fileLine=" $$include mainpagegametypes.include$$";fileLines.Add(fileLine);
fileLine=" $$include mainpagelocations.include$$";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$closefile$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"mainpage.include");
fileLines.Clear();
fileLine="$$IF (server.servertype EQUALS \"COD1\")$$";fileLines.Add(fileLine);
fileLine=" <tr align=left> ";fileLines.Add(fileLine);
fileLine=" <th>Max Clients</th><td height=27px width=150px>$$sv_maxclients$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Private Clients</th><td height=27px width=150px>$$sv_privateclients$$</td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Max Ping</th><td height=27px width=150px>$$sv_maxping$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Max Rate</th><td height=27px width=150px>$$sv_maxrate$$</td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Version</th><td height=27px width=150px>$$shortversion$$</td>";fileLines.Add(fileLine);
fileLine=" <th> </th><td width=150px> </td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Pure</th><td width=150px><img src=\"$$Case(sv_pure,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" <th>Punkbuster</th><td width=150px><img src=\"$$Case(sv_punkbuster,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine="$$ELSE$$";fileLines.Add(fileLine);
fileLine=" $$IF (server.servertype EQUALS \"COD2\")$$";fileLines.Add(fileLine);
fileLine=" <tr align=left> ";fileLines.Add(fileLine);
fileLine=" <th>Max Clients</th><td height=27px width=150px>$$sv_maxclients$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Private Clients</th><td height=27px width=150px>$$sv_privateclients$$</td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Max Ping</th><td height=27px width=150px>$$sv_maxping$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Max Rate</th><td height=27px width=150px>$$sv_maxrate$$</td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Version</th><td height=27px width=150px>$$shortversion$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Voice</th><td width=150px><img src=\"$$Case(sv_voice,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Pure</th><td width=150px><img src=\"$$Case(sv_pure,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" <th>Punkbuster</th><td width=150px><img src=\"$$Case(sv_punkbuster,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" $$ELSE$$";fileLines.Add(fileLine);
fileLine=" $$IF (server.servertype EQUALS \"COD4\")$$";fileLines.Add(fileLine);
fileLine=" <tr align=left> ";fileLines.Add(fileLine);
fileLine=" <th>Max Clients</th><td height=27px width=150px>$$sv_maxclients$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Private Clients</th><td height=27px width=150px>$$sv_privateclients$$</td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Max Ping</th><td height=27px width=150px>$$sv_maxping$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Max Rate</th><td height=27px width=150px>$$sv_maxrate$$</td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Version</th><td height=27px width=150px>$$shortversion$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Voice</th><td width=150px><img src=\"$$Case(sv_voice,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Pure</th><td width=150px><img src=\"$$Case(sv_pure,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" <th>Punkbuster</th><td width=150px><img src=\"$$Case(sv_punkbuster,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" $$ELSE$$";fileLines.Add(fileLine);
fileLine=" $$IF (server.servertype EQUALS \"COD5\")$$";fileLines.Add(fileLine);
fileLine=" <tr align=left> ";fileLines.Add(fileLine);
fileLine=" <th>Max Clients</th><td height=27px width=150px>$$sv_maxclients$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Private Clients</th><td height=27px width=150px>$$sv_privateclients$$</td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Max Ping</th><td height=27px width=150px>$$sv_maxping$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Max Rate</th><td height=27px width=150px>$$sv_maxrate$$</td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Version</th><td height=27px width=150px>$$shortversion$$</td>";fileLines.Add(fileLine);
fileLine=" <th>Voice</th><td width=150px><img src=\"$$Case(sv_voice,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" <tr align=left>";fileLines.Add(fileLine);
fileLine=" <th>Pure</th><td width=150px><img src=\"$$Case(sv_pure,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" <th>Punkbuster</th><td width=150px><img src=\"$$Case(sv_punkbuster,\"0\",\"images/red.gif\",\"1\",\"images/green.gif\")$$\" ></td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" $$ELSE$$";fileLines.Add(fileLine);
fileLine=" $$IF (server.servertype EQUALS \"WOLFENSTEIN\")$$";fileLines.Add(fileLine);
fileLine=" $$ENDIF$$";fileLines.Add(fileLine);
fileLine=" $$ENDIF$$";fileLines.Add(fileLine);
fileLine=" $$ENDIF$$";fileLines.Add(fileLine);
fileLine=" $$ENDIF$$";fileLines.Add(fileLine);
fileLine="$$ENDIF$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"servervariables.include");
fileLines.Clear();
fileLine="<table cellspacing=1 border=0 class=style4>";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <th height=34px>#</th>";fileLines.Add(fileLine);
fileLine=" <th>Weapon</th>";fileLines.Add(fileLine);
fileLine=" <th width=60px>Kills</th>";fileLines.Add(fileLine);
fileLine=" <th width=50px>Suicides</th>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" $$loop row as stat index as statindex select count(*) as killcount,id,playerweapon,realname,image,(select count(*) from killdata as subkilldata where killdata.playerweapon=subkilldata.playerweapon and killtype='SUICIDE') as suicidecount,(select count(*) from killdata as subkilldata where killdata.playerweapon=subkilldata.playerweapon and killtype='TEAMKILL') as teamkillcount from killdata,weapon where killtype='KILL' and weapon.idx=killdata.playerweapon group by playerweapon order by killcount desc limit %%MAXMAINPAGEWEAPONS%%$$";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <th width=15px align=center>$$statindex$$</th> ";fileLines.Add(fileLine);
fileLine=" <td id=name width=175px valign=bottom align=center>";fileLines.Add(fileLine);
fileLine=" $$if (stat.image !EQUALS \"\")$$";fileLines.Add(fileLine);
fileLine=" <img src=\"$$stat.image$$\" width=175 height=77><br><b>$$stat.realname$$</b>";fileLines.Add(fileLine);
fileLine=" $$else$$";fileLines.Add(fileLine);
fileLine=" <img src=\"images/default.jpg\" width=175 height=77><br><b>$$stat.realname$$</b>";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" <td align=center>$$stat.killcount$$</td>";fileLines.Add(fileLine);
fileLine=" <td align=center>$$stat.suicidecount$$</td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" $$endloop stat$$";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"mainpageweapons.include");
fileLines.Clear();
fileLine="<table cellspacing=1 border=0 class=style4>";fileLines.Add(fileLine);
fileLine="<tr>";fileLines.Add(fileLine);
fileLine="<th height=34px>#</th> ";fileLines.Add(fileLine);
fileLine="<th>Totals</th>";fileLines.Add(fileLine);
fileLine="<th width=60px>Kills</th>";fileLines.Add(fileLine);
fileLine="<th width=50px>Suicides</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$loop row as stat index as statindex select count(*) as killcount,id,playerclass,realname,image,(select count(*) from killdata as subkilldata where killdata.playerclass=subkilldata.playerclass and killtype='SUICIDE') as suicidecount,(select count(*) from killdata as subkilldata where killdata.playerclass=subkilldata.playerclass and killtype='TEAMKILL') as teamkillcount from killdata,class where killtype='KILL' and class.idx=killdata.playerclass group by playerclass order by killcount desc limit %%MAXMAINPAGECLASSES%%$$";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="<th width=15px>$$statindex$$</th> ";fileLines.Add(fileLine);
fileLine="<td width=175px>";fileLines.Add(fileLine);
fileLine="<img src=\"$$stat.image$$\" width=175><br><b>$$stat.realname$$</b>";fileLines.Add(fileLine);
fileLine="$$if (stat.image !EQUALS \"\")$$$$endif$$";fileLines.Add(fileLine);
fileLine="</a>";fileLines.Add(fileLine);
fileLine="</td>";fileLines.Add(fileLine);
fileLine="<td>$$stat.killcount$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$stat.suicidecount$$</td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$endloop stat$$";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"mainpageclasses.include");
fileLines.Clear();
fileLine="<table cellspacing=1 border=0 class=style4>";fileLines.Add(fileLine);
fileLine="<tr>";fileLines.Add(fileLine);
fileLine="<th height=34px>#</th>";fileLines.Add(fileLine);
fileLine="<th>Map</th>";fileLines.Add(fileLine);
fileLine="<th width=50px>Rounds<br>Played</th>";fileLines.Add(fileLine);
fileLine="<th width=50px>Average<br>Players</th>";fileLines.Add(fileLine);
fileLine="<th width=50px>Total<br>Players</th>";fileLines.Add(fileLine);
fileLine="<th width=60px>Kills</th>";fileLines.Add(fileLine);
fileLine="<th width=50px>Suicides</th>";fileLines.Add(fileLine);
fileLine="<th width=60px>Time<br>Played</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$loop row as map index as mapindex select count(mapname) as roundcount,sum(duration) as duration,mapname,id,realname,image from view_rounds,map where view_rounds.mapname=map.idx group by mapname order by roundcount desc limit %%MAXMAINPAGEMAPS%%$$";fileLines.Add(fileLine);
fileLine="$$kills=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$teamkills=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$suicides=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$totalplayers=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$averageplayers=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select count(*) as killcount from killdata where killtype='KILL' and roundindex in (select roundidx from view_rounds where mapname='%%map.mapname%%')$$";fileLines.Add(fileLine);
fileLine="$$kills=stats.killcount$$";fileLines.Add(fileLine);
fileLine="$$endloop stats$$";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select count(*) as killcount from killdata where killtype='TEAMKILL' and roundindex in (select roundidx from view_rounds where mapname='%%map.mapname%%')$$";fileLines.Add(fileLine);
fileLine="$$teamkills=stats.killcount$$";fileLines.Add(fileLine);
fileLine="$$endloop stats$$";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select count(*) as killcount from killdata where killtype='SUICIDE' and roundindex in (select roundidx from view_rounds where mapname='%%map.mapname%%')$$";fileLines.Add(fileLine);
fileLine="$$suicides=stats.killcount$$";fileLines.Add(fileLine);
fileLine="$$endloop stats$$";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select count(*) as totalplayers from playerinround where roundindex in (select roundidx from view_rounds where mapname='%%map.mapname%%')$$";fileLines.Add(fileLine);
fileLine="$$totalplayers=stats.totalplayers$$";fileLines.Add(fileLine);
fileLine="$$endloop stats$$";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select %%totalplayers%%.0/%%map.roundcount%%.0 as averageplayers from rounds limit 1$$";fileLines.Add(fileLine);
fileLine="$$averageplayers=stats.averageplayers$$";fileLines.Add(fileLine);
fileLine="$$endloop stats$$";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="<th width=15px align=center>$$mapindex$$</th>";fileLines.Add(fileLine);
fileLine="<td id=name width=150px align=center>";fileLines.Add(fileLine);
fileLine="<a href=\"map_$$map.id$$.html\">$$if (map.image !EQUALS \"\")$$<img src=\"$$map.image$$\" width=150 height=113><br><b>$$map.realname$$</b>";fileLines.Add(fileLine);
fileLine="$$else$$<img src=\"images/default.jpg\" width=150 height=113><br><b>$$map.realname$$</b>$$endif$$</a>";fileLines.Add(fileLine);
fileLine="</td>";fileLines.Add(fileLine);
fileLine="<td>$$map.roundcount$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$formatfloat(\"%.1f\",averageplayers)$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$totalplayers$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$kills$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$suicides$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$formatduration(\"%H:%M\",map.duration)$$</td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$endloop maps$$";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"mainpagemaps.include");
fileLines.Clear();
fileLine="<table cellspacing=1 border=0 class=style4>";fileLines.Add(fileLine);
fileLine="<tr>";fileLines.Add(fileLine);
fileLine="<th height=34px>#</th>";fileLines.Add(fileLine);
fileLine="<th>Gametype</th>";fileLines.Add(fileLine);
fileLine="<th width=50px>Rounds<br>Played</th>";fileLines.Add(fileLine);
fileLine="<th width=50px>Average<br>Players</th>";fileLines.Add(fileLine);
fileLine="<th width=50px>Total<br>Players</th>";fileLines.Add(fileLine);
fileLine="<th width=60px>Kills</th>";fileLines.Add(fileLine);
fileLine="<th width=50px>Suicides</th>";fileLines.Add(fileLine);
fileLine="<th width=60px>Time<br>Played</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$loop row as gametype index as gametypeindex select count(gametype) as roundcount,sum(duration) as duration,gametype,id,realname,image from view_rounds,gametype where view_rounds.gametype=gametype.idx group by gametype order by roundcount desc limit %%MAXMAINPAGEGAMETYPES%%$$";fileLines.Add(fileLine);
fileLine="$$kills=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$teamkills=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$suicides=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$totalplayers=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$averageplayers=\"0\"$$";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select max(roundidx) as lastround from view_rounds where gametype='%%gametype.gametype%%'$$";fileLines.Add(fileLine);
fileLine="$$lastround=stats.lastround$$";fileLines.Add(fileLine);
fileLine="$$endloop$$";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select count(*) as killcount from killdata where killtype='KILL' and roundindex in (select roundidx from view_rounds where gametype='%%gametype.gametype%%')$$";fileLines.Add(fileLine);
fileLine="$$kills=stats.killcount$$";fileLines.Add(fileLine);
fileLine="$$endloop stats$$";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select count(*) as killcount from killdata where killtype='TEAMKILL' and roundindex in (select roundidx from view_rounds where gametype='%%gametype.gametype%%')$$";fileLines.Add(fileLine);
fileLine="$$teamkills=stats.killcount$$";fileLines.Add(fileLine);
fileLine="$$endloop stats$$";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select count(*) as killcount from killdata where killtype='SUICIDE' and roundindex in (select roundidx from view_rounds where gametype='%%gametype.gametype%%')$$";fileLines.Add(fileLine);
fileLine="$$suicides=stats.killcount$$";fileLines.Add(fileLine);
fileLine="$$endloop stats$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select count(*) as totalplayers from playerinround where roundindex in (select roundidx from view_rounds where gametype='%%gametype.gametype%%')$$";fileLines.Add(fileLine);
fileLine="$$totalplayers=stats.totalplayers$$";fileLines.Add(fileLine);
fileLine="$$endloop stats$$";fileLines.Add(fileLine);
fileLine="$$loop stats as stats index as statsindex select %%totalplayers%%.0/%%gametype.roundcount%%.0 as averageplayers from rounds limit 1$$";fileLines.Add(fileLine);
fileLine="$$averageplayers=stats.averageplayers$$";fileLines.Add(fileLine);
fileLine="$$endloop stats$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="<th width=15px align=center>$$gametypeindex$$</th>";fileLines.Add(fileLine);
fileLine="<td id=name>";fileLines.Add(fileLine);
fileLine="<a href=\"gametype_$$gametype.id$$.html\">$$if (gametype.image !EQUALS \"\")$$<img src=\"$$gametype.image$$\" width=150><br><b>$$gametype.realname$$</b>";fileLines.Add(fileLine);
fileLine="$$else$$<img src=\"images/default.jpg\" width=150 height=113><br><b>$$gametype.realname$$</b>$$endif$$</a>";fileLines.Add(fileLine);
fileLine="</td>";fileLines.Add(fileLine);
fileLine="<td>$$gametype.roundcount$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$formatfloat(\"%.1f\",averageplayers)$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$totalplayers$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$kills$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$suicides$$</td>";fileLines.Add(fileLine);
fileLine="<td>$$formatduration(\"%H:%M\",gametype.duration)$$</td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$endloop gametype$$";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"mainpagegametypes.include");
fileLines.Clear();
fileLine="";fileLines.Add(fileLine);
fileLine="<body>";fileLines.Add(fileLine);
fileLine="<table cellspacing=0 border=0 class=style4>";fileLines.Add(fileLine);
fileLine="<table align=left cellspacing=1 border=0 class=style4>";fileLines.Add(fileLine);
fileLine="<tr> ";fileLines.Add(fileLine);
fileLine="<th height=34px width=15px>#</th>";fileLines.Add(fileLine);
fileLine="<th width=160px>Location</th>";fileLines.Add(fileLine);
fileLine="<th width=60px>Kills</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$loop row as stat index as statindex select count(*) as killcount,id,targetlocation,realname,image,(select count(*) from killdata as subkilldata where killdata.targetlocation=subkilldata.targetlocation and killtype='SUICIDE') as suicidecount,(select count(*) from killdata as subkilldata where killdata.targetlocation=subkilldata.targetlocation and killtype='TEAMKILL') as teamkillcount from killdata,location where killtype='KILL' and location.idx=killdata.targetlocation group by targetlocation order by killcount desc limit %%MAXMAINPAGELOCATIONS%%$$";fileLines.Add(fileLine);
fileLine="<tr>";fileLines.Add(fileLine);
fileLine="<th id=\"ignore\" height=24px align=center>$$statindex$$</th>";fileLines.Add(fileLine);
fileLine="<td id=name align=center onmouseover = \"doButtons('$$stat.image$$')\" onmouseout = \"doButtons('images/player.jpg', 'images/player.jpg')\"><b>$$stat.realname$$</b></td>";fileLines.Add(fileLine);
fileLine="<td id=\"ignore\" align=center>$$stat.killcount$$</td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$endloop stat$$";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="<table valign=center cellspacing=0 border=0 class=style5 width=250px>";fileLines.Add(fileLine);
fileLine="<tr>";fileLines.Add(fileLine);
fileLine="<td width=250px height=434px><img name=picture src=\"images/player.jpg\"></td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="</body>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"mainpagelocations.include");
fileLines.Clear();
fileLine="$$openfile awardlist.html$$";fileLines.Add(fileLine);
fileLine="$$include menu.include$$";fileLines.Add(fileLine);
fileLine="<body>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br> ";fileLines.Add(fileLine);
fileLine="<table class=nameplate align=center>";fileLines.Add(fileLine);
fileLine="<td width=299 height=50 background=\"images/nameplate2.jpg\"><div align=\"center\">AWARDS</div></td>";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="<br> ";fileLines.Add(fileLine);
fileLine="<table cellspacing=0 class=style2 width=985px align=center valign=top>";fileLines.Add(fileLine);
fileLine="$$awardprint=\"\"$$";fileLines.Add(fileLine);
fileLine="$$loop row as awarddef index as awarddefindex select * from awarddefinition$$";fileLines.Add(fileLine);
fileLine=" $$updatestatus(\"Award: %%awarddef.name%%\")$$";fileLines.Add(fileLine);
fileLine=" $$pointsrecorded=\"0\"$$";fileLines.Add(fileLine);
fileLine=" $$loop row as awardpoints index as awardpointsindex select count(*) from view_awardpoints where awardindex='%%awarddef.awardindex%%'$$";fileLines.Add(fileLine);
fileLine=" $$pointsrecorded=awardpoints.0$$";fileLines.Add(fileLine);
fileLine=" $$endloop awardpoints$$";fileLines.Add(fileLine);
fileLine=" $$if (pointsrecorded !EQUALS \"0\")$$";fileLines.Add(fileLine);
fileLine=" $$if (awardprint EQUALS \"\")$$<tr valign=top align=left>$$endif$$";fileLines.Add(fileLine);
fileLine=" $$if (awardprint EQUALS \"XX\")$$</tr>$$awardprint=\"\"$$$$endif$$";fileLines.Add(fileLine);
fileLine=" $$awardprint=\"%%awardprint%%X\"$$";fileLines.Add(fileLine);
fileLine=" <th valign=top align=left>";fileLines.Add(fileLine);
fileLine=" <table border=0 cellspacing=0 class=style1 width=100%>";fileLines.Add(fileLine);
fileLine=" <tr><th id=award height=30px colspan=2 align=center><b>$$awarddef.name$$</b></th></tr>";fileLines.Add(fileLine);
fileLine=" <tr valign=top>";fileLines.Add(fileLine);
fileLine=" <td align=center>$$if (awarddef.image !EQUALS \"\")$$<img src=\"$$awarddef.image$$\">";fileLines.Add(fileLine);
fileLine=" $$else$$<img src=\"images/default.jpg\">$$endif$$</td>";fileLines.Add(fileLine);
fileLine=" <td>";fileLines.Add(fileLine);
fileLine=" <table cellspacing=1 class=style1 width=100%>";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <th>#</th>";fileLines.Add(fileLine);
fileLine=" <th>Player</th>";fileLines.Add(fileLine);
fileLine=" <th>Score</th>";fileLines.Add(fileLine);
fileLine=" </tr> ";fileLines.Add(fileLine);
fileLine=" $$if (awarddef.weighted EQUALS \"Y\")$$";fileLines.Add(fileLine);
fileLine=" $$selectcommand=\"select coalesce(cast(sum(awardpoints.score)as float)/cast(count(awardpoints.score)as float),'-9999999') as awardscore,name as playername,awardpoints.playerindex from awardpoints,player where awardindex='%%awarddef.awardindex%%' and player.playerindex=awardpoints.playerindex and player.dropped='N' group by awardpoints.playerindex order by awardscore desc limit %%MAXAWARDPLAYERS%%\"$$";fileLines.Add(fileLine);
fileLine=" $$else$$";fileLines.Add(fileLine);
fileLine=" $$selectcommand=\"select sum(awardpoints.score) as awardscore,name as playername,awardpoints.playerindex from awardpoints,player where awardindex='%%awarddef.awardindex%%' and player.playerindex=awardpoints.playerindex and player.dropped='N' group by awardpoints.playerindex order by awardscore desc limit %%MAXAWARDPLAYERS%%\"$$";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine=" $$loop row as awardpoints index as awardpointsindex %%selectcommand%%$$";fileLines.Add(fileLine);
fileLine=" $$if (awardpointsindex EQUALS \"1\")$$";fileLines.Add(fileLine);
fileLine=" $$MessageCentre(\"AWARD%%awarddef.id%%\",awardpoints.playername,formatfloat(\"%.2f\",awardpoints.awardscore))$$";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <th align=middle height=27px width=14px>$$awardpointsindex$$</th>";fileLines.Add(fileLine);
fileLine=" <td width=180px><b><a href=\"player_$$hash(awardpoints.playername)$$.html\">$$colouredtext2html(awardpoints.playername)$$</a></b></td>";fileLines.Add(fileLine);
fileLine=" <td align=center width=60px>$$formatfloat(\"%.2f\",awardpoints.awardscore)$$</font></td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" $$endloop awardpoints$$";fileLines.Add(fileLine);
fileLine=" <br>";fileLines.Add(fileLine);
fileLine=" <br>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" </th>";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine="$$endloop awarddef$$";fileLines.Add(fileLine);
fileLine="$$if (awardprint !EQUALS \"\")$$</tr>$$awardprint=\"\"$$$$endif$$";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="</body>";fileLines.Add(fileLine);
fileLine="$$closefile$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"awards.include");
fileLines.Clear();
fileLine="$$if (%%sortkey%%allowed !EQUALS \"N\")$$";fileLines.Add(fileLine);
fileLine="$$openfile playerlist_%%sortkey%%.html$$";fileLines.Add(fileLine);
fileLine="$$include menu.include$$";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<table border=0 class=nameplate align=center>";fileLines.Add(fileLine);
fileLine="<td width=299 height=50 background=\"images/nameplate2.jpg\"><div align=\"center\">$$colouredtext2html(title)$$</div></td>";fileLines.Add(fileLine);
fileLine="</table> ";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<table align=center cellspacing=0 border=0 class=style3 width=985px>";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="$$if (HOMEPAGETITLE !EQUALS \"\")$$ ";fileLines.Add(fileLine);
fileLine="<td height=30px id=index>$$HOMEPAGETITLE$$ Leaderboard</td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$else$$";fileLines.Add(fileLine);
fileLine="<tr align=center> ";fileLines.Add(fileLine);
fileLine="<td height=30px id=index>Leaderboard</td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$endif$$";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="<th>";fileLines.Add(fileLine);
fileLine="<table align=center border=0 cellspacing=0 class=style3 width=985px> ";fileLines.Add(fileLine);
fileLine="<tr id=\"ignore\">";fileLines.Add(fileLine);
fileLine="<th height=30px width=20px>#</th>";fileLines.Add(fileLine);
fileLine="<th width=160px>Player</th>";fileLines.Add(fileLine);
fileLine="$$if (killsallowed !EQUALS \"N\")$$<th><a href=\"playerlist_kills.html\">Kills</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (deathsallowed !EQUALS \"N\")$$<th><a href=\"playerlist_deaths.html\">Deaths</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (teamkillsallowed !EQUALS \"N\")$$<th><a href=\"playerlist_teamkills.html\">Team Kills</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (suicidesallowed !EQUALS \"N\")$$<th><a href=\"playerlist_suicides.html\">Suicides</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (skillweightedallowed !EQUALS \"N\")$$<th><a href=\"playerlist_skillweighted.html\">Skill<br>Weighted</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (scoreweightedallowed !EQUALS \"N\")$$<th><a href=\"playerlist_scoreweighted.html\">Score<br>Weighted</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (skillallowed !EQUALS \"N\")$$<th><a href=\"playerlist_skill.html\">Skill</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (scoreallowed !EQUALS \"N\")$$<th><a href=\"playerlist_score.html\">Score</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (ratioallowed !EQUALS \"N\")$$<th><a href=\"playerlist_ratio.html\">Ratio</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestkillstreakallowed !EQUALS \"N\")$$<th><a href=\"playerlist_longestkillstreak.html\">Kill<br>Streak</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestdeathstreakallowed !EQUALS \"N\")$$<th><a href=\"playerlist_longestdeathstreak.html\">Death<br>Streak</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestteamkillstreakallowed !EQUALS \"N\")$$<th><a href=\"playerlist_longestteamkillstreak.html\">Team Kill<br>Streak</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (roundsallowed !EQUALS \"N\")$$<th><a href=\"playerlist_rounds.html\">Rounds</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (durationallowed !EQUALS \"N\")$$<th><a href=\"playerlist_duration.html\">Time<br>Played</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$firstrow=\"Y\"$$";fileLines.Add(fileLine);
fileLine="$$playerdisplaydropped=\"N\"$$";fileLines.Add(fileLine);
fileLine="$$loop row as player index as playerindex select *,coalesce(cast(kills as float)/cast(deaths as float),kills) as ratio from player where dropped='N' order by %%sortkey%% desc limit %%MAXPLAYERLISTENTRIES%%$$";fileLines.Add(fileLine);
fileLine="$$if (playerindex EQUALS \"1\")$$";fileLines.Add(fileLine);
fileLine=" $$if (sortkey EQUALS \"duration\")$$";fileLines.Add(fileLine);
fileLine=" $$MessageCentre(messagecentrekey,player.name,formatduration(\"%H:%M:%S\",player.%%sortkey%%))$$";fileLines.Add(fileLine);
fileLine=" $$else$$";fileLines.Add(fileLine);
fileLine=" $$if ((sortkey EQUALS \"score\") OR (sortkey EQUALS \"skill\"))$$";fileLines.Add(fileLine);
fileLine=" $$MessageCentre(messagecentrekey,player.name,formatfloat(\"%.1f\",player.%%sortkey%%))$$";fileLines.Add(fileLine);
fileLine=" $$else$$";fileLines.Add(fileLine);
fileLine=" $$if (((sortkey EQUALS \"scoreweighted\") OR (sortkey EQUALS \"skillweighted\")) OR (sortkey EQUALS \"ratio\"))$$";fileLines.Add(fileLine);
fileLine=" $$MessageCentre(messagecentrekey,player.name,formatfloat(\"%.2f\",player.%%sortkey%%))$$";fileLines.Add(fileLine);
fileLine=" $$else$$";fileLines.Add(fileLine);
fileLine=" $$MessageCentre(messagecentrekey,player.name,player.%%sortkey%%)$$";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine=" $$endif$$";fileLines.Add(fileLine);
fileLine="$$endif$$";fileLines.Add(fileLine);
fileLine="<tr onMouseover=\"changeto(event, '494848')\" onMouseout=\"changeback(event, '2f2f2f')\" align=center>";fileLines.Add(fileLine);
fileLine="<th id=index width=20px align=\"center\">$$playerindex$$</th>";fileLines.Add(fileLine);
fileLine="<td align=left id=name><b>";fileLines.Add(fileLine);
fileLine="$$playerdisplayname=player.name$$";fileLines.Add(fileLine);
fileLine="$$playerdataplayerindex=player.playerindex$$";fileLines.Add(fileLine);
fileLine="$$include playerdisplay.include$$";fileLines.Add(fileLine);
fileLine="</b></td>";fileLines.Add(fileLine);
fileLine="$$if (killsallowed !EQUALS \"N\")$$<td>$$player.kills$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (deathsallowed !EQUALS \"N\")$$<td>$$player.deaths$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (teamkillsallowed !EQUALS \"N\")$$<td>$$player.teamkills$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (suicidesallowed !EQUALS \"N\")$$<td>$$player.suicides$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (skillweightedallowed !EQUALS \"N\")$$<td>$$formatfloat(\"%.2f\",player.skillweighted)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (scoreweightedallowed !EQUALS \"N\")$$<td>$$formatfloat(\"%.2f\",player.scoreweighted)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (skillallowed !EQUALS \"N\")$$<td>$$formatfloat(\"%.1f\",player.skill)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (scoreallowed !EQUALS \"N\")$$<td>$$formatfloat(\"%.1f\",player.score)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (ratioallowed !EQUALS \"N\")$$<td>$$formatfloat(\"%.2f\",player.ratio)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestkillstreakallowed !EQUALS \"N\")$$<td>$$player.longestkillstreak$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestdeathstreakallowed !EQUALS \"N\")$$<td>$$player.longestdeathstreak$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestteamkillstreakallowed !EQUALS \"N\")$$<td>$$player.longestteamkillstreak$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (roundsallowed !EQUALS \"N\")$$<td>$$player.rounds$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (durationallowed !EQUALS \"N\")$$<td>$$formatduration(\"%H:%M:%S\",player.duration)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$endloop$$";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="$$closefile$$";fileLines.Add(fileLine);
fileLine="$$endif$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"playerlists.include");
fileLines.Clear();
fileLine="$$if (%%sortkey%%allowed !EQUALS \"N\")$$";fileLines.Add(fileLine);
fileLine="$$openfile clanlist_%%sortkey%%.html$$";fileLines.Add(fileLine);
fileLine="$$include menu.include$$";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="$$loop row as clanrow index as clanrowindex select * from clan where clanindex in (select clanindex from view_player where clanindex>=0)$$";fileLines.Add(fileLine);
fileLine="$$loop row as clanstats index as clanstatsindex select sum(rounds) as rounds,sum(score) as score,sum(skill) as skill,sum(duration) as duration, max(lastactiveround) as lastactiveround,sum(kills) as kills,sum(deaths) as deaths,sum(suicides) as suicides,max(longestkillstreak) as longestkillstreak,max(longestdeathstreak) as longestdeathstreak,max(longestteamkillstreak) as longestteamkillstreak,sum(teamwins) as teamwins, sum(teamkills) as teamkills, sum(teamlosses) as teamlosses from view_player where clanindex='%%clanrow.clanindex%%'$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<table border=0 cellspacing=0 class=nameplate align=center>";fileLines.Add(fileLine);
fileLine="<td width=599 height=99 background=\"images/nameplate3.jpg\"><div align=\"center\">$$if (clanrow.webaddress !EQUALS \"\")$$<a href=\"$$clanrow.webaddress$$\">$$endif$$";fileLines.Add(fileLine);
fileLine="$$colouredtext2html(clanrow.name)$$";fileLines.Add(fileLine);
fileLine="$$if (clanrow.webaddress !EQUALS \"\")$$</a>$$endif$$</div></td>";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="<table cellspacing=0 border=0 align=center class=style3 width=599px";fileLines.Add(fileLine);
fileLine="$$if (clanrow.banner !EQUALS \"\")$$";fileLines.Add(fileLine);
fileLine="<tr valign=middle align=center>";fileLines.Add(fileLine);
fileLine="<td align=center colspan=6>";fileLines.Add(fileLine);
fileLine="$$if (clanrow.webaddress !EQUALS \"\")$$<a href=\"$$clanrow.webaddress$$\">$$endif$$";fileLines.Add(fileLine);
fileLine="<img src=\"$$clanrow.banner$$\">";fileLines.Add(fileLine);
fileLine="$$if (clanrow.webaddress !EQUALS \"\")$$</a>$$endif$$";fileLines.Add(fileLine);
fileLine="</td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$endif$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="<tr align=left>";fileLines.Add(fileLine);
fileLine="<th align=left>Rounds</th><td>$$clanstats.rounds$$</td>";fileLines.Add(fileLine);
fileLine="<th align=left>Play Time</th><td>$$formatduration(\"%H:%M:%S\",clanstats.duration)$$</td>";fileLines.Add(fileLine);
fileLine="<th> </th><td> </td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="<tr align=left>";fileLines.Add(fileLine);
fileLine="<th>Score</th><td>$$formatfloat(\"%.0f\",clanstats.score)$$</td>";fileLines.Add(fileLine);
fileLine="<th>Skill</th><td>$$formatfloat(\"%.0f\",clanstats.skill)$$</td>";fileLines.Add(fileLine);
fileLine="<th> </th><td> </td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="<tr align=left>";fileLines.Add(fileLine);
fileLine="<th>Kills</th><td>$$clanstats.kills$$</td>";fileLines.Add(fileLine);
fileLine="<th>Deaths</th><td>$$clanstats.deaths$$</td>";fileLines.Add(fileLine);
fileLine="<th>Suicides</th><td>$$clanstats.suicides$$</td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="<tr align=left>";fileLines.Add(fileLine);
fileLine="<th>Kill Streak</th><td>$$clanstats.longestkillstreak$$</td>";fileLines.Add(fileLine);
fileLine="<th>Death Streak</th><td>$$clanstats.longestdeathstreak$$</td>";fileLines.Add(fileLine);
fileLine="<th> </th><td> </td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="$$endloop clanstats$$";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<table align=center cellspacing=0 border=0 class=style3 width=900px>";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="<td height=30px id=index>SQUAD</td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="<th>";fileLines.Add(fileLine);
fileLine="<table cellspacing=0 border=0 class=style3 width=900px>";fileLines.Add(fileLine);
fileLine="<tr>";fileLines.Add(fileLine);
fileLine="<th width=20px>#</th> ";fileLines.Add(fileLine);
fileLine="<th>Clan Member</th>";fileLines.Add(fileLine);
fileLine="$$if (killsallowed !EQUALS \"N\")$$<th><a href=\"clanlist_kills.html\">Kills</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (deathsallowed !EQUALS \"N\")$$<th><a href=\"clanlist_deaths.html\">Deaths</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (teamkillsallowed !EQUALS \"N\")$$<th><a href=\"clanlist_kills.html\">Kills</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (suicidesallowed !EQUALS \"N\")$$<th><a href=\"clanlist_suicides.html\">Suicides</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (skillweightedallowed !EQUALS \"N\")$$<th><a href=\"clanlist_skillweighted.html\">Skill<br>Weighted</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (scoreweightedallowed !EQUALS \"N\")$$<th><a href=\"clanlist_scoreweighted.html\">Score<br>Weighted</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (skillallowed !EQUALS \"N\")$$<th><a href=\"clanlist_skill.html\">Skill</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (scoreallowed !EQUALS \"N\")$$<th><a href=\"clanlist_score.html\">Score</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (ratioallowed !EQUALS \"N\")$$<th><a href=\"clanlist_ratio.html\">Ratio</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestkillstreakallowed !EQUALS \"N\")$$<th><a href=\"clanlist_longestkillstreak.html\">Kill<br>Streak</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestdeathstreakallowed !EQUALS \"N\")$$<th><a href=\"clanlist_longestdeathstreak.html\">Death<br>Streak</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestteamkillstreakallowed !EQUALS \"N\")$$<th><a href=\"clanlist_longestteamkillstreak.html\">Team Kill<br>Streak</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (roundsallowed !EQUALS \"N\")$$<th><a href=\"clanlist_rounds.html\">Rounds</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (durationallowed !EQUALS \"N\")$$<th><a href=\"clanlist_duration.html\">Time<br>Played</a></th>$$endif$$";fileLines.Add(fileLine);
fileLine="<th>X-Fire</th>";fileLines.Add(fileLine);
fileLine="<th>Role</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$playerdisplaydropped=\"N\"$$";fileLines.Add(fileLine);
fileLine="$$loop row as player index as playerindex select *,coalesce(cast(kills as float)/cast(deaths as float),kills) as ratio from view_player where clanindex='%%clanrow.clanindex%%' order by %%sortkey%% desc$$";fileLines.Add(fileLine);
fileLine="$$playerdataplayerindex=player.playerindex$$";fileLines.Add(fileLine);
fileLine="$$playerdisplayname=player.name$$";fileLines.Add(fileLine);
fileLine="$$tablename=\"playerdataxfire\"$$$$include playerprofilecomponent.include$$";fileLines.Add(fileLine);
fileLine="$$tablename=\"playerdataclanrole\"$$$$include playerprofilecomponent.include$$";fileLines.Add(fileLine);
fileLine="<tr onMouseover=\"changeto(event, '494848')\" onMouseout=\"changeback(event, '2f2f2f')\" align=center>";fileLines.Add(fileLine);
fileLine="<th id=index width=20px align=center>$$playerindex$$</th>";fileLines.Add(fileLine);
fileLine="<td align=left height=25px width=160px id=name><b>$$include playerdisplay.include$$</b></td>";fileLines.Add(fileLine);
fileLine="$$if (killsallowed !EQUALS \"N\")$$<td>$$player.kills$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (deathsallowed !EQUALS \"N\")$$<td>$$player.deaths$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (teamkillsallowed !EQUALS \"N\")$$<td>$$player.teamkills$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (suicidesallowed !EQUALS \"N\")$$<td>$$player.suicides$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (skillweightedallowed !EQUALS \"N\")$$<td>$$formatfloat(\"%.2f\",player.skillweighted)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (scoreweightedallowed !EQUALS \"N\")$$<td>$$formatfloat(\"%.2f\",player.scoreweighted)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (skillallowed !EQUALS \"N\")$$<td>$$formatfloat(\"%.1f\",player.skill)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (scoreallowed !EQUALS \"N\")$$<td>$$formatfloat(\"%.1f\",player.score)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (ratioallowed !EQUALS \"N\")$$<td>$$formatfloat(\"%.2f\",player.ratio)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestkillstreakallowed !EQUALS \"N\")$$<td>$$player.longestkillstreak$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestdeathstreakallowed !EQUALS \"N\")$$<td>$$player.longestdeathstreak$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (longestteamkillstreakallowed !EQUALS \"N\")$$<td>$$player.longestteamkillstreak$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (roundsallowed !EQUALS \"N\")$$<td>$$player.rounds$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="$$if (durationallowed !EQUALS \"N\")$$<td>$$formatduration(\"%H:%M:%S\",player.duration)$$</td>$$endif$$";fileLines.Add(fileLine);
fileLine="<td>$$if (playerdataxfire !EQUALS \"\")$$$$playerdataxfire$$$$endif$$ </td>";fileLines.Add(fileLine);
fileLine="<td>$$if (playerdataclanrole !EQUALS \"\")$$$$playerdataclanrole$$$$endif$$ </td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$endloop$$";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="$$endloop clanrow$$";fileLines.Add(fileLine);
fileLine="$$closefile$$";fileLines.Add(fileLine);
fileLine="$$endif$$";fileLines.Add(fileLine);
ExportTemplateFile(directory,fileLines,"clanlist.include");
fileLines.Clear();
fileLine="$$openfile info.html$$";fileLines.Add(fileLine);
fileLine="$$include menu.include$$";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="<table border=0 class=nameplate align=center>";fileLines.Add(fileLine);
fileLine=" <tr><td width=299 height=50 background=\"images/nameplate2.jpg\"><div align=\"center\"><b>STATS INFO</b></div></td></tr>";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="<table border=0 cellspacing=0 align=center class=style3>";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="<th id=index height=30px colspan=2>SKILL CALCULATION</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="<td valign=top>";fileLines.Add(fileLine);
fileLine="<table align=center class=style1 border=0 cellspacing=1 width=250px>";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine=" <th>Location</th>";fileLines.Add(fileLine);
fileLine=" <th>Value</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$loop row as weight index as weightindex select * from SkillWeights where key like 'location_%' order by key desc$$";fileLines.Add(fileLine);
fileLine="<tr>";fileLines.Add(fileLine);
fileLine=" <td height=24px align=center>";fileLines.Add(fileLine);
fileLine=" $$if (weight.image !EQUALS \"\")$$<b onmouseover = \"doButtons('$$weight.image$$')\" onmouseout = \"doButtons('images/player.jpg', 'images/player.jpg')\">$$endif$$$$weight.realname$$</b>";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine=" <td align=center>$$weight.weight$$</td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="$$endloop$$";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="</td>";fileLines.Add(fileLine);
fileLine="<td valign=top>";fileLines.Add(fileLine);
fileLine="<table align=center cellspacing=0 border=0 class=style5 width=250px>";fileLines.Add(fileLine);
fileLine="<tr align=center> ";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="<tr> ";fileLines.Add(fileLine);
fileLine="<td><img name=picture src=\"images/player.jpg\"></td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="</td>";fileLines.Add(fileLine);
fileLine="</table>";fileLines.Add(fileLine);
fileLine="<br>";fileLines.Add(fileLine);
fileLine="<table border=0 cellspacing=0 align=center class=style3>";fileLines.Add(fileLine);
fileLine="<tr align=center>";fileLines.Add(fileLine);
fileLine="<th id=index height=30px colspan=2>SKILL CALCULATION</th>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="";fileLines.Add(fileLine);
fileLine="<tr width=100%>";fileLines.Add(fileLine);
fileLine=" <td>";fileLines.Add(fileLine);
fileLine=" <table align=center border=0 cellspacing=1 class=style1 width=520px> ";fileLines.Add(fileLine);
fileLine=" <tr> ";fileLines.Add(fileLine);
fileLine=" <th align=center height=25px>WEAPON</th>";fileLines.Add(fileLine);
fileLine=" <th align=center>VALUE</th>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <td colspan=2 align=center height=6px> </td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine="$$loop row as weight index as weightindex select * from SkillWeights where key like 'weapon_%' order by realname asc$$";fileLines.Add(fileLine);
fileLine=" <tr>";fileLines.Add(fileLine);
fileLine=" <td align=center>$$if (weight.image !EQUALS \"\")$$<img src=\"$$weight.image$$\" width=175 height=77><br>$$else$$<img src=\"images/default.jpg\" width=175 height=77><br>$$endif$$$$weight.realname$$</td>";fileLines.Add(fileLine);
fileLine=" <td align=center>$$weight.weight$$</td>";fileLines.Add(fileLine);
fileLine=" </tr>";fileLines.Add(fileLine);
fileLine="$$endloop$$";fileLines.Add(fileLine);
fileLine=" </table>";fileLines.Add(fileLine);
fileLine=" </table> ";fileLines.Add(fileLine);
fileLine=" <br>";fileLines.Add(fileLine);
fileLine=" </td>";fileLines.Add(fileLine);
fileLine="</tr>";fileLines.Add(fileLine);
fileLine="<tr width=100%>";fileLines.Add(fileLine);
fileLine=" <td>";fileLines.Add(fileLine);
fileLine=" <table align=center border=0 cellspacing=1 class=style1 width=520px> ";fileLines.Add(fileLine);