diff --git a/System/UTSAccuBeta4_2.u b/System/UTSAccuBeta4_2.u new file mode 100755 index 0000000..bb4ff71 Binary files /dev/null and b/System/UTSAccuBeta4_2.u differ diff --git a/System/UTStatsBeta4_2.u b/System/UTStatsBeta4_2.u new file mode 100755 index 0000000..9c0f763 Binary files /dev/null and b/System/UTStatsBeta4_2.u differ diff --git a/html/GeoIP.dat b/html/GeoIP.dat new file mode 100755 index 0000000..d898243 Binary files /dev/null and b/html/GeoIP.dat differ diff --git a/html/admin.php b/html/admin.php new file mode 100755 index 0000000..74eb5b7 --- /dev/null +++ b/html/admin.php @@ -0,0 +1,60 @@ + + + UTStats Administration +'; + +IF (empty($import_adminkey)) { + echo'Error: + No key set in config.php + '; + include("includes/footer.php"); + return; +} + + +IF (!empty($adminkey) and $adminkey != $import_adminkey) { + echo'Error: + Keys do not match + '; + $adminkey = ''; +} + +IF (empty($adminkey)) { + echo' + Enter Admin key: +
+ + + Remember the key +
+ '; + include("includes/footer.php"); + return; +} + + +echo' +
'; + +$action = str_replace(array('.', '/', '<', ':'), array(), $action); +$fn = "pages/admin/$action.php"; +if (!file_exists($fn) or !is_file($fn)) die('bla'); +require($fn); + +include('includes/footer.php'); + +?> diff --git a/html/images/bars/h_bar1.png b/html/images/bars/h_bar1.png new file mode 100755 index 0000000..c6638fd Binary files /dev/null and b/html/images/bars/h_bar1.png differ diff --git a/html/images/bars/h_bar10.png b/html/images/bars/h_bar10.png new file mode 100755 index 0000000..50f7e14 Binary files /dev/null and b/html/images/bars/h_bar10.png differ diff --git a/html/images/bars/h_bar11.png b/html/images/bars/h_bar11.png new file mode 100755 index 0000000..17176f1 Binary files /dev/null and b/html/images/bars/h_bar11.png differ diff --git a/html/images/bars/h_bar12.png b/html/images/bars/h_bar12.png new file mode 100755 index 0000000..5a6a8b3 Binary files /dev/null and b/html/images/bars/h_bar12.png differ diff --git a/html/images/bars/h_bar13.png b/html/images/bars/h_bar13.png new file mode 100755 index 0000000..c798d7b Binary files /dev/null and b/html/images/bars/h_bar13.png differ diff --git a/html/images/bars/h_bar14.png b/html/images/bars/h_bar14.png new file mode 100755 index 0000000..02ea0a9 Binary files /dev/null and b/html/images/bars/h_bar14.png differ diff --git a/html/images/bars/h_bar15.png b/html/images/bars/h_bar15.png new file mode 100755 index 0000000..7330058 Binary files /dev/null and b/html/images/bars/h_bar15.png differ diff --git a/html/images/bars/h_bar16.png b/html/images/bars/h_bar16.png new file mode 100755 index 0000000..21c0456 Binary files /dev/null and b/html/images/bars/h_bar16.png differ diff --git a/html/images/bars/h_bar2.png b/html/images/bars/h_bar2.png new file mode 100755 index 0000000..7302d90 Binary files /dev/null and b/html/images/bars/h_bar2.png differ diff --git a/html/images/bars/h_bar3.png b/html/images/bars/h_bar3.png new file mode 100755 index 0000000..d8ccc70 Binary files /dev/null and b/html/images/bars/h_bar3.png differ diff --git a/html/images/bars/h_bar4.png b/html/images/bars/h_bar4.png new file mode 100755 index 0000000..615d588 Binary files /dev/null and b/html/images/bars/h_bar4.png differ diff --git a/html/images/bars/h_bar5.png b/html/images/bars/h_bar5.png new file mode 100755 index 0000000..91a8513 Binary files /dev/null and b/html/images/bars/h_bar5.png differ diff --git a/html/images/bars/h_bar6.png b/html/images/bars/h_bar6.png new file mode 100755 index 0000000..59266f0 Binary files /dev/null and b/html/images/bars/h_bar6.png differ diff --git a/html/images/bars/h_bar7.png b/html/images/bars/h_bar7.png new file mode 100755 index 0000000..9d15c10 Binary files /dev/null and b/html/images/bars/h_bar7.png differ diff --git a/html/images/bars/h_bar8.png b/html/images/bars/h_bar8.png new file mode 100755 index 0000000..f7a35d0 Binary files /dev/null and b/html/images/bars/h_bar8.png differ diff --git a/html/images/bars/h_bar9.png b/html/images/bars/h_bar9.png new file mode 100755 index 0000000..22cbba2 Binary files /dev/null and b/html/images/bars/h_bar9.png differ diff --git a/html/images/bars/index.htm b/html/images/bars/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/images/bars/v_bar1.png b/html/images/bars/v_bar1.png new file mode 100755 index 0000000..6ae04ff Binary files /dev/null and b/html/images/bars/v_bar1.png differ diff --git a/html/images/bars/v_bar10.png b/html/images/bars/v_bar10.png new file mode 100755 index 0000000..fa91fa8 Binary files /dev/null and b/html/images/bars/v_bar10.png differ diff --git a/html/images/bars/v_bar11.png b/html/images/bars/v_bar11.png new file mode 100755 index 0000000..49bd4c0 Binary files /dev/null and b/html/images/bars/v_bar11.png differ diff --git a/html/images/bars/v_bar12.png b/html/images/bars/v_bar12.png new file mode 100755 index 0000000..07c6dab Binary files /dev/null and b/html/images/bars/v_bar12.png differ diff --git a/html/images/bars/v_bar13.png b/html/images/bars/v_bar13.png new file mode 100755 index 0000000..ec5950b Binary files /dev/null and b/html/images/bars/v_bar13.png differ diff --git a/html/images/bars/v_bar14.png b/html/images/bars/v_bar14.png new file mode 100755 index 0000000..5f6401d Binary files /dev/null and b/html/images/bars/v_bar14.png differ diff --git a/html/images/bars/v_bar15.png b/html/images/bars/v_bar15.png new file mode 100755 index 0000000..dc65286 Binary files /dev/null and b/html/images/bars/v_bar15.png differ diff --git a/html/images/bars/v_bar16.png b/html/images/bars/v_bar16.png new file mode 100755 index 0000000..a8893b9 Binary files /dev/null and b/html/images/bars/v_bar16.png differ diff --git a/html/images/bars/v_bar2.png b/html/images/bars/v_bar2.png new file mode 100755 index 0000000..f90b7f6 Binary files /dev/null and b/html/images/bars/v_bar2.png differ diff --git a/html/images/bars/v_bar3.png b/html/images/bars/v_bar3.png new file mode 100755 index 0000000..156862c Binary files /dev/null and b/html/images/bars/v_bar3.png differ diff --git a/html/images/bars/v_bar4.png b/html/images/bars/v_bar4.png new file mode 100755 index 0000000..0f6b2b0 Binary files /dev/null and b/html/images/bars/v_bar4.png differ diff --git a/html/images/bars/v_bar5.png b/html/images/bars/v_bar5.png new file mode 100755 index 0000000..0771a95 Binary files /dev/null and b/html/images/bars/v_bar5.png differ diff --git a/html/images/bars/v_bar6.png b/html/images/bars/v_bar6.png new file mode 100755 index 0000000..d30c8fd Binary files /dev/null and b/html/images/bars/v_bar6.png differ diff --git a/html/images/bars/v_bar7.png b/html/images/bars/v_bar7.png new file mode 100755 index 0000000..9496f8c Binary files /dev/null and b/html/images/bars/v_bar7.png differ diff --git a/html/images/bars/v_bar8.png b/html/images/bars/v_bar8.png new file mode 100755 index 0000000..5a9fa53 Binary files /dev/null and b/html/images/bars/v_bar8.png differ diff --git a/html/images/bars/v_bar9.png b/html/images/bars/v_bar9.png new file mode 100755 index 0000000..3559892 Binary files /dev/null and b/html/images/bars/v_bar9.png differ diff --git a/html/images/blankbar.gif b/html/images/blankbar.gif new file mode 100755 index 0000000..6ba6306 Binary files /dev/null and b/html/images/blankbar.gif differ diff --git a/html/images/characters/char1.jpg b/html/images/characters/char1.jpg new file mode 100755 index 0000000..3e9dc9d Binary files /dev/null and b/html/images/characters/char1.jpg differ diff --git a/html/images/characters/char10.jpg b/html/images/characters/char10.jpg new file mode 100755 index 0000000..d42ffd8 Binary files /dev/null and b/html/images/characters/char10.jpg differ diff --git a/html/images/characters/char11.jpg b/html/images/characters/char11.jpg new file mode 100755 index 0000000..2fc3adc Binary files /dev/null and b/html/images/characters/char11.jpg differ diff --git a/html/images/characters/char12.jpg b/html/images/characters/char12.jpg new file mode 100755 index 0000000..0288d05 Binary files /dev/null and b/html/images/characters/char12.jpg differ diff --git a/html/images/characters/char13.jpg b/html/images/characters/char13.jpg new file mode 100755 index 0000000..bfffa5d Binary files /dev/null and b/html/images/characters/char13.jpg differ diff --git a/html/images/characters/char14.jpg b/html/images/characters/char14.jpg new file mode 100755 index 0000000..ca92844 Binary files /dev/null and b/html/images/characters/char14.jpg differ diff --git a/html/images/characters/char2.jpg b/html/images/characters/char2.jpg new file mode 100755 index 0000000..8e9ef8c Binary files /dev/null and b/html/images/characters/char2.jpg differ diff --git a/html/images/characters/char3.jpg b/html/images/characters/char3.jpg new file mode 100755 index 0000000..eb1c174 Binary files /dev/null and b/html/images/characters/char3.jpg differ diff --git a/html/images/characters/char4.jpg b/html/images/characters/char4.jpg new file mode 100755 index 0000000..f7edb22 Binary files /dev/null and b/html/images/characters/char4.jpg differ diff --git a/html/images/characters/char5.jpg b/html/images/characters/char5.jpg new file mode 100755 index 0000000..137e981 Binary files /dev/null and b/html/images/characters/char5.jpg differ diff --git a/html/images/characters/char6.jpg b/html/images/characters/char6.jpg new file mode 100755 index 0000000..e2a8b31 Binary files /dev/null and b/html/images/characters/char6.jpg differ diff --git a/html/images/characters/char7.jpg b/html/images/characters/char7.jpg new file mode 100755 index 0000000..a55d8c0 Binary files /dev/null and b/html/images/characters/char7.jpg differ diff --git a/html/images/characters/char8.jpg b/html/images/characters/char8.jpg new file mode 100755 index 0000000..8bb9040 Binary files /dev/null and b/html/images/characters/char8.jpg differ diff --git a/html/images/characters/char9.jpg b/html/images/characters/char9.jpg new file mode 100755 index 0000000..581d022 Binary files /dev/null and b/html/images/characters/char9.jpg differ diff --git a/html/images/characters/index.htm b/html/images/characters/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/images/del.png b/html/images/del.png new file mode 100755 index 0000000..6fc4d3b Binary files /dev/null and b/html/images/del.png differ diff --git a/html/images/favicon.ico b/html/images/favicon.ico new file mode 100755 index 0000000..765407a Binary files /dev/null and b/html/images/favicon.ico differ diff --git a/html/images/flags/ad.png b/html/images/flags/ad.png new file mode 100755 index 0000000..8e7d7b8 Binary files /dev/null and b/html/images/flags/ad.png differ diff --git a/html/images/flags/ae.png b/html/images/flags/ae.png new file mode 100755 index 0000000..be9d284 Binary files /dev/null and b/html/images/flags/ae.png differ diff --git a/html/images/flags/af.png b/html/images/flags/af.png new file mode 100755 index 0000000..385de43 Binary files /dev/null and b/html/images/flags/af.png differ diff --git a/html/images/flags/ag.png b/html/images/flags/ag.png new file mode 100755 index 0000000..20440ba Binary files /dev/null and b/html/images/flags/ag.png differ diff --git a/html/images/flags/ai.png b/html/images/flags/ai.png new file mode 100755 index 0000000..c71ec83 Binary files /dev/null and b/html/images/flags/ai.png differ diff --git a/html/images/flags/al.png b/html/images/flags/al.png new file mode 100755 index 0000000..2afeb63 Binary files /dev/null and b/html/images/flags/al.png differ diff --git a/html/images/flags/am.png b/html/images/flags/am.png new file mode 100755 index 0000000..134ff6b Binary files /dev/null and b/html/images/flags/am.png differ diff --git a/html/images/flags/an.png b/html/images/flags/an.png new file mode 100755 index 0000000..ce2a9c3 Binary files /dev/null and b/html/images/flags/an.png differ diff --git a/html/images/flags/ao.png b/html/images/flags/ao.png new file mode 100755 index 0000000..94831db Binary files /dev/null and b/html/images/flags/ao.png differ diff --git a/html/images/flags/aq.png b/html/images/flags/aq.png new file mode 100755 index 0000000..f214498 Binary files /dev/null and b/html/images/flags/aq.png differ diff --git a/html/images/flags/ar.png b/html/images/flags/ar.png new file mode 100755 index 0000000..f7d1d93 Binary files /dev/null and b/html/images/flags/ar.png differ diff --git a/html/images/flags/as.png b/html/images/flags/as.png new file mode 100755 index 0000000..5e6b4cd Binary files /dev/null and b/html/images/flags/as.png differ diff --git a/html/images/flags/at.png b/html/images/flags/at.png new file mode 100755 index 0000000..d098a34 Binary files /dev/null and b/html/images/flags/at.png differ diff --git a/html/images/flags/au.png b/html/images/flags/au.png new file mode 100755 index 0000000..2539471 Binary files /dev/null and b/html/images/flags/au.png differ diff --git a/html/images/flags/aw.png b/html/images/flags/aw.png new file mode 100755 index 0000000..d0a9950 Binary files /dev/null and b/html/images/flags/aw.png differ diff --git a/html/images/flags/az.png b/html/images/flags/az.png new file mode 100755 index 0000000..38d856d Binary files /dev/null and b/html/images/flags/az.png differ diff --git a/html/images/flags/ba.png b/html/images/flags/ba.png new file mode 100755 index 0000000..a7802bc Binary files /dev/null and b/html/images/flags/ba.png differ diff --git a/html/images/flags/bb.png b/html/images/flags/bb.png new file mode 100755 index 0000000..205ab1f Binary files /dev/null and b/html/images/flags/bb.png differ diff --git a/html/images/flags/bd.png b/html/images/flags/bd.png new file mode 100755 index 0000000..f5d70f7 Binary files /dev/null and b/html/images/flags/bd.png differ diff --git a/html/images/flags/be.png b/html/images/flags/be.png new file mode 100755 index 0000000..cfc02c9 Binary files /dev/null and b/html/images/flags/be.png differ diff --git a/html/images/flags/bf.png b/html/images/flags/bf.png new file mode 100755 index 0000000..602d349 Binary files /dev/null and b/html/images/flags/bf.png differ diff --git a/html/images/flags/bg.png b/html/images/flags/bg.png new file mode 100755 index 0000000..41543f2 Binary files /dev/null and b/html/images/flags/bg.png differ diff --git a/html/images/flags/bh.png b/html/images/flags/bh.png new file mode 100755 index 0000000..ba1a0b3 Binary files /dev/null and b/html/images/flags/bh.png differ diff --git a/html/images/flags/bi.png b/html/images/flags/bi.png new file mode 100755 index 0000000..4a31c28 Binary files /dev/null and b/html/images/flags/bi.png differ diff --git a/html/images/flags/bj.png b/html/images/flags/bj.png new file mode 100755 index 0000000..3f633b2 Binary files /dev/null and b/html/images/flags/bj.png differ diff --git a/html/images/flags/bm.png b/html/images/flags/bm.png new file mode 100755 index 0000000..4226252 Binary files /dev/null and b/html/images/flags/bm.png differ diff --git a/html/images/flags/bn.png b/html/images/flags/bn.png new file mode 100755 index 0000000..7977797 Binary files /dev/null and b/html/images/flags/bn.png differ diff --git a/html/images/flags/bo.png b/html/images/flags/bo.png new file mode 100755 index 0000000..bcd0bed Binary files /dev/null and b/html/images/flags/bo.png differ diff --git a/html/images/flags/br.png b/html/images/flags/br.png new file mode 100755 index 0000000..006a820 Binary files /dev/null and b/html/images/flags/br.png differ diff --git a/html/images/flags/bs.png b/html/images/flags/bs.png new file mode 100755 index 0000000..c1f396b Binary files /dev/null and b/html/images/flags/bs.png differ diff --git a/html/images/flags/bt.png b/html/images/flags/bt.png new file mode 100755 index 0000000..dbc798a Binary files /dev/null and b/html/images/flags/bt.png differ diff --git a/html/images/flags/bv.png b/html/images/flags/bv.png new file mode 100755 index 0000000..bac14bc Binary files /dev/null and b/html/images/flags/bv.png differ diff --git a/html/images/flags/bw.png b/html/images/flags/bw.png new file mode 100755 index 0000000..0f578cb Binary files /dev/null and b/html/images/flags/bw.png differ diff --git a/html/images/flags/by.png b/html/images/flags/by.png new file mode 100755 index 0000000..f1e19f3 Binary files /dev/null and b/html/images/flags/by.png differ diff --git a/html/images/flags/bz.png b/html/images/flags/bz.png new file mode 100755 index 0000000..b9eb10d Binary files /dev/null and b/html/images/flags/bz.png differ diff --git a/html/images/flags/ca.png b/html/images/flags/ca.png new file mode 100755 index 0000000..0d4d74d Binary files /dev/null and b/html/images/flags/ca.png differ diff --git a/html/images/flags/cc.png b/html/images/flags/cc.png new file mode 100755 index 0000000..82310fa Binary files /dev/null and b/html/images/flags/cc.png differ diff --git a/html/images/flags/cd.png b/html/images/flags/cd.png new file mode 100755 index 0000000..05f14ca Binary files /dev/null and b/html/images/flags/cd.png differ diff --git a/html/images/flags/cf.png b/html/images/flags/cf.png new file mode 100755 index 0000000..c443e16 Binary files /dev/null and b/html/images/flags/cf.png differ diff --git a/html/images/flags/cg.png b/html/images/flags/cg.png new file mode 100755 index 0000000..503e7b3 Binary files /dev/null and b/html/images/flags/cg.png differ diff --git a/html/images/flags/ch.png b/html/images/flags/ch.png new file mode 100755 index 0000000..cf13acb Binary files /dev/null and b/html/images/flags/ch.png differ diff --git a/html/images/flags/ci.png b/html/images/flags/ci.png new file mode 100755 index 0000000..a25068b Binary files /dev/null and b/html/images/flags/ci.png differ diff --git a/html/images/flags/ck.png b/html/images/flags/ck.png new file mode 100755 index 0000000..e5a036d Binary files /dev/null and b/html/images/flags/ck.png differ diff --git a/html/images/flags/cl.png b/html/images/flags/cl.png new file mode 100755 index 0000000..bcacb1d Binary files /dev/null and b/html/images/flags/cl.png differ diff --git a/html/images/flags/cm.png b/html/images/flags/cm.png new file mode 100755 index 0000000..7ef0fec Binary files /dev/null and b/html/images/flags/cm.png differ diff --git a/html/images/flags/cn.png b/html/images/flags/cn.png new file mode 100755 index 0000000..c691364 Binary files /dev/null and b/html/images/flags/cn.png differ diff --git a/html/images/flags/co.png b/html/images/flags/co.png new file mode 100755 index 0000000..b7213de Binary files /dev/null and b/html/images/flags/co.png differ diff --git a/html/images/flags/cr.png b/html/images/flags/cr.png new file mode 100755 index 0000000..f8e7811 Binary files /dev/null and b/html/images/flags/cr.png differ diff --git a/html/images/flags/cs.png b/html/images/flags/cs.png new file mode 100755 index 0000000..33ea6c1 Binary files /dev/null and b/html/images/flags/cs.png differ diff --git a/html/images/flags/cu.png b/html/images/flags/cu.png new file mode 100755 index 0000000..4725b37 Binary files /dev/null and b/html/images/flags/cu.png differ diff --git a/html/images/flags/cv.png b/html/images/flags/cv.png new file mode 100755 index 0000000..5321516 Binary files /dev/null and b/html/images/flags/cv.png differ diff --git a/html/images/flags/cx.png b/html/images/flags/cx.png new file mode 100755 index 0000000..e197852 Binary files /dev/null and b/html/images/flags/cx.png differ diff --git a/html/images/flags/cy.png b/html/images/flags/cy.png new file mode 100755 index 0000000..94c1333 Binary files /dev/null and b/html/images/flags/cy.png differ diff --git a/html/images/flags/cz.png b/html/images/flags/cz.png new file mode 100755 index 0000000..0a3bedf Binary files /dev/null and b/html/images/flags/cz.png differ diff --git a/html/images/flags/de.png b/html/images/flags/de.png new file mode 100755 index 0000000..6971ba3 Binary files /dev/null and b/html/images/flags/de.png differ diff --git a/html/images/flags/dj.png b/html/images/flags/dj.png new file mode 100755 index 0000000..a9b2adf Binary files /dev/null and b/html/images/flags/dj.png differ diff --git a/html/images/flags/dk.png b/html/images/flags/dk.png new file mode 100755 index 0000000..8f34fe5 Binary files /dev/null and b/html/images/flags/dk.png differ diff --git a/html/images/flags/dm.png b/html/images/flags/dm.png new file mode 100755 index 0000000..31fa4cd Binary files /dev/null and b/html/images/flags/dm.png differ diff --git a/html/images/flags/do.png b/html/images/flags/do.png new file mode 100755 index 0000000..818b2ce Binary files /dev/null and b/html/images/flags/do.png differ diff --git a/html/images/flags/dz.png b/html/images/flags/dz.png new file mode 100755 index 0000000..0b1b336 Binary files /dev/null and b/html/images/flags/dz.png differ diff --git a/html/images/flags/ec.png b/html/images/flags/ec.png new file mode 100755 index 0000000..a9a1e8b Binary files /dev/null and b/html/images/flags/ec.png differ diff --git a/html/images/flags/ee.png b/html/images/flags/ee.png new file mode 100755 index 0000000..a8fc075 Binary files /dev/null and b/html/images/flags/ee.png differ diff --git a/html/images/flags/eg.png b/html/images/flags/eg.png new file mode 100755 index 0000000..02b02e5 Binary files /dev/null and b/html/images/flags/eg.png differ diff --git a/html/images/flags/eh.png b/html/images/flags/eh.png new file mode 100755 index 0000000..9f6cb1c Binary files /dev/null and b/html/images/flags/eh.png differ diff --git a/html/images/flags/er.png b/html/images/flags/er.png new file mode 100755 index 0000000..6811a68 Binary files /dev/null and b/html/images/flags/er.png differ diff --git a/html/images/flags/es.png b/html/images/flags/es.png new file mode 100755 index 0000000..bba29f5 Binary files /dev/null and b/html/images/flags/es.png differ diff --git a/html/images/flags/et.png b/html/images/flags/et.png new file mode 100755 index 0000000..d7904c9 Binary files /dev/null and b/html/images/flags/et.png differ diff --git a/html/images/flags/fi.png b/html/images/flags/fi.png new file mode 100755 index 0000000..9144a0f Binary files /dev/null and b/html/images/flags/fi.png differ diff --git a/html/images/flags/fj.png b/html/images/flags/fj.png new file mode 100755 index 0000000..fbe2eb6 Binary files /dev/null and b/html/images/flags/fj.png differ diff --git a/html/images/flags/fk.png b/html/images/flags/fk.png new file mode 100755 index 0000000..2b721f9 Binary files /dev/null and b/html/images/flags/fk.png differ diff --git a/html/images/flags/fm.png b/html/images/flags/fm.png new file mode 100755 index 0000000..1a91064 Binary files /dev/null and b/html/images/flags/fm.png differ diff --git a/html/images/flags/fo.png b/html/images/flags/fo.png new file mode 100755 index 0000000..5e17381 Binary files /dev/null and b/html/images/flags/fo.png differ diff --git a/html/images/flags/fr.png b/html/images/flags/fr.png new file mode 100755 index 0000000..b0c177f Binary files /dev/null and b/html/images/flags/fr.png differ diff --git a/html/images/flags/ga.png b/html/images/flags/ga.png new file mode 100755 index 0000000..744515d Binary files /dev/null and b/html/images/flags/ga.png differ diff --git a/html/images/flags/gb.png b/html/images/flags/gb.png new file mode 100755 index 0000000..ce4c90a Binary files /dev/null and b/html/images/flags/gb.png differ diff --git a/html/images/flags/gd.png b/html/images/flags/gd.png new file mode 100755 index 0000000..70467ac Binary files /dev/null and b/html/images/flags/gd.png differ diff --git a/html/images/flags/ge.png b/html/images/flags/ge.png new file mode 100755 index 0000000..3768ccd Binary files /dev/null and b/html/images/flags/ge.png differ diff --git a/html/images/flags/gf.png b/html/images/flags/gf.png new file mode 100755 index 0000000..d4616ed Binary files /dev/null and b/html/images/flags/gf.png differ diff --git a/html/images/flags/gh.png b/html/images/flags/gh.png new file mode 100755 index 0000000..3f3b980 Binary files /dev/null and b/html/images/flags/gh.png differ diff --git a/html/images/flags/gi.png b/html/images/flags/gi.png new file mode 100755 index 0000000..482c717 Binary files /dev/null and b/html/images/flags/gi.png differ diff --git a/html/images/flags/gl.png b/html/images/flags/gl.png new file mode 100755 index 0000000..39fb25e Binary files /dev/null and b/html/images/flags/gl.png differ diff --git a/html/images/flags/gm.png b/html/images/flags/gm.png new file mode 100755 index 0000000..95cce12 Binary files /dev/null and b/html/images/flags/gm.png differ diff --git a/html/images/flags/gn.png b/html/images/flags/gn.png new file mode 100755 index 0000000..5f8bba1 Binary files /dev/null and b/html/images/flags/gn.png differ diff --git a/html/images/flags/gp.png b/html/images/flags/gp.png new file mode 100755 index 0000000..5525d33 Binary files /dev/null and b/html/images/flags/gp.png differ diff --git a/html/images/flags/gq.png b/html/images/flags/gq.png new file mode 100755 index 0000000..2cbd4a8 Binary files /dev/null and b/html/images/flags/gq.png differ diff --git a/html/images/flags/gr.png b/html/images/flags/gr.png new file mode 100755 index 0000000..45b1589 Binary files /dev/null and b/html/images/flags/gr.png differ diff --git a/html/images/flags/gs.png b/html/images/flags/gs.png new file mode 100755 index 0000000..7706171 Binary files /dev/null and b/html/images/flags/gs.png differ diff --git a/html/images/flags/gt.png b/html/images/flags/gt.png new file mode 100755 index 0000000..6ecdbff Binary files /dev/null and b/html/images/flags/gt.png differ diff --git a/html/images/flags/gu.png b/html/images/flags/gu.png new file mode 100755 index 0000000..bce752f Binary files /dev/null and b/html/images/flags/gu.png differ diff --git a/html/images/flags/gw.png b/html/images/flags/gw.png new file mode 100755 index 0000000..5e70972 Binary files /dev/null and b/html/images/flags/gw.png differ diff --git a/html/images/flags/gy.png b/html/images/flags/gy.png new file mode 100755 index 0000000..2cb64d2 Binary files /dev/null and b/html/images/flags/gy.png differ diff --git a/html/images/flags/hk.png b/html/images/flags/hk.png new file mode 100755 index 0000000..5fb3aff Binary files /dev/null and b/html/images/flags/hk.png differ diff --git a/html/images/flags/hm.png b/html/images/flags/hm.png new file mode 100755 index 0000000..214924d Binary files /dev/null and b/html/images/flags/hm.png differ diff --git a/html/images/flags/hn.png b/html/images/flags/hn.png new file mode 100755 index 0000000..de08a36 Binary files /dev/null and b/html/images/flags/hn.png differ diff --git a/html/images/flags/hr.png b/html/images/flags/hr.png new file mode 100755 index 0000000..3d8d894 Binary files /dev/null and b/html/images/flags/hr.png differ diff --git a/html/images/flags/ht.png b/html/images/flags/ht.png new file mode 100755 index 0000000..dc6d443 Binary files /dev/null and b/html/images/flags/ht.png differ diff --git a/html/images/flags/hu.png b/html/images/flags/hu.png new file mode 100755 index 0000000..d9eb523 Binary files /dev/null and b/html/images/flags/hu.png differ diff --git a/html/images/flags/id.png b/html/images/flags/id.png new file mode 100755 index 0000000..f62aaaa Binary files /dev/null and b/html/images/flags/id.png differ diff --git a/html/images/flags/ie.png b/html/images/flags/ie.png new file mode 100755 index 0000000..c7be694 Binary files /dev/null and b/html/images/flags/ie.png differ diff --git a/html/images/flags/il.png b/html/images/flags/il.png new file mode 100755 index 0000000..4f8743e Binary files /dev/null and b/html/images/flags/il.png differ diff --git a/html/images/flags/in.png b/html/images/flags/in.png new file mode 100755 index 0000000..f1d201f Binary files /dev/null and b/html/images/flags/in.png differ diff --git a/html/images/flags/index.htm b/html/images/flags/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/images/flags/io.png b/html/images/flags/io.png new file mode 100755 index 0000000..9ece8ab Binary files /dev/null and b/html/images/flags/io.png differ diff --git a/html/images/flags/iq.png b/html/images/flags/iq.png new file mode 100755 index 0000000..80561ac Binary files /dev/null and b/html/images/flags/iq.png differ diff --git a/html/images/flags/ir.png b/html/images/flags/ir.png new file mode 100755 index 0000000..395c6e7 Binary files /dev/null and b/html/images/flags/ir.png differ diff --git a/html/images/flags/is.png b/html/images/flags/is.png new file mode 100755 index 0000000..bf733b5 Binary files /dev/null and b/html/images/flags/is.png differ diff --git a/html/images/flags/it.png b/html/images/flags/it.png new file mode 100755 index 0000000..480f387 Binary files /dev/null and b/html/images/flags/it.png differ diff --git a/html/images/flags/jm.png b/html/images/flags/jm.png new file mode 100755 index 0000000..1524b9e Binary files /dev/null and b/html/images/flags/jm.png differ diff --git a/html/images/flags/jo.png b/html/images/flags/jo.png new file mode 100755 index 0000000..4d25698 Binary files /dev/null and b/html/images/flags/jo.png differ diff --git a/html/images/flags/jp.png b/html/images/flags/jp.png new file mode 100755 index 0000000..5aacb34 Binary files /dev/null and b/html/images/flags/jp.png differ diff --git a/html/images/flags/ke.png b/html/images/flags/ke.png new file mode 100755 index 0000000..59c790a Binary files /dev/null and b/html/images/flags/ke.png differ diff --git a/html/images/flags/kg.png b/html/images/flags/kg.png new file mode 100755 index 0000000..9a02593 Binary files /dev/null and b/html/images/flags/kg.png differ diff --git a/html/images/flags/kh.png b/html/images/flags/kh.png new file mode 100755 index 0000000..8fad7cb Binary files /dev/null and b/html/images/flags/kh.png differ diff --git a/html/images/flags/ki.png b/html/images/flags/ki.png new file mode 100755 index 0000000..71c515a Binary files /dev/null and b/html/images/flags/ki.png differ diff --git a/html/images/flags/km.png b/html/images/flags/km.png new file mode 100755 index 0000000..f0aab2e Binary files /dev/null and b/html/images/flags/km.png differ diff --git a/html/images/flags/kn.png b/html/images/flags/kn.png new file mode 100755 index 0000000..887c87c Binary files /dev/null and b/html/images/flags/kn.png differ diff --git a/html/images/flags/kp.png b/html/images/flags/kp.png new file mode 100755 index 0000000..139afed Binary files /dev/null and b/html/images/flags/kp.png differ diff --git a/html/images/flags/kr.png b/html/images/flags/kr.png new file mode 100755 index 0000000..425c9a9 Binary files /dev/null and b/html/images/flags/kr.png differ diff --git a/html/images/flags/kw.png b/html/images/flags/kw.png new file mode 100755 index 0000000..a4c27ff Binary files /dev/null and b/html/images/flags/kw.png differ diff --git a/html/images/flags/ky.png b/html/images/flags/ky.png new file mode 100755 index 0000000..b9e233c Binary files /dev/null and b/html/images/flags/ky.png differ diff --git a/html/images/flags/kz.png b/html/images/flags/kz.png new file mode 100755 index 0000000..215c45c Binary files /dev/null and b/html/images/flags/kz.png differ diff --git a/html/images/flags/la.png b/html/images/flags/la.png new file mode 100755 index 0000000..fd70e04 Binary files /dev/null and b/html/images/flags/la.png differ diff --git a/html/images/flags/lb.png b/html/images/flags/lb.png new file mode 100755 index 0000000..cbc27a2 Binary files /dev/null and b/html/images/flags/lb.png differ diff --git a/html/images/flags/lc.png b/html/images/flags/lc.png new file mode 100755 index 0000000..b47370b Binary files /dev/null and b/html/images/flags/lc.png differ diff --git a/html/images/flags/li.png b/html/images/flags/li.png new file mode 100755 index 0000000..156079c Binary files /dev/null and b/html/images/flags/li.png differ diff --git a/html/images/flags/lk.png b/html/images/flags/lk.png new file mode 100755 index 0000000..91c7a51 Binary files /dev/null and b/html/images/flags/lk.png differ diff --git a/html/images/flags/lr.png b/html/images/flags/lr.png new file mode 100755 index 0000000..a779984 Binary files /dev/null and b/html/images/flags/lr.png differ diff --git a/html/images/flags/ls.png b/html/images/flags/ls.png new file mode 100755 index 0000000..377d7da Binary files /dev/null and b/html/images/flags/ls.png differ diff --git a/html/images/flags/lt.png b/html/images/flags/lt.png new file mode 100755 index 0000000..8cf8561 Binary files /dev/null and b/html/images/flags/lt.png differ diff --git a/html/images/flags/lu.png b/html/images/flags/lu.png new file mode 100755 index 0000000..0925952 Binary files /dev/null and b/html/images/flags/lu.png differ diff --git a/html/images/flags/lv.png b/html/images/flags/lv.png new file mode 100755 index 0000000..72511ac Binary files /dev/null and b/html/images/flags/lv.png differ diff --git a/html/images/flags/ly.png b/html/images/flags/ly.png new file mode 100755 index 0000000..c3ff32e Binary files /dev/null and b/html/images/flags/ly.png differ diff --git a/html/images/flags/ma.png b/html/images/flags/ma.png new file mode 100755 index 0000000..70f0912 Binary files /dev/null and b/html/images/flags/ma.png differ diff --git a/html/images/flags/mc.png b/html/images/flags/mc.png new file mode 100755 index 0000000..e28ffd6 Binary files /dev/null and b/html/images/flags/mc.png differ diff --git a/html/images/flags/md.png b/html/images/flags/md.png new file mode 100755 index 0000000..a48b555 Binary files /dev/null and b/html/images/flags/md.png differ diff --git a/html/images/flags/mg.png b/html/images/flags/mg.png new file mode 100755 index 0000000..7d59a91 Binary files /dev/null and b/html/images/flags/mg.png differ diff --git a/html/images/flags/mh.png b/html/images/flags/mh.png new file mode 100755 index 0000000..7463976 Binary files /dev/null and b/html/images/flags/mh.png differ diff --git a/html/images/flags/mk.png b/html/images/flags/mk.png new file mode 100755 index 0000000..2e72beb Binary files /dev/null and b/html/images/flags/mk.png differ diff --git a/html/images/flags/ml.png b/html/images/flags/ml.png new file mode 100755 index 0000000..36a632e Binary files /dev/null and b/html/images/flags/ml.png differ diff --git a/html/images/flags/mm.png b/html/images/flags/mm.png new file mode 100755 index 0000000..86ecd2c Binary files /dev/null and b/html/images/flags/mm.png differ diff --git a/html/images/flags/mn.png b/html/images/flags/mn.png new file mode 100755 index 0000000..22aa6cb Binary files /dev/null and b/html/images/flags/mn.png differ diff --git a/html/images/flags/mo.png b/html/images/flags/mo.png new file mode 100755 index 0000000..f22e255 Binary files /dev/null and b/html/images/flags/mo.png differ diff --git a/html/images/flags/mp.png b/html/images/flags/mp.png new file mode 100755 index 0000000..9cdccae Binary files /dev/null and b/html/images/flags/mp.png differ diff --git a/html/images/flags/mq.png b/html/images/flags/mq.png new file mode 100755 index 0000000..d4616ed Binary files /dev/null and b/html/images/flags/mq.png differ diff --git a/html/images/flags/mr.png b/html/images/flags/mr.png new file mode 100755 index 0000000..1460ab7 Binary files /dev/null and b/html/images/flags/mr.png differ diff --git a/html/images/flags/ms.png b/html/images/flags/ms.png new file mode 100755 index 0000000..31e6ef0 Binary files /dev/null and b/html/images/flags/ms.png differ diff --git a/html/images/flags/mt.png b/html/images/flags/mt.png new file mode 100755 index 0000000..bb243c5 Binary files /dev/null and b/html/images/flags/mt.png differ diff --git a/html/images/flags/mu.png b/html/images/flags/mu.png new file mode 100755 index 0000000..d8b22cc Binary files /dev/null and b/html/images/flags/mu.png differ diff --git a/html/images/flags/mv.png b/html/images/flags/mv.png new file mode 100755 index 0000000..0024b86 Binary files /dev/null and b/html/images/flags/mv.png differ diff --git a/html/images/flags/mw.png b/html/images/flags/mw.png new file mode 100755 index 0000000..975fb0a Binary files /dev/null and b/html/images/flags/mw.png differ diff --git a/html/images/flags/mx.png b/html/images/flags/mx.png new file mode 100755 index 0000000..98be90b Binary files /dev/null and b/html/images/flags/mx.png differ diff --git a/html/images/flags/my.png b/html/images/flags/my.png new file mode 100755 index 0000000..1865930 Binary files /dev/null and b/html/images/flags/my.png differ diff --git a/html/images/flags/mz.png b/html/images/flags/mz.png new file mode 100755 index 0000000..87672b7 Binary files /dev/null and b/html/images/flags/mz.png differ diff --git a/html/images/flags/na.png b/html/images/flags/na.png new file mode 100755 index 0000000..040daf2 Binary files /dev/null and b/html/images/flags/na.png differ diff --git a/html/images/flags/nc.png b/html/images/flags/nc.png new file mode 100755 index 0000000..bf6f02e Binary files /dev/null and b/html/images/flags/nc.png differ diff --git a/html/images/flags/ne.png b/html/images/flags/ne.png new file mode 100755 index 0000000..8e6eb32 Binary files /dev/null and b/html/images/flags/ne.png differ diff --git a/html/images/flags/nf.png b/html/images/flags/nf.png new file mode 100755 index 0000000..9060d53 Binary files /dev/null and b/html/images/flags/nf.png differ diff --git a/html/images/flags/ng.png b/html/images/flags/ng.png new file mode 100755 index 0000000..46dceb2 Binary files /dev/null and b/html/images/flags/ng.png differ diff --git a/html/images/flags/ni.png b/html/images/flags/ni.png new file mode 100755 index 0000000..4527065 Binary files /dev/null and b/html/images/flags/ni.png differ diff --git a/html/images/flags/nl.png b/html/images/flags/nl.png new file mode 100755 index 0000000..c078391 Binary files /dev/null and b/html/images/flags/nl.png differ diff --git a/html/images/flags/no.png b/html/images/flags/no.png new file mode 100755 index 0000000..d0073fd Binary files /dev/null and b/html/images/flags/no.png differ diff --git a/html/images/flags/np.png b/html/images/flags/np.png new file mode 100755 index 0000000..543c902 Binary files /dev/null and b/html/images/flags/np.png differ diff --git a/html/images/flags/nr.png b/html/images/flags/nr.png new file mode 100755 index 0000000..05ba8e1 Binary files /dev/null and b/html/images/flags/nr.png differ diff --git a/html/images/flags/nu.png b/html/images/flags/nu.png new file mode 100755 index 0000000..eafce7b Binary files /dev/null and b/html/images/flags/nu.png differ diff --git a/html/images/flags/nz.png b/html/images/flags/nz.png new file mode 100755 index 0000000..af703c0 Binary files /dev/null and b/html/images/flags/nz.png differ diff --git a/html/images/flags/om.png b/html/images/flags/om.png new file mode 100755 index 0000000..e1c9598 Binary files /dev/null and b/html/images/flags/om.png differ diff --git a/html/images/flags/pa.png b/html/images/flags/pa.png new file mode 100755 index 0000000..aca9541 Binary files /dev/null and b/html/images/flags/pa.png differ diff --git a/html/images/flags/pe.png b/html/images/flags/pe.png new file mode 100755 index 0000000..a801662 Binary files /dev/null and b/html/images/flags/pe.png differ diff --git a/html/images/flags/pf.png b/html/images/flags/pf.png new file mode 100755 index 0000000..cf4d029 Binary files /dev/null and b/html/images/flags/pf.png differ diff --git a/html/images/flags/pg.png b/html/images/flags/pg.png new file mode 100755 index 0000000..d704154 Binary files /dev/null and b/html/images/flags/pg.png differ diff --git a/html/images/flags/ph.png b/html/images/flags/ph.png new file mode 100755 index 0000000..55d850e Binary files /dev/null and b/html/images/flags/ph.png differ diff --git a/html/images/flags/pk.png b/html/images/flags/pk.png new file mode 100755 index 0000000..4c8ee9f Binary files /dev/null and b/html/images/flags/pk.png differ diff --git a/html/images/flags/pl.png b/html/images/flags/pl.png new file mode 100755 index 0000000..eb722dc Binary files /dev/null and b/html/images/flags/pl.png differ diff --git a/html/images/flags/pm.png b/html/images/flags/pm.png new file mode 100755 index 0000000..681bcd8 Binary files /dev/null and b/html/images/flags/pm.png differ diff --git a/html/images/flags/pn.png b/html/images/flags/pn.png new file mode 100755 index 0000000..f5743c5 Binary files /dev/null and b/html/images/flags/pn.png differ diff --git a/html/images/flags/pr.png b/html/images/flags/pr.png new file mode 100755 index 0000000..0536dcb Binary files /dev/null and b/html/images/flags/pr.png differ diff --git a/html/images/flags/ps.png b/html/images/flags/ps.png new file mode 100755 index 0000000..94c6512 Binary files /dev/null and b/html/images/flags/ps.png differ diff --git a/html/images/flags/pt.png b/html/images/flags/pt.png new file mode 100755 index 0000000..6cd086e Binary files /dev/null and b/html/images/flags/pt.png differ diff --git a/html/images/flags/pw.png b/html/images/flags/pw.png new file mode 100755 index 0000000..6ab9422 Binary files /dev/null and b/html/images/flags/pw.png differ diff --git a/html/images/flags/py.png b/html/images/flags/py.png new file mode 100755 index 0000000..2eab2bf Binary files /dev/null and b/html/images/flags/py.png differ diff --git a/html/images/flags/qa.png b/html/images/flags/qa.png new file mode 100755 index 0000000..0b8c897 Binary files /dev/null and b/html/images/flags/qa.png differ diff --git a/html/images/flags/re.png b/html/images/flags/re.png new file mode 100755 index 0000000..d4616ed Binary files /dev/null and b/html/images/flags/re.png differ diff --git a/html/images/flags/ro.png b/html/images/flags/ro.png new file mode 100755 index 0000000..ce0a889 Binary files /dev/null and b/html/images/flags/ro.png differ diff --git a/html/images/flags/ru.png b/html/images/flags/ru.png new file mode 100755 index 0000000..fb4f54a Binary files /dev/null and b/html/images/flags/ru.png differ diff --git a/html/images/flags/rw.png b/html/images/flags/rw.png new file mode 100755 index 0000000..774d035 Binary files /dev/null and b/html/images/flags/rw.png differ diff --git a/html/images/flags/sa.png b/html/images/flags/sa.png new file mode 100755 index 0000000..80b0a05 Binary files /dev/null and b/html/images/flags/sa.png differ diff --git a/html/images/flags/sb.png b/html/images/flags/sb.png new file mode 100755 index 0000000..7b75f5c Binary files /dev/null and b/html/images/flags/sb.png differ diff --git a/html/images/flags/sc.png b/html/images/flags/sc.png new file mode 100755 index 0000000..804ff98 Binary files /dev/null and b/html/images/flags/sc.png differ diff --git a/html/images/flags/sd.png b/html/images/flags/sd.png new file mode 100755 index 0000000..75229d5 Binary files /dev/null and b/html/images/flags/sd.png differ diff --git a/html/images/flags/se.png b/html/images/flags/se.png new file mode 100755 index 0000000..e13cc6f Binary files /dev/null and b/html/images/flags/se.png differ diff --git a/html/images/flags/sg.png b/html/images/flags/sg.png new file mode 100755 index 0000000..337b1be Binary files /dev/null and b/html/images/flags/sg.png differ diff --git a/html/images/flags/sh.png b/html/images/flags/sh.png new file mode 100755 index 0000000..c696327 Binary files /dev/null and b/html/images/flags/sh.png differ diff --git a/html/images/flags/si.png b/html/images/flags/si.png new file mode 100755 index 0000000..907b389 Binary files /dev/null and b/html/images/flags/si.png differ diff --git a/html/images/flags/sj.png b/html/images/flags/sj.png new file mode 100755 index 0000000..bac14bc Binary files /dev/null and b/html/images/flags/sj.png differ diff --git a/html/images/flags/sk.png b/html/images/flags/sk.png new file mode 100755 index 0000000..6ab7df8 Binary files /dev/null and b/html/images/flags/sk.png differ diff --git a/html/images/flags/sl.png b/html/images/flags/sl.png new file mode 100755 index 0000000..4c543da Binary files /dev/null and b/html/images/flags/sl.png differ diff --git a/html/images/flags/sm.png b/html/images/flags/sm.png new file mode 100755 index 0000000..fe0cace Binary files /dev/null and b/html/images/flags/sm.png differ diff --git a/html/images/flags/sn.png b/html/images/flags/sn.png new file mode 100755 index 0000000..e3edef7 Binary files /dev/null and b/html/images/flags/sn.png differ diff --git a/html/images/flags/so.png b/html/images/flags/so.png new file mode 100755 index 0000000..2c34d60 Binary files /dev/null and b/html/images/flags/so.png differ diff --git a/html/images/flags/sr.png b/html/images/flags/sr.png new file mode 100755 index 0000000..8ccf0c1 Binary files /dev/null and b/html/images/flags/sr.png differ diff --git a/html/images/flags/st.png b/html/images/flags/st.png new file mode 100755 index 0000000..c83b44c Binary files /dev/null and b/html/images/flags/st.png differ diff --git a/html/images/flags/sv.png b/html/images/flags/sv.png new file mode 100755 index 0000000..f6e2c2f Binary files /dev/null and b/html/images/flags/sv.png differ diff --git a/html/images/flags/sy.png b/html/images/flags/sy.png new file mode 100755 index 0000000..9f2dc3e Binary files /dev/null and b/html/images/flags/sy.png differ diff --git a/html/images/flags/sz.png b/html/images/flags/sz.png new file mode 100755 index 0000000..c880f71 Binary files /dev/null and b/html/images/flags/sz.png differ diff --git a/html/images/flags/tc.png b/html/images/flags/tc.png new file mode 100755 index 0000000..a4d1069 Binary files /dev/null and b/html/images/flags/tc.png differ diff --git a/html/images/flags/td.png b/html/images/flags/td.png new file mode 100755 index 0000000..cf8e057 Binary files /dev/null and b/html/images/flags/td.png differ diff --git a/html/images/flags/tf.png b/html/images/flags/tf.png new file mode 100755 index 0000000..88d2158 Binary files /dev/null and b/html/images/flags/tf.png differ diff --git a/html/images/flags/tg.png b/html/images/flags/tg.png new file mode 100755 index 0000000..c360da6 Binary files /dev/null and b/html/images/flags/tg.png differ diff --git a/html/images/flags/th.png b/html/images/flags/th.png new file mode 100755 index 0000000..eed829d Binary files /dev/null and b/html/images/flags/th.png differ diff --git a/html/images/flags/ti.png b/html/images/flags/ti.png new file mode 100755 index 0000000..6eacaf4 Binary files /dev/null and b/html/images/flags/ti.png differ diff --git a/html/images/flags/tj.png b/html/images/flags/tj.png new file mode 100755 index 0000000..efad9a5 Binary files /dev/null and b/html/images/flags/tj.png differ diff --git a/html/images/flags/tk.png b/html/images/flags/tk.png new file mode 100755 index 0000000..36a08b1 Binary files /dev/null and b/html/images/flags/tk.png differ diff --git a/html/images/flags/tl.png b/html/images/flags/tl.png new file mode 100755 index 0000000..b5df531 Binary files /dev/null and b/html/images/flags/tl.png differ diff --git a/html/images/flags/tm.png b/html/images/flags/tm.png new file mode 100755 index 0000000..88d2158 Binary files /dev/null and b/html/images/flags/tm.png differ diff --git a/html/images/flags/tn.png b/html/images/flags/tn.png new file mode 100755 index 0000000..3475a44 Binary files /dev/null and b/html/images/flags/tn.png differ diff --git a/html/images/flags/to.png b/html/images/flags/to.png new file mode 100755 index 0000000..7be6de8 Binary files /dev/null and b/html/images/flags/to.png differ diff --git a/html/images/flags/tp.png b/html/images/flags/tp.png new file mode 100755 index 0000000..c5884b6 Binary files /dev/null and b/html/images/flags/tp.png differ diff --git a/html/images/flags/tr.png b/html/images/flags/tr.png new file mode 100755 index 0000000..d9dfbb8 Binary files /dev/null and b/html/images/flags/tr.png differ diff --git a/html/images/flags/tt.png b/html/images/flags/tt.png new file mode 100755 index 0000000..5b37c6f Binary files /dev/null and b/html/images/flags/tt.png differ diff --git a/html/images/flags/tv.png b/html/images/flags/tv.png new file mode 100755 index 0000000..23614ac Binary files /dev/null and b/html/images/flags/tv.png differ diff --git a/html/images/flags/tw.png b/html/images/flags/tw.png new file mode 100755 index 0000000..9787569 Binary files /dev/null and b/html/images/flags/tw.png differ diff --git a/html/images/flags/tz.png b/html/images/flags/tz.png new file mode 100755 index 0000000..3d39b1b Binary files /dev/null and b/html/images/flags/tz.png differ diff --git a/html/images/flags/ua.png b/html/images/flags/ua.png new file mode 100755 index 0000000..1fbe64c Binary files /dev/null and b/html/images/flags/ua.png differ diff --git a/html/images/flags/ug.png b/html/images/flags/ug.png new file mode 100755 index 0000000..3a7f3a4 Binary files /dev/null and b/html/images/flags/ug.png differ diff --git a/html/images/flags/uk.png b/html/images/flags/uk.png new file mode 100755 index 0000000..ce4c90a Binary files /dev/null and b/html/images/flags/uk.png differ diff --git a/html/images/flags/um.png b/html/images/flags/um.png new file mode 100755 index 0000000..a21bdc5 Binary files /dev/null and b/html/images/flags/um.png differ diff --git a/html/images/flags/us.png b/html/images/flags/us.png new file mode 100755 index 0000000..d2eacb2 Binary files /dev/null and b/html/images/flags/us.png differ diff --git a/html/images/flags/uy.png b/html/images/flags/uy.png new file mode 100755 index 0000000..e279248 Binary files /dev/null and b/html/images/flags/uy.png differ diff --git a/html/images/flags/uz.png b/html/images/flags/uz.png new file mode 100755 index 0000000..456d359 Binary files /dev/null and b/html/images/flags/uz.png differ diff --git a/html/images/flags/va.png b/html/images/flags/va.png new file mode 100755 index 0000000..c3c20ba Binary files /dev/null and b/html/images/flags/va.png differ diff --git a/html/images/flags/vc.png b/html/images/flags/vc.png new file mode 100755 index 0000000..6824712 Binary files /dev/null and b/html/images/flags/vc.png differ diff --git a/html/images/flags/ve.png b/html/images/flags/ve.png new file mode 100755 index 0000000..ef96a14 Binary files /dev/null and b/html/images/flags/ve.png differ diff --git a/html/images/flags/vg.png b/html/images/flags/vg.png new file mode 100755 index 0000000..66c42a1 Binary files /dev/null and b/html/images/flags/vg.png differ diff --git a/html/images/flags/vi.png b/html/images/flags/vi.png new file mode 100755 index 0000000..8ff456e Binary files /dev/null and b/html/images/flags/vi.png differ diff --git a/html/images/flags/vn.png b/html/images/flags/vn.png new file mode 100755 index 0000000..36e2155 Binary files /dev/null and b/html/images/flags/vn.png differ diff --git a/html/images/flags/vu.png b/html/images/flags/vu.png new file mode 100755 index 0000000..4962e7b Binary files /dev/null and b/html/images/flags/vu.png differ diff --git a/html/images/flags/wf.png b/html/images/flags/wf.png new file mode 100755 index 0000000..d4616ed Binary files /dev/null and b/html/images/flags/wf.png differ diff --git a/html/images/flags/ws.png b/html/images/flags/ws.png new file mode 100755 index 0000000..dd4e683 Binary files /dev/null and b/html/images/flags/ws.png differ diff --git a/html/images/flags/xx.png b/html/images/flags/xx.png new file mode 100755 index 0000000..cd2dafb Binary files /dev/null and b/html/images/flags/xx.png differ diff --git a/html/images/flags/ye.png b/html/images/flags/ye.png new file mode 100755 index 0000000..87463a8 Binary files /dev/null and b/html/images/flags/ye.png differ diff --git a/html/images/flags/yt.png b/html/images/flags/yt.png new file mode 100755 index 0000000..d4616ed Binary files /dev/null and b/html/images/flags/yt.png differ diff --git a/html/images/flags/yu.png b/html/images/flags/yu.png new file mode 100755 index 0000000..33ea6c1 Binary files /dev/null and b/html/images/flags/yu.png differ diff --git a/html/images/flags/za.png b/html/images/flags/za.png new file mode 100755 index 0000000..e10ff5a Binary files /dev/null and b/html/images/flags/za.png differ diff --git a/html/images/flags/zm.png b/html/images/flags/zm.png new file mode 100755 index 0000000..4fe4cbe Binary files /dev/null and b/html/images/flags/zm.png differ diff --git a/html/images/flags/zw.png b/html/images/flags/zw.png new file mode 100755 index 0000000..413ae62 Binary files /dev/null and b/html/images/flags/zw.png differ diff --git a/html/images/fonts/arbocrest.ttf b/html/images/fonts/arbocrest.ttf new file mode 100755 index 0000000..934f65e Binary files /dev/null and b/html/images/fonts/arbocrest.ttf differ diff --git a/html/images/fonts/arbocrest.txt b/html/images/fonts/arbocrest.txt new file mode 100755 index 0000000..ecc9bf4 --- /dev/null +++ b/html/images/fonts/arbocrest.txt @@ -0,0 +1,36 @@ +------------------------------------------------------------------------ +ShyFonts Freeware Terms of Use +------------------------------------------------------------------------ + +By downloading this font package you agree to the following terms +of use: + + - This FONT PACKAGE is freeware. + + - This FONT PACKAGE may be distributed ONLY via the Internet for + FREE. Under NO circumstances may this FONT PACKAGE be sold for + a profit nor be included as part of another product or CD-ROM + compilation. If you wish to include this FONT PACKAGE for FREE + distribution on your Web Site, please include all of the fonts + and original documentation supplied with this FONT PACKAGE. + + - You may install and use this FONT PACKAGE on an unlimited + amount of machines. + + - You may NOT rename, edit, or create any alternate variations of + the fonts included in this FONT PACKAGE. + + - This FONT PACKAGE comes "as is" with NO warranty whatsoever. + SHYFONTS accepts NO responsibility for any damages or loss of + any kind due to the use of this FONT PACKAGE. The use of this + FONT PACKAGE is solely your responsibility -- you use this FONT + PACKAGE at your own risk. + + - Enjoy the fonts! + +If you have any question regarding this document or the usage of +this font package, feel free to contact us at info@shyfonts.com. +Thank you for downloading this font package and enjoy! + +------------------------------------------------------------------------ +©1999 ShyFonts Type Foundry -- http://www.shyfonts.com \ No newline at end of file diff --git a/html/images/fonts/index.htm b/html/images/fonts/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/images/index.htm b/html/images/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/images/magnify.gif b/html/images/magnify.gif new file mode 100755 index 0000000..18119f2 Binary files /dev/null and b/html/images/magnify.gif differ diff --git a/html/images/maps/blank.jpg b/html/images/maps/blank.jpg new file mode 100755 index 0000000..f63726c Binary files /dev/null and b/html/images/maps/blank.jpg differ diff --git a/html/images/maps/index.htm b/html/images/maps/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/images/ranks/1.png b/html/images/ranks/1.png new file mode 100755 index 0000000..8b89495 Binary files /dev/null and b/html/images/ranks/1.png differ diff --git a/html/images/ranks/2.png b/html/images/ranks/2.png new file mode 100755 index 0000000..5942ac0 Binary files /dev/null and b/html/images/ranks/2.png differ diff --git a/html/images/ranks/3.png b/html/images/ranks/3.png new file mode 100755 index 0000000..6c5b6d6 Binary files /dev/null and b/html/images/ranks/3.png differ diff --git a/html/images/ranks/down.png b/html/images/ranks/down.png new file mode 100755 index 0000000..e6a4976 Binary files /dev/null and b/html/images/ranks/down.png differ diff --git a/html/images/ranks/index.htm b/html/images/ranks/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/images/ranks/same.png b/html/images/ranks/same.png new file mode 100755 index 0000000..81a5ed8 Binary files /dev/null and b/html/images/ranks/same.png differ diff --git a/html/images/ranks/up.png b/html/images/ranks/up.png new file mode 100755 index 0000000..8e8a64a Binary files /dev/null and b/html/images/ranks/up.png differ diff --git a/html/images/s_asc.png b/html/images/s_asc.png new file mode 100755 index 0000000..9990376 Binary files /dev/null and b/html/images/s_asc.png differ diff --git a/html/images/s_desc.png b/html/images/s_desc.png new file mode 100755 index 0000000..a03226d Binary files /dev/null and b/html/images/s_desc.png differ diff --git a/html/images/sidebar.gif b/html/images/sidebar.gif new file mode 100755 index 0000000..49d4efe Binary files /dev/null and b/html/images/sidebar.gif differ diff --git a/html/images/statslogo.gif b/html/images/statslogo.gif new file mode 100755 index 0000000..9557cd7 Binary files /dev/null and b/html/images/statslogo.gif differ diff --git a/html/images/templates/basic.png b/html/images/templates/basic.png new file mode 100755 index 0000000..7cf650a Binary files /dev/null and b/html/images/templates/basic.png differ diff --git a/html/images/templates/err_banned.png b/html/images/templates/err_banned.png new file mode 100755 index 0000000..53105cf Binary files /dev/null and b/html/images/templates/err_banned.png differ diff --git a/html/images/templates/err_disabled.png b/html/images/templates/err_disabled.png new file mode 100755 index 0000000..cd5f8bc Binary files /dev/null and b/html/images/templates/err_disabled.png differ diff --git a/html/images/templates/err_na.png b/html/images/templates/err_na.png new file mode 100755 index 0000000..d47ec58 Binary files /dev/null and b/html/images/templates/err_na.png differ diff --git a/html/images/templates/err_no_ft.png b/html/images/templates/err_no_ft.png new file mode 100755 index 0000000..6899499 Binary files /dev/null and b/html/images/templates/err_no_ft.png differ diff --git a/html/images/templates/err_no_gd.png b/html/images/templates/err_no_gd.png new file mode 100755 index 0000000..8f4f504 Binary files /dev/null and b/html/images/templates/err_no_gd.png differ diff --git a/html/images/templates/index.htm b/html/images/templates/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/images/unwatch.png b/html/images/unwatch.png new file mode 100755 index 0000000..724a95a Binary files /dev/null and b/html/images/unwatch.png differ diff --git a/html/images/utlogo.gif b/html/images/utlogo.gif new file mode 100755 index 0000000..4cc5c6e Binary files /dev/null and b/html/images/utlogo.gif differ diff --git a/html/images/watch.png b/html/images/watch.png new file mode 100755 index 0000000..3a1230d Binary files /dev/null and b/html/images/watch.png differ diff --git a/html/images/watermark.png b/html/images/watermark.png new file mode 100755 index 0000000..6ce8859 Binary files /dev/null and b/html/images/watermark.png differ diff --git a/html/images/weapons/avenger.jpg b/html/images/weapons/avenger.jpg new file mode 100755 index 0000000..8a7b949 Binary files /dev/null and b/html/images/weapons/avenger.jpg differ diff --git a/html/images/weapons/bio.jpg b/html/images/weapons/bio.jpg new file mode 100755 index 0000000..a43d0b0 Binary files /dev/null and b/html/images/weapons/bio.jpg differ diff --git a/html/images/weapons/blank.jpg b/html/images/weapons/blank.jpg new file mode 100755 index 0000000..c8fac8b Binary files /dev/null and b/html/images/weapons/blank.jpg differ diff --git a/html/images/weapons/chainsaw.jpg b/html/images/weapons/chainsaw.jpg new file mode 100755 index 0000000..0e52c9b Binary files /dev/null and b/html/images/weapons/chainsaw.jpg differ diff --git a/html/images/weapons/creepinator.jpg b/html/images/weapons/creepinator.jpg new file mode 100755 index 0000000..3a604ba Binary files /dev/null and b/html/images/weapons/creepinator.jpg differ diff --git a/html/images/weapons/deemer.jpg b/html/images/weapons/deemer.jpg new file mode 100755 index 0000000..9eab790 Binary files /dev/null and b/html/images/weapons/deemer.jpg differ diff --git a/html/images/weapons/enforcer.jpg b/html/images/weapons/enforcer.jpg new file mode 100755 index 0000000..398ae87 Binary files /dev/null and b/html/images/weapons/enforcer.jpg differ diff --git a/html/images/weapons/enforcer2.jpg b/html/images/weapons/enforcer2.jpg new file mode 100755 index 0000000..ccddb61 Binary files /dev/null and b/html/images/weapons/enforcer2.jpg differ diff --git a/html/images/weapons/fighter.jpg b/html/images/weapons/fighter.jpg new file mode 100755 index 0000000..3778819 Binary files /dev/null and b/html/images/weapons/fighter.jpg differ diff --git a/html/images/weapons/flak.jpg b/html/images/weapons/flak.jpg new file mode 100755 index 0000000..df163de Binary files /dev/null and b/html/images/weapons/flak.jpg differ diff --git a/html/images/weapons/gandi.jpg b/html/images/weapons/gandi.jpg new file mode 100755 index 0000000..8af7341 Binary files /dev/null and b/html/images/weapons/gandi.jpg differ diff --git a/html/images/weapons/impact.jpg b/html/images/weapons/impact.jpg new file mode 100755 index 0000000..d95a729 Binary files /dev/null and b/html/images/weapons/impact.jpg differ diff --git a/html/images/weapons/index.htm b/html/images/weapons/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/images/weapons/ishock.jpg b/html/images/weapons/ishock.jpg new file mode 100755 index 0000000..e0c14bd Binary files /dev/null and b/html/images/weapons/ishock.jpg differ diff --git a/html/images/weapons/minigun.jpg b/html/images/weapons/minigun.jpg new file mode 100755 index 0000000..55ce638 Binary files /dev/null and b/html/images/weapons/minigun.jpg differ diff --git a/html/images/weapons/pulse.jpg b/html/images/weapons/pulse.jpg new file mode 100755 index 0000000..7f714c4 Binary files /dev/null and b/html/images/weapons/pulse.jpg differ diff --git a/html/images/weapons/ripper.jpg b/html/images/weapons/ripper.jpg new file mode 100755 index 0000000..d8cff4b Binary files /dev/null and b/html/images/weapons/ripper.jpg differ diff --git a/html/images/weapons/rockets.jpg b/html/images/weapons/rockets.jpg new file mode 100755 index 0000000..8dd9ce5 Binary files /dev/null and b/html/images/weapons/rockets.jpg differ diff --git a/html/images/weapons/shock.jpg b/html/images/weapons/shock.jpg new file mode 100755 index 0000000..7509301 Binary files /dev/null and b/html/images/weapons/shock.jpg differ diff --git a/html/images/weapons/slv.jpg b/html/images/weapons/slv.jpg new file mode 100755 index 0000000..16b3b3b Binary files /dev/null and b/html/images/weapons/slv.jpg differ diff --git a/html/images/weapons/sniper.jpg b/html/images/weapons/sniper.jpg new file mode 100755 index 0000000..0f00cdb Binary files /dev/null and b/html/images/weapons/sniper.jpg differ diff --git a/html/images/weapons/titan.jpg b/html/images/weapons/titan.jpg new file mode 100755 index 0000000..1bfb246 Binary files /dev/null and b/html/images/weapons/titan.jpg differ diff --git a/html/images/weapons/trans.jpg b/html/images/weapons/trans.jpg new file mode 100755 index 0000000..86e720e Binary files /dev/null and b/html/images/weapons/trans.jpg differ diff --git a/html/import.php b/html/import.php new file mode 100755 index 0000000..250e841 --- /dev/null +++ b/html/import.php @@ -0,0 +1,920 @@ +"); +} + +?> + + + Importing Latest Log Files + '; +} + + +IF (empty($import_adminkey)) { + if ($html) echo'Error:'; + echo "\$import_adminkey not set in config.php!\n"; + if ($html) { + echo ''; + include("includes/footer.php"); + } + return; +} + +IF (!empty($adminkey) and $adminkey != $import_adminkey) { + if ($html) echo'Error:'; + echo "Keys do not match\n"; + $adminkey = ''; + if (!$html) return; +} + +IF (empty($adminkey)) { + if (!$html) die('Please provide the adminkey' ."\n"); + echo' + Enter Admin key: +
+ + + Remember the key +
+ '; + include("includes/footer.php"); + return; +} + + +IF (!@is_dir('logs')) { + if ($html) echo'Error:'; + echo "Can't find the logs directory!\n"; + if ($html) echo "
"; + echo "Current working directory is: ". getcwd() ."\n"; + if ($html) echo "
"; + if (!$html) echo "You forgot to cd to my home directory? Take a look at \$import_homedir in config.php.\n"; + if ($html) { + echo ''; + include("includes/footer.php"); + } + return; +} + + + +if ($html) echo'
'; +echo "\n"; + +$start_time = time(); +$files = isset($_REQUEST['files']) ? $_REQUEST['files'] : 0; +$elapsed = isset($_REQUEST['elapsed']) ? $_REQUEST['elapsed'] : 0; + +if ($ftp_use and !isset($_GET['no_ftp'])) { + DeBugMessage("Use ftp: yes\n\$ftp_use: " . gettype($ftp_use) . ":". var_export($ftp_use, true)); + require("includes/ftp.php"); + $elapsed = $elapsed - (time() - $start_time); +} +else { + ob_flush(); + DeBugMessage("Use ftp: no\n\$ftp_use: " . gettype($ftp_use) . ":". var_export($ftp_use, true)); +} + + +$logdir = opendir('logs'); + +DeBugMessage("Open logdir and read logs"); + +while (false !== ($filename = readdir($logdir))) +{ +// Our (self set) timelimit exceeded => reload the page to prevent srcipt abort + if (!empty($import_reload_after) and $start_time + $import_reload_after <= time()) { + if (!$html) die('Time limit exceeded - unable to reload page (no HTML output)' ."\n"); + + $elapsed = $elapsed + time() - $start_time; + $target = $PHP_SELF ."?key=". urlencode($adminkey) ."&".str_rand()."=".str_rand()."&no_ftp=1&debug=$debug&files=$files&elapsed=$elapsed"; + echo ''; + + echo'
+ + + +
Maximum execution time exeeded; restarting ...
'; + + include("includes/footer.php"); + return; + } + + $oldfilename = $filename; + $filename = 'logs/' . $filename; + $backupfilename = 'logs/backup/' . $oldfilename; + + // UTDC log: Move to logs/utdc/ + if ($import_utdc_download_enable + and substr($filename, strlen($filename) - strlen($import_utdc_log_extension)) == $import_utdc_log_extension + and substr($oldfilename, 0, strlen($import_utdc_log_start)) == $import_utdc_log_start) { + if ($import_utdc_log_compress == 'no') $import_utdc_log_compress = 'yes'; + if ($html) { + echo' + + + + +
UTDC log: '.$oldfilename.'
'; + } else { + echo "UTDC log: $oldfilename:\n"; + } + echo 'Moving to logs/utdc/: '; + if ($html) echo ''; + echo backup_logfile($import_utdc_log_compress, $filename, 'logs/utdc/'.$oldfilename, true) . "\n"; + if ($html) echo '

'; + echo "\n\n"; + unlink($filename); + continue; + } + + // UTDC shot: Move to logs/utdc/ + if ($import_utdc_download_enable + and substr($filename, strlen($filename) - strlen($import_utdc_screenshot_extension)) == $import_utdc_screenshot_extension + and substr($oldfilename, 0, strlen($import_utdc_screenshot_start)) == $import_utdc_screenshot_start) { + if ($import_utdc_log_compress == 'no') $import_utdc_log_compress = 'yes'; + if ($html) { + echo' + + + + +
UTDC log: '.$oldfilename.'
'; + } else { + echo "UTDC log: $oldfilename:\n"; + } + echo 'Moving to logs/utdc/: '; + if ($html) echo ''; + echo backup_logfile("none", $filename, 'logs/utdc/'.$oldfilename, true) . "\n"; + if ($html) echo '

'; + echo "\n\n"; + unlink($filename); + continue; + } + + // ACE log: Move to logs/ace/ + if ($import_ace_download_enable + and substr($filename, strlen($filename) - strlen($import_ace_log_extension)) == $import_ace_log_extension + and substr($oldfilename, 0, strlen($import_ace_log_start)) == $import_ace_log_start) { + if ($import_ace_log_compress == 'no') $import_ace_log_compress = 'yes'; + if ($html) { + echo' + + + + +
ACE log: '.$oldfilename.'
'; + } else { + echo "ACE log: $oldfilename:\n"; + } + echo 'Moving to logs/ace/: '; + if ($html) echo ''; + echo backup_logfile($import_ace_log_compress, $filename, 'logs/ace/'.$oldfilename, true) . "\n"; + if ($html) echo '

'; + echo "\n\n"; + unlink($filename); + continue; + } + + if ($import_ace_download_enable + and substr($filename, strlen($filename) - strlen($import_ace_screenshot_extension)) == $import_ace_screenshot_extension + and substr($oldfilename, 0, strlen($import_ace_screenshot_start)) == $import_ace_screenshot_start) { + if ($html) { + echo' + + + + +
ACE Screenshot: '.$oldfilename.'
'; + } else { + echo "ACE screenshot: $oldfilename:\n"; + } + echo 'Moving to logs/ace/: '; + if ($html) echo ''; + echo backup_logfile("none", $filename, 'logs/ace/'.$oldfilename, false) . "\n"; + if ($html) echo '

'; + echo "\n\n"; + unlink($filename); + continue; + } + + + + // AnthChecker log: Move to logs/ac/ + if ($import_ac_download_enable + and substr($filename, strlen($filename) - strlen($import_ac_log_extension)) == $import_ac_log_extension + and substr($oldfilename, 0, strlen($import_ac_log_start)) == $import_ac_log_start) { + if ($import_ac_log_compress == 'no') $import_ac_log_compress = 'yes'; + if ($html) { + echo' + + + + +
AC log: '.$oldfilename.'
'; + } else { + echo "AC log: $oldfilename:\n"; + } + echo 'Moving to logs/ac/: '; + if ($html) echo ''; + echo backup_logfile($import_ac_log_compress, $filename, 'logs/ac/'.$oldfilename, true) . "\n"; + if ($html) echo '

'; + echo "\n\n"; + unlink($filename); + continue; + } + + if(substr($filename, strlen($filename) - strlen($import_log_extension)) != $import_log_extension) continue; + if(substr($oldfilename, 0, strlen($import_log_start)) != $import_log_start) continue; + + // Create a unique ID + $uid = str_rand(); + + // Check if there are any logs to do ... + + // Create our temp Table + + for (;;) { + $sql = "CREATE ". ($import_use_temporary_tables ? 'TEMPORARY ' : '') ."TABLE `uts_temp_$uid` ( + `id` mediumint(5) NOT NULL, + `col0` char(20) NOT NULL default '', + `col1` char(120) NOT NULL default '', + `col2` char(120) NOT NULL default '', + `col3` char(120) NOT NULL default '', + `col4` char(120) NOT NULL default '', + KEY `part1` (`col1` (20),`col2` (20)), + KEY `part2` (`col0` (20),`col1` (20),`col2` (20)), + KEY `full` (`col0` (20),`col1` (20),`col2` (20),`col3` (20),`col4` (20)) + ) TYPE=". ($import_use_heap_tables ? 'HEAP' : 'MyISAM') .";"; + + $result = mysql_query($sql); + if ($result) break; + + if (mysql_errno() == 1044 and $import_use_temporary_tables) { + echo "
WARNING: Unable to create temporary table (". mysql_error() .")
"; + echo "I'll retry without using MySQL's temporary table feature (see \$import_use_temporary_tables in config.php for details).

"; + $import_use_temporary_tables = false; + continue; + } + die("
Unable to create the temporary table - are you allowed to create tables in this database?

"); + } + $id = 0; + + if ($html) { + echo' + + + + + '; + + // Create sql for NGLog + $row = 1; + $handle = fopen("$filename", "r"); + + while (($data = my_fgets($handle, 5000)) !== FALSE) { + if ($debug) debug_output('Raw input ', $data); + $data = preg_replace('/[\x00]/', '', $data); + if ($debug) debug_output('After preg_replace', $data); + $data = explode("\t", $data); + + $num = count($data); + $row++; + for ($c=0; $c < 1; $c++) { + + $col0 = addslashes($data[0]); + $col1 = addslashes($data[1]); + $col2 = addslashes($data[2]); + $col3 = addslashes($data[3]); + $col4 = addslashes($data[4]); + + $col0 = trim($col0, " \n\r"); + $col1 = trim($col1, " \n\r"); + $col2 = trim($col2, " \n\r"); + $col3 = trim($col3, " \n\r"); + $col4 = trim($col4, " \n\r"); + + $id++; + mysql_query("INSERT INTO uts_temp_$uid VALUES ($id, '$col0', '$col1', '$col2', '$col3', '$col4');") or die(mysql_error()); + } + } + fclose($handle); + $files++; + + if ($html) echo''; + } elseIF (($qm_playercount < 2) || (($qm_gamename == "Bunny Track") and ($qm_playercount < 1))) { + echo "No (Not Enough Players)\n"; + if ($html) echo ''; + } elseIF ($log_incompatible) { + echo "No (Logfile incompatible [created by UTStats $actor_version])\n"; + if ($html) echo ''; + } elseIF ($import_ignore_if_gametime_less_than != 0 and ceil(($qm_gameend[col0] - $qm_gamestart[col0]) / 60) < $import_ignore_if_gametime_less_than) { + echo "No (game too short [". ceil(($qm_gameend[col0] - $qm_gamestart[col0]) / 60) ." < $import_ignore_if_gametime_less_than minutes])\n"; + if ($html) echo ''; + } else { + + $sql_mutators = "SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'GoodMutator'"; + $q_mutators = mysql_query($sql_mutators); + while ($r_mutators = mysql_fetch_array($q_mutators)) { + $qm_mutators .= "".$r_mutators[col3].", "; + } + + + $qm_serveran = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Server_AdminName'"); + $qm_serverae = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Server_AdminEmail'"); + $qm_serverm1 = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Server_MOTDLine1'"); + $qm_serverm2 = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Server_MOTDLine2'"); + $qm_serverm3 = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Server_MOTDLine3'"); + $qm_serverm4 = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Server_MOTDLine4'"); + + $qm_gameinfotl = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'TimeLimit'"); + $qm_gameinfofl = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'FragLimit'"); + $qm_gameinfogt = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'GoalTeamScore'"); + $qm_gameinfomp = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'MaxPlayers'"); + $qm_gameinfoms = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'MaxSpectators'"); + $qm_gameinfogs = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'GameSpeed'"); + $qm_gameinfout = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'UseTranslocator'"); + $qm_gameinfoff = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'FriendlyFireScale'"); + $qm_gameinfows = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'WeaponsStay'"); + + $gametime = $qm_time[col3]; + $servername = addslashes($qm_servername[col3]); + $serverip = $qm_serverip[col3]; + $serverport = $qm_serverport[col3]; + $gamename = addslashes($qm_gamename[col3]); + $servergametime = get_dp($qm_gameend[col0] - $qm_gamestart[col0]); + $gamestart = $qm_gamestart[col0]; + $gameend = $qm_gameend[col0]; + + + $tournament = $qm_tournament[col3]; + $teamgame = $qm_teamgame[col3]; + $mapname = addslashes($qm_mapname[col3]); + $mapfile = addslashes($qm_mapfile[col3]); + + // Lazy Hack for unknown gametypes + $unknowngt = substr("$mapfile", 0, 3); // Gets first 3 characters + + IF ($unknowngt == "JB-") { + $gamename = "JailBreak"; + $teamgame = 'True'; + } + + // Append insta to game if it was an insta game + IF (($qm_insta[col3] == "True") && ($gamename != "Bunny Track")) { $gameinsta = 1; $gamename = "$gamename (insta)"; } else { $gameinsta = 0; } + + // Get the unique ID of this gametype. + // Create a new one if it has none yet. + $r_gid = small_query("SELECT id FROM uts_games WHERE gamename = '$gamename'"); + if ($r_gid) { + $gid = $r_gid['id']; + } else { + mysql_query("INSERT INTO uts_games SET gamename = '$gamename', name = '$gamename'") or die(mysql_error()); + $gid = mysql_insert_id(); + } + + + // Check wheter we want to override the gametype for this match + // (Useful if we want a server to have separate stats for one server or if we want to + // combine DM and TDM rankings or ...) + + // Read all rules + if (!isset($overriderules)) { + $overriderules = array(); + $sql_overriderules = "SELECT id, serverip, gamename, mutator, gid FROM uts_gamestype ORDER BY id ASC;"; + $q_overriderules = mysql_query($sql_overriderules); + while ($r_overriderules = mysql_fetch_array($q_overriderules)) { + $overriderules[$r_overriderules['id']]['serverip'] = $r_overriderules['serverip']; + $overriderules[$r_overriderules['id']]['gamename'] = $r_overriderules['gamename']; + $overriderules[$r_overriderules['id']]['mutator'] = $r_overriderules['mutator']; + $overriderules[$r_overriderules['id']]['gid'] = $r_overriderules['gid']; + } + } + + // Check if one of our overriderules applies to this match + foreach($overriderules as $rule) { + if ($rule['serverip'] != '*' and $rule['serverip'] != "$serverip:$serverport") continue; + if ($rule['gamename'] != '*' and $rule['gamename'] != $gamename) continue; + if ($rule['mutator'] != '*' and stristr($qm_mutators, $rule['mutator']) === false) continue; + $gid = $rule['gid']; + break; + } + + + $qm_firstblood = small_query("SELECT col2 FROM uts_temp_$uid WHERE col1 = 'first_blood'"); + + $firstblood = addslashes($qm_firstblood[col2]); + + + $serverinfo = addslashes("Admin: $qm_serveran[col3]
Email: $qm_serverae[col3]

+ MOTD
$qm_serverm1[col3]
$qm_serverm2[col3]
$qm_serverm3[col3]
$qm_serverm4[col3]"); + + + $gameinfo = addslashes( add_info('Time Limit:', $qm_gameinfotl[col3]) . + add_info('Frag Limit:', $qm_gameinfofl[col3]) . + add_info('Goal Team Score:', $qm_gameinfogt[col3]) . + add_info('Max Players:', $qm_gameinfomp[col3]) . + add_info('Max Specs:', $qm_gameinfoms[col3]) . + add_info('Game Speed:', $qm_gameinfogs[col3]) . + add_info('Translocator:', $qm_gameinfout[col3]) . + add_info('Friendly Fire:', $qm_gameinfoff[col3]) . + add_info('Weapon Stay:', $qm_gameinfows[col3]) . + add_info('UTStats Actor Version:', $actor_version)); + + // Tidy Up The Info + + $mutators = substr("$qm_mutators", 0, -2); // remove trailing , + $mutators = un_ut($mutators); // Remove Class and BotPack. etc + $mutators = addslashes($mutators); + + $gametime = utdate($gametime); + + + // Get Teams Info + $sql_tinfo = "SELECT col4 FROM uts_temp_$uid WHERE col1 = 'player' AND col2 = 'TeamName' GROUP BY col4 ORDER BY col4 ASC"; + $q_tinfo = mysql_query($sql_tinfo) or die(mysql_error()); + + $t0info = 0; + $t1info = 0; + $t2info = 0; + $t3info = 0; + + while ($r_tinfo = mysql_fetch_array($q_tinfo)) { + IF ($r_tinfo[col4] == "Red") { $t0info = 1; } + IF ($r_tinfo[col4] == "Blue") { $t1info = 1; } + IF ($r_tinfo[col4] == "Green") { $t2info = 1; } + IF ($r_tinfo[col4] == "Gold") { $t3info = 1; } + } + + // Get Teamscores + $sql_tscore = "SELECT col2 AS team, col3 AS score FROM uts_temp_$uid WHERE col1 = 'teamscore'"; + $q_tscore = mysql_query($sql_tscore) or die(mysql_error()); + + $t0score = 0; + $t1score = 0; + $t2score = 0; + $t3score = 0; + + while ($r_tscore = mysql_fetch_array($q_tscore)) { + if ($r_tscore['team'] == "0") $t0score = $r_tscore['score']; + if ($r_tscore['team'] == "1") $t1score = $r_tscore['score']; + if ($r_tscore['team'] == "2") $t2score = $r_tscore['score']; + if ($r_tscore['team'] == "3") $t3score = $r_tscore['score']; + } + + +// Insert Server Info Into Database +$sql_serverinfo = "INSERT INTO uts_match (time, servername, serverip, gamename, gid, gametime, mutators, insta, tournament, teamgame, mapname, mapfile, serverinfo, gameinfo, frags, kills, suicides, teamkills, deaths, +t0, t1, t2, t3, t0score, t1score, t2score, t3score) +VALUES ('$gametime', '$servername', '$serverip:$serverport', '$gamename', '$gid', '$servergametime', '$mutators', '$gameinsta', '$tournament', +'$teamgame', '$mapname', '$mapfile', '$serverinfo', '$gameinfo', '$s_frags', '$s_kills', '$s_suicides', '$s_teamkills', '$s_deaths', +$t0info, $t1info, $t2info, $t3info, $t0score, $t1score, $t2score, $t3score);"; + + $q_serverinfo = mysql_query($sql_serverinfo) or die(mysql_error()); + $matchid = mysql_insert_id(); // Get our Match ID + + + + echo "Yes (ID: $matchid)\n"; + if ($html) echo ''; + + // Process Player Stuff + $playerid2pid = array(); + $ignored_players = array(); + $imported_players = array(); + + if ($html) echo ''; + // Check if theres any players left, if none or one delete the match (its possible ...) + $final_pcount = small_count("SELECT id FROM uts_player WHERE matchid = $matchid"); + + IF ($final_pcount == NULL || ($final_pcount == 1 && $gamename != "Bunny Track")) { + echo' + + + '; + + $sql_radjust = "SELECT pid, gid, rank FROM uts_player WHERE matchid = $matchid"; + $q_radjust = mysql_query($sql_radjust) or die(mysql_error()); + while ($r_radjust = mysql_fetch_array($q_radjust)) { + $pid = $r_radjust[pid]; + $gid = $r_radjust[gid]; + $rank = $r_radjust[rank]; + + $sql_crank = small_query("SELECT id, rank, matches FROM uts_rank WHERE pid = $pid AND gid = $gid"); + if (!$sql_crank) continue; + + $rid = $sql_crank[id]; + $newrank = $sql_crank[rank]-$rank; + $oldrank = $sql_crank[rank]; + $matchcount = $sql_crank[matches]-1; + + mysql_query("UPDATE uts_rank SET rank = $newrank, prevrank = $oldrank, matches = $matchcount WHERE id = $rid") or die(mysql_error()); + } + mysql_query("DELETE FROM uts_rank WHERE matches = 0") or die(mysql_error()); + + $rem_mrecord = "DELETE FROM uts_match WHERE id = $matchid"; + mysql_query($rem_mrecord); + $rem_precord = "DELETE FROM uts_player WHERE matchid = $matchid"; + mysql_query($rem_precord); + $rem_precord = "DELETE FROM uts_events WHERE matchid = $matchid"; + mysql_query($rem_precord); + } else { + // Make our weapons statistics + echo "\n"; + if ($html) echo ''; + + // Make our kills matrix stuff ... + if ($html) echo ''; + + + $updategameinfo = false; + if (count($ignored_players) > 0) { + // Maybe we imported the player and ignored another record of him? + $ignored_players = array_unique($ignored_players); + foreach($ignored_players as $t_id => $t_name) { + if (in_array($t_name, $imported_players)) unset($ignored_players[$t_id]); + } + if (count($ignored_players) > 0) { + $gameinfo .= addslashes(add_info('Ignored Players:', implode(', ', $ignored_players))); + $updategameinfo = true; + } + } + if ($updategameinfo) { + mysql_query("UPDATE uts_match SET gameinfo = '$gameinfo' WHERE id = '$matchid'"); + $updategameinfo = false; + } + } + } + + // Delete Temp MySQL Table + $droptable = "DROP TABLE uts_temp_$uid"; + mysql_query($droptable) or die(mysql_error()); + + if ($html) echo'
Importing '.$oldfilename.'
'; + } else { + echo "Importing $oldfilename:\n"; + } + echo 'Creating Temp MySQL Table: '; + if ($html) echo ''; + echo "uts_temp_$uid\n"; + if ($html) echo '
'; + echo 'Backing Up Log File: '; + if ($html) echo ''; + + // Copy the file to backup folder first + echo backup_logfile($import_log_backup, $filename, $backupfilename, true) . "\n"; + + if ($html) echo '
'; + echo 'Player Data Moved to Temp MySQL: '; + if ($html) echo ''; + echo "Yes\n"; + + + + $log_incompatible = false; + $actor_version = 'unknown'; + $qm_logtype = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Log_Standard'"); + if ($qm_logtype['col3'] == 'UTStats') { + $qm_logversion = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Log_Version'"); + $actor_version = $qm_logversion['col3']; + } + + if (!in_array($actor_version, $compatible_actor_versions)) { + if ($import_incompatible_logs) { + if ($html) echo '
'; + echo "WARNING: "; + if ($html) echo ''; + echo "This logfile was created using an incompatible UTStats server actor version ($actor_version). You may experience strange results and/or bugs!\n"; + } else { + $log_incompatible = true; + } + } + + + if ($html) echo '
'; + echo "Match Data Created: "; + if ($html) echo ''; + + // Get the match table info + $qm_time = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Absolute_Time'"); + $qm_servername = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Server_ServerName'"); + $qm_serverip = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'True_Server_IP'"); + $qm_serverport = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'info' AND col2 = 'Server_Port'"); + $qm_gamename = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'GameName'"); + + $qm_gamestart = small_query("SELECT col0 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'realstart'"); + $qm_gameend = small_query("SELECT col0 FROM uts_temp_$uid WHERE col1 = 'game_end'"); + + $qm_insta = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'insta'"); + $qm_tournament = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'TournamentMode'"); + $qm_teamgame = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'game' AND col2 = 'TeamGame'"); + $qm_mapname = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'map' AND col2 = 'Title'"); + $qm_mapfile = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'map' AND col2 = 'Name'"); + $qm_frags = small_query("SELECT SUM(col4) AS frags FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'frags'"); + $qm_kills = small_query("SELECT SUM(col4) AS kills FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'kills'"); + $qm_suicides = small_query("SELECT SUM(col4) AS suicides FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'suicides'"); + $qm_deaths = small_query("SELECT SUM(col4) AS deaths FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'deaths'"); + $qm_teamkills = small_query("SELECT SUM(col4) AS teamkills FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'teamkills'"); + + $qm_playercount = small_count("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'player' AND col2 = 'rename' GROUP BY col3"); + + $s_frags = $qm_frags[frags]; + $s_suicides = $qm_suicides[suicides]; + $s_deaths = $qm_deaths[deaths]; + + // Add teamkills only if its a team game, else add them to kills total + IF ($qm_teamgame[col3] == "True") { + $s_kills = $qm_kills[kills]; + $s_teamkills = $qm_teamkills[teamkills]; + } else { + $s_kills = $qm_kills[kills]+$qm_teamkills[teamkills]; + $s_teamkills = 0; + } + + // Change the gamename to bunny track if needed: + if (($qm_gamename[col3] == "BunnyTrack2") || (($qm_gamename[col3] == "Capture the Flag") && (strtolower(substr($qm_mapfile[col3], 0, 7)) == "ctf-bt-"))) { + $qm_gamename[col3] = "Bunny Track"; + } + + // Check if anything happened, if it didnt stop everything now + // + IF (($qm_kills[kills] == 0 && $qm_deaths[deaths] == 0) && ($qm_gamename[col3] != "Bunny Track")) { + echo "No (Empty Match)\n"; + if ($html) echo '
'; + echo "Importing Players: "; + if ($html) echo ''; + + // Get List of Player IDs and Process What They Have Done + $sql_player = "SELECT DISTINCT col4 FROM uts_temp_$uid WHERE col1 = 'player' AND col2 = 'rename' AND col4 <> ''"; + $q_player = mysql_query($sql_player) or die(mysql_error()); + while ($r_player = mysql_fetch_array($q_player)) { + $playerid = $r_player[col4]; + + // Get players last name used + $r_player2 = small_query("SELECT col3 FROM uts_temp_$uid WHERE col1 = 'player' AND col2 = 'rename' AND col4 = $playerid ORDER BY id DESC LIMIT 0,1"); + $playername = addslashes($r_player2[col3]); + + + // Are they a Bot + $r_player1 = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'player' AND col2 = 'IsABot' AND col3 = $playerid ORDER BY id DESC LIMIT 0,1"); + $playertype = $r_player1[col4]; + // This player is a bot + if ($playertype == 'True' and $import_ignore_bots) { + $ignored_players[] = $playername; + // We do not want to know who killed and who was killed by this bot... + mysql_query("DELETE FROM uts_temp_$uid WHERE (col1 = 'kill' OR col1 = 'teamkill') AND (col2 = '$playerid' OR col4 = '$playerid');") or die(mysql_error()); + if ($html) echo ""; + echo "Bot:$playername "; + if ($html) echo ""; + continue; + } + + // Get players last team + $r_player3 = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'player' AND col2 = 'TeamChange' AND col3 = $playerid AND col4 != 255 ORDER BY id DESC LIMIT 0,1"); + $playerteam = $r_player3[col4]; + + $qc_kills = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'kills'AND col3 = $playerid"); + $qc_teamkills = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'teamkills' AND col3 = $playerid"); + $qc_deaths = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'deaths' AND col3 = $playerid"); + + // Player had no kills, deaths or teamkills => ignore + IF ($qc_kills[col4] == 0 && $qc_deaths[col4] == 0 && $qc_teamkills[col4] ==0 && $gamename != "Bunny Track") { + $ignored_players[] = $playername; + continue; + } + + // Process all the other player information + include("import/import_playerstuff.php"); + + if ($playerbanned) { + // Banned players don't have a rank. + mysql_query("DELETE FROM uts_rank WHERE pid = '$pid'"); + + if ($import_ban_type == 2) { + // We do not want to know who killed and who was killed by this banned player + $ignored_players[] = $playername; + mysql_query("DELETE FROM uts_temp_$uid WHERE (col1 = 'kill' OR col1 = 'teamkill') AND (col2 = '$playerid' OR col4 = '$playerid');") or die(mysql_error()); + if ($html) echo ""; + echo "Banned:$playername "; + if ($html) echo ""; + continue; + } + } + + // Get Gametype specific stuff done + IF ($gamename == "Assault" || $gamename == "Assault (insta)") { include("import/import_ass.php"); } + IF ($gamename == "Capture the Flag" || $gamename == "Capture the Flag (insta)") { include("import/import_ctf.php"); } + IF ($gamename == "Bunny Track") { include("import/import_bt.php"); } + IF ($gamename == "Domination" || $gamename == "Domination (insta)") { include("import/import_dom.php"); } + IF ($gamename == "Tournament Team Game" || $gamename == "Tournament Team Game (insta)") { include("import/import_tdm.php"); } + IF ($gamename == "JailBreak" || $gamename == "JailBreak (insta)") { include("import/import_jailbreak.php"); } + IF ($gamename == "Last Man Standing" || $gamename == "Last Man Standing (insta)") { include("import/import_lms.php"); } + IF ($gamename == "Extended Last Man Standing" || $gamename == "Extended Last Man Standing (insta)") { include("import/import_lms.php"); } + IF ($gamename == "Last Man Standing +" || $gamename == "Last Man Standing + (insta)") { include("import/import_lms.php"); } + IF ($gamename == "Last Man Standing++" || $gamename == "Last Man Standing++ (insta)") { include("import/import_lms.php"); } + + // Do the rankings + include("import/import_ranking.php"); + + if ($playerbanned) { + if ($html) echo ""; + echo "Banned:"; + } + echo $playername.' '; + if ($playerbanned and $html) echo ""; + if ($html) echo "
"; + $imported_players[] = $playername; + } + if ($html) echo '
Deleting Match:0 or 1 Player Entries Left
'; + echo "Importing weapon statistics: "; + if ($html) echo ''; + include("import/import_weapons.php"); + echo "Done\n"; + if ($html) echo '
'; + echo "Building kills matrix: "; + if ($html) echo ''; + include("import/import_killsmatrix.php"); + echo "Done\n"; + + + if ($html) echo '
'; + echo "Combining Duplicate Player Entries: "; + if ($html) echo ''; + + // Combine duplicate player entries ... very intensive :( + include("import/import_pcleanup.php"); + + echo "Done\n"; + if ($html) echo'
'; + echo "Deleting Temp MySQL Table: "; + if ($html) echo ''; + echo "uts_temp_$uid\n"; + if ($html) echo '

'; + echo "\n\n"; + + // Clear variables + + $asscode = ""; + $assteam = ""; + $asswin = ""; + $avgping = ""; + $data = ""; + $domplayer = ""; + $droptable = ""; + $firstblood = ""; + $gameinfo = ""; + $gameinsta = ""; + $gamename = ""; + $gametime = ""; + $highping = ""; + $unknowngt = ""; + $lowping = ""; + $mapname = ""; + $mapfile = ""; + $matchid = ""; + $mutators = ""; + $num = ""; + $playerid = ""; + $playerfragscnt = ""; + $playername = ""; + $playerecordid = ""; + $playerteam = ""; + $qm_mutators = ""; + $row = 1; + $servername = ""; + $serverinfo = ""; + $serverip = ""; + $serverport = ""; + $suicidecnt = ""; + $t0info = ""; + $t1info = ""; + $t2info = ""; + $t3info = ""; + $t0score = ""; + $t1score = ""; + $t2score = ""; + $t3score = ""; + $teamgame = ""; + $tournament = ""; + +// Delete log file + unlink($filename); +} +closedir($logdir); + +if ($html) echo '
'; +echo "\n"; + +// Import stats +if ($files != 0) { + $elapsed = $elapsed + time() - $start_time; + if ($html) echo '

'; + echo "Processed $files ". ($files == 1 ? 'file' : 'files') ." in $elapsed ". ($elapsed == 1 ? 'second' : 'seconds') ." "; + echo "(". get_dp($elapsed / $files) ." seconds/file)\n"; + if ($html) echo '


'; +} + + +// Optimise database +if (rand(0, 5) == 0) { + if ($html) echo '

'; + echo "Optimizing tables... "; + mysql_query("OPTIMIZE TABLE uts_match, uts_player, uts_rank, uts_killsmatrix, uts_weaponstats, uts_pinfo;") or die(mysql_error()); + echo "Done\n"; + if ($html) echo '

'; +} + +// Analyze Key distribution +if (rand(0, 10) == 0) { + if ($html) echo '

'; + echo "Analyzing tables... "; + mysql_query("ANALYZE TABLE uts_match, uts_player, uts_rank, uts_killsmatrix, uts_weaponstats, uts_pinfo;") or die(mysql_error()); + echo "Done\n"; + if ($html) echo '

'; +} + + +// Purge old logs +if ($purged = (purge_backups('logs/backup', $import_log_backups_purge_after))) { + if ($html) echo '

'; + echo "Purged $purged old logfiles\n"; + if ($html) echo '

'; +} + +// Purge old utdc logs +if ($import_utdc_download_enable) { + if ($purged = (purge_backups('logs/utdc', $import_utdc_log_purge_after))) { + if ($html) echo '

'; + echo "Purged $purged old UTDC logfiles\n"; + if ($html) echo '

'; + } +} + +// Purge old AnthChecker logs +if ($import_ac_download_enable) { + if ($purged = (purge_backups('logs/ac', $import_ac_log_purge_after))) { + if ($html) echo '

'; + echo "Purged $purged old AC logfiles\n"; + if ($html) echo '

'; + } +} + +// Purge old ACE logs +if ($import_ace_download_enable) { + if ($purged = (purge_backups('logs/ace', $import_ace_log_purge_after))) { + if ($html) echo '

'; + echo "Purged $purged old ACE logfiles\n"; + if ($html) echo '

'; + } +} + +echo "\n\n"; +if ($html) echo '
'; +echo "Import Script Completed\n"; +if ($html) echo '
'; + +if ($html) include("includes/footer.php"); +?> diff --git a/html/import/import_ass.php b/html/import/import_ass.php new file mode 100755 index 0000000..9539bc5 --- /dev/null +++ b/html/import/import_ass.php @@ -0,0 +1,34 @@ + diff --git a/html/import/import_bt.php b/html/import/import_bt.php new file mode 100755 index 0000000..fe6a480 --- /dev/null +++ b/html/import/import_bt.php @@ -0,0 +1,46 @@ + $cap_speed) { + $cap_speed = $r_capbt['col3']; + $col0 = $r_capbt['col0']; // time + $col1 = $r_capbt['col1']; // cap + $col2 = $r_capbt['col2']; // playerid + $col3 = $r_capbt['col3']; // speed in 2000 - seconds (old system) or 600000 - hundreds of seconds (new system) + $col4 = $r_capbt['col4']; // date in seconds since epoch + } + $flag_capture++; + } + + if ($cap_speed != 0) { + # use col2 to store the rank, col3 to store the captime in seconds and col4 to store the date of the record + $col2 = small_count("SELECT DISTINCT col2 FROM uts_temp_$uid WHERE col1 = 'cap' AND col3 > $col3") + 1; + if ($col1 == "btcap") { + $col3 = ceil(600000 - $col3) / 100; + } + else if ($col1 == "cap") { + $col3 = ceil((2000 - $col3-1)*100/1.1) / 100; + $col1 = "btcap"; + } + $col3 = sprintf("%01.2f", $col3); + $sql_eventsbt = "INSERT INTO uts_events + (matchid, playerid, col0, col1, col2, col3, col4) VALUES + ($matchid, $playerid, '$col0', '$col1', '$col2', '$col3', '$col4')"; + mysql_query($sql_eventsbt) or die (mysql_error()); + } + + if ($flag_capture > 0) { + $sql_playerflags = " UPDATE uts_player + SET flag_capture = $flag_capture + WHERE id = $playerecordid"; + mysql_query($sql_playerflags) or die(mysql_error()); + } +?> diff --git a/html/import/import_ctf.php b/html/import/import_ctf.php new file mode 100755 index 0000000..206cbb0 --- /dev/null +++ b/html/import/import_ctf.php @@ -0,0 +1,43 @@ + diff --git a/html/import/import_dom.php b/html/import/import_dom.php new file mode 100755 index 0000000..91106ac --- /dev/null +++ b/html/import/import_dom.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/html/import/import_jailbreak.php b/html/import/import_jailbreak.php new file mode 100755 index 0000000..6d6e0da --- /dev/null +++ b/html/import/import_jailbreak.php @@ -0,0 +1,22 @@ + 'RedeemerDeath' and col4 <> 'JailRelease'"); + $r_suicides = $q_suicides['suicides']; + + $r_frags = $r_kills - $r_suicides; + $r_efficiency = get_dp(($r_kills / ($r_kills + $r_deaths + $r_suicides + $r_teamkills)) * 100); + + + mysql_query(" UPDATE uts_player + SET ass_obj = '$r_releases', + suicides = '$r_suicides', + frags = '$r_frags', + eff = '$r_efficiency' + WHERE id = $playerecordid;") or die(mysql_error()); + +?> \ No newline at end of file diff --git a/html/import/import_killsmatrix.php b/html/import/import_killsmatrix.php new file mode 100755 index 0000000..433a659 --- /dev/null +++ b/html/import/import_killsmatrix.php @@ -0,0 +1,22 @@ + diff --git a/html/import/import_lms.php b/html/import/import_lms.php new file mode 100755 index 0000000..eb3ebd7 --- /dev/null +++ b/html/import/import_lms.php @@ -0,0 +1,46 @@ + diff --git a/html/import/import_pcleanup.php b/html/import/import_pcleanup.php new file mode 100755 index 0000000..3e1be8a --- /dev/null +++ b/html/import/import_pcleanup.php @@ -0,0 +1,256 @@ + 3"; + mysql_query($rem_srecord); +} + +$cleaned = false; +// Get list of players +$sql_pname = "SELECT pid, name FROM uts_player, uts_pinfo AS pi WHERE matchid = $matchid AND pid = pi.id"; +$q_pname = mysql_query($sql_pname); +while ($r_pname = mysql_fetch_array($q_pname)) { + $playername = addslashes($r_pname[name]); + $pid = $r_pname['pid']; + + + // Check if player has more than 1 record + $q_ids = mysql_query("SELECT playerid FROM uts_player WHERE pid = '$pid' AND matchid = $matchid"); + + IF (mysql_num_rows($q_ids) > 1) { + $numrecords = mysql_num_rows($q_ids); + echo $r_pname[name] .' '; + // get all the ids this player had + $playerids = array(); + while ($r_ids = mysql_fetch_array($q_ids)) { + $playerids[] = $r_ids['playerid']; + } + + $r_newplayerid = small_query("SELECT (MAX(playerid) + 1) AS newplayerid FROM uts_player WHERE matchid = $matchid"); + $newplayerid = $r_newplayerid['newplayerid']; + + // Fix the events table + foreach ($playerids as $i => $oldplayerid) { + mysql_query("UPDATE uts_events SET playerid = $newplayerid WHERE playerid = $oldplayerid AND matchid = $matchid"); + } + + // Fix matchcount in ranking table + // mysql_query("UPDATE uts_rank SET matches = matches - ". ($numrecords - 1) ." WHERE pid = '$pid' AND gid = '$gid'") or die(mysql_error()); + + // *********************** + // UPDATE THE KILLS MATRIX + $sql_kmupdate = " SELECT victim, + SUM(kills) AS kills + FROM uts_killsmatrix + WHERE matchid = $matchid + AND killer IN (". implode(",", $playerids) .") + GROUP BY victim;"; + + $q_kmupdate = mysql_query($sql_kmupdate); + while ($r_kmupdate = mysql_fetch_array($q_kmupdate)) { + mysql_query(" INSERT + INTO uts_killsmatrix + SET matchid = $matchid, + killer = $newplayerid, + victim = ${r_kmupdate['victim']}, + kills = ${r_kmupdate['kills']};"); + } + + $sql_kmupdate = " SELECT killer, + SUM(kills) AS kills + FROM uts_killsmatrix + WHERE matchid = $matchid + AND victim IN (". implode(",", $playerids) .") + GROUP BY killer;"; + + $q_kmupdate = mysql_query($sql_kmupdate); + while ($r_kmupdate = mysql_fetch_array($q_kmupdate)) { + mysql_query(" INSERT + INTO uts_killsmatrix + SET matchid = $matchid, + killer = ${r_kmupdate['killer']}, + victim = $newplayerid, + kills = ${r_kmupdate['kills']};"); + } + + mysql_query(" DELETE + FROM uts_killsmatrix + WHERE matchid = $matchid + AND (killer IN (". implode(",", $playerids) .") + OR victim IN (". implode(",", $playerids) ."));"); + + + // FINISHED UPDATING THE KILLS MATRiX + // ********************************** + + + // Get non summed information + + $r_truepinfo1 = small_query("SELECT insta, pid, team, isabot, country, ip, gid FROM uts_player WHERE pid = '$pid' AND matchid = $matchid LIMIT 0,1"); + // fix rejoin as spec + if ($r_treupinfo1['team'] == 255) { + $r_trueteam = small_query("SELECT team FROM uts_player WHERE pid = '$pid' AND matchid = $matchid AND team != 255 LIMIT 0,1"); + if ($r_trueteam['team'] < 255) { + $r_truepinfo1['team'] = $r_trueteam['team']; + } + } + + // Group Player Stuff so we only have 1 player record per match + if ($gamename == "Bunny Track") { + // In bunnytrack the gamescore is 2000 - fastest time in seconds so use MAX gamescore rather then SUM + $r_truepinfo2 = small_query("SELECT + SUM(gametime) AS gametime, + MAX(gamescore) AS gamescore, + AVG(lowping) AS lowping, + AVG(highping) AS highping, + AVG(avgping) AS avgping, + SUM(frags) AS frags, + SUM(deaths) AS deaths, + SUM(kills) AS kills, + SUM(suicides) AS suicides, + SUM(teamkills) AS teamkills, + AVG(eff) AS eff, + AVG(accuracy) AS accuracy, + AVG(ttl) AS ttl, + SUM(flag_taken) AS flag_taken, + SUM(flag_pickedup) AS flag_pickedup, + SUM(flag_dropped) AS flag_dropped, + SUM(flag_return) AS flag_return, + SUM(flag_capture) AS flag_capture, + SUM(flag_cover) AS flag_cover, + SUM(flag_seal) AS flag_seal, + SUM(flag_assist) AS flag_assist, + SUM(flag_kill) AS flag_kill, + SUM(dom_cp) AS dom_cp, + SUM(ass_obj) AS ass_obj, + SUM(spree_double) AS spree_double, + SUM(spree_triple) AS spree_triple, + SUM(spree_multi) AS spree_multi, + SUM(spree_mega) AS spree_mega, + SUM(spree_ultra) AS spree_ultra, + SUM(spree_monster) AS spree_monster, + SUM(spree_kill) AS spree_kill, + SUM(spree_rampage) AS spree_rampage, + SUM(spree_dom) AS spree_dom, + SUM(spree_uns) AS spree_uns, + SUM(spree_god) AS spree_god, + SUM(pu_pads) AS pu_pads, + SUM(pu_armour) AS pu_armour, + SUM(pu_keg) AS pu_keg, + SUM(pu_invis) AS pu_invis, + SUM(pu_belt) AS pu_belt, + SUM(pu_amp) AS pu_amp, + SUM(rank) AS rank + FROM uts_player WHERE matchid = $matchid AND pid = '$pid'"); + } + else { + $r_truepinfo2 = small_query("SELECT + SUM(gametime) AS gametime, + SUM(gamescore) AS gamescore, + AVG(lowping) AS lowping, + AVG(highping) AS highping, + AVG(avgping) AS avgping, + SUM(frags) AS frags, + SUM(deaths) AS deaths, + SUM(kills) AS kills, + SUM(suicides) AS suicides, + SUM(teamkills) AS teamkills, + AVG(eff) AS eff, + AVG(accuracy) AS accuracy, + AVG(ttl) AS ttl, + SUM(flag_taken) AS flag_taken, + SUM(flag_pickedup) AS flag_pickedup, + SUM(flag_dropped) AS flag_dropped, + SUM(flag_return) AS flag_return, + SUM(flag_capture) AS flag_capture, + SUM(flag_cover) AS flag_cover, + SUM(flag_seal) AS flag_seal, + SUM(flag_assist) AS flag_assist, + SUM(flag_kill) AS flag_kill, + SUM(dom_cp) AS dom_cp, + SUM(ass_obj) AS ass_obj, + SUM(spree_double) AS spree_double, + SUM(spree_triple) AS spree_triple, + SUM(spree_multi) AS spree_multi, + SUM(spree_mega) AS spree_mega, + SUM(spree_ultra) AS spree_ultra, + SUM(spree_monster) AS spree_monster, + SUM(spree_kill) AS spree_kill, + SUM(spree_rampage) AS spree_rampage, + SUM(spree_dom) AS spree_dom, + SUM(spree_uns) AS spree_uns, + SUM(spree_god) AS spree_god, + SUM(pu_pads) AS pu_pads, + SUM(pu_armour) AS pu_armour, + SUM(pu_keg) AS pu_keg, + SUM(pu_invis) AS pu_invis, + SUM(pu_belt) AS pu_belt, + SUM(pu_amp) AS pu_amp, + SUM(rank) AS rank + FROM uts_player WHERE matchid = $matchid AND pid = '$pid'"); + } + + // Remove all of this player's records + $rem_precord = "DELETE FROM uts_player WHERE matchid = $matchid AND pid = '$pid'"; + mysql_query($rem_precord); + + // Add this new record to match + $upd_precord = " INSERT + INTO uts_player + SET matchid = $matchid, + insta = '$r_truepinfo1[insta]', + playerid = '$newplayerid', + pid = '$pid', + team = '$r_truepinfo1[team]', + isabot = '$r_truepinfo1[isabot]', + country = '$r_truepinfo1[country]', + ip = '$r_truepinfo1[ip]', + gid = '$r_truepinfo1[gid]', + gametime = '$r_truepinfo2[gametime]', + gamescore = '$r_truepinfo2[gamescore]', + lowping = '".(int)$r_truepinfo2[lowping]."', + highping = '".(int)$r_truepinfo2[highping]."', + avgping = '".(int)$r_truepinfo2[avgping]."', + frags = '$r_truepinfo2[frags]', + deaths = '$r_truepinfo2[deaths]', + kills = '$r_truepinfo2[kills]', + suicides = '$r_truepinfo2[suicides]', + teamkills = '$r_truepinfo2[teamkills]', + eff = '$r_truepinfo2[eff]', + accuracy = '$r_truepinfo2[accuracy]', + ttl = '$r_truepinfo2[ttl]', + flag_taken = '$r_truepinfo2[flag_taken]', + flag_dropped = '$r_truepinfo2[flag_dropped]', + flag_return = '$r_truepinfo2[flag_return]', + flag_capture = '$r_truepinfo2[flag_capture]', + flag_cover = '$r_truepinfo2[flag_cover]', + flag_seal = '$r_truepinfo2[flag_seal]', + flag_assist = '$r_truepinfo2[flag_assist]', + flag_kill = '$r_truepinfo2[flag_kill]', + flag_pickedup = '$r_truepinfo2[flag_pickedup]', + dom_cp = '$r_truepinfo2[dom_cp]', + ass_obj = '$r_truepinfo2[ass_obj]', + spree_double = '$r_truepinfo2[spree_double]', + spree_triple = '$r_truepinfo2[spree_triple]', + spree_multi = '$r_truepinfo2[spree_multi]', + spree_mega = '$r_truepinfo2[spree_mega]', + spree_ultra = '$r_truepinfo2[spree_ultra]', + spree_monster = '$r_truepinfo2[spree_monster]', + spree_kill = '$r_truepinfo2[spree_kill]', + spree_rampage = '$r_truepinfo2[spree_rampage]', + spree_dom = '$r_truepinfo2[spree_dom]', + spree_uns = '$r_truepinfo2[spree_uns]', + spree_god = '$r_truepinfo2[spree_god]', + pu_pads = '$r_truepinfo2[pu_pads]', + pu_armour = '$r_truepinfo2[pu_armour]', + pu_keg = '$r_truepinfo2[pu_keg]', + pu_invis = '$r_truepinfo2[pu_invis]', + pu_belt = '$r_truepinfo2[pu_belt]', + pu_amp = '$r_truepinfo2[pu_amp]', + rank = '$r_truepinfo2[rank]';"; + mysql_query($upd_precord) or die(mysql_error()); + $cleaned = true; + } +} +if ($cleaned and $html) echo "
"; +?> \ No newline at end of file diff --git a/html/import/import_playerstuff.php b/html/import/import_playerstuff.php new file mode 100755 index 0000000..73714e4 --- /dev/null +++ b/html/import/import_playerstuff.php @@ -0,0 +1,182 @@ + 0"); + $lowping = $r_player9[lowping]; + $highping = $r_player9[highping]; + $avgping = (int)$r_player9[avgping]; + + // People who join at the end error the import, this stops it + IF ($lowping == NULL) { $lowping = 0; } + IF ($highping == NULL) { $highping = 0; } + IF ($avgping == NULL) { $avgping = 0; } + + // Get accuracy, ttl etc + $r_acc = 0; + $r_deaths = 0; + $r_efficiency = 0; + $r_frags = 0; + $r_kills = 0; + $r_teamkills = 0; + $r_suicides = 0; + $r_tos = 0; + $r_ttl = 0; + + $q_acc = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'accuracy' AND col3 = $playerid"); + $q_deaths = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'deaths' AND col3 = $playerid"); + $q_kills = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'kills' AND col3 = $playerid"); + $q_teamkills = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'teamkills' AND col3 = $playerid"); + $q_efficiency = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'efficiency' AND col3 = $playerid"); + $q_suicides = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'suicides' AND col3 = $playerid"); + $q_tos = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'time_on_server' AND col3 = $playerid"); + $q_ttl = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'ttl' AND col3 = $playerid"); + $q_score = small_query("SELECT col4 FROM uts_temp_$uid WHERE col1 = 'stat_player' AND col2 = 'score' AND col3 = $playerid"); + + IF ($teamgame == "True") { + $r_kills = $q_kills[col4]; + $r_teamkills = $q_teamkills[col4]; + } + IF ($teamgame == "False") { + $r_kills = $q_kills[col4] + $q_teamkills[col4]; + $r_teamkills = 0; + } + + $r_acc = get_dp($q_acc[col4]); + $r_efficiency = get_dp($q_efficiency[col4]); + $r_deaths = $q_deaths[col4]; + $r_suicides = $q_suicides[col4]; + $r_frags = $r_kills-$r_suicides-$r_teamkills; + + $r_tos = get_dp($q_tos[col4]); + // time on server can't be longer then the server game time! + if ($r_tos > $servergametime) { + $r_tos = get_dp($servergametime); + } + $r_ttl = get_dp($q_ttl[col4]); + $r_score = $q_score[col4]; + + // Generate player record + $sql_playerid = " INSERT + INTO uts_player + SET matchid = '$matchid', + playerid = '$playerid', + pid = '$pid', + team = '$playerteam', + gid = '$gid', + insta = '$gameinsta', + country = '$playercountry', + ip = '$playerip', + + + spree_double = '$q_spree_dbl', + spree_multi = '$q_spree_mult', + spree_ultra = '$q_spree_ult', + spree_monster = '$q_spree_mon', + spree_kill = '$q_spree_kill', + spree_rampage = '$q_spree_rampage', + spree_dom = '$q_spree_dom', + spree_uns = '$q_spree_uns', + spree_god = '$q_spree_god', + + pu_pads = '$pu_pads', + pu_armour = '$pu_armour', + pu_keg = '$pu_keg', + pu_belt = '$pu_belt', + pu_amp = '$pu_amp', + pu_invis = '$pu_invis', + + lowping = '$lowping', + highping = '$highping', + avgping = '$avgping', + + accuracy = '$r_acc', + frags = '$r_frags', + deaths = '$r_deaths', + kills = '$r_kills', + suicides = '$r_suicides', + teamkills = '$r_teamkills', + eff = '$r_efficiency', + gametime = '$r_tos', + ttl = '$r_ttl', + gamescore= '$r_score'"; + + $q_playerid = mysql_query($sql_playerid) or die(mysql_error()); + $playerecordid = mysql_insert_id(); + + +?> diff --git a/html/import/import_ranking.php b/html/import/import_ranking.php new file mode 100755 index 0000000..9ad18a2 --- /dev/null +++ b/html/import/import_ranking.php @@ -0,0 +1,127 @@ + 0 AND e.col2 <= 5 GROUP BY e.col2"; + $q_btmaprank = mysql_query($sql_btmaprank) or die ("Can't retrieve \$q_btmaprank: ". mysql_error()); + while($r_btmaprank = mysql_fetch_assoc($q_btmaprank)) { + IF ($r_btmaprank[no] == 1) { + $rank_bt += $r_btmaprank[count] * 10; + } elseIF ($r_btmaprank[no] == 2) { + $rank_bt += $r_btmaprank[count] * 8; + } elseIF ($r_btmaprank[no] == 3) { + $rank_bt += $r_btmaprank[count] * 6; + } elseIF ($r_btmaprank[no] == 4) { + $rank_bt += $r_btmaprank[count] * 4; + } elseIF ($r_btmaprank[no] == 5) { + $rank_bt += $r_btmaprank[count] * 2; + } + // if ($dbg) echo "| pid: $r_btmaprank[no]*$r_btmaprank[count] => $rank_bt
"; + } + + $rank_nrank = $rank_bt; + } else { + $rank_nrank = $rank_fpos-$rank_fneg; + } + + // Average the rank over game minutes + if ($r_gametime == 0) { + // some bug occured, ignore + if ($dbg) echo "Skip ranking. " ; + + return; + } + + $rank_nrank = ($rank_nrank/$r_gametime) * 600; + if ($dbg) echo "Points: $rank_nrank
Time: $r_gametime
"; + + // Add rank gametime to previous amount + $rank_gametime = $r_gametime; + + // Reduce ranking if player hasnt played that much + IF ($rank_gametime < 10) return; + + IF ($rank_gametime < 50) { + $rank_nrank = $rank_nrank*.25; + } + + IF ($rank_gametime >= 50 && $rank_gametime < 100) { + $rank_nrank = $rank_nrank*.50; + } + + IF ($rank_gametime >= 100 && $rank_gametime < 200) { + $rank_nrank = $rank_nrank*.70; + } + + IF ($rank_gametime >= 200 && $rank_gametime < 300) { + $rank_nrank = $rank_nrank*.85; + } + + if ($dbg) echo "Reduced: $rank_nrank
"; + + // Add new rank record if one does not exist + IF($rank_id == NULL) { + mysql_query("INSERT INTO uts_rank SET time = '$r_gametime', pid = '$pid', gid = '$gid', rank = '0', matches = '0';") or die(mysql_error()); + $rank_id = mysql_insert_id(); + $rank_gametime = 0; + $rank_crank = 0; + $rank_matches = 0; + } + + // Add number of matches played + $rank_matches = $rank_matches+1; + + // Work out effective rank given + $eff_rank = $rank_nrank-$rank_crank; + + // if ($dbg) echo "", intval($rank_crank), "-", intval($rank_nrank). "-", $rank_matches, " "; + + // Add effective rank points given to uts_player record + mysql_query("UPDATE uts_player SET rank = $eff_rank WHERE id = $playerecordid") or die(mysql_error()); + + // Update the rank + mysql_query("UPDATE uts_rank SET time = '$rank_gametime', rank = '$rank_nrank', prevrank = '$rank_crank', matches = '$rank_matches' WHERE id = $rank_id;") or die(mysql_error()); +?> diff --git a/html/import/import_tdm.php b/html/import/import_tdm.php new file mode 100755 index 0000000..6595072 --- /dev/null +++ b/html/import/import_tdm.php @@ -0,0 +1,2 @@ + diff --git a/html/import/import_weapons.php b/html/import/import_weapons.php new file mode 100755 index 0000000..5d59a3f --- /dev/null +++ b/html/import/import_weapons.php @@ -0,0 +1,209 @@ + $r_weapons['kills'], + 'weap_shotcount' => 0, + 'weap_hitcount' => 0, + 'weap_damagegiven' => 0, + 'weap_accuracy' => 0 + ); + + +} + + +// Get the weapon statistics +$sql_weapons = " SELECT col1 AS type, + col2 AS weaponname, + col3 AS player, + col4 AS value + FROM uts_temp_$uid + WHERE col1 LIKE 'weap_%'"; + +$q_weapons = mysql_query($sql_weapons) or die(mysql_error()); +while ($r_weapons = mysql_fetch_array($q_weapons)) { + // Get the wepon's id or assign a new one + if (empty($r_weapons['weaponname'])) continue; + if (isset($weaponnames[$r_weapons['weaponname']])) { + $weaponid = $weaponnames[$r_weapons['weaponname']]; + } else { + mysql_query("INSERT INTO uts_weapons SET name = '". addslashes($r_weapons['weaponname']) ."'") or die(mysql_error()); + $weaponid = mysql_insert_id(); + $weaponnames[$r_weapons['weaponname']] = $weaponid; + } + + // Get the unique pid of this player + if (!isset($playerid2pid[$r_weapons['player']])) { +// Happens if we're ignoring bots or banned players + continue; + } else { + $pid = $playerid2pid[$r_weapons['player']]; + } + + if (!isset($weapons[$pid][$weaponid]['weap_kills'])) { + $weapons[$pid][$weaponid] = array( + 'weap_kills' => 0, + 'weap_shotcount' => 0, + 'weap_hitcount' => 0, + 'weap_damagegiven' => 0, + 'weap_accuracy' => 0 + ); + } + + $weapons[$pid][$weaponid][$r_weapons['type']] = $r_weapons['value']; +} + + +// Finally write the weapon statistics for this match +$s_weapons = array(); +foreach($weapons as $playerid => $weapon) { + foreach($weapon as $weaponid => $infos) { + if ($infos['weap_kills'] == 0 and $infos['weap_shotcount'] == 0) continue; + mysql_query(" INSERT + INTO uts_weaponstats + SET matchid = '$matchid', + pid = '$playerid', + weapon = '$weaponid', + kills = '${infos['weap_kills']}', + shots = '${infos['weap_shotcount']}', + hits= '${infos['weap_hitcount']}', + damage = '${infos['weap_damagegiven']}', + acc = '". round($infos['weap_accuracy'], 2) ."';") or die(mysql_error()); + + // Summarize totals for this match + if (!isset($s_weapons[$weaponid]['weap_kills'])) { + $s_weapons[$weaponid]['weap_kills'] = $infos['weap_kills']; + $s_weapons[$weaponid]['weap_shotcount'] = $infos['weap_shotcount']; + $s_weapons[$weaponid]['weap_hitcount'] = $infos['weap_hitcount']; + $s_weapons[$weaponid]['weap_damagegiven'] = $infos['weap_damagegiven']; + $s_weapons[$weaponid]['weap_accuracy'] = $infos['weap_accuracy']; + } else { + $s_weapons[$weaponid]['weap_kills'] += $infos['weap_kills']; + $s_weapons[$weaponid]['weap_shotcount'] += $infos['weap_shotcount']; + $s_weapons[$weaponid]['weap_hitcount'] += $infos['weap_hitcount']; + $s_weapons[$weaponid]['weap_damagegiven'] += $infos['weap_damagegiven']; + $s_weapons[$weaponid]['weap_accuracy'] = ($s_weapons[$weaponid]['weap_accuracy'] + $infos['weap_accuracy']) / 2; + } + } +} + + +// Update the player's weapon statistics (matchid 0); +foreach($weapons as $playerid => $weapon) { + foreach($weapon as $weaponid => $infos) { + if ($infos['weap_kills'] == 0 and $infos['weap_shotcount'] == 0) continue; + // Check whether a record for this player and weapon already + // exists + $r_pstat = small_query(" SELECT pid + FROM uts_weaponstats + WHERE matchid = '0' + AND pid = '$playerid' + AND weapon = '$weaponid'"); + // No -> create + if (!$r_pstat) { + mysql_query(" INSERT + INTO uts_weaponstats + SET matchid = '0', + pid = '$playerid', + weapon = '$weaponid', + kills = '${infos['weap_kills']}', + shots = '${infos['weap_shotcount']}', + hits= '${infos['weap_hitcount']}', + damage = '${infos['weap_damagegiven']}', + acc = '". round($infos['weap_accuracy'], 2) ."';") or die(mysql_error()); + // Yes -> update + } else { + mysql_query(" UPDATE uts_weaponstats + SET weapon = '$weaponid', + kills = kills + '${infos['weap_kills']}', + shots = shots + '${infos['weap_shotcount']}', + hits = hits + '${infos['weap_hitcount']}', + damage = damage + '${infos['weap_damagegiven']}', + acc = (acc + '". round($infos['weap_accuracy'], 2) ."') / 2 + WHERE matchid = '0' + AND pid = '$playerid' + AND weapon = '$weaponid';") or die(mysql_error()); + } + } +} + +// Update the global weapon statistics (matchid 0, playerid 0 ); +foreach($s_weapons as $weaponid => $infos) { + if ($infos['weap_kills'] == 0 and $infos['weap_shotcount'] == 0) continue; + // Check whether the global record for this weapon already exists + $r_pstat = small_query(" SELECT pid + FROM uts_weaponstats + WHERE matchid = '0' + AND pid = '0' + AND weapon = '$weaponid'"); + // No -> create + if (!$r_pstat) { + mysql_query(" INSERT + INTO uts_weaponstats + SET matchid = '0', + pid = '0', + weapon = '$weaponid', + kills = '${infos['weap_kills']}', + shots = '${infos['weap_shotcount']}', + hits= '${infos['weap_hitcount']}', + damage = '${infos['weap_damagegiven']}', + acc = '". round($infos['weap_accuracy'], 2) ."';") or die(mysql_error()); + // Yes -> update + } else { + mysql_query(" UPDATE uts_weaponstats + SET weapon = '$weaponid', + kills = kills + '${infos['weap_kills']}', + shots = shots + '${infos['weap_shotcount']}', + hits = hits + '${infos['weap_hitcount']}', + damage = damage + '${infos['weap_damagegiven']}', + acc = (acc + '". round($infos['weap_accuracy'], 2) ."') / 2 + WHERE matchid = '0' + AND pid = '0' + AND weapon = '$weaponid';") or die(mysql_error()); + } +} + + + + +?> \ No newline at end of file diff --git a/html/import/index.htm b/html/import/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/includes/clanbase.php b/html/includes/clanbase.php new file mode 100755 index 0000000..5ad7640 --- /dev/null +++ b/html/includes/clanbase.php @@ -0,0 +1,90 @@ +| )/U", $file, $out, PREG_SET_ORDER); + + + //for each player split the information and put all info in one array + + for ($x=0;$x',$out[$x][1]); + } + + //return the array + + return ($player); + + //All players are listed as: + //$player[0] + //$player[1] + //$player[2] + //etc. + + //the info for each player is listed as: + //$player[0][0] = pid; + //$player[0][1] = name; +} + + +/* + This function is to get the clans from a war. + It will return an array with all the information. +*/ + +function get_clans($wid) { + //Load the page where all players are listed into a var. + + $url = 'http://www.clanbase.com/warinfo.php?wid='.$wid.'&frame=1'; + $file = implode('', file($url)); + + //Use an expression to get the tags from each clan + + preg_match_all("/pagetitle'>Match (.*)vs (.*)<.div>/U", $file, $out, PREG_SET_ORDER); + + //Add the information to one array + + $clan[0][0]=$out[0][1]; + $clan[1][0]=$out[0][2]; + + //Use an expression to get the cid + full name from each clan + + preg_match_all("/claninfo\.php\?cid+=(.*)<.a>/U", $file, $out, PREG_SET_ORDER); + + //Add the information to one array + + $temp = explode('" class="slink">', $out[0][1]); + $clan[0][1]=$temp[0]; + $clan[0][2]=$temp[1]; + + $temp = explode('" class="slink">', $out[1][1]); + $clan[1][1]=$temp[0]; + $clan[1][2]=$temp[1]; + + //return the array + + return ($clan); + + + //The clans are listed as: + //$clan[0] + //$clan[1] + + //the info for each clan is listed as: + //$clan[0][0] = tag + //$clan[0][1] = cid + //$clan[0][2] = full name + +} +?> \ No newline at end of file diff --git a/html/includes/config.php b/html/includes/config.php new file mode 100755 index 0000000..7e9bd6f --- /dev/null +++ b/html/includes/config.php @@ -0,0 +1,188 @@ + \ No newline at end of file diff --git a/html/includes/config_pic.php b/html/includes/config_pic.php new file mode 100755 index 0000000..e70aee5 --- /dev/null +++ b/html/includes/config_pic.php @@ -0,0 +1,239 @@ + 'Player has played a total of 57 Capture the Flag games.' +// +// '%PLAYERNAME%'s overall accuracy this month was %MONTH_ACC% % while it was %LMONTH_ACC% last month!' +// ==> 'Player's overall accuracy this month was 42.22 % while it was 27.52 % last month!' + + +$j=0; +$pic[$i]['process'][$j]['type'] = 'text'; +$pic[$i]['process'][$j]['value'] = '%PLAYERNAME%'; +$pic[$i]['process'][$j]['fontcolor'] = '000000'; +$pic[$i]['process'][$j]['fontsize'] = 18; +$pic[$i]['process'][$j]['x_from'] = 9; +$pic[$i]['process'][$j]['y_from'] = 23; +$j++; +$pic[$i]['process'][$j]['type'] = 'text'; +$pic[$i]['process'][$j]['value'] = '%GAMENAME%'; +$pic[$i]['process'][$j]['fontsize'] = 14; +$pic[$i]['process'][$j]['x_from'] = 9; +$pic[$i]['process'][$j]['y_from'] = 43; +$j++; +$pic[$i]['process'][$j]['type'] = 'text'; +$pic[$i]['process'][$j]['value'] = 'Rank:'; +$pic[$i]['process'][$j]['fontcolor'] = 'DDDD20'; +$pic[$i]['process'][$j]['x_from'] = 9; +$pic[$i]['process'][$j]['y_from'] = 69; +$j++; +$pic[$i]['process'][$j]['type'] = 'text'; +$pic[$i]['process'][$j]['align'] = 'left'; +$pic[$i]['process'][$j]['value'] = '%RT%'; +$pic[$i]['process'][$j]['x_from'] = 65; +$pic[$i]['process'][$j]['y_from'] = 69; +$j++; +$pic[$i]['process'][$j]['type'] = 'text'; +$pic[$i]['process'][$j]['value'] = 'Hours:'; +$pic[$i]['process'][$j]['fontcolor'] = '000000'; +$pic[$i]['process'][$j]['x_from'] = 9; +$pic[$i]['process'][$j]['y_from'] = 91; +$j++; +$pic[$i]['process'][$j]['type'] = 'text'; +$pic[$i]['process'][$j]['align'] = 'left'; +$pic[$i]['process'][$j]['value'] = '%TOTAL_GAMETIME%'; +$pic[$i]['process'][$j]['x_from'] = 75; +$pic[$i]['process'][$j]['y_from'] = 91; +$j++; + + + + + + + + +// The next picture + +$i++; +$pic[$i]['enabled'] = false; +$pic[$i]['gidrequired'] = false; +$pic[$i]['load']['template'] = 'basic.png'; +$pic[$i]['load']['recreate'] = true; +$pic[$i]['load']['bgcolor'] = 'AAAAAA'; +$pic[$i]['load']['bgtransparent'] = false; + +$pic[$i]['output']['type'] = 'png'; + +$pic[$i]['default']['align'] = 'left'; +$pic[$i]['default']['angle'] = 0; +$pic[$i]['default']['font'] = 'microsbe.ttf'; +$pic[$i]['default']['fontcolor'] = 'FFFFFF'; +$pic[$i]['default']['fontsize'] = 10; + +$j=0; +$pic[$i]['process'][$j]['type'] = 'text'; +$pic[$i]['process'][$j]['value'] = '%PLAYERNAME% sucks!'; +$pic[$i]['process'][$j]['x_from'] = 9; +$pic[$i]['process'][$j]['y_from'] = 23; +$j++; +$pic[$i]['process'][$j]['type'] = 'text'; +$pic[$i]['process'][$j]['value'] = 'in %GAMENAME% games that is...'; +$pic[$i]['process'][$j]['x_from'] = 9; +$pic[$i]['process'][$j]['y_from'] = 43; +$j++; + + + +?> \ No newline at end of file diff --git a/html/includes/countries.php b/html/includes/countries.php new file mode 100755 index 0000000..4de8dde --- /dev/null +++ b/html/includes/countries.php @@ -0,0 +1,244 @@ + 'Afghanistan', + 'al' => 'Albania, People\'s Socialist Republic of', + 'dz' => 'Algeria, People\'s Democratic Republic of', + 'as' => 'American Samoa', + 'ad' => 'Andorra, Principality of', + 'ao' => 'Angola, Republic of', + 'ai' => 'Anguilla', + 'aq' => 'Antarctica (the territory South of 60 deg S)', + 'ag' => 'Antigua and Barbuda', + 'ar' => 'Argentina, Argentine Republic', + 'am' => 'Armenia', + 'aw' => 'Aruba', + 'au' => 'Australia, Commonwealth of', + 'at' => 'Austria, Republic of', + 'az' => 'Azerbaijan, Republic of', + 'bs' => 'Bahamas, Commonwealth of the', + 'bh' => 'Bahrain, Kingdom of', + 'bd' => 'Bangladesh, People\'s Republic of', + 'bb' => 'Barbados', + 'by' => 'Belarus', + 'be' => 'Belgium, Kingdom of', + 'bz' => 'Belize', + 'bj' => 'Benin, People\'s Republic of', + 'bm' => 'Bermuda', + 'bt' => 'Bhutan, Kingdom of', + 'bo' => 'Bolivia, Republic of', + 'ba' => 'Bosnia and Herzegovina', + 'bw' => 'Botswana, Republic of', + 'bv' => 'Bouvet Island (Bouvetoya)', + 'br' => 'Brazil, Federative Republic of', + 'io' => 'British Indian Ocean Territory (Chagos Archipelago)', + 'vg' => 'British Virgin Islands', + 'bn' => 'Brunei Darussalam', + 'bg' => 'Bulgaria, People\'s Republic of', + 'bf' => 'Burkina Faso', + 'bi' => 'Burundi, Republic of', + 'kh' => 'Cambodia, Kingdom of', + 'cm' => 'Cameroon, United Republic of', + 'ca' => 'Canada', + 'cv' => 'Cape Verde, Republic of', + 'ky' => 'Cayman Islands', + 'cf' => 'Central African Republic', + 'td' => 'Chad, Republic of', + 'cl' => 'Chile, Republic of', + 'cn' => 'China, People\'s Republic of', + 'cx' => 'Christmas Island', + 'cc' => 'Cocos (Keeling) Islands', + 'co' => 'Colombia, Republic of', + 'km' => 'Comoros, Federal and Islamic Republic of', + 'cd' => 'Congo, Democratic Republic of', + 'cg' => 'Congo, People\'s Republic of', + 'ck' => 'Cook Islands', + 'cr' => 'Costa Rica, Republic of', + 'ci' => 'Cote D\'Ivoire, Ivory Coast, Republic of the', + 'cu' => 'Cuba, Republic of', + 'cy' => 'Cyprus, Republic of', + 'cz' => 'Czech Republic', + 'dk' => 'Denmark, Kingdom of', + 'dj' => 'Djibouti, Republic of', + 'dm' => 'Dominica, Commonwealth of', + 'do' => 'Dominican Republic', + 'tl' => 'Timor-Leste', + 'ec' => 'Ecuador, Republic of', + 'eg' => 'Egypt, Arab Republic of', + 'sv' => 'El Salvador, Republic of', + 'gq' => 'Equatorial Guinea, Republic of', + 'er' => 'Eritrea', + 'ee' => 'Estonia', + 'et' => 'Ethiopia', + 'fo' => 'Faeroe Islands', + 'fk' => 'Falkland Islands (Malvinas)', + 'fj' => 'Fiji, Republic of the Fiji Islands', + 'fi' => 'Finland, Republic of', + 'fr' => 'France, French Republic', + 'gf' => 'French Guiana', + 'pf' => 'French Polynesia', + 'tf' => 'French Southern Territories', + 'ga' => 'Gabon, Gabonese Republic', + 'gm' => 'Gambia, Republic of the', + 'ge' => 'Georgia', + 'de' => 'Germany', + 'gh' => 'Ghana, Republic of', + 'gi' => 'Gibraltar', + 'gr' => 'Greece, Hellenic Republic', + 'gl' => 'Greenland', + 'gd' => 'Grenada', + 'gp' => 'Guadaloupe', + 'gu' => 'Guam', + 'gt' => 'Guatemala, Republic of', + 'gn' => 'Guinea, Revolutionary People\'s Rep\'c of', + 'gw' => 'Guinea-Bissau, Republic of', + 'gy' => 'Guyana, Republic of', + 'ht' => 'Haiti, Republic of', + 'hm' => 'Heard and McDonald Islands', + 'va' => 'Holy See (Vatican City State)', + 'hn' => 'Honduras, Republic of', + 'hk' => 'Hong Kong, Special Administrative Region of China', + 'hr' => 'Hrvatska (Croatia)', + 'hu' => 'Hungary, Hungarian People\'s Republic', + 'is' => 'Iceland, Republic of', + 'in' => 'India, Republic of', + 'id' => 'Indonesia, Republic of', + 'ir' => 'Iran, Islamic Republic of', + 'iq' => 'Iraq, Republic of', + 'ie' => 'Ireland', + 'il' => 'Israel, State of', + 'it' => 'Italy, Italian Republic', + 'jm' => 'Jamaica', + 'jp' => 'Japan', + 'jo' => 'Jordan, Hashemite Kingdom of', + 'kz' => 'Kazakhstan, Republic of', + 'ke' => 'Kenya, Republic of', + 'ki' => 'Kiribati, Republic of', + 'kp' => 'Korea, Democratic People\'s Republic of', + 'kr' => 'Korea, Republic of', + 'kw' => 'Kuwait, State of', + 'kg' => 'Kyrgyz Republic', + 'la' => 'Lao People\'s Democratic Republic', + 'lv' => 'Latvia', + 'lb' => 'Lebanon, Lebanese Republic', + 'ls' => 'Lesotho, Kingdom of', + 'lr' => 'Liberia, Republic of', + 'ly' => 'Libyan Arab Jamahiriya', + 'li' => 'Liechtenstein, Principality of', + 'lt' => 'Lithuania', + 'lu' => 'Luxembourg, Grand Duchy of', + 'mo' => 'Macao, Special Administrative Region of China', + 'mk' => 'Macedonia, the former Yugoslav Republic of', + 'mg' => 'Madagascar, Republic of', + 'mw' => 'Malawi, Republic of', + 'my' => 'Malaysia', + 'mv' => 'Maldives, Republic of', + 'ml' => 'Mali, Republic of', + 'mt' => 'Malta, Republic of', + 'mh' => 'Marshall Islands', + 'mq' => 'Martinique', + 'mr' => 'Mauritania, Islamic Republic of', + 'mu' => 'Mauritius', + 'yt' => 'Mayotte', + 'mx' => 'Mexico, United Mexican States', + 'fm' => 'Micronesia, Federated States of', + 'md' => 'Moldova, Republic of', + 'mc' => 'Monaco, Principality of', + 'mn' => 'Mongolia, Mongolian People\'s Republic', + 'ms' => 'Montserrat', + 'ma' => 'Morocco, Kingdom of', + 'mz' => 'Mozambique, People\'s Republic of', + 'mm' => 'Myanmar', + 'na' => 'Namibia', + 'nr' => 'Nauru, Republic of', + 'np' => 'Nepal, Kingdom of', + 'an' => 'Netherlands Antilles', + 'nl' => 'Netherlands, Kingdom of the', + 'nc' => 'New Caledonia', + 'nz' => 'New Zealand', + 'ni' => 'Nicaragua, Republic of', + 'ne' => 'Niger, Republic of the', + 'ng' => 'Nigeria, Federal Republic of', + 'nu' => 'Niue, Republic of', + 'nf' => 'Norfolk Island', + 'mp' => 'Northern Mariana Islands', + 'no' => 'Norway, Kingdom of', + 'om' => 'Oman, Sultanate of', + 'pk' => 'Pakistan, Islamic Republic of', + 'pw' => 'Palau', + 'ps' => 'Palestinian Territory, Occupied', + 'pa' => 'Panama, Republic of', + 'pg' => 'Papua New Guinea', + 'py' => 'Paraguay, Republic of', + 'pe' => 'Peru, Republic of', + 'ph' => 'Philippines, Republic of the', + 'pn' => 'Pitcairn Island', + 'pl' => 'Poland, Polish People\'s Republic', + 'pt' => 'Portugal, Portuguese Republic', + 'pr' => 'Puerto Rico', + 'qa' => 'Qatar, State of', + 're' => 'Reunion', + 'ro' => 'Romania, Socialist Republic of', + 'ru' => 'Russian Federation', + 'rw' => 'Rwanda, Rwandese Republic', + 'sh' => 'St. Helena', + 'kn' => 'St. Kitts and Nevis', + 'lc' => 'St. Lucia', + 'pm' => 'St. Pierre and Miquelon', + 'vc' => 'St. Vincent and the Grenadines', + 'ws' => 'Samoa, Independent State of', + 'sm' => 'San Marino, Republic of', + 'st' => 'Sao Tome and Principe, Democratic Republic of', + 'sa' => 'Saudi Arabia, Kingdom of', + 'sn' => 'Senegal, Republic of', + 'sc' => 'Seychelles, Republic of', + 'sl' => 'Sierra Leone, Republic of', + 'sg' => 'Singapore, Republic of', + 'sk' => 'Slovakia (Slovak Republic)', + 'si' => 'Slovenia', + 'sb' => 'Solomon Islands', + 'so' => 'Somalia, Somali Republic', + 'za' => 'South Africa, Republic of', + 'gs' => 'South Georgia and the South Sandwich Islands', + 'es' => 'Spain, Spanish State', + 'lk' => 'Sri Lanka, Democratic Socialist Republic of', + 'sd' => 'Sudan, Democratic Republic of the', + 'sr' => 'Suriname, Republic of', + 'sg' => 'Svalbard & Jan Mayen Islands', + 'sz' => 'Swaziland, Kingdom of', + 'se' => 'Sweden, Kingdom of', + 'ch' => 'Switzerland, Swiss Confederation', + 'sy' => 'Syrian Arab Republic', + 'tw' => 'Taiwan, Province of China', + 'tj' => 'Tajikistan', + 'tz' => 'Tanzania, United Republic of', + 'th' => 'Thailand, Kingdom of', + 'tg' => 'Togo, Togolese Republic', + 'tk' => 'Tokelau (Tokelau Islands)', + 'to' => 'Tonga, Kingdom of', + 'tt' => 'Trinidad and Tobago, Republic of', + 'tn' => 'Tunisia, Republic of', + 'tr' => 'Turkey, Republic of', + 'tm' => 'Turkmenistan', + 'tc' => 'Turks and Caicos Islands', + 'tv' => 'Tuvalu', + 'vi' => 'US Virgin Islands', + 'ug' => 'Uganda, Republic of', + 'ua' => 'Ukraine', + 'ae' => 'United Arab Emirates', + 'gb' => 'United Kingdom of Great Britain & N. Ireland', + 'um' => 'United States Minor Outlying Islands', + 'us' => 'United States of America', + 'uy' => 'Uruguay, Eastern Republic of', + 'uz' => 'Uzbekistan', + 'vu' => 'Vanuatu', + 've' => 'Venezuela, Bolivarian Republic of', + 'vn' => 'Viet Nam, Socialist Republic of', + 'wf' => 'Wallis and Futuna Islands', + 'eh' => 'Western Sahara', + 'ye' => 'Yemen', + 'yu' => 'Yugoslavia, Socialist Federal Republic of', + 'zm' => 'Zambia, Republic of', + 'zw' => 'Zimbabwe', + 'xx' => 'Unknown country' + ); +?> \ No newline at end of file diff --git a/html/includes/footer.php b/html/includes/footer.php new file mode 100755 index 0000000..0fd4f3f --- /dev/null +++ b/html/includes/footer.php @@ -0,0 +1,16 @@ +

+'; + +// Please leave this bit in, its the least you can do with all the work we have done :) + + echo' + + +
+ UTStats Beta 4.2.8 © 2005 azazel, AnthraX and toa
+ + +'; + +ob_end_flush(); \ No newline at end of file diff --git a/html/includes/ftp.php b/html/includes/ftp.php new file mode 100755 index 0000000..7e058a3 --- /dev/null +++ b/html/includes/ftp.php @@ -0,0 +1,411 @@ +PopError()) !== false) { + + $fctname = $err['fctname']; + + $msg = $err['msg']; + + $desc = $err['desc']; + + if($desc) $tmp=' ('.$desc.')'; else $tmp=''; + + if (strpos($msg, 'socket set') === 0) { + + $tmp .= "\nTry disabling the usage of sockets (set \$ftp_type = 'pure'; in config.php)"; + + } + + tablerow('Error details:', $fctname.': '.$msg.$tmp, true); + + } + + + +} + + + +function tablerow($left, $right, $error=false) { + + global $html, $ftp_debug; + + if ($ftp_debug) return; + + $space = ($html) ? ' ' : ' '; + + $left = (empty($left)) ? $space : (($html) ? htmlentities($left) : $left); + + $right = (empty($right)) ? $space : (($html) ? nl2br(htmlentities($right)) : $right); + + $style = ($error) ? 'style="background-color: red;"' : ''; + + if ($html) { + + echo ''; + + echo ''. $left .''; + + echo ''. $right .''; + + echo ''; + + } else { + + if (strlen($left) < 30) $left .= str_repeat(" ", 30 - strlen($left)); + + echo "$left $right\n"; + + } + + flush(); + +} + + + +function ftpupdate() + +{ + + global $html, $ftp, $ftp_uname, $ftp_upass, $ftp_hostname, $ftp_port, $g_ftp_error, $ftp_debug, + + $ftp_delete, $ftp_movedir, $ftp_dir, $ftp_passive, $import_log_start, $import_log_extension, + + $import_utdc_download_enable, $import_utdc_log_start, $import_utdc_log_extension, $import_utdc_screenshot_start, $import_utdc_screenshot_extension, + $import_ac_download_enable, $import_ac_log_start, $import_ac_log_extension, + $import_ace_download_enable, $import_ace_log_start, $import_ace_log_extension, $import_ace_screenshot_start, $import_ace_screenshot_extension; + + + + if (!$ftp_debug) { + + if ($html) echo''; + + } + + + + // Update, from here on were going to be doing multiple FTP sessions. + + for ($i = 0; $i < count($ftp_hostname); $i++) { + + if ($i != 0) { + + if ($html and !$ftp_debug) echo ''; + + echo "\n"; + + } + + + + tablerow('Connecting to server:', $ftp_hostname[$i] .':'. $ftp_port[$i]); + + if (!$ftp->SetServer($ftp_hostname[$i], $ftp_port[$i])) { + + ftp_error("Unable to set server: ". $ftp->lastmsg); $ftp->quit(true); continue; + + } + + if (!$ftp->connect()) { + + ftp_error("Unable to connect to server: ". $ftp->lastmsg); $ftp->quit(true); continue; + + } + + + + tablerow('', "Connected, now logging in..."); + + if (!$ftp->login($ftp_uname[$i], $ftp_upass[$i])) { + + ftp_error("Login failed!\nBad username/password?"); $ftp->quit(true); continue; + + } + + tablerow('', "Logged in!"); + + + + if (!$ftp->SetType(FTP_BINARY)) { + + ftp_error("Could not set type: ". $ftp->lastmsg); $ftp->quit(true); continue; + + } + + if (!isset($ftp_passive[$i]) or $ftp_passive[$i]) { + + tablerow("", "Setting passive mode"); + + if(!$ftp->Passive(true)) { + + ftp_error("Could not set passive mode: ". $ftp->lastmsg); $ftp->quit(true); continue; + + } + + } else { + + tablerow("", "Setting active mode"); + + if(!$ftp->Passive(false)) { + + ftp_error("Could not set active mode: ". $ftp->lastmsg); $ftp->quit(true); continue; + + } + + } + + if (($pwd = $ftp->pwd()) === false) { + + ftp_error("Unable to retrieve current working directory"); $ftp->quit(true); continue; + + } + + tablerow("Current directory is:", $pwd); + + + + $dl_start = time(); + + $dl_files = 0; + + $dl_bytes = 0; + + $error = false; + + foreach($ftp_dir[$i] as $dir) { + + if (!empty($dir)) { + + if (!$ftp->chdir($dir)) { + + ftp_error("Unable to change directory to: $dir"); $ftp->quit(true); continue; + + } + + tablerow('', "Changing directory to: $dir"); + + if (($pwd = $ftp->pwd()) === false) { + + ftp_error("Unable to retrieve current working directory"); $ftp->quit(true); continue; + + } + + tablerow("New directory is:", $pwd); + + } + + + + if (($filelist = $ftp->nlist()) === false) { + + ftp_error("Unable to retrieve file list"); continue; + + } + + + + tablerow("Directory contains:", count($filelist) ." ". ((count($filelist) == 1) ? 'file' : 'files')); + + if (count($filelist) == 0) { + + continue; + + } + + foreach ($filelist as $filename) { + + if (((substr($filename, 0, strlen($import_log_start)) == $import_log_start) and (substr($filename, strlen($filename) - strlen($import_log_extension)) == $import_log_extension)) + + or ($import_utdc_download_enable and (substr($filename, 0, strlen($import_utdc_log_start)) == $import_utdc_log_start) and (substr($filename, strlen($filename) - strlen($import_utdc_log_extension)) == $import_utdc_log_extension)) + + or ($import_utdc_download_enable and (substr($filename, 0, strlen($import_utdc_screenshot_start)) == $import_utdc_screenshot_start) and (substr($filename, strlen($filename) - strlen($import_utdc_screenshot_extension)) == $import_utdc_screenshot_extension)) + + or ($import_ac_download_enable and (substr($filename, 0, strlen($import_ac_log_start)) == $import_ac_log_start) and (substr($filename, strlen($filename) - strlen($import_ac_log_extension)) == $import_ac_log_extension)) + + or ($import_ace_download_enable and (substr($filename, 0, strlen($import_ace_log_start)) == $import_ace_log_start) and (substr($filename, strlen($filename) - strlen($import_ace_log_extension)) == $import_ace_log_extension)) + + or ($import_ace_download_enable and (substr($filename, 0, strlen($import_ace_screenshot_start)) == $import_ace_screenshot_start) and (substr($filename, strlen($filename) - strlen($import_ace_screenshot_extension)) == $import_ace_screenshot_extension))) { + } else { + continue; + } + + $size = $ftp->get($filename, 'logs/' . $filename); + + if ($size === FALSE) { + + $result = 'ERROR!'; + + $error = true; + + if (file_exists('logs/' . $filename)) { + unlink('logs/' . $filename); + } + + } else { + + $result = "OK (". number_format(round(($size / 1024), 0)) ." KB)"; + + $dl_files++; + + $dl_bytes += $size; + + } + + tablerow(($dl_files == 1) ? 'Downloading...' : '', "$filename -> $result"); + + if ((!isset($ftp_delete[$i]) or $ftp_delete[$i]) and !$error) { + $ftp->delete($filename); + } + else { + // rename the file to prevent reimporting + $ftp->rename($filename, "~" . $filename); + } + + } + + } + + $dl_kb = number_format(round(($dl_bytes / 1024), 0)); + + $dl_time = time() - $dl_start; + + tablerow("Downloaded:", "$dl_files ". ((count($filelist) == 1) ? 'file' : 'files') ." ($dl_kb KB) in $dl_time seconds"); + + + + if ($error) { + + ftp_error('There were errors when downoading (some) files!'); + + } + + + + tablerow("Disconnecting...", "done!"); + + $ftp->quit(true); + + } + + if (!$ftp_debug and $html) echo '
'; + + echo "FTP Transferring Log Files...\n"; + + if ($html) echo '

'; + + echo "\n\n"; + + + + //update timestamp + + + + if (!$g_ftp_error) { + + $file = fopen('includes/ftptimestamp.php', 'wb+', 1); + + fwrite($file, time()); + + fclose($file); + + } + +} + + + + + +$fname = 'includes/ftptimestamp.php'; + +$timestamp = 0; + + + +if(file_exists($fname)) + +{ + + $file = fopen($fname, 'rb'); + + $timestamp = trim(my_fgets($file)); + + fclose($file); + +} + + + +if(!$timestamp || (time() - $timestamp) > $ftp_interval*60) { + + if ($timestamp) { + + if ($html) echo '

'; + + echo "Last FTP update more than $ftp_interval minutes ago, starting update ($ftp_type): \n"; + + if ($html) echo '

'; + + } + + if ($ftp_debug) { + + if ($html) echo '
'; + + echo "FTP Debugging Output:\n"; + + if ($html) echo '
';
+
+	}
+
+	$ftp = new ftp($ftp_debug, $ftp_debug);
+
+	ftpupdate();
+
+	if ($ftp_debug and $html) echo '

'; + +} else { + + if ($html) echo '

'; + + echo "Last FTP update was ". round(((time() - $timestamp) / 60), 0) ." minutes ago, no update necessary\n"; + + if ($html) echo '

'; + +} + + + +?> \ No newline at end of file diff --git a/html/includes/ftp_class.php b/html/includes/ftp_class.php new file mode 100755 index 0000000..5281379 --- /dev/null +++ b/html/includes/ftp_class.php @@ -0,0 +1,492 @@ + +// http://www.phpclasses.org/browse/package/1743.html +// License: Free for non-commercial use +// + +if(!defined('CRLF')) define('CRLF',"\r\n"); +if(!defined("FTP_AUTOASCII")) define("FTP_AUTOASCII", -1); +if(!defined("FTP_BINARY")) define("FTP_BINARY", 1); +if(!defined("FTP_ASCII")) define("FTP_ASCII", 0); +if(!defined('FTP_FORCE')) define('FTP_FORCE', TRUE); +define('FTP_OS_Unix','u'); +define('FTP_OS_Windows','w'); +define('FTP_OS_Mac','m'); + +class ftp_base { + /* Public variables */ + var $LocalEcho=FALSE; + var $Verbose=FALSE; + var $OS_local; + var $lastmsg; + + /* Private variables */ + var $_lastaction=NULL; + var $_errors; + var $_type; + var $_umask; + var $_timeout; + var $_passive; + var $_host; + var $_fullhost; + var $_port; + var $_datahost; + var $_dataport; + var $_ftp_control_sock; + var $_ftp_data_sock; + var $_ftp_temp_sock; + var $_login; + var $_password; + var $_connected; + var $_ready; + var $_code; + var $_message; + var $_can_restore; + var $_port_available; + + var $_error_array=array(); + var $AuthorizedTransferMode=array( + FTP_AUTOASCII, + FTP_ASCII, + FTP_BINARY + ); + var $OS_FullName=array( + FTP_OS_Unix => 'UNIX', + FTP_OS_Windows => 'WINDOWS', + FTP_OS_Mac => 'MACOS' + ); + var $NewLineCode=array( + FTP_OS_Unix => "\n", + FTP_OS_Mac => "\r", + FTP_OS_Windows => "\r\n" + ); + var $AutoAsciiExt=array("ASP","BAT","C","CPP","CSV","H","HTM","HTML","SHTML","INI","LOG","PHP","PHP3","PL","PERL","SH","SQL","TXT"); + + /* Constructor */ + function ftp_base($port_mode=FALSE) { + $this->_port_available=($port_mode==TRUE); + $this->SendMSG("Staring FTP client class with".($this->_port_available?"":"out")." PORT mode support"); + $this->_connected=FALSE; + $this->_ready=FALSE; + $this->_can_restore=FALSE; + $this->_code=0; + $this->_message=""; + $this->SetUmask(0022); + $this->SetType(FTP_AUTOASCII); + $this->SetTimeout(30); + $this->Passive(!$this->_port_available); + $this->_login="anonymous"; + $this->_password="anon@ftp.com"; + $this->OS_local=FTP_OS_Unix; + if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $this->OS_local=FTP_OS_Windows; + elseif(strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') $this->OS_local=FTP_OS_Mac; + } + +// +// +// + function parselisting($list) { +// Parses i line like: "drwxrwx--- 2 owner group 4096 Apr 23 14:57 text" + if(preg_match("/^([-ld])([rwxst-]+)\s+(\d+)\s+(\w+)\s+(\w+)\s+(\d+)\s+(\w{3})\s+(\d+)\s+([\:\d]+)\s+(.+)$/i", $list, $ret)) { + $v=array( + "type" => ($ret[1]=="-"?"f":$ret[1]), + "perms" => 0, + "inode" => $ret[3], + "owner" => $ret[4], + "group" => $ret[5], + "size" => $ret[6], + "date" => $ret[7]." ".$ret[8]." ".$ret[9], + "name" => $ret[10] + ); + $v["perms"]+=00400*(int)($ret[2]{0}=="r"); + $v["perms"]+=00200*(int)($ret[2]{1}=="w"); + $v["perms"]+=00100*(int)in_array($ret[2]{2}, array("x","s")); + $v["perms"]+=00040*(int)($ret[2]{3}=="r"); + $v["perms"]+=00020*(int)($ret[2]{4}=="w"); + $v["perms"]+=00010*(int)in_array($ret[2]{5}, array("x","s")); + $v["perms"]+=00004*(int)($ret[2]{6}=="r"); + $v["perms"]+=00002*(int)($ret[2]{7}=="w"); + $v["perms"]+=00001*(int)in_array($ret[2]{8}, array("x","t")); + $v["perms"]+=04000*(int)in_array($ret[2]{2}, array("S","s")); + $v["perms"]+=02000*(int)in_array($ret[2]{5}, array("S","s")); + $v["perms"]+=01000*(int)in_array($ret[2]{8}, array("T","t")); + } + return $v; + } + + function SendMSG($message = "", $crlf=true) { + $this->lastmsg = $message; + if ($this->Verbose) { + echo $message.($crlf?CRLF:""); + flush(); + } + return TRUE; + } + + function SetType($mode=FTP_AUTOASCII) { + if(!in_array($mode, $this->AuthorizedTransferMode)) { + $this->SendMSG("Wrong type"); + return FALSE; + } + $this->_type=$mode; + $this->SendMSG("Transfer type: ".($this->_type==FTP_BINARY?"binary":($this->_type==FTP_ASCII?"ASCII":"auto ASCII") ) ); + return TRUE; + } + + function Passive($pasv=NULL) { + if(is_null($pasv)) $this->_passive=!$this->_passive; + else $this->_passive=$pasv; + if(!$this->_port_available and !$this->_passive) { + $this->SendMSG("Only passive connections available!"); + $this->_passive=TRUE; + return FALSE; + } + $this->SendMSG("Passive mode ".($this->_passive?"on":"off")); + return TRUE; + } + + function SetServer($host, $port=21, $reconnect=true) { + global $ftp_debug; + if ($ftp_debug) { + $this->verbose=true; + $this->SendMSG("Connect to:
\n- Server: $host
\n- Port: $port
\n"); + $this->verbose=false; + } + $port = intval($port); + if(!is_long($port)) { + $this->verbose=true; + $this->SendMSG("Incorrect port syntax"); + return FALSE; + } else { + $ip=@gethostbyname($host); + $dns=@gethostbyaddr($host); + if(!$ip) $ip=$host; + if(!$dns) $dns=$host; + if(ip2long($ip) === -1) { + $this->SendMSG("Wrong host name/address \"".$host."\""); + return FALSE; + } + $this->_host=$ip; + $this->_fullhost=$dns; + $this->_port=$port; + $this->_dataport=$port-1; + } + $this->SendMSG("Host \"".$this->_fullhost."(".$this->_host."):".$this->_port."\""); + if($reconnect){ + if($this->_connected) { + $this->SendMSG("Reconnecting"); + if(!$this->quit(FTP_FORCE)) return FALSE; + if(!$this->connect()) return FALSE; + } + } + return TRUE; + } + + function SetUmask($umask=0022) { + $this->_umask=$umask; + umask($this->_umask); + $this->SendMSG("UMASK 0".decoct($this->_umask)); + return TRUE; + } + + function SetTimeout($timeout=30) { + $this->_timeout=$timeout; + $this->SendMSG("Timeout ".$this->_timeout); + if($this->_connected) + if(!$this->_settimeout($this->_ftp_control_sock)) return FALSE; + return TRUE; + } + + function connect() { + $this->SendMsg('Local OS : '.$this->OS_FullName[$this->OS_local]); + if(!($this->_ftp_control_sock = $this->_connect($this->_host, $this->_port))) { + $this->SendMSG("Error : Cannot connect to remote host \"".$this->_fullhost." :".$this->_port."\""); + return FALSE; + } + $this->SendMSG("Connected to remote host \"".$this->_fullhost.":".$this->_port."\". Waiting for greeting."); + do { + if(!$this->_readmsg()) return FALSE; + if(!$this->_checkCode()) return FALSE; + $this->_lastaction=time(); + } while($this->_code<200); + $this->_ready=true; + return TRUE; + } + + function quit($force=false) { + if($this->_ready) { + if(!$this->_exec("QUIT") and !$force) return FALSE; + if(!$this->_checkCode() and !$force) return FALSE; + $this->_ready=false; + $this->SendMSG("Session finished"); + } + $this->_quit(); + return TRUE; + } + + function login($user=NULL, $pass=NULL) { + if(!is_null($user)) $this->_login=$user; + else $this->_login="anonymous"; + if(!is_null($pass)) $this->_password=$pass; + else $this->_password="anon@anon.com"; + if(!$this->_exec("USER ".$this->_login, "login")) return FALSE; + if(!$this->_checkCode()) return FALSE; + if($this->_code!=230) { + if(!$this->_exec((($this->_code==331)?"PASS ":"ACCT ").$this->_password, "login")) return FALSE; + if(!$this->_checkCode()) return FALSE; + } + $this->SendMSG("Authentication succeeded"); + $this->_can_restore=$this->restore(100); + $this->SendMSG("This server can".($this->_can_restore?"":"'t")." resume broken uploads/downloads"); + return TRUE; + } + + function pwd() { + if(!$this->_exec("PWD", "pwd")) return FALSE; + if(!$this->_checkCode()) return FALSE; + return ereg_replace("^[0-9]{3} \"(.+)\" .+".CRLF, "\\1", $this->_message); + } + + function cdup() { + if(!$this->_exec("CDUP", "cdup")) return FALSE; + if(!$this->_checkCode()) return FALSE; + return true; + } + + function chdir($pathname) { + if(!$this->_exec("CWD ".$pathname, "chdir")) return FALSE; + if(!$this->_checkCode()) return FALSE; + return TRUE; + } + + function rmdir($pathname) { + if(!$this->_exec("RMD ".$pathname, "rmdir")) return FALSE; + if(!$this->_checkCode()) return FALSE; + return TRUE; + } + + function mkdir($pathname) { + if(!$this->_exec("MKD ".$pathname, "mkdir")) return FALSE; + if(!$this->_checkCode()) return FALSE; + return TRUE; + } + + function rename($from, $to) { + if(!$this->_exec("RNFR ".$from, "rename")) return FALSE; + if(!$this->_checkCode()) return FALSE; + if($this->_code==350) { + if(!$this->_exec("RNTO ".$to, "rename")) return FALSE; + if(!$this->_checkCode()) return FALSE; + } else return FALSE; + return TRUE; + } + + function filesize($pathname) { + if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE; + if(!$this->_checkCode()) return FALSE; + return ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message); + } + + function mdtm($pathname) { + if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE; + if(!$this->_checkCode()) return FALSE; + $mdtm = ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message); + $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d"); + $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); + return $timestamp; + } + + function systype() { + if(!$this->_exec("SYST", "systype")) return FALSE; + if(!$this->_checkCode()) return FALSE; + $DATA = explode(" ", $this->_message); + return $DATA[1]; + } + + function delete($pathname) { + if(!$this->_exec("DELE ".$pathname, "delete")) return FALSE; + if(!$this->_checkCode()) return FALSE; + return TRUE; + } + + function site($command, $fnction="site") { + if(!$this->_exec("SITE ".$command, $fnction)) return FALSE; + if(!$this->_checkCode()) return FALSE; + return TRUE; + } + + function chmod($pathname, $mode) { + if(!$this->site("CHMOD ".decoct($mode)." ".$pathname, "chmod")) return FALSE; + return TRUE; + } + + function restore($from) { + if(!$this->_exec("REST ".$from, "resore")) return FALSE; + if(!$this->_checkCode()) return FALSE; + return TRUE; + } + + function features() { + if(!$this->_exec("FEAT", "features")) return FALSE; + if(!$this->_checkCode()) return FALSE; + return preg_split("/[".CRLF."]+/", ereg_replace("[0-9]{3}[ -][^".CRLF."]*".CRLF, "", $this->_message), -1, PREG_SPLIT_NO_EMPTY); + } + + function rawlist($arg="", $pathname="") { + return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "LIST", "rawlist"); + } + + function nlist($arg="", $pathname="") { + return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "NLST", "nlist"); + } + + function is_exists($pathname) + { + if (!($remote_list = $this->nlist("-a", dirname($pathname)))) { + $this->SendMSG("Error : Cannot get remote file list"); + return -1; + } + reset($remote_list); + while (list(,$value) = each($remote_list)) { + if ($value == basename($pathname)) { + $this->SendMSG("Remote file ".$pathname." exists"); + return TRUE; + } + } + $this->SendMSG("Remote file ".$pathname." does not exist"); + return FALSE; + } + + function get($remotefile, $localfile=NULL) { + if(is_null($localfile)) $localfile=$remotefile; + if (@file_exists($localfile)) $this->SendMSG("Warning : local file will be overwritten"); + $fp = @fopen($localfile, "w"); + if (!$fp) { + $this->PushError("get","can't open local file", "Cannot create \"".$localfile."\""); + return FALSE; + } + $pi=pathinfo($remotefile); + if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; + else $mode=FTP_BINARY; + if(!$this->_data_prepare($mode)) { + fclose($fp); + return FALSE; + } + if($this->_can_restore) $this->restore(0); + if(!$this->_exec("RETR ".$remotefile, "get")) { + $this->_data_close(); + fclose($fp); + return FALSE; + } + if(!$this->_checkCode()) { + $this->_data_close(); + fclose($fp); + return FALSE; + } + $out=$this->_data_read($mode, $fp); + fclose($fp); + $this->_data_close(); + if(!$this->_readmsg()) return FALSE; + if(!$this->_checkCode()) return FALSE; + return $out; + } + + function put($localfile, $remotefile=NULL) { + if(is_null($remotefile)) $remotefile=$localfile; + if (!@file_exists($localfile)) { + $this->PushError("put","can't open local file", "No such file or directory \"".$localfile."\""); + return FALSE; + } + $fp = @fopen($localfile, "r"); + if (!$fp) { + $this->PushError("put","can't open local file", "Cannot read file \"".$localfile."\""); + return FALSE; + } + $pi=pathinfo($localfile); + if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; + else $mode=FTP_BINARY; + if(!$this->_data_prepare($mode)) { + fclose($fp); + return FALSE; + } + if($this->_can_restore) $this->restore(0); + if(!$this->_exec("STOR ".$remotefile, "put")) { + $this->_data_close(); + fclose($fp); + return FALSE; + } + if(!$this->_checkCode()) { + $this->_data_close(); + fclose($fp); + return FALSE; + } + $ret=$this->_data_write($mode, $fp); + fclose($fp); + $this->_data_close(); + if(!$this->_readmsg()) return FALSE; + if(!$this->_checkCode()) return FALSE; + return $ret; + } + +// +// +// + function _checkCode() { + return ($this->_code<400 and $this->_code>0); + } + + function _list($arg="", $cmd="LIST", $fnction="_list") { + if(!$this->_data_prepare()) return FALSE; + if(!$this->_exec($cmd.$arg, $fnction)) { + $this->_data_close(); + return FALSE; + } + if($this->_code == 450 and $cmd == "NLST") return(array()); + if(!$this->_checkCode()) { + $this->_data_close(); + return FALSE; + } + $out=$this->_data_read(); + $this->_data_close(); + if(!$this->_readmsg()) return FALSE; + if(!$this->_checkCode()) return FALSE; + if($out === FALSE ) return FALSE; + $out=preg_split("/[".CRLF."]+/", $out, -1, PREG_SPLIT_NO_EMPTY); + $this->SendMSG(implode($this->NewLineCode[$this->OS_local], $out)); + return $out; + } + +// +// +// +// G�n�re une erreur pour traitement externe � la classe + function PushError($fctname,$msg,$desc=false){ + $error=array(); + $error['time']=time(); + $error['fctname']=$fctname; + $error['msg']=$msg; + $error['desc']=$desc; + if($desc) $tmp=' ('.$desc.')'; else $tmp=''; + $this->SendMSG($fctname.': '.$msg.$tmp); + return(array_push($this->_error_array,$error)); + } + +// R�cup�re une erreur externe + function PopError(){ + if(count($this->_error_array)) return(array_pop($this->_error_array)); + else return(false); + } +} + +if (isset($ftp_type) and $ftp_type == 'pure') { + require_once "ftp_class_pure.php"; +} else { + $mod_sockets=TRUE; + if (!extension_loaded('sockets')) { + $prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : ''; + if(!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets=FALSE; + } + require_once "ftp_class_".($mod_sockets?"sockets":"pure").".php"; +} +?> \ No newline at end of file diff --git a/html/includes/ftp_class_native.php b/html/includes/ftp_class_native.php new file mode 100755 index 0000000..4f7f1df --- /dev/null +++ b/html/includes/ftp_class_native.php @@ -0,0 +1,142 @@ +lastmsg = "Incorrect port syntax"; + return(false); + } else { + $ip=@gethostbyname($host); + $dns=@gethostbyaddr($host); + if(!$ip) $ip = $host; + if(!$dns) $dns = $host; + if(ip2long($ip) === -1) { + $this->lastmsg("Wrong host name/address \"".$host."\""); + return(false); + } + $this->host = $ip; + $this->fullhost = $dns; + $this->port = $port; + } + return(true); + } + + function connect() { + $php_erormsg = ''; + if (!check_extension('ftp') or true) { + $this->lastmsg = "No FTP support in this php build!"; + return(false); + } + $this->fp = @ftp_connect($this->host, $this->port, 30); + if (!$this->fp) { + $this->lastmsg = $php_errormsg; + return(false); + } + return(true); + } + + function login($user, $pass) { + $php_errormsg = ''; + if (!@ftp_login($this->fp, $user, $pass)) { + $this->lastmsg = $php_errormsg; + return(false); + } + return(true); + } + + function SetType($transfertype) { + $this->transfertype = $transfertype; + return(true); + } + + function Passive($pasv) { + $php_errormsg = ''; + if (!@ftp_pasv($this->fp, $pasv)) { + $this->lastmsg = $php_errormsg; + return(false); + } + return(true); + } + + function pwd() { + $php_errormsg = ''; + if (!($res = @ftp_pwd($this->fp))) { + $this->lastmsg = $php_errormsg; + return(false); + } + return($res); + } + + function chdir($dir) { + $php_errormsg = ''; + if (!@ftp_chdir($this->fp, $dir)) { + $this->lastmsg = $php_errormsg; + return(false); + } + return(true); + } + + function nlist() { + $php_errormsg = ''; + if (!($res = @ftp_nlist($this->fp, '.'))) { + $this->lastmsg = $php_errormsg; + return(false); + } + return($res); + } + + function get($remotefile, $localfile) { + $php_errormsg = ''; + if (!@ftp_get($this->fp, $localfile, $remotefile, $this->transfertype)) { + $this->lastmsg = $php_errormsg; + $this->PushError('get', "Unable to download $remotefile", $php_errormsg); + return(false); + } + return(filesize($localfile)); + } + + function delete($remotefile) { + $php_errormsg = ''; + if (!@ftp_delete($this->fp, $remotefile)) { + $this->lastmsg = $php_errormsg; + return(false); + } + return(true); + } + + + function quit() { + if ($this->fp) { + ftp_close($this->fp); + $this->fp = NULL; + } + return(true); + } + + + function PushError($fctname, $msg, $desc=false){ + $error=array(); + $error['time']=time(); + $error['fctname']=$fctname; + $error['msg']=$msg; + $error['desc']=$desc; + if($desc) $tmp=' ('.$desc.')'; else $tmp=''; + return(array_push($this->errors,$error)); + } + + function PopError(){ + if(count($this->errors)) return(array_pop($this->_error_array)); + else return(false); + } + + + +} diff --git a/html/includes/ftp_class_pure.php b/html/includes/ftp_class_pure.php new file mode 100755 index 0000000..e7806db --- /dev/null +++ b/html/includes/ftp_class_pure.php @@ -0,0 +1,192 @@ + +// http://www.phpclasses.org/browse/package/1743.html +// License: Free for non-commercial use +// + + +class ftp extends ftp_base { + function ftp($verb=FALSE, $le=FALSE) { + $this->LocalEcho = $le; + $this->Verbose = $verb; + $this->ftp_base(); + } + +// +// +// + + function _settimeout($sock) { + if(!@stream_set_timeout($sock, $this->_timeout)) { + $this->PushError('_settimeout','socket set send timeout'); + $this->_quit(); + return FALSE; + } + return TRUE; + } + + function _connect($host, $port) { + $this->SendMSG("NOT using PHP's socket extension"); + $this->SendMSG("Creating socket"); + $sock = @fsockopen($host, $port, $errno, $errstr, $this->_timeout); + if (!$sock) { + $this->PushError('_connect','socket connect failed', $errstr." (".$errno.")"); + return FALSE; + } + $this->_connected=true; + return $sock; + } + + function _readmsg($fnction="_readmsg"){ + if(!$this->_connected) { + $this->PushError($fnction, 'Connect first'); + return FALSE; + } + $result=true; + $this->_message=""; + $this->_code=0; + $go=true; + do { + $tmp=@my_fgets($this->_ftp_control_sock, 512); + if($tmp===false) { + $go=$result=false; + $this->PushError($fnction,'Read failed'); + } else { + $this->_message.=$tmp; +// for($i=0; $i_message); $i++) +// if(ord($this->_message[$i])<32) echo "#".ord($this->_message[$i]); else echo $this->_message[$i]; +// echo CRLF; + if(preg_match("/^([0-9]{3})(-(.*".CRLF.")+\\1)? [^".CRLF."]+".CRLF."$/", $this->_message, $regs)) $go=false; + } + } while($go); + if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF; + $this->_code=(int)$regs[1]; + return $result; + } + + function _exec($cmd, $fnction="_exec") { + if(!$this->_ready) { + $this->PushError($fnction,'Connect first'); + return FALSE; + } + if($this->LocalEcho) echo "PUT > ",$cmd,CRLF; + $status=@fputs($this->_ftp_control_sock, $cmd.CRLF); + if($status===false) { + $this->PushError($fnction,'socket write failed'); + return FALSE; + } + $this->_lastaction=time(); + if(!$this->_readmsg($fnction)) return FALSE; + return TRUE; + } + + function _data_prepare($mode=FTP_ASCII) { + if($mode==FTP_BINARY) { + if(!$this->_exec("TYPE I", "_data_prepare")) return FALSE; + } else { + if(!$this->_exec("TYPE A", "_data_prepare")) return FALSE; + } + if($this->_passive) { + if(!$this->_exec("PASV", "pasv")) { + $this->_data_close(); + return FALSE; + } + if(!$this->_checkCode()) { + $this->_data_close(); + return FALSE; + } + $ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message)); + $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; + $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); + $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); + $this->_ftp_data_sock=@fsockopen($this->_datahost, $this->_dataport, $errno, $errstr, $this->_timeout); + if(!$this->_ftp_data_sock) { + $this->PushError("_data_prepare","fsockopen fails", $errstr." (".$errno.")"); + $this->_data_close(); + return FALSE; + } + else $this->_ftp_data_sock; + } else { + $this->SendMSG("Only passive connections available!"); + return FALSE; + } + return TRUE; + } + + function _data_read($mode=FTP_ASCII, $fp=NULL) { + $NewLine=$this->NewLineCode[$this->OS_local]; + if(is_resource($fp)) $out=0; + else $out=""; + if(!$this->_passive) { + $this->SendMSG("Only passive connections available!"); + return FALSE; + } + if($mode!=FTP_BINARY) { + while (!feof($this->_ftp_data_sock)) { + $tmp=fread($this->_ftp_data_sock, 4096); + $line.=$tmp; + if(!preg_match("/".CRLF."$/", $line)) continue; + $line=rtrim($line,CRLF).$NewLine; + if(is_resource($fp)) $out+=fwrite($fp, $line, strlen($line)); + else $out.=$line; + $line=""; + } + } else { + while (!feof($this->_ftp_data_sock)) { + $block=fread($this->_ftp_data_sock, 4096); + if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block)); + else $out.=$line; + } + } + return $out; + } + + function _data_write($mode=FTP_ASCII, $fp=NULL) { + $NewLine=$this->NewLineCode[$this->OS_local]; + if(is_resource($fp)) $out=0; + else $out=""; + if(!$this->_passive) { + $this->SendMSG("Only passive connections available!"); + return FALSE; + } + if(is_resource($fp)) { + while(!feof($fp)) { + $line=my_fgets($fp, 4096); + if($mode!=FTP_BINARY) $line=rtrim($line, CRLF).CRLF; + do { + if(($res=@fwrite($this->_ftp_data_sock, $line))===FALSE) { + $this->PushError("_data_write","Can't write to socket"); + return FALSE; + } + $line=substr($line, $res); + }while($line!=""); + } + } else { + if($mode!=FTP_BINARY) $fp=rtrim($fp, $NewLine).CRLF; + do { + if(($res=@fwrite($this->_ftp_data_sock, $fp))===FALSE) { + $this->PushError("_data_write","Can't write to socket"); + return FALSE; + } + $fp=substr($fp, $res); + }while($fp!=""); + } + return TRUE; + } + + function _data_close() { + @fclose($this->_ftp_data_sock); + $this->SendMSG("Disconnected data from remote host"); + return TRUE; + } + + function _quit($force=FALSE) { + if($this->_connected or $force) { + @fclose($this->_ftp_control_sock); + $this->_connected=false; + $this->SendMSG("Socket closed"); + } + } +} +?> \ No newline at end of file diff --git a/html/includes/ftp_class_sockets.php b/html/includes/ftp_class_sockets.php new file mode 100755 index 0000000..8cfd27f --- /dev/null +++ b/html/includes/ftp_class_sockets.php @@ -0,0 +1,249 @@ + +// http://www.phpclasses.org/browse/package/1743.html +// License: Free for non-commercial use +// + + +class ftp extends ftp_base { + function ftp($verb=FALSE, $le=FALSE) { + $this->LocalEcho = $le; + $this->Verbose = $verb; + $this->ftp_base(TRUE); + } + +// +// +// + + function _settimeout($sock) { + if(!@socket_set_option($sock, 1, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { + $this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock))); + @socket_close($sock); + return FALSE; + } + if(!@socket_set_option($sock, 1, SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) { + $this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock))); + @socket_close($sock); + return FALSE; + } + return true; + } + + function _connect($host, $port) { + $this->SendMSG("Using PHP's socket extension"); + $this->SendMSG("Creating socket"); + $sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP); + if ($sock < 0) { + $this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock))); + return FALSE; + } + if(!$this->_settimeout($sock)) return FALSE; + $this->SendMSG("Connecting to \"".$host.":".$port."\""); + if (!($res = @socket_connect($sock, $host, $port))) { + $this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock))); + @socket_close($sock); + return FALSE; + } + $this->_connected=true; + return $sock; + } + + function _readmsg($fnction="_readmsg"){ + if(!$this->_connected) { + $this->PushError($fnction,'Connect first'); + return FALSE; + } + $result=true; + $this->_message=""; + $this->_code=0; + $go=true; + do { + $tmp=@socket_read($this->_ftp_control_sock, 4096, PHP_BINARY_READ); + if($tmp===false) { + $go=$result=false; + $this->PushError($fnction,'Read failed', socket_strerror(socket_last_error($this->_ftp_control_sock))); + } elseif($tmp=="") $go=false; + else { + $this->_message.=$tmp; +// for($i=0; $i_message); $i++) +// if(ord($this->_message[$i])<32) echo "#".ord($this->_message[$i]); else echo $this->_message[$i]; +// echo CRLF; + if(preg_match("/^([0-9]{3})(-(.*".CRLF.")+\\1)? [^".CRLF."]+".CRLF."$/", $this->_message, $regs)) $go=false; + } + } while($go); + if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF; + $this->_code=(int)$regs[1]; + return $result; + } + + function _exec($cmd, $fnction="_exec") { + if(!$this->_ready) { + $this->PushError($fnction,'Connect first'); + return FALSE; + } + if($this->LocalEcho) echo "PUT > ",$cmd,CRLF; + $status=@socket_write($this->_ftp_control_sock, $cmd.CRLF); + if($status===false) { + $this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream))); + return FALSE; + } + $this->_lastaction=time(); + if(!$this->_readmsg($fnction)) return FALSE; + return TRUE; + } + + function _data_prepare($mode=FTP_ASCII) { + if($mode==FTP_BINARY) { + if(!$this->_exec("TYPE I", "_data_prepare")) return FALSE; + } else { + if(!$this->_exec("TYPE A", "_data_prepare")) return FALSE; + } + $this->SendMSG("Creating data socket"); + $this->_ftp_data_sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP); + if ($this->_ftp_data_sock < 0) { + $this->PushError('_data_prepare','socket create failed',socket_strerror(socket_last_error($this->_ftp_data_sock))); + return FALSE; + } + if(!$this->_settimeout($this->_ftp_data_sock)) { + $this->_data_close(); + return FALSE; + } + if($this->_passive) { + if(!$this->_exec("PASV", "pasv")) { + $this->_data_close(); + return FALSE; + } + if(!$this->_checkCode()) { + $this->_data_close(); + return FALSE; + } + $ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message)); + $this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3]; + $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]); + $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); + if(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { + $this->PushError("_data_prepare","socket_connect", socket_strerror(socket_last_error($this->_ftp_data_sock))); + $this->_data_close(); + return FALSE; + } + else $this->_ftp_temp_sock=$this->_ftp_data_sock; + } else { + if(!@socket_getsockname($this->_ftp_control_sock, $addr, $port)) { + $this->PushError("_data_prepare","can't get control socket information", socket_strerror(socket_last_error($this->_ftp_control_sock))); + $this->_data_close(); + return FALSE; + } + if(!@socket_bind($this->_ftp_data_sock,$addr)){ + $this->PushError("_data_prepare","can't bind data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); + $this->_data_close(); + return FALSE; + } + if(!@socket_listen($this->_ftp_data_sock)) { + $this->PushError("_data_prepare","can't listen data socket", socket_strerror(socket_last_error($this->_ftp_data_sock))); + $this->_data_close(); + return FALSE; + } + if(!@socket_getsockname($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) { + $this->PushError("_data_prepare","can't get data socket information", socket_strerror(socket_last_error($this->_ftp_data_sock))); + $this->_data_close(); + return FALSE; + } + if(!$this->_exec('PORT '.str_replace('.',',',$this->_datahost.'.'.($this->_dataport>>8).'.'.($this->_dataport&0x00FF)), "_port")) { + $this->_data_close(); + return FALSE; + } + if(!$this->_checkCode()) { + $this->_data_close(); + return FALSE; + } + } + return TRUE; + } + + function _data_read($mode=FTP_ASCII, $fp=NULL) { + $NewLine=$this->NewLineCode[$this->OS_local]; + if(is_resource($fp)) $out=0; + else $out=""; + if(!$this->_passive) { + $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); + $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); + if($this->_ftp_temp_sock===FALSE) { + $this->PushError("_data_read","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); + $this->_data_close(); + return FALSE; + } + } + if($mode!=FTP_BINARY) { + while(($tmp=@socket_read($this->_ftp_temp_sock, 8192, PHP_NORMAL_READ))!==false) { + $line.=$tmp; + if(!preg_match("/".CRLF."$/", $line)) continue; + $line=rtrim($line,CRLF).$NewLine; + if(is_resource($fp)) $out+=fwrite($fp, $line, strlen($line)); + else $out.=$line; + $line=""; + } + } else { + while($block=@socket_read($this->_ftp_temp_sock, 8192, PHP_BINARY_READ)) { + if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block)); + else $out.=$line; + } + } + return $out; + } + + function _data_write($mode=FTP_ASCII, $fp=NULL) { + $NewLine=$this->NewLineCode[$this->OS_local]; + if(is_resource($fp)) $out=0; + else $out=""; + if(!$this->_passive) { + $this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport); + $this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock); + if($this->_ftp_temp_sock===FALSE) { + $this->PushError("_data_write","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock))); + $this->_data_close(); + return FALSE; + } + } + if(is_resource($fp)) { + while(!feof($fp)) { + $line=my_fgets($fp, 4096); + if($mode!=FTP_BINARY) $line=rtrim($line, CRLF).CRLF; + do { + if(($res=@socket_write($this->_ftp_temp_sock, $line))===FALSE) { + $this->PushError("_data_write","socket_write", socket_strerror(socket_last_error($this->_ftp_temp_sock))); + return FALSE; + } + $line=substr($line, $res); + }while($line!=""); + } + } else { + if($mode!=FTP_BINARY) $fp=rtrim($fp, $NewLine).CRLF; + do { + if(($res=@socket_write($this->_ftp_temp_sock, $fp))===FALSE) { + $this->PushError("_data_write","socket_write", socket_strerror(socket_last_error($this->_ftp_temp_sock))); + return FALSE; + } + $fp=substr($fp, $res); + }while($fp!=""); + } + return TRUE; + } + + function _data_close() { + @socket_close($this->_ftp_temp_sock); + @socket_close($this->_ftp_data_sock); + $this->SendMSG("Disconnected data from remote host"); + return TRUE; + } + + function _quit() { + if($this->_connected) { + @socket_close($this->_ftp_control_sock); + $this->_connected=false; + $this->SendMSG("Socket closed"); + } + } +} +?> \ No newline at end of file diff --git a/html/includes/ftptimestamp.php b/html/includes/ftptimestamp.php new file mode 100755 index 0000000..5b6994a --- /dev/null +++ b/html/includes/ftptimestamp.php @@ -0,0 +1 @@ +1112804209 \ No newline at end of file diff --git a/html/includes/functions.php b/html/includes/functions.php new file mode 100755 index 0000000..1975914 --- /dev/null +++ b/html/includes/functions.php @@ -0,0 +1,605 @@ +=")) ? true : false; + + if ($use_fgets and $compression == 'none') { + if ($length == -1) { + return(fgets($fp)); + } else { + return(fgets($fp, $length)); + } + } + + $buffer = ''; + $i = 0; + while(!feof($fp)) { + if ($length != -1 and $i >= $length) break; + $i++; + switch($compression) { + case 'bz2': $char = bzread($fp, 1); break; + case 'zlib': $char = gzread($fp, 1); break; + default: $char = fread($fp, 1); + } + $buffer .= $char; + if ($char == "\n") break; + } + if (empty($buffer) and feof($fp)) return(false); + return($buffer); +} + +function my_fopen($filename, $mode, &$compression) { + if ($compression === NULL) { + $compression = 'none'; + if (substr($filename, -4) == '.bz2') { + if (check_extension('bz2')) { + $compression = 'bz2'; + } else { + return(false); + } + } + if (substr($filename, -3) == '.gz') { + if (check_extension('zlib')) { + $compression = 'zlib'; + } else { + return(false); + } + } + } + + switch($compression) { + case 'bz2': $fp = @bzopen($filename, $mode); break; + case 'zlib': $fp = @gzopen($filename, $mode); break; + default: $fp = @fopen($filename, $mode); break; + } + return($fp); +} + + +function my_fclose($fp, $compression) { + switch($compression) { + case 'bz2': return(@bzclose($fp)); + case 'zlib': return(@gzclose($fp)); + default: return(@fclose($fp)); + } + +} + + +// Small query +function small_query($query) { + $sql_small = "$query"; + $q_small = mysql_query($sql_small) or die(mysql_error()); + $r_small = mysql_fetch_array($q_small); + return $r_small; +} + +// Small query count +function small_count($query) { + $sql_small = "$query"; + $q_small = mysql_query($sql_small) or die(mysql_error()); + $r_small = mysql_num_rows($q_small); + return $r_small; +} + +// uid generator +function str_rand($length = 8, $seeds = 'abcdefghijklmnopqrstuvwxyz0123456789') +{ + $str = ''; + $seeds_count = strlen($seeds); + + // Seed + list($usec, $sec) = explode(' ', microtime()); + $seed = (float) $sec + ((float) $usec * 100000); + mt_srand($seed); + + // Generate + for ($i = 0; $length > $i; $i++) { + $str .= $seeds{mt_rand(0, $seeds_count - 1)}; + } + + return $str; +} + +function zero_out($data) { + if (!is_array($data)) return($data); + foreach($data as $key => $value) { + if ($value == '0') $data[$key] = ''; + } + return($data); +} + +function get_dp($number) { + $dp = number_format($number, 2, '.', ''); + return ($dp); +} + +function sec2min($number) { + $dp = $number/60; + + $dp = number_format($dp, 2, '.', ''); + return ($dp); +} + +function sec2hour($number) { + $dp = $number/3600; + + $dp = number_format($dp, 2, '.', ''); + return ($dp); +} + +function un_ut($name) { + $gname = str_replace("Botpack.", "", "$name"); + $gname = str_replace("Class ", "", "$gname"); + $gname = str_replace("CTFGame", "Capture The Flag", "$gname"); + $gname = str_replace(".unr", "", "$gname"); + return ($gname); +} + +function mtimestamp($date) { + $hour = substr($date, 8, 2); + $minute = substr($date, 10, 2); + $second = 00; + $day = substr($date, 6, 2); + $month = substr($date, 4, 2); + $year = substr($date, 0, 4); + + return(mktime($hour,$minute,$second,$month,$day,$year)); +} + +function mdate($date) { + + $ourdate = date('D, M j Y \a\t g:i a', mtimestamp($date)); + return ($ourdate); +} + +function mdate2($date) { + $hour = substr("$date", 8, 2); + $minute = substr("$date", 10, 2); + $second = "00"; + $day = substr("$date", 6, 2); + $month = substr("$date", 4, 2); + $year = substr("$date", 0, 4); + + $ourdate = mktime($hour,$minute,$second,$month,$day,$year); + + $ourdate = date('Y-m-d g:i a', $ourdate); + return ($ourdate); +} + +function utdate($gametime) { + $year = substr("$gametime", 0, 4); + $month = substr("$gametime", 5, 2); + $day = substr("$gametime", 8, 2); + $hour = substr("$gametime", 11, 2); + $minute = substr("$gametime", 14, 2); + $second = substr("$gametime", 17, 2); + + $gametime = $year . $month . $day . $hour . $minute . $second; + return ($gametime); +} + +function btcaptime($time) { + if (empty($time)) { + return; + } + if ($time < 0) { + return "-:--"; + } + $minutes = intval($time / 60); + $seconds = intval($time % 60); + $hundreds = substr($time, -2, 2); + if (substr($hundreds, 0, 1) == '.') { + $hundreds = substr($hundreds, 1, 1) . 0; + } + if ((substr($hundreds, 1, 1) == '.') or (!preg_match("/\./", $time))) { + $hundreds = "00"; + } + if ($seconds < 10) { + $seconds = "0" . $seconds; + } + return $minutes . ":" . $seconds . ":" . $hundreds; +} + +// UT Server Query Functions +function GetItemInfo ($itemname, $itemchunks) +{ + + $retval = "N/A"; + for ($i = 0; $i < count($itemchunks); $i++) { + //Found this item + + if (strcasecmp($itemchunks[$i], $itemname) == 0) { + $retval = $itemchunks[$i+1]; + + } + } + + //Return value + return $retval; +} + +function GetMinutes($seconds) +{ + $timemins = intval($seconds / 60); + $timesecs = ($seconds % 60); + + $Reqlength = 2; //Amount of digits we need + if ($Reqlength-strlen($timemins) > 0) $timemins = str_repeat("0",($Reqlength-strlen($timemins))) . $timemins; + if ($Reqlength-strlen($timesecs) > 0) $timesecs = str_repeat("0",($Reqlength-strlen($timesecs))) . $timesecs; + return $timemins . ":" . $timesecs; +} + + +function FlagImage($country, $mini = true) { + global $a_countries; + $width = ($mini) ? 15 : 18; + $height = ($mini) ? 10 : 12; + if (empty($country)) return(''); + if (!file_exists("images/flags/$country.png")) return(''); //18*12 + $countryname = (isset($a_countries[$country])) ? $a_countries[$country] : ''; + return(''. $country .''); +} + + +function RankMovement($diff) { + $diff = round($diff, 2); + if ($diff == 0) { + $chimg = 'same'; + $chtext = "ranking not affected"; + } + if ($diff > 0) { + $chimg = 'up'; + $chtext = "gained ". get_dp($diff) ." ranking points"; + } + if ($diff < 0) { + $chimg = 'down'; + $chtext = "lost ". get_dp($diff * -1) ." ranking points"; + } + $moveimg = ''; + if (file_exists("images/ranks/$chimg.png")) { + $infos = getimagesize("images/ranks/$chimg.png"); + $width = $infos[0]; + $height = $infos[1]; + $moveimg = ''; + } + return($moveimg); +} + + +function ordinal($number) { + + // when fed a number, adds the English ordinal suffix. Works for any + // number, even negatives + + if ($number % 100 > 10 && $number %100 < 14): + $suffix = "th"; + else: + switch($number % 10) { + + case 0: + $suffix = "th"; + break; + + case 1: + $suffix = "st"; + break; + + case 2: + $suffix = "nd"; + break; + + case 3: + $suffix = "rd"; + break; + + default: + $suffix = "th"; + break; + } + + endif; + + return $suffix; +} + + +function RankImageOrText($pid, $name, $rank, $gid, $gamename, $mini = true, $format = NULL, $rankchange = NULL) { + + $points = 0; + if (empty($rank)) { + $r_rank = small_query("SELECT rank FROM uts_rank WHERE pid = '$pid' AND gid= '$gid';"); + if (!$r_rank) return(''); + $points = get_dp($r_rank['rank']); + $r_no = small_query("SELECT (COUNT(*) + 1) AS no FROM uts_rank WHERE gid = '$gid' and rank > ${points}9"); + $rank = $r_no['no']; + } + + $ranktext = $rank.ordinal($rank); + if (file_exists("images/ranks/$rank.png")) { + $width = ($mini) ? 14 : 16; + $height = ($mini) ? 10 : 13; + $img = ''. $rank .''; + } else { + $img = ''; + } + $moveimg = ''; + if ($rankchange !== NULL) { + $moveimg = ' '. RankMovement($rankchange); + } + + + if (empty($format)) { + if ($img) { + return($img.$moveimg); + } else { + return('('.$ranktext.$moveimg.')'); + } + } + $imageortext = ($img) ? $img : $ranktext; + $search = array('%RT%', '%RN%', '%RP%', '%RI%', '%GN%', '%PN%', '%IT%'); + $replace = array($ranktext, $rank, $points, $img, $gamename, $name, $imageortext); + return(str_replace($search, $replace, $format)); +} + + +function FormatPlayerName($country, $pid, $name, $gid = NULL, $gamename = NULL, $mini = true, $rankchange = NULL) { + static $cache = array(); + + if (isset($cache[$pid])) return($cache[$pid]); + + $ranktext = false; + if (!empty($gamename) and $pid !== NULL) { + $ranktext = RankImageOrText($pid, $name, 0, $gid, $gamename, $mini, NULL, $rankchange); + } + $ret = ''; + if (!empty($country)) $ret .= FlagImage($country, $mini) ." "; + $ret .= htmlentities($name); + if ($ranktext) $ret .= " " . $ranktext; + $cache[$pid] = $ret; + return($ret); +} + +function QuoteHintText($text) { + $search = array('\\', '\'', '(', ')'); + $replace = array('\\\\', '\\\'', '\\(', '\\)'); + return(str_replace($search, $replace, $text)); +} + + +function OverlibPrintHint($name, $text = NULL, $caption = NULL) { + include(dirname(__FILE__) .'/hints.php'); + if (!isset($hint[$name]) and empty($text)) return(''); + if ($text === NULL) $text = $hint[$name]['text']; + if ($caption === NULL and isset($hint[$name]['caption'])) $caption = $hint[$name]['caption']; + $rv = 'onmouseover="return overlib(\''. QuoteHintText($text) .'\''; + if ($caption !== NULL) $rv .= ', CAPTION, \''. QuoteHintText($caption) .'\''; + $rv .= ');" '; + $rv .= 'onmouseout="return nd();"'; + return($rv); +} + +function debug_output($desc, $data) { + echo '
';
+	echo $desc .": ";
+
+	$len = strlen($data);
+	for ($i = 0; $i < $len; $i++) {
+		echo substr($data, $i, 1) .'  ';
+	}
+	echo "\n";
+	echo str_repeat(' ', (strlen($desc) + 2));
+	for ($i = 0; $i < $len; $i++) {
+		echo ord(substr($data, $i, 1)) .' ';
+	}
+	echo "
"; +} + +function check_extension($name) { + if (extension_loaded($name)) return(true); + if( !(bool)ini_get("enable_dl") or (bool)ini_get( "safe_mode" )) return(false); + $prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : ''; + return(@dl($prefix . $name . PHP_SHLIB_SUFFIX)); +} + + +function compress_file($method, $in, $out, $stripx00) { + if ((!file_exists($out) and !is_writeable(dirname($out))) or (file_exists($out) and !is_writable($out))) return(false); + $blocksize = 8192; + + switch($method) { + case 'bz2': $suffix = '.bz2'; break; + case 'zlib': $suffix = '.gz'; break; + case 'none': $suffix = ''; break; + default: return(false); + } + + if (substr($out, strlen($out) - strlen($suffix)) != $suffix) $out .= $suffix; + + $fp_in = fopen($in, 'rb'); + if (!$fp_in) return(false); + switch($method) { + case 'bz2': $fp_out = @bzopen($out, 'wb'); break; + case 'zlib': $fp_out = @gzopen($out, 'wb6'); break; + case 'none': $fp_out = @fopen($out, 'wb'); break; + } + if (!$fp_out) return(false); + + while (!feof($fp_in)) { + $buffer = @fread($fp_in, $blocksize); + if ($buffer === false) return(false); + if ($stripx00) $buffer = preg_replace('/[\x00]/', '', $buffer); + switch($method) { + case 'bz2': $bytes = @bzwrite($fp_out, $buffer, strlen($buffer)); break; + case 'zlib': $bytes = @gzwrite($fp_out, $buffer, strlen($buffer)); break; + case 'none': $bytes = @fwrite($fp_out, $buffer, strlen($buffer)); break; + } + if ($bytes === false) return(false); + } + + + @fclose($fp_in); + switch($method) { + case 'bz2': @bzclose($fp_out); break; + case 'zlib': @gzclose($fp_out); break; + case 'none': @fclose($fp_out); break; + } + return(true); +} + +function backup_logfile($method, $filename, $backupfilename, $stripx00) { + switch($method) { + case 'compress': + if (!check_extension('bz2') or !compress_file('bz2', $filename, $backupfilename, $stripx00)) { + return(backup_logfile('gzip', $filename, $backupfilename, $stripx00)); + } + return('Succeeded (bz2)'); + break; + + case 'gzip': + if (!check_extension('zlib') or !compress_file('zlib', $filename, $backupfilename, $stripx00)) { + return(backup_logfile('yes', $filename, $backupfilename, $stripx00)); + } + return('Succeeded (gzip)'); + break; + + case 'no': + return('NO (disabled in config)'); + break; + + default: + if ($stripx00) { + if (compress_file('none', $filename, $backupfilename, $stripx00)) { + return('Succeeded (uncompressed)'); + } else { + return('FAILED' . (!empty($php_errormsg) ? ': '. $php_errormsg : '')); + } + } + if (@copy($filename, $backupfilename)) { + return('Succeeded (uncompressed)'); + } else { + return('FAILED' . (!empty($php_errormsg) ? ': '. $php_errormsg : '')); + } + } +} + +function purge_backups($dir, $maxage) { + if (empty($maxage) or rand(0, 5) != 0) return(NULL); + + // $maxage is days but we need seconds + $maxage = $maxage * 86400; + $deleted = 0; + + $dh = opendir($dir); + while (false !== ($filename = readdir($dh))) { + if ($filename == '.htaccess' or $filename == 'index.htm') continue; + $cna = $dir .'/'. $filename; + if (@is_file($cna) and (@filemtime($cna) + $maxage) < time()) { + unlink($cna); + $deleted++; + } + + } + closedir($dh); + + return($deleted); +} + + +function file_size_info($filesize) { + $bytes = array('KB', 'KB', 'MB', 'GB', 'TB'); # values are always displayed + if ($filesize < 1024) $filesize = 1; # in at least kilobytes. + for ($i = 0; $filesize > 1024; $i++) $filesize /= 1024; + $file_size_info['size'] = ceil($filesize); + $file_size_info['type'] = $bytes[$i]; + return $file_size_info; +} + +function GetCurrentWatchlist() { + if (!isset($_COOKIE['uts_watchlist'])) return(array()); + $watchlist = @explode(',', $_COOKIE['uts_watchlist']); + if (!$watchlist or !is_array($watchlist)) return(array()); + foreach($watchlist as $key => $value) { + $watchlist[$key] = addslashes($value); + } + return($watchlist); +} + +function PlayerOnWatchlist($pid) { + $watchlist = GetCurrentWatchlist(); + return(in_array($pid, $watchlist)); +} + +function ToggleWatchStatus($pid) { + $watchlist = GetCurrentWatchlist(); + + if (in_array($pid, $watchlist)) { + $key = array_search($pid, $watchlist); + unset($watchlist[$key]); + $status = 0; + } else { + $watchlist[] = $pid; + $status = 1; + } + setcookie('uts_watchlist', implode(',',$watchlist), time()+60*60*24*30*365*5); + return($status); +} + +function DeBugMessage($message) { + global $debug, $html; + if(!$debug) { + return; + } + + if ($html) echo '
'; + echo "Debugging Output:\n"; + if ($html) echo '
';
+	echo $message . "\n";
+	if ($html) echo '


'; +} + +?> diff --git a/html/includes/functions_admin.php b/html/includes/functions_admin.php new file mode 100755 index 0000000..b4a788b --- /dev/null +++ b/html/includes/functions_admin.php @@ -0,0 +1,332 @@ +', $valtmp2); + $values[$valtmp3[0]] = $valtmp3[1]; + } + } + if (isset($_REQUEST['submit']) and isset($_REQUEST['cur_var'])) { + $values[$_REQUEST['cur_var']] = $_REQUEST[$_REQUEST['cur_var']]; + unset($_REQUEST[$_REQUEST['cur_var']]); + if (isset($options['vars'][$i - 1]['exitif']) and $options['vars'][$i - 1]['exitif'] == $values[$_REQUEST['cur_var']]) $i = $maxsteps; + } + if ($i == $maxsteps) return($values); + echo ' + + + +
'.htmlentities($options['title']).'
Step '.$step.' of '.$maxsteps.'

'; + if ($step != $maxsteps and !isset($options['vars'][$i])) die("Something went wrong :("); + + echo '
'; + + echo ''; + if ($step == $maxsteps) { + echo ''; + } + + foreach($options['vars'] as $num => $var) { + if ((!isset($values[$var['name']]) and $num != $i) or $num > $i) continue; + echo ''; + + echo ''; + } + + $valstr = ''; + foreach($values as $key => $value) { + if (empty($key)) continue; + if (!empty($valstr)) $valstr .= ','; + $valstr .= "$key=>$value"; + } + + + $_REQUEST['step'] = ''; + $_REQUEST['values'] = ''; + foreach($_REQUEST as $key => $value) { + if (isset($_COOKIE[$key])) continue; + switch($key){ + case 'step': + $value = $step; break; + case 'values': + $value = $valstr; break; + case 'submit': + case 'back': + case 'cur_var': + case 'playerfilter': + case 'noop': + continue 2; + } + echo ''; + } + + echo ''; + $caption = ($step == $maxsteps) ? 'Finish' : 'Next >>'; + echo ''; + + echo '
Please Confirm!
'; + + if ($num == $i or !isset($var['caption'])) { + echo htmlentities($var['prompt']); + } else { + echo htmlentities($var['caption']); + } + + echo ''; + if ($num != $i) { + if (isset($var['extraoption']) and $values[$var['name']] == $var['extraoption']) { + echo htmlentities($values[$var['name']]); + } else { + switch($var['type']) { + case 'game': + $r_game = small_query("SELECT gamename, name FROM uts_games WHERE id = '". $values[$var['name']] ."'"); + echo htmlentities($r_game['name']) .' ('. htmlentities($r_game['gamename']) .')'; + break; + case 'server': + $r_server = small_query("SELECT servername, serverip FROM uts_match WHERE id = '". $values[$var['name']] ."'"); + echo htmlentities($r_server['servername']) .' ('. $r_server['serverip'] .')'; + break; + case 'player': + $r_player = small_query("SELECT name FROM uts_pinfo WHERE id = '". $values[$var['name']] ."'"); + echo htmlentities($r_player['name']); + break; + case 'match': + $r_match = small_query("SELECT id, time, serverip, mapfile FROM uts_match WHERE id = '". $values[$var['name']] ."'"); + echo htmlentities($r_match['id'].': '.mdate2($r_match['time']).' ('.un_ut($r_match['mapfile']).' on '.$r_match['serverip'].')'); + break; + case 'static': + case 'text': + echo htmlentities($values[$var['name']]); + break; + default: + echo 'Show: Don\'tknow what to do with type '. $var['type']; + } + } + } else { + if (isset($var['initialvalue']) and isset($values[$var['initialvalue']])) $values[$var['name']] = $values[$var['initialvalue']]; + echo ''; + switch($var['type']) { + case 'game': + echo ''; + break; + + + case 'server': + echo ''; + break; + + case 'player': + echo ''; + echo '    '; + echo 'Filter: '; + echo ' '; + break; + + case 'match': + echo ''; + break; + + case 'static': + echo ''; + break; + + case 'text': + $pval = (isset($values[$var['name']])) ? $values[$var['name']] : ''; + echo ''; + break; + + + default: + echo 'Select: Don\'tknow what to do with type '. $var['type']; + } + } + echo '
'; + if ($step != 1) echo ''; + echo '
'; + + + echo '
'; + require('includes/footer.php'); + exit; +} + + +?> \ No newline at end of file diff --git a/html/includes/geoip.inc b/html/includes/geoip.inc new file mode 100755 index 0000000..a095469 --- /dev/null +++ b/html/includes/geoip.inc @@ -0,0 +1,498 @@ + 0, "AP" => 1, "EU" => 2, "AD" => 3, "AE" => 4, "AF" => 5, +"AG" => 6, "AI" => 7, "AL" => 8, "AM" => 9, "AN" => 10, "AO" => 11, +"AQ" => 12, "AR" => 13, "AS" => 14, "AT" => 15, "AU" => 16, "AW" => 17, +"AZ" => 18, "BA" => 19, "BB" => 20, "BD" => 21, "BE" => 22, "BF" => 23, +"BG" => 24, "BH" => 25, "BI" => 26, "BJ" => 27, "BM" => 28, "BN" => 29, +"BO" => 30, "BR" => 31, "BS" => 32, "BT" => 33, "BV" => 34, "BW" => 35, +"BY" => 36, "BZ" => 37, "CA" => 38, "CC" => 39, "CD" => 40, "CF" => 41, +"CG" => 42, "CH" => 43, "CI" => 44, "CK" => 45, "CL" => 46, "CM" => 47, +"CN" => 48, "CO" => 49, "CR" => 50, "CU" => 51, "CV" => 52, "CX" => 53, +"CY" => 54, "CZ" => 55, "DE" => 56, "DJ" => 57, "DK" => 58, "DM" => 59, +"DO" => 60, "DZ" => 61, "EC" => 62, "EE" => 63, "EG" => 64, "EH" => 65, +"ER" => 66, "ES" => 67, "ET" => 68, "FI" => 69, "FJ" => 70, "FK" => 71, +"FM" => 72, "FO" => 73, "FR" => 74, "FX" => 75, "GA" => 76, "GB" => 77, +"GD" => 78, "GE" => 79, "GF" => 80, "GH" => 81, "GI" => 82, "GL" => 83, +"GM" => 84, "GN" => 85, "GP" => 86, "GQ" => 87, "GR" => 88, "GS" => 89, +"GT" => 90, "GU" => 91, "GW" => 92, "GY" => 93, "HK" => 94, "HM" => 95, +"HN" => 96, "HR" => 97, "HT" => 98, "HU" => 99, "ID" => 100, "IE" => 101, +"IL" => 102, "IN" => 103, "IO" => 104, "IQ" => 105, "IR" => 106, "IS" => 107, +"IT" => 108, "JM" => 109, "JO" => 110, "JP" => 111, "KE" => 112, "KG" => 113, +"KH" => 114, "KI" => 115, "KM" => 116, "KN" => 117, "KP" => 118, "KR" => 119, +"KW" => 120, "KY" => 121, "KZ" => 122, "LA" => 123, "LB" => 124, "LC" => 125, +"LI" => 126, "LK" => 127, "LR" => 128, "LS" => 129, "LT" => 130, "LU" => 131, +"LV" => 132, "LY" => 133, "MA" => 134, "MC" => 135, "MD" => 136, "MG" => 137, +"MH" => 138, "MK" => 139, "ML" => 140, "MM" => 141, "MN" => 142, "MO" => 143, +"MP" => 144, "MQ" => 145, "MR" => 146, "MS" => 147, "MT" => 148, "MU" => 149, +"MV" => 150, "MW" => 151, "MX" => 152, "MY" => 153, "MZ" => 154, "NA" => 155, +"NC" => 156, "NE" => 157, "NF" => 158, "NG" => 159, "NI" => 160, "NL" => 161, +"NO" => 162, "NP" => 163, "NR" => 164, "NU" => 165, "NZ" => 166, "OM" => 167, +"PA" => 168, "PE" => 169, "PF" => 170, "PG" => 171, "PH" => 172, "PK" => 173, +"PL" => 174, "PM" => 175, "PN" => 176, "PR" => 177, "PS" => 178, "PT" => 179, +"PW" => 180, "PY" => 181, "QA" => 182, "RE" => 183, "RO" => 184, "RU" => 185, +"RW" => 186, "SA" => 187, "SB" => 188, "SC" => 189, "SD" => 190, "SE" => 191, +"SG" => 192, "SH" => 193, "SI" => 194, "SJ" => 195, "SK" => 196, "SL" => 197, +"SM" => 198, "SN" => 199, "SO" => 200, "SR" => 201, "ST" => 202, "SV" => 203, +"SY" => 204, "SZ" => 205, "TC" => 206, "TD" => 207, "TF" => 208, "TG" => 209, +"TH" => 210, "TJ" => 211, "TK" => 212, "TM" => 213, "TN" => 214, "TO" => 215, +"TL" => 216, "TR" => 217, "TT" => 218, "TV" => 219, "TW" => 220, "TZ" => 221, +"UA" => 222, "UG" => 223, "UM" => 224, "US" => 225, "UY" => 226, "UZ" => 227, +"VA" => 228, "VC" => 229, "VE" => 230, "VG" => 231, "VI" => 232, "VN" => 233, +"VU" => 234, "WF" => 235, "WS" => 236, "YE" => 237, "YT" => 238, "RS" => 239, +"ZA" => 240, "ZM" => 241, "ME" => 242, "ZW" => 243, "A1" => 244, "A2" => 245, +"O1" => 246, "AX" => 247, "GG" => 248, "IM" => 249, "JE" => 250 +); + var $GEOIP_COUNTRY_CODES = array( +"", "AP", "EU", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", +"AR", "AS", "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", +"BI", "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", +"CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", +"CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", +"EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", "GA", "GB", +"GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", +"GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", +"IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", +"KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", +"LT", "LU", "LV", "LY", "MA", "MC", "MD", "MG", "MH", "MK", "ML", "MM", "MN", +"MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", +"NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", +"PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", +"QA", "RE", "RO", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", +"SJ", "SK", "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", +"TF", "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TL", "TR", "TT", "TV", "TW", +"TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", +"VU", "WF", "WS", "YE", "YT", "RS", "ZA", "ZM", "ME", "ZW", "A1", "A2", "O1", +"AX", "GG", "IM", "JE" +); + var $GEOIP_COUNTRY_CODES3 = array( +"","AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","ANT","AGO","AQ","ARG", +"ASM","AUT","AUS","ABW","AZE","BIH","BRB","BGD","BEL","BFA","BGR","BHR","BDI", +"BEN","BMU","BRN","BOL","BRA","BHS","BTN","BV","BWA","BLR","BLZ","CAN","CC", +"COD","CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI","CUB","CPV", +"CX","CYP","CZE","DEU","DJI","DNK","DMA","DOM","DZA","ECU","EST","EGY","ESH", +"ERI","ESP","ETH","FIN","FJI","FLK","FSM","FRO","FRA","FX","GAB","GBR","GRD", +"GEO","GUF","GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","GS","GTM","GUM", +"GNB","GUY","HKG","HM","HND","HRV","HTI","HUN","IDN","IRL","ISR","IND","IO", +"IRQ","IRN","ISL","ITA","JAM","JOR","JPN","KEN","KGZ","KHM","KIR","COM","KNA", +"PRK","KOR","KWT","CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU", +"LUX","LVA","LBY","MAR","MCO","MDA","MDG","MHL","MKD","MLI","MMR","MNG","MAC", +"MNP","MTQ","MRT","MSR","MLT","MUS","MDV","MWI","MEX","MYS","MOZ","NAM","NCL", +"NER","NFK","NGA","NIC","NLD","NOR","NPL","NRU","NIU","NZL","OMN","PAN","PER", +"PYF","PNG","PHL","PAK","POL","SPM","PCN","PRI","PSE","PRT","PLW","PRY","QAT", +"REU","ROU","RUS","RWA","SAU","SLB","SYC","SDN","SWE","SGP","SHN","SVN","SJM", +"SVK","SLE","SMR","SEN","SOM","SUR","STP","SLV","SYR","SWZ","TCA","TCD","TF", +"TGO","THA","TJK","TKL","TLS","TKM","TUN","TON","TUR","TTO","TUV","TWN","TZA", +"UKR","UGA","UM","USA","URY","UZB","VAT","VCT","VEN","VGB","VIR","VNM","VUT", +"WLF","WSM","YEM","YT","SRB","ZAF","ZMB","MNE","ZWE","A1","A2","O1", +"ALA","GGY","IMN","JEY" + ); + var $GEOIP_COUNTRY_NAMES = array( +"", "Asia/Pacific Region", "Europe", "Andorra", "United Arab Emirates", +"Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", +"Netherlands Antilles", "Angola", "Antarctica", "Argentina", "American Samoa", +"Austria", "Australia", "Aruba", "Azerbaijan", "Bosnia and Herzegovina", +"Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", +"Burundi", "Benin", "Bermuda", "Brunei Darussalam", "Bolivia", "Brazil", +"Bahamas", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", +"Canada", "Cocos (Keeling) Islands", "Congo, The Democratic Republic of the", +"Central African Republic", "Congo", "Switzerland", "Cote D'Ivoire", "Cook +Islands", "Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", "Cape +Verde", "Christmas Island", "Cyprus", "Czech Republic", "Germany", "Djibouti", +"Denmark", "Dominica", "Dominican Republic", "Algeria", "Ecuador", "Estonia", +"Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji", +"Falkland Islands (Malvinas)", "Micronesia, Federated States of", "Faroe +Islands", "France", "France, Metropolitan", "Gabon", "United Kingdom", +"Grenada", "Georgia", "French Guiana", "Ghana", "Gibraltar", "Greenland", +"Gambia", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia +and the South Sandwich Islands", "Guatemala", "Guam", "Guinea-Bissau", +"Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras", +"Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "India", +"British Indian Ocean Territory", "Iraq", "Iran, Islamic Republic of", +"Iceland", "Italy", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan", +"Cambodia", "Kiribati", "Comoros", "Saint Kitts and Nevis", "Korea, Democratic +People's Republic of", "Korea, Republic of", "Kuwait", "Cayman Islands", +"Kazakstan", "Lao People's Democratic Republic", "Lebanon", "Saint Lucia", +"Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", "Luxembourg", +"Latvia", "Libyan Arab Jamahiriya", "Morocco", "Monaco", "Moldova, Republic +of", "Madagascar", "Marshall Islands", "Macedonia", +"Mali", "Myanmar", "Mongolia", "Macau", "Northern Mariana Islands", +"Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives", +"Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia", +"Niger", "Norfolk Island", "Nigeria", "Nicaragua", "Netherlands", "Norway", +"Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French +Polynesia", "Papua New Guinea", "Philippines", "Pakistan", "Poland", "Saint +Pierre and Miquelon", "Pitcairn Islands", "Puerto Rico", "Palestinian Territory", +"Portugal", "Palau", "Paraguay", "Qatar", "Reunion", "Romania", +"Russian Federation", "Rwanda", "Saudi Arabia", "Solomon Islands", +"Seychelles", "Sudan", "Sweden", "Singapore", "Saint Helena", "Slovenia", +"Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal", +"Somalia", "Suriname", "Sao Tome and Principe", "El Salvador", "Syrian Arab +Republic", "Swaziland", "Turks and Caicos Islands", "Chad", "French Southern +Territories", "Togo", "Thailand", "Tajikistan", "Tokelau", "Turkmenistan", +"Tunisia", "Tonga", "Timor-Leste", "Turkey", "Trinidad and Tobago", "Tuvalu", +"Taiwan", "Tanzania, United Republic of", "Ukraine", +"Uganda", "United States Minor Outlying Islands", "United States", "Uruguay", +"Uzbekistan", "Holy See (Vatican City State)", "Saint Vincent and the +Grenadines", "Venezuela", "Virgin Islands, British", "Virgin Islands, U.S.", +"Vietnam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte", +"Serbia", "South Africa", "Zambia", "Montenegro", "Zimbabwe", +"Anonymous Proxy","Satellite Provider","Other", +"Aland Islands","Guernsey","Isle of Man","Jersey" +); +} +function geoip_load_shared_mem ($file) { + + $fp = fopen($file, "rb"); + if (!$fp) { + print "error opening $file: $php_errormsg\n"; + exit; + } + $s_array = fstat($fp); + $size = $s_array['size']; + if ($shmid = @shmop_open (GEOIP_SHM_KEY, "w", 0, 0)) { + shmop_delete ($shmid); + shmop_close ($shmid); + } + $shmid = shmop_open (GEOIP_SHM_KEY, "c", 0644, $size); + shmop_write ($shmid, fread($fp, $size), 0); + shmop_close ($shmid); +} + +function _setup_segments($gi){ + $gi->databaseType = GEOIP_COUNTRY_EDITION; + $gi->record_length = STANDARD_RECORD_LENGTH; + if ($gi->flags & GEOIP_SHARED_MEMORY) { + $offset = @shmop_size ($gi->shmid) - 3; + for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) { + $delim = @shmop_read ($gi->shmid, $offset, 3); + $offset += 3; + if ($delim == (chr(255).chr(255).chr(255))) { + $gi->databaseType = ord(@shmop_read ($gi->shmid, $offset, 1)); + $offset++; + + if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){ + $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0; + } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){ + $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1; + } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)|| + ($gi->databaseType == GEOIP_CITY_EDITION_REV1) + || ($gi->databaseType == GEOIP_ORG_EDITION) + || ($gi->databaseType == GEOIP_ISP_EDITION) + || ($gi->databaseType == GEOIP_ASNUM_EDITION)){ + $gi->databaseSegments = 0; + $buf = @shmop_read ($gi->shmid, $offset, SEGMENT_RECORD_LENGTH); + for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){ + $gi->databaseSegments += (ord($buf[$j]) << ($j * 8)); + } + if (($gi->databaseType == GEOIP_ORG_EDITION)|| + ($gi->databaseType == GEOIP_ISP_EDITION)) { + $gi->record_length = ORG_RECORD_LENGTH; + } + } + break; + } else { + $offset -= 4; + } + } + if (($gi->databaseType == GEOIP_COUNTRY_EDITION)|| + ($gi->databaseType == GEOIP_PROXY_EDITION)|| + ($gi->databaseType == GEOIP_NETSPEED_EDITION)){ + $gi->databaseSegments = GEOIP_COUNTRY_BEGIN; + } + } else { + $filepos = ftell($gi->filehandle); + fseek($gi->filehandle, -3, SEEK_END); + for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) { + $delim = fread($gi->filehandle,3); + if ($delim == (chr(255).chr(255).chr(255))){ + $gi->databaseType = ord(fread($gi->filehandle,1)); + if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){ + $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0; + } + else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){ + $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1; + } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0) || + ($gi->databaseType == GEOIP_CITY_EDITION_REV1) || + ($gi->databaseType == GEOIP_ORG_EDITION) || + ($gi->databaseType == GEOIP_ISP_EDITION) || + ($gi->databaseType == GEOIP_ASNUM_EDITION)){ + $gi->databaseSegments = 0; + $buf = fread($gi->filehandle,SEGMENT_RECORD_LENGTH); + for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){ + $gi->databaseSegments += (ord($buf[$j]) << ($j * 8)); + } + if ($gi->databaseType == GEOIP_ORG_EDITION || + $gi->databaseType == GEOIP_ISP_EDITION) { + $gi->record_length = ORG_RECORD_LENGTH; + } + } + break; + } else { + fseek($gi->filehandle, -4, SEEK_CUR); + } + } + if (($gi->databaseType == GEOIP_COUNTRY_EDITION)|| + ($gi->databaseType == GEOIP_PROXY_EDITION)|| + ($gi->databaseType == GEOIP_NETSPEED_EDITION)){ + $gi->databaseSegments = GEOIP_COUNTRY_BEGIN; + } + fseek($gi->filehandle,$filepos,SEEK_SET); + } + return $gi; +} + +function geoip_open($filename, $flags) { + $gi = new GeoIP; + $gi->flags = $flags; + if ($gi->flags & GEOIP_SHARED_MEMORY) { + $gi->shmid = @shmop_open (GEOIP_SHM_KEY, "a", 0, 0); + } else { + $gi->filehandle = fopen($filename,"rb"); + if ($gi->flags & GEOIP_MEMORY_CACHE) { + $s_array = fstat($gi->filehandle); + $gi->memory_buffer = fread($gi->filehandle, $s_array['size']); + } + } + + $gi = _setup_segments($gi); + return $gi; +} + +function geoip_close($gi) { + if ($gi->flags & GEOIP_SHARED_MEMORY) { + return true; + } + + return fclose($gi->filehandle); +} + +function geoip_country_id_by_name($gi, $name) { + $addr = gethostbyname($name); + if (!$addr || $addr == $name) { + return false; + } + return geoip_country_id_by_addr($gi, $addr); +} + +function geoip_country_code_by_name($gi, $name) { + $country_id = geoip_country_id_by_name($gi,$name); + if ($country_id !== false) { + return $gi->GEOIP_COUNTRY_CODES[$country_id]; + } + return false; +} + +function geoip_country_name_by_name($gi, $name) { + $country_id = geoip_country_id_by_name($gi,$name); + if ($country_id !== false) { + return $gi->GEOIP_COUNTRY_NAMES[$country_id]; + } + return false; +} + +function geoip_country_id_by_addr($gi, $addr) { + $ipnum = ip2long($addr); + return _geoip_seek_country($gi, $ipnum) - GEOIP_COUNTRY_BEGIN; +} + +function geoip_country_code_by_addr($gi, $addr) { + if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) { + $record = geoip_record_by_addr($gi,$addr); + return $record->country_code; + } else { + $country_id = geoip_country_id_by_addr($gi,$addr); + if ($country_id !== false) { + return $gi->GEOIP_COUNTRY_CODES[$country_id]; + } + } + return false; +} + +function geoip_country_name_by_addr($gi, $addr) { + if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) { + $record = geoip_record_by_addr($gi,$addr); + return $record->country_name; + } else { + $country_id = geoip_country_id_by_addr($gi,$addr); + if ($country_id !== false) { + return $gi->GEOIP_COUNTRY_NAMES[$country_id]; + } + } + return false; +} + +function _geoip_seek_country($gi, $ipnum) { + $offset = 0; + for ($depth = 31; $depth >= 0; --$depth) { + if ($gi->flags & GEOIP_MEMORY_CACHE) { + $buf = substr($gi->memory_buffer, + 2 * $gi->record_length * $offset, + 2 * $gi->record_length); + } elseif ($gi->flags & GEOIP_SHARED_MEMORY) { + $buf = @shmop_read ($gi->shmid, + 2 * $gi->record_length * $offset, + 2 * $gi->record_length ); + } else { + fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0 + or die("fseek failed"); + $buf = fread($gi->filehandle, 2 * $gi->record_length); + } + $x = array(0,0); + for ($i = 0; $i < 2; ++$i) { + for ($j = 0; $j < $gi->record_length; ++$j) { + $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8); + } + } + if ($ipnum & (1 << $depth)) { + if ($x[1] >= $gi->databaseSegments) { + return $x[1]; + } + $offset = $x[1]; + } else { + if ($x[0] >= $gi->databaseSegments) { + return $x[0]; + } + $offset = $x[0]; + } + } + trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR); + return false; +} + +function _get_org($gi,$ipnum){ + $seek_org = _geoip_seek_country($gi,$ipnum); + if ($seek_org == $gi->databaseSegments) { + return NULL; + } + $record_pointer = $seek_org + (2 * $gi->record_length - 1) * $gi->databaseSegments; + if ($gi->flags & GEOIP_SHARED_MEMORY) { + $org_buf = @shmop_read ($gi->shmid, $record_pointer, MAX_ORG_RECORD_LENGTH); + } else { + fseek($gi->filehandle, $record_pointer, SEEK_SET); + $org_buf = fread($gi->filehandle,MAX_ORG_RECORD_LENGTH); + } + $org_buf = substr($org_buf, 0, strpos($org_buf, 0)); + return $org_buf; +} + +function geoip_org_by_addr ($gi,$addr) { + if ($addr == NULL) { + return 0; + } + $ipnum = ip2long($addr); + return _get_org($gi, $ipnum); +} + +function _get_region($gi,$ipnum){ + if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){ + $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV0; + if ($seek_region >= 1000){ + $country_code = "US"; + $region = chr(($seek_region - 1000)/26 + 65) . chr(($seek_region - 1000)%26 + 65); + } else { + $country_code = $gi->GEOIP_COUNTRY_CODES[$seek_region]; + $region = ""; + } + return array ($country_code,$region); + } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1) { + $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV1; + //print $seek_region; + if ($seek_region < US_OFFSET){ + $country_code = ""; + $region = ""; + } else if ($seek_region < CANADA_OFFSET) { + $country_code = "US"; + $region = chr(($seek_region - US_OFFSET)/26 + 65) . chr(($seek_region - US_OFFSET)%26 + 65); + } else if ($seek_region < WORLD_OFFSET) { + $country_code = "CA"; + $region = chr(($seek_region - CANADA_OFFSET)/26 + 65) . chr(($seek_region - CANADA_OFFSET)%26 + 65); + } else { + $country_code = $gi->GEOIP_COUNTRY_CODES[($seek_region - WORLD_OFFSET) / FIPS_RANGE]; + $region = ""; + } + return array ($country_code,$region); + } +} + +function geoip_region_by_addr ($gi,$addr) { + if ($addr == NULL) { + return 0; + } + $ipnum = ip2long($addr); + return _get_region($gi, $ipnum); +} + +function getdnsattributes ($l,$ip){ + $r = new Net_DNS_Resolver(); + $r->nameservers = array("ws1.maxmind.com"); + $p = $r->search($l."." . $ip .".s.maxmind.com","TXT","IN"); + $str = is_object($p->answer[0])?$p->answer[0]->string():''; + ereg("\"(.*)\"",$str,$regs); + $str = $regs[1]; + return $str; +} + +?> diff --git a/html/includes/header.php b/html/includes/header.php new file mode 100755 index 0000000..e84a63e --- /dev/null +++ b/html/includes/header.php @@ -0,0 +1,66 @@ + + + + Unreal Tournament Stats - Powered by UTStats + + + + + + + + + + + +'; + +include("includes/sidebar.php"); + + +echo' +
+ + + +
+ UTStats Logo +
+
+
+'; \ No newline at end of file diff --git a/html/includes/hints.php b/html/includes/hints.php new file mode 100755 index 0000000..b8da8de --- /dev/null +++ b/html/includes/hints.php @@ -0,0 +1,81 @@ + "Frags", + "text" => "A player's frag count is equal to their kills minus suicides. In team games team kills (not team suicides) are also subtracted from the player's kills." + ); + +$hint['K'] = array ( "caption" => "Kills", + "text" => "Number of times a player kills another player.
Note: UTStats only tracks human vs. human kills. Bot kills and other bot related events are not tracked." + ); + +$hint['D'] = array ( "caption" => "Deaths", + "text" => "Number of times a player gets killed by another player.
- This does not include environment induced deaths, like trap doors. These and self kills are counted separately, as suicides.
- Team based deaths are counted as team deaths." + ); + +$hint['S'] = array ( "caption" => "Suicides", + "text" => "Number of times a player dies due to action of their own cause. Suicides can be environment induced (drowning, getting crushed, falling) or weapon related (fatal splash damage from their own weapon)." + ); + +$hint['TK'] = array ( "caption" => "Team Kills", + "text" => "Number of times a player in a team based game kills someone on their own team.
Note: Team kills subtract from a player's personal frags and thus the team frags as a whole." + ); + +$hint['Multis'] = + array ( "caption" => "Multi Kills", + "text" => "Special event: If you manage to kill more 2 than people within a short space of time you get a Double Kill, 3 is a Multi Kill etc" + ); + +$hint['Sprees'] = + array ( "caption" => "Killing Sprees", + "text" => "Special event: If you manage to kill 5 or more opponents without dying yourself, you will be on a killing spree. If you kill more than 10 opponents, you are on a rampage, etc." + ); + +$hint['EFF'] = array ( "caption" => "Efficiency", + "text" => "A ratio that denotes the player's kill skill by comparing it with his overall performance. A perfect efficiency is equal to 1 (100%), anything less than 0.5 (50%) is below average.
Formula: Kills / (Kills + Deaths + Suicides [+Team Kills])" + ); + +$hint['ACC'] = array ( "caption" => "Accuracy", + "text" => "Overall accuracy when using all weapons. Most accurate in insta but also very accurate in normal weapons." + ); + +$hint['TTL'] = array ( "caption" => "Time to Live", + "text" => "The length of time a player is in a game in seconds divided by how many times he/she dies, thus giving an average time of how long he/she will live." + ); + +$hint['DK'] = array ( "caption" => "Double Kill", + "text" => "Killed 2 people in a short space of time without dying himself/herself" + ); + +$hint['MK'] = array ( "caption" => "Multi Kill", + "text" => "Killed 3 people in a short space of time without dying himself/herself" + ); + +$hint['UK'] = array ( "caption" => "Ultra Kill", + "text" => "Killed 4 people in a short space of time without dying himself/herself" + ); + +$hint['MOK'] = array ( "caption" => "Monster Kill", + "text" => "Killed 5 people in a short space of time without dying himself/herself" + ); + + +$hint['KS'] = array ( "caption" => "Killing Spree", + "text" => "Killed 5 people in a row without dying himself/herself" + ); + +$hint['RA'] = array ( "caption" => "Rampage", + "text" => "Killed 10 people in a row without dying himself/herself" + ); + +$hint['DO'] = array ( "caption" => "Dominating", + "text" => "Killed 15 people in a row without dying himself/herself" + ); + +$hint['US'] = array ( "caption" => "Unstoppable", + "text" => "Killed 20 people in a row without dying himself/herself" + ); + +$hint['GL'] = array ( "caption" => "God Like", + "text" => "Killed 25 people in a row without dying himself/herself" + ); + +?> \ No newline at end of file diff --git a/html/includes/index.htm b/html/includes/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/includes/overlib_mini.js b/html/includes/overlib_mini.js new file mode 100755 index 0000000..704d123 --- /dev/null +++ b/html/includes/overlib_mini.js @@ -0,0 +1,322 @@ +//\///// +//\ overLIB 4.21 - You may not remove or change this notice. +//\ Copyright Erik Bosrup 1998-2004. All rights reserved. +//\ +//\ Contributors are listed on the homepage. +//\ This file might be old, always check for the latest version at: +//\ http://www.bosrup.com/web/overlib/ +//\ +//\ Please read the license agreement (available through the link above) +//\ before using overLIB. Direct any licensing questions to erik@bosrup.com. +//\ +//\ Do not sell this as your own work or remove this copyright notice. +//\ For full details on copying or changing this script please read the +//\ license agreement at the link above. Please give credit on sites that +//\ use overLIB and submit changes of the script so other people can use +//\ them as well. +//\///// +//\ THIS IS A VERY MODIFIED VERSION. DO NOT EDIT OR PUBLISH. GET THE ORIGINAL! +var olLoaded=0,pmStart=10000000,pmUpper=10001000,pmCount=pmStart+1,pmt='',pms=new Array(),olInfo=new Info('4.21',1),FREPLACE=0,FBEFORE=1,FAFTER=2,FALTERNATE=3,FCHAIN=4,olHideForm=0,olHautoFlag=0,olVautoFlag=0,hookPts=new Array(),postParse=new Array(),cmdLine=new Array(),runTime=new Array(); +registerCommands('donothing,inarray,caparray,sticky,background,noclose,caption,left,right,center,offsetx,offsety,fgcolor,bgcolor,textcolor,capcolor,closecolor,width,border,cellpad,status,autostatus,autostatuscap,height,closetext,snapx,snapy,fixx,fixy,relx,rely,fgbackground,bgbackground,padx,pady,fullhtml,above,below,capicon,textfont,captionfont,closefont,textsize,captionsize,closesize,timeout,function,delay,hauto,vauto,closeclick,wrap,followmouse,mouseoff,closetitle,cssoff,compatmode,cssclass,fgclass,bgclass,textfontclass,captionfontclass,closefontclass'); +if(typeof ol_fgcolor=='undefined')var ol_fgcolor="#CCCCFF";if(typeof ol_bgcolor=='undefined')var ol_bgcolor="#333399";if(typeof ol_textcolor=='undefined')var ol_textcolor="#000000";if(typeof ol_capcolor=='undefined')var ol_capcolor="#FFFFFF";if(typeof ol_closecolor=='undefined')var ol_closecolor="#9999FF";if(typeof ol_textfont=='undefined')var ol_textfont="Verdana,Arial,Helvetica";if(typeof ol_captionfont=='undefined')var ol_captionfont="Verdana,Arial,Helvetica";if(typeof ol_closefont=='undefined')var ol_closefont="Verdana,Arial,Helvetica";if(typeof ol_textsize=='undefined')var ol_textsize="1";if(typeof ol_captionsize=='undefined')var ol_captionsize="1";if(typeof ol_closesize=='undefined')var ol_closesize="1";if(typeof ol_width=='undefined')var ol_width="200";if(typeof ol_border=='undefined')var ol_border="1";if(typeof ol_cellpad=='undefined')var ol_cellpad=2;if(typeof ol_offsetx=='undefined')var ol_offsetx=10;if(typeof ol_offsety=='undefined')var ol_offsety=10;if(typeof ol_text=='undefined')var ol_text="Default Text";if(typeof ol_cap=='undefined')var ol_cap="";if(typeof ol_sticky=='undefined')var ol_sticky=0;if(typeof ol_background=='undefined')var ol_background="";if(typeof ol_close=='undefined')var ol_close="Close";if(typeof ol_hpos=='undefined')var ol_hpos=RIGHT;if(typeof ol_status=='undefined')var ol_status="";if(typeof ol_autostatus=='undefined')var ol_autostatus=0;if(typeof ol_height=='undefined')var ol_height=-1;if(typeof ol_snapx=='undefined')var ol_snapx=0;if(typeof ol_snapy=='undefined')var ol_snapy=0;if(typeof ol_fixx=='undefined')var ol_fixx=-1;if(typeof ol_fixy=='undefined')var ol_fixy=-1;if(typeof ol_relx=='undefined')var ol_relx=null;if(typeof ol_rely=='undefined')var ol_rely=null;if(typeof ol_fgbackground=='undefined')var ol_fgbackground="";if(typeof ol_bgbackground=='undefined')var ol_bgbackground="";if(typeof ol_padxl=='undefined')var ol_padxl=1;if(typeof ol_padxr=='undefined')var ol_padxr=1;if(typeof ol_padyt=='undefined')var ol_padyt=1;if(typeof ol_padyb=='undefined')var ol_padyb=1;if(typeof ol_fullhtml=='undefined')var ol_fullhtml=0;if(typeof ol_vpos=='undefined')var ol_vpos=BELOW;if(typeof ol_aboveheight=='undefined')var ol_aboveheight=0;if(typeof ol_capicon=='undefined')var ol_capicon="";if(typeof ol_frame=='undefined')var ol_frame=self;if(typeof ol_timeout=='undefined')var ol_timeout=0;if(typeof ol_function=='undefined')var ol_function=null;if(typeof ol_delay=='undefined')var ol_delay=0;if(typeof ol_hauto=='undefined')var ol_hauto=0;if(typeof ol_vauto=='undefined')var ol_vauto=0;if(typeof ol_closeclick=='undefined')var ol_closeclick=0;if(typeof ol_wrap=='undefined')var ol_wrap=0;if(typeof ol_followmouse=='undefined')var ol_followmouse=1;if(typeof ol_mouseoff=='undefined')var ol_mouseoff=0;if(typeof ol_closetitle=='undefined')var ol_closetitle='Close';if(typeof ol_compatmode=='undefined')var ol_compatmode=0;if(typeof ol_css=='undefined')var ol_css=CSSOFF;if(typeof ol_fgclass=='undefined')var ol_fgclass="";if(typeof ol_bgclass=='undefined')var ol_bgclass="";if(typeof ol_textfontclass=='undefined')var ol_textfontclass="";if(typeof ol_captionfontclass=='undefined')var ol_captionfontclass="";if(typeof ol_closefontclass=='undefined')var ol_closefontclass=""; +if(typeof ol_texts=='undefined')var ol_texts=new Array("Text 0","Text 1");if(typeof ol_caps=='undefined')var ol_caps=new Array("Caption 0","Caption 1"); +var o3_text="",o3_cap="",o3_sticky=0,o3_background="",o3_close="Close",o3_hpos=RIGHT,o3_offsetx=2,o3_offsety=2,o3_fgcolor="",o3_bgcolor="",o3_textcolor="",o3_capcolor="",o3_closecolor="",o3_width=100,o3_border=1,o3_cellpad=2,o3_status="",o3_autostatus=0,o3_height=-1,o3_snapx=0,o3_snapy=0,o3_fixx=-1,o3_fixy=-1,o3_relx=null,o3_rely=null,o3_fgbackground="",o3_bgbackground="",o3_padxl=0,o3_padxr=0,o3_padyt=0,o3_padyb=0,o3_fullhtml=0,o3_vpos=BELOW,o3_aboveheight=0,o3_capicon="",o3_textfont="Verdana,Arial,Helvetica",o3_captionfont="Verdana,Arial,Helvetica",o3_closefont="Verdana,Arial,Helvetica",o3_textsize="1",o3_captionsize="1",o3_closesize="1",o3_frame=self,o3_timeout=0,o3_timerid=0,o3_allowmove=0,o3_function=null,o3_delay=0,o3_delayid=0,o3_hauto=0,o3_vauto=0,o3_closeclick=0,o3_wrap=0,o3_followmouse=1,o3_mouseoff=0,o3_closetitle='',o3_compatmode=0,o3_css=CSSOFF,o3_fgclass="",o3_bgclass="",o3_textfontclass="",o3_captionfontclass="",o3_closefontclass=""; +var o3_x=0,o3_y=0,o3_showingsticky=0,o3_removecounter=0; +var over=null,fnRef,hoveringSwitch=false,olHideDelay; +var isMac=(navigator.userAgent.indexOf("Mac")!=-1),olOp=(navigator.userAgent.toLowerCase().indexOf('opera')>-1&&document.createTextNode),olNs4=(navigator.appName=='Netscape'&&parseInt(navigator.appVersion)==4),olNs6=(document.getElementById)?true:false,olKq=(olNs6&&/konqueror/i.test(navigator.userAgent)),olIe4=(document.all)?true:false,olIe5=false,olIe55=false,docRoot='document.body'; +if(olNs4){var oW=window.innerWidth;var oH=window.innerHeight;window.onresize=function(){if(oW!=window.innerWidth||oH!=window.innerHeight)location.reload();}} +if(olIe4){var agent=navigator.userAgent;if(/MSIE/.test(agent)){var versNum=parseFloat(agent.match(/MSIE[ ](\d\.\d+)\.*/i)[1]);if(versNum>=5){olIe5=true;olIe55=(versNum>=5.5&&!olOp)?true:false;if(olNs6)olNs6=false;}} +if(olNs6)olIe4=false;} +if(document.compatMode&&document.compatMode=='CSS1Compat'){docRoot=((olIe4&&!olOp)?'document.documentElement':docRoot);} +if(window.addEventListener)window.addEventListener("load",OLonLoad_handler,false);else if(window.attachEvent)window.attachEvent("onload",OLonLoad_handler); +var capExtent; +function overlib(){if(!olLoaded||isExclusive(overlib.arguments))return true;if(olCheckMouseCapture)olMouseCapture();if(over){over=(typeof over.id!='string')?o3_frame.document.all['overDiv']:over;cClick();} +olHideDelay=0;o3_text=ol_text;o3_cap=ol_cap;o3_sticky=ol_sticky;o3_background=ol_background;o3_close=ol_close;o3_hpos=ol_hpos;o3_offsetx=ol_offsetx;o3_offsety=ol_offsety;o3_fgcolor=ol_fgcolor;o3_bgcolor=ol_bgcolor;o3_textcolor=ol_textcolor;o3_capcolor=ol_capcolor;o3_closecolor=ol_closecolor;o3_width=ol_width;o3_border=ol_border;o3_cellpad=ol_cellpad;o3_status=ol_status;o3_autostatus=ol_autostatus;o3_height=ol_height;o3_snapx=ol_snapx;o3_snapy=ol_snapy;o3_fixx=ol_fixx;o3_fixy=ol_fixy;o3_relx=ol_relx;o3_rely=ol_rely;o3_fgbackground=ol_fgbackground;o3_bgbackground=ol_bgbackground;o3_padxl=ol_padxl;o3_padxr=ol_padxr;o3_padyt=ol_padyt;o3_padyb=ol_padyb;o3_fullhtml=ol_fullhtml;o3_vpos=ol_vpos;o3_aboveheight=ol_aboveheight;o3_capicon=ol_capicon;o3_textfont=ol_textfont;o3_captionfont=ol_captionfont;o3_closefont=ol_closefont;o3_textsize=ol_textsize;o3_captionsize=ol_captionsize;o3_closesize=ol_closesize;o3_timeout=ol_timeout;o3_function=ol_function;o3_delay=ol_delay;o3_hauto=ol_hauto;o3_vauto=ol_vauto;o3_closeclick=ol_closeclick;o3_wrap=ol_wrap;o3_followmouse=ol_followmouse;o3_mouseoff=ol_mouseoff;o3_closetitle=ol_closetitle;o3_css=ol_css;o3_compatmode=ol_compatmode;o3_fgclass=ol_fgclass;o3_bgclass=ol_bgclass;o3_textfontclass=ol_textfontclass;o3_captionfontclass=ol_captionfontclass;o3_closefontclass=ol_closefontclass; +setRunTimeVariables(); +fnRef=''; +o3_frame=ol_frame; +if(!(over=createDivContainer()))return false; +parseTokens('o3_',overlib.arguments);if(!postParseChecks())return false; +if(o3_delay==0){return runHook("olMain",FREPLACE);}else{o3_delayid=setTimeout("runHook('olMain',FREPLACE)",o3_delay);return false;}} +function nd(time){if(olLoaded&&!isExclusive()){hideDelay(time); +if(o3_removecounter>=1){o3_showingsticky=0 }; +if(o3_showingsticky==0){o3_allowmove=0;if(over!=null&&o3_timerid==0)runHook("hideObject",FREPLACE,over);}else{o3_removecounter++;}} +return true;} +function cClick(){if(olLoaded){runHook("hideObject",FREPLACE,over);o3_showingsticky=0;} +return false;} +function overlib_pagedefaults(){parseTokens('ol_',overlib_pagedefaults.arguments);} +function olMain(){var layerhtml,styleType;runHook("olMain",FBEFORE); +if(o3_background!=""||o3_fullhtml){ +layerhtml=runHook('ol_content_background',FALTERNATE,o3_css,o3_text,o3_background,o3_fullhtml);}else{ +styleType=(pms[o3_css-1-pmStart]=="cssoff"||pms[o3_css-1-pmStart]=="cssclass"); +if(o3_fgbackground!="")o3_fgbackground="background=\""+o3_fgbackground+"\"";if(o3_bgbackground!="")o3_bgbackground=(styleType?"background=\""+o3_bgbackground+"\"":o3_bgbackground); +if(o3_fgcolor!="")o3_fgcolor=(styleType?"bgcolor=\""+o3_fgcolor+"\"":o3_fgcolor);if(o3_bgcolor!="")o3_bgcolor=(styleType?"bgcolor=\""+o3_bgcolor+"\"":o3_bgcolor); +if(o3_height>0)o3_height=(styleType?"height=\""+o3_height+"\"":o3_height);else o3_height=""; +if(o3_cap==""){ +layerhtml=runHook('ol_content_simple',FALTERNATE,o3_css,o3_text);}else{ +if(o3_sticky){ +layerhtml=runHook('ol_content_caption',FALTERNATE,o3_css,o3_text,o3_cap,o3_close);}else{ +layerhtml=runHook('ol_content_caption',FALTERNATE,o3_css,o3_text,o3_cap,"");}}} +if(o3_sticky){if(o3_timerid>0){clearTimeout(o3_timerid);o3_timerid=0;} +o3_showingsticky=1;o3_removecounter=0;} +if(!runHook("createPopup",FREPLACE,layerhtml))return false; +if(o3_autostatus>0){o3_status=o3_text;if(o3_autostatus>1)o3_status=o3_cap;} +o3_allowmove=0; +if(o3_timeout>0){if(o3_timerid>0)clearTimeout(o3_timerid);o3_timerid=setTimeout("cClick()",o3_timeout);} +runHook("disp",FREPLACE,o3_status);runHook("olMain",FAFTER); +return(olOp&&event&&event.type=='mouseover'&&!o3_status)?'':(o3_status!='');} +function ol_content_simple(text){var cpIsMultiple=/,/.test(o3_cellpad);var txt='
':((!olNs4&&cpIsMultiple)?' style="'+setCellPadStr(o3_cellpad)+'">':'>'))+(o3_textfontclass?'':wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass?'':wrapStr(1,o3_textsize))+'
'; +set_background("");return txt;} +function ol_content_caption(text,title,close){var nameId,txt,cpIsMultiple=/,/.test(o3_cellpad);var closing,closeevent; +closing="";closeevent="onmouseover";if(o3_closeclick==1)closeevent=(o3_closetitle?"title='"+o3_closetitle+"'":"")+" onclick";if(o3_capicon!=""){nameId=' hspace=\"5\"'+' align=\"middle\" alt=\"\"';if(typeof o3_dragimg!='undefined'&&o3_dragimg)nameId=' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';o3_capicon='';} +if(close!="") +closing=''+(o3_closefontclass?'':wrapStr(0,o3_closesize,'close'))+close+(o3_closefontclass?'':wrapStr(1,o3_closesize,'close'))+'';txt='
':'>')+(o3_captionfontclass?'':''+wrapStr(0,o3_captionsize,'caption'))+o3_capicon+title+(o3_captionfontclass?'':wrapStr(1,o3_captionsize)+'')+''+closing+'
' :((!olNs4&&cpIsMultiple)?' style="'+setCellPadStr(o3_cellpad)+'">':'>'))+(o3_textfontclass?'':wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass?'':wrapStr(1,o3_textsize))+'
'; +set_background("");return txt;} +function ol_content_background(text,picture,hasfullhtml){if(hasfullhtml){txt=text;}else{txt='
'+(o3_textfontclass?'':wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass?'':wrapStr(1,o3_textsize))+'
';} +set_background(picture);return txt;} +function set_background(pic){if(pic==""){if(olNs4){over.background.src=null;}else if(over.style){over.style.backgroundImage="none";} +}else{if(olNs4){over.background.src=pic;}else if(over.style){over.style.width=o3_width+'px';over.style.backgroundImage="url("+pic+")";}}} +var olShowId=-1; +function disp(statustext){runHook("disp",FBEFORE); +if(o3_allowmove==0){runHook("placeLayer",FREPLACE);(olNs6&&olShowId<0)?olShowId=setTimeout("runHook('showObject',FREPLACE,over)",1):runHook("showObject",FREPLACE,over);o3_allowmove=(o3_sticky||o3_followmouse==0)?0:1;} +runHook("disp",FAFTER); +if(statustext!="")self.status=statustext;} +function createPopup(lyrContent){runHook("createPopup",FBEFORE); +if(o3_wrap){var wd,ww,theObj=(olNs4?over:over.style);theObj.top=theObj.left=((olIe4&&!olOp)?0:-10000)+(!olNs4?'px':0);layerWrite(lyrContent);wd=(olNs4?over.clip.width:over.offsetWidth);if(wd>(ww=windowWidth())){lyrContent=lyrContent.replace(/\ /g,' ');o3_width=ww;o3_wrap=0;}} +layerWrite(lyrContent); +if(o3_wrap)o3_width=(olNs4?over.clip.width:over.offsetWidth); +runHook("createPopup",FAFTER,lyrContent); +return true;} +function placeLayer(){var placeX,placeY,widthFix=0; +if(o3_frame.innerWidth)widthFix=18;iwidth=windowWidth(); +winoffset=(olIe4)?eval('o3_frame.'+docRoot+'.scrollLeft'):o3_frame.pageXOffset; +placeX=runHook('horizontalPlacement',FCHAIN,iwidth,winoffset,widthFix); +if(o3_frame.innerHeight){iheight=o3_frame.innerHeight;}else if(eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientHeight=='number'")&&eval('o3_frame.'+docRoot+'.clientHeight')){iheight=eval('o3_frame.'+docRoot+'.clientHeight');} +scrolloffset=(olIe4)?eval('o3_frame.'+docRoot+'.scrollTop'):o3_frame.pageYOffset;placeY=runHook('verticalPlacement',FCHAIN,iheight,scrolloffset); +repositionTo(over,placeX,placeY);} +function olMouseMove(e){var e=(e)?e:event; +if(e.pageX){o3_x=e.pageX;o3_y=e.pageY;}else if(e.clientX){o3_x=eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft');o3_y=eval('e.clientY+o3_frame.'+docRoot+'.scrollTop');} +if(o3_allowmove==1)runHook("placeLayer",FREPLACE); +if(hoveringSwitch&&!olNs4&&runHook("cursorOff",FREPLACE)){(olHideDelay?hideDelay(olHideDelay):cClick());hoveringSwitch=!hoveringSwitch;}} +function no_overlib(){return ver3fix;} +function olMouseCapture(){capExtent=document;var fN,str='',l,k,f,wMv,sS,mseHandler=olMouseMove;var re=/function[ ]*(\w*)\(/; +wMv=(!olIe4&&window.onmousemove);if(document.onmousemove||wMv){if(wMv)capExtent=window;f=capExtent.onmousemove.toString();fN=f.match(re);if(fN==null){str=f+'(e);';}else if(fN[1]=='anonymous'||fN[1]=='olMouseMove'||(wMv&&fN[1]=='onmousemove')){if(!olOp&&wMv){l=f.indexOf('{')+1;k=f.lastIndexOf('}');sS=f.substring(l,k);if((l=sS.indexOf('('))!=-1){sS=sS.substring(0,l).replace(/^\s+/,'').replace(/\s+$/,'');if(eval("typeof "+sS+"=='undefined'"))window.onmousemove=null;else str=sS+'(e);';}} +if(!str){olCheckMouseCapture=false;return;} +}else{if(fN[1])str=fN[1]+'(e);';else{l=f.indexOf('{')+1;k=f.lastIndexOf('}');str=f.substring(l,k)+'\n';}} +str+='olMouseMove(e);';mseHandler=new Function('e',str);} +capExtent.onmousemove=mseHandler;if(olNs4)capExtent.captureEvents(Event.MOUSEMOVE);} +function parseTokens(pf,ar){ +var v,i,mode=-1,par=(pf!='ol_'),fnMark=(par&&!ar.length?1:0); +for(i=0;ipmStart&&ar[i]=pmCount||ar[i]==DONOTHING){continue;} +if(ar[i]==INARRAY){fnMark=0;eval(pf+'text=ol_texts['+ar[++i]+'].toString()');continue;} +if(ar[i]==CAPARRAY){eval(pf+'cap=ol_caps['+ar[++i]+'].toString()');continue;} +if(ar[i]==STICKY){if(pf!='ol_')eval(pf+'sticky=1');continue;} +if(ar[i]==BACKGROUND){eval(pf+'background="'+ar[++i]+'"');continue;} +if(ar[i]==NOCLOSE){if(pf!='ol_')opt_NOCLOSE();continue;} +if(ar[i]==CAPTION){eval(pf+"cap='"+escSglQuote(ar[++i])+"'");continue;} +if(ar[i]==CENTER||ar[i]==LEFT||ar[i]==RIGHT){eval(pf+'hpos='+ar[i]);if(pf!='ol_')olHautoFlag=1;continue;} +if(ar[i]==OFFSETX){eval(pf+'offsetx='+ar[++i]);continue;} +if(ar[i]==OFFSETY){eval(pf+'offsety='+ar[++i]);continue;} +if(ar[i]==FGCOLOR){eval(pf+'fgcolor="'+ar[++i]+'"');continue;} +if(ar[i]==BGCOLOR){eval(pf+'bgcolor="'+ar[++i]+'"');continue;} +if(ar[i]==TEXTCOLOR){eval(pf+'textcolor="'+ar[++i]+'"');continue;} +if(ar[i]==CAPCOLOR){eval(pf+'capcolor="'+ar[++i]+'"');continue;} +if(ar[i]==CLOSECOLOR){eval(pf+'closecolor="'+ar[++i]+'"');continue;} +if(ar[i]==WIDTH){eval(pf+'width='+ar[++i]);continue;} +if(ar[i]==BORDER){eval(pf+'border='+ar[++i]);continue;} +if(ar[i]==CELLPAD){i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad'));continue;} +if(ar[i]==STATUS){eval(pf+"status='"+escSglQuote(ar[++i])+"'");continue;} +if(ar[i]==AUTOSTATUS){eval(pf+'autostatus=('+pf+'autostatus==1)?0:1');continue;} +if(ar[i]==AUTOSTATUSCAP){eval(pf+'autostatus=('+pf+'autostatus==2)?0:2');continue;} +if(ar[i]==HEIGHT){eval(pf+'height='+pf+'aboveheight='+ar[++i]);continue;} +if(ar[i]==CLOSETEXT){eval(pf+"close='"+escSglQuote(ar[++i])+"'");continue;} +if(ar[i]==SNAPX){eval(pf+'snapx='+ar[++i]);continue;} +if(ar[i]==SNAPY){eval(pf+'snapy='+ar[++i]);continue;} +if(ar[i]==FIXX){eval(pf+'fixx='+ar[++i]);continue;} +if(ar[i]==FIXY){eval(pf+'fixy='+ar[++i]);continue;} +if(ar[i]==RELX){eval(pf+'relx='+ar[++i]);continue;} +if(ar[i]==RELY){eval(pf+'rely='+ar[++i]);continue;} +if(ar[i]==FGBACKGROUND){eval(pf+'fgbackground="'+ar[++i]+'"');continue;} +if(ar[i]==BGBACKGROUND){eval(pf+'bgbackground="'+ar[++i]+'"');continue;} +if(ar[i]==PADX){eval(pf+'padxl='+ar[++i]);eval(pf+'padxr='+ar[++i]);continue;} +if(ar[i]==PADY){eval(pf+'padyt='+ar[++i]);eval(pf+'padyb='+ar[++i]);continue;} +if(ar[i]==FULLHTML){if(pf!='ol_')eval(pf+'fullhtml=1');continue;} +if(ar[i]==BELOW||ar[i]==ABOVE){eval(pf+'vpos='+ar[i]);if(pf!='ol_')olVautoFlag=1;continue;} +if(ar[i]==CAPICON){eval(pf+'capicon="'+ar[++i]+'"');continue;} +if(ar[i]==TEXTFONT){eval(pf+"textfont='"+escSglQuote(ar[++i])+"'");continue;} +if(ar[i]==CAPTIONFONT){eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'");continue;} +if(ar[i]==CLOSEFONT){eval(pf+"closefont='"+escSglQuote(ar[++i])+"'");continue;} +if(ar[i]==TEXTSIZE){eval(pf+'textsize="'+ar[++i]+'"');continue;} +if(ar[i]==CAPTIONSIZE){eval(pf+'captionsize="'+ar[++i]+'"');continue;} +if(ar[i]==CLOSESIZE){eval(pf+'closesize="'+ar[++i]+'"');continue;} +if(ar[i]==TIMEOUT){eval(pf+'timeout='+ar[++i]);continue;} +if(ar[i]==FUNCTION){if(pf=='ol_'){if(typeof ar[i+1]!='number'){v=ar[++i];ol_function=(typeof v=='function'?v:null);}}else{fnMark=0;v=null;if(typeof ar[i+1]!='number')v=ar[++i]; opt_FUNCTION(v);} continue;} +if(ar[i]==DELAY){eval(pf+'delay='+ar[++i]);continue;} +if(ar[i]==HAUTO){eval(pf+'hauto=('+pf+'hauto==0)?1:0');continue;} +if(ar[i]==VAUTO){eval(pf+'vauto=('+pf+'vauto==0)?1:0');continue;} +if(ar[i]==CLOSECLICK){eval(pf+'closeclick=('+pf+'closeclick==0)?1:0');continue;} +if(ar[i]==WRAP){eval(pf+'wrap=('+pf+'wrap==0)?1:0');continue;} +if(ar[i]==FOLLOWMOUSE){eval(pf+'followmouse=('+pf+'followmouse==1)?0:1');continue;} +if(ar[i]==MOUSEOFF){eval(pf+'mouseoff=('+pf+'mouseoff==0)?1:0');v=ar[i+1];if(pf!='ol_'&&eval(pf+'mouseoff')&&typeof v=='number'&&(vpmUpper))olHideDelay=ar[++i];continue;} +if(ar[i]==CLOSETITLE){eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'");continue;} +if(ar[i]==CSSOFF||ar[i]==CSSCLASS){eval(pf+'css='+ar[i]);continue;} +if(ar[i]==COMPATMODE){eval(pf+'compatmode=('+pf+'compatmode==0)?1:0');continue;} +if(ar[i]==FGCLASS){eval(pf+'fgclass="'+ar[++i]+'"');continue;} +if(ar[i]==BGCLASS){eval(pf+'bgclass="'+ar[++i]+'"');continue;} +if(ar[i]==TEXTFONTCLASS){eval(pf+'textfontclass="'+ar[++i]+'"');continue;} +if(ar[i]==CAPTIONFONTCLASS){eval(pf+'captionfontclass="'+ar[++i]+'"');continue;} +if(ar[i]==CLOSEFONTCLASS){eval(pf+'closefontclass="'+ar[++i]+'"');continue;} +i=parseCmdLine(pf,i,ar);}} +if(fnMark&&o3_function)o3_text=o3_function(); +if((pf=='o3_')&&o3_wrap){o3_width=0; +var tReg=/<.*\n*>/ig;if(!tReg.test(o3_text))o3_text=o3_text.replace(/[ ]+/g,' ');if(!tReg.test(o3_cap))o3_cap=o3_cap.replace(/[ ]+/g,' ');} +if((pf=='o3_')&&o3_sticky){if(!o3_close&&(o3_frame!=ol_frame))o3_close=ol_close;if(o3_mouseoff&&(o3_frame==ol_frame))opt_NOCLOSE(' ');}} +function layerWrite(txt){txt+="\n";if(olNs4){var lyr=o3_frame.document.layers['overDiv'].document +lyr.write(txt) +lyr.close() +}else if(typeof over.innerHTML!='undefined'){if(olIe5&&isMac)over.innerHTML='';over.innerHTML=txt;}else{range=o3_frame.document.createRange();range.setStartAfter(over);domfrag=range.createContextualFragment(txt); +while(over.hasChildNodes()){over.removeChild(over.lastChild);} +over.appendChild(domfrag);}} +function showObject(obj){runHook("showObject",FBEFORE); +var theObj=(olNs4?obj:obj.style);theObj.visibility='visible'; +runHook("showObject",FAFTER);} +function hideObject(obj){runHook("hideObject",FBEFORE); +var theObj=(olNs4?obj:obj.style);if(olNs6&&olShowId>0){clearTimeout(olShowId);olShowId=0;} +theObj.visibility='hidden';theObj.top=theObj.left=((olIe4&&!olOp)?0:-10000)+(!olNs4?'px':0); +if(o3_timerid>0)clearTimeout(o3_timerid);if(o3_delayid>0)clearTimeout(o3_delayid); +o3_timerid=0;o3_delayid=0;self.status=""; +if(obj.onmouseout||obj.onmouseover){if(olNs4)obj.releaseEvents(Event.MOUSEOUT||Event.MOUSEOVER);obj.onmouseout=obj.onmouseover=null;} +runHook("hideObject",FAFTER);} +function repositionTo(obj,xL,yL){var theObj=(olNs4?obj:obj.style);theObj.left=xL+(!olNs4?'px':0);theObj.top=yL+(!olNs4?'px':0);} +function cursorOff(){var left=parseInt(over.style.left);var top=parseInt(over.style.top);var right=left+(over.offsetWidth>=parseInt(o3_width)?over.offsetWidth:parseInt(o3_width));var bottom=top+(over.offsetHeight>=o3_aboveheight?over.offsetHeight:o3_aboveheight); +if(o3_xright||o3_ybottom)return true; +return false;} +function opt_FUNCTION(callme){o3_text=(callme?(typeof callme=='string'?(/.+\(.*\)/.test(callme)?eval(callme):callme):callme()):(o3_function?o3_function():'No Function')); +return 0;} +function opt_NOCLOSE(unused){if(!unused)o3_close=""; +if(olNs4){over.captureEvents(Event.MOUSEOUT||Event.MOUSEOVER);over.onmouseover=function(){if(o3_timerid>0){clearTimeout(o3_timerid);o3_timerid=0;} } +over.onmouseout=function(e){if(olHideDelay)hideDelay(olHideDelay);else cClick(e);} +}else{over.onmouseover=function(){hoveringSwitch=true;if(o3_timerid>0){clearTimeout(o3_timerid);o3_timerid=0;} }} +return 0;} +function opt_MULTIPLEARGS(i,args,parameter){var k=i,re,pV,str=''; +for(k=i;kpmStart)break;str+=args[k]+',';} +if(str)str=str.substring(0,--str.length); +k--;pV=(olNs4&&/cellpad/i.test(parameter))?str.split(',')[0]:str;eval(parameter+'="'+pV+'"'); +return k;} +function nbspCleanup(){if(o3_wrap){o3_text=o3_text.replace(/\ /g,' ');o3_cap=o3_cap.replace(/\ /g,' ');}} +function escSglQuote(str){return str.toString().replace(/'/g,"\\'");} +function OLonLoad_handler(e){var re=/\w+\(.*\)[;\s]+/g,olre=/overlib\(|nd\(|cClick\(/,fn,l,i; +if(!olLoaded)olLoaded=1; +if(window.removeEventListener&&e.eventPhase==3)window.removeEventListener("load",OLonLoad_handler,false);else if(window.detachEvent){window.detachEvent("onload",OLonLoad_handler);var fN=document.body.getAttribute('onload');if(fN){fN=fN.toString().match(re);if(fN&&fN.length){for(i=0;i':''):'';else{fontStr='o3_'+whichString+'font';fontColor='o3_'+((whichString=='caption')? 'cap':whichString)+'color';return(hasDims&&!olNs4)?(isClose?'':'
'):'';}} +function quoteMultiNameFonts(theFont){var v,pM=theFont.split(',');for(var i=0;i0)clearTimeout(o3_timerid); +o3_timerid=setTimeout("cClick()",(o3_timeout=time));}} +function horizontalPlacement(browserWidth,horizontalScrollAmount,widthFix){var placeX,iwidth=browserWidth,winoffset=horizontalScrollAmount;var parsedWidth=parseInt(o3_width); +if(o3_fixx>-1||o3_relx!=null){ +placeX=(o3_relx!=null?( o3_relx<0?winoffset+o3_relx+iwidth-parsedWidth-widthFix:winoffset+o3_relx):o3_fixx);}else{ +if(o3_hauto==1){if((o3_x-winoffset)>(iwidth/2)){o3_hpos=LEFT;}else{o3_hpos=RIGHT;}} +if(o3_hpos==CENTER){placeX=o3_x+o3_offsetx-(parsedWidth/2); +if(placeX(winoffset+iwidth-widthFix)){placeX=iwidth+winoffset-parsedWidth-widthFix;if(placeX<0)placeX=0;}} +if(o3_hpos==LEFT){placeX=o3_x-o3_offsetx-parsedWidth;if(placeX1){var snapping=placeX % o3_snapx; +if(o3_hpos==LEFT){placeX=placeX-(o3_snapx+snapping);}else{ +placeX=placeX+(o3_snapx-snapping);} +if(placeX-1||o3_rely!=null){ +placeY=(o3_rely!=null?(o3_rely<0?scrolloffset+o3_rely+iheight-parsedHeight:scrolloffset+o3_rely):o3_fixy);}else{ +if(o3_vauto==1){if((o3_y-scrolloffset)>(iheight/2)&&o3_vpos==BELOW&&(o3_y+parsedHeight+o3_offsety-(scrolloffset+iheight)>0)){o3_vpos=ABOVE;}else if(o3_vpos==ABOVE&&(o3_y-(parsedHeight+o3_offsety)-scrolloffset<0)){o3_vpos=BELOW;}} +if(o3_vpos==ABOVE){if(o3_aboveheight==0)o3_aboveheight=parsedHeight; +placeY=o3_y-(o3_aboveheight+o3_offsety);if(placeY1){var snapping=placeY % o3_snapy; +if(o3_aboveheight>0&&o3_vpos==ABOVE){placeY=placeY-(o3_snapy+snapping);}else{placeY=placeY+(o3_snapy-snapping);} +if(placeY
');divContainer=layerReference(id);}else{divContainer=frm.document.createElement("DIV");divContainer.id=id;body.appendChild(divContainer);} +objRef=divContainer.style;} +objRef.position='absolute';objRef.visibility='hidden';objRef.zIndex=zValue;if(olIe4&&!olOp)objRef.left=objRef.top='0px';else objRef.left=objRef.top=-10000+(!olNs4?'px':0);} +return divContainer;} +function layerReference(id){return(olNs4?o3_frame.document.layers[id]:(document.all?o3_frame.document.all[id]:o3_frame.document.getElementById(id)));} +function isFunction(fnRef){var rtn=true; +if(typeof fnRef=='object'){for(var i=0;ijS){for(var k=jS;k-1){i=j;break;}}} +return i;} +function postParseChecks(pf,args){if(typeof postParse!='undefined'&&postParse.length){for(var k=0;k-1)hookPt.alt[pms[CSSOFF-1-pmStart]]=fnRef; +}else if(hookType==FBEFORE||hookType==FAFTER){var hookPt=(hookType==1?hookPt.before:hookPt.after); +if(typeof fnRef=='object'){hookPt=hookPt.concat(fnRef);}else{hookPt[hookPt.length++]=fnRef;} +if(optPm)hookPt=reOrder(hookPt,fnRef,optPm); +}else if(hookType==FALTERNATE){if(last=='number')hookPt.alt[pms[optPm-1-pmStart]]=fnRef;}else if(hookType==FCHAIN){hookPt=hookPt.chain;if(typeof fnRef=='object')hookPt=hookPt.concat(fnRef);else hookPt[hookPt.length++]=fnRef;} +return;}} +function registerRunTimeFunction(fn){if(isFunction(fn)){if(typeof fn=='object'){runTime=runTime.concat(fn);}else{runTime[runTime.length++]=fn;}}} +function registerCmdLineFunction(fn){if(isFunction(fn)){if(typeof fn=='object'){cmdLine=cmdLine.concat(fn);}else{cmdLine[cmdLine.length++]=fn;}}} +function registerPostParseFunction(fn){if(isFunction(fn)){if(typeof fn=='object'){postParse=postParse.concat(fn);}else{postParse[postParse.length++]=fn;}}} +function runHook(fnHookTo,hookType){var l=hookPts[fnHookTo],k,rtnVal=null,optPm,arS,ar=runHook.arguments; +if(hookType==FREPLACE){arS=argToString(ar,2); +if(typeof l=='undefined'||!(l=l.ovload))rtnVal=eval(fnHookTo+'('+arS+')');else rtnVal=eval('l('+arS+')'); +}else if(hookType==FBEFORE||hookType==FAFTER){if(typeof l!='undefined'){l=(hookType==1?l.before:l.after); +if(l.length){arS=argToString(ar,2);for(var k=0;k0;k--)if((rtnVal=eval('l[k-1]('+arS+')'))!=void(0))break;} +return rtnVal;} +function FunctionReference(){this.ovload=null;this.before=new Array();this.after=new Array();this.alt=new Array();this.chain=new Array();} +function Info(version,prerelease){this.version=version;this.prerelease=prerelease; +this.simpleversion=Math.round(this.version*100);this.major=parseInt(this.simpleversion/100);this.minor=parseInt(this.simpleversion/10)-this.major * 10;this.revision=parseInt(this.simpleversion)-this.major * 100-this.minor * 10;this.meets=meets;} +function meets(reqdVersion){return(!reqdVersion)?false:this.simpleversion>=Math.round(100*parseFloat(reqdVersion));} +registerHook("ol_content_simple",ol_content_simple,FALTERNATE,CSSOFF);registerHook("ol_content_caption",ol_content_caption,FALTERNATE,CSSOFF);registerHook("ol_content_background",ol_content_background,FALTERNATE,CSSOFF);registerHook("ol_content_simple",ol_content_simple,FALTERNATE,CSSCLASS);registerHook("ol_content_caption",ol_content_caption,FALTERNATE,CSSCLASS);registerHook("ol_content_background",ol_content_background,FALTERNATE,CSSCLASS);registerPostParseFunction(checkPositionFlags);registerHook("hideObject",nbspCleanup,FAFTER);registerHook("horizontalPlacement",horizontalPlacement,FCHAIN);registerHook("verticalPlacement",verticalPlacement,FCHAIN);if(olNs4||(olIe5&&isMac)||olKq)olLoaded=1;registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode'); +var olCheckMouseCapture=true;if((olNs4||olNs6||olIe4)){olMouseCapture();}else{overlib=no_overlib;nd=no_overlib;ver3fix=true;} diff --git a/html/includes/sidebar.php b/html/includes/sidebar.php new file mode 100755 index 0000000..e62e292 --- /dev/null +++ b/html/includes/sidebar.php @@ -0,0 +1,27 @@ + + UT Logo +
+

Home

+

Recent Matches

+

Rankings

+

Servers

+

Players

+

Maps

+

Totals

+

Watchlist

+

Import

+

Admin

+

Credits

+

Help

+

UTStats Forums

+
+ UT Character +
+ + +Spacing + +'; +?> \ No newline at end of file diff --git a/html/includes/teamstats.php b/html/includes/teamstats.php new file mode 100755 index 0000000..66e53ab --- /dev/null +++ b/html/includes/teamstats.php @@ -0,0 +1,177 @@ + + + '.htmlentities($title).' + '; + + + $sql_players = "SELECT pi.name, pi.banned, p.pid, p.team, p.country, p.gametime, p.gamescore, p.frags, p.deaths, p.suicides, p.teamkills, p.eff, p.accuracy, p.ttl, p.rank".(($extra) ? ', p.'.$extra.' AS '.$extra : '')." + FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid + ORDER BY".(($teams) ? ' team ASC,' : '')." $order"; + $q_players = mysql_query($sql_players) or die(mysql_error()); + $header = true; + teamstats_init_totals($totals, $num); + while ($r_players = zero_out(mysql_fetch_array($q_players))) { + $r_players['dom_cp'] = $r_players['gamescore'] - $r_players['frags']; + + $r_players['team'] = intval($r_players['team']); + if ($teams and $oldteam != $r_players['team']) { + if ($r_players['team'] != 0) teamstats_team_totals($totals, $num, $teams, $extra, $teamscore[$oldteam]); + $oldteam = $r_players['team']; + teamstats_init_totals($totals, $num, $extra); + + switch(intval($r_players['team'])) { + case 0: $teamname = 'Red'; break; + case 1: $teamname = 'Blue'; break; + case 2: $teamname = 'Green'; break; + case 3: $teamname = 'Gold'; break; + } + echo'Team: '.$teamname.''; + $header = true; + } + if ($header) { + $header = false; + echo ' + + Player + Time + Score'; + if ($extra) echo' '.htmlentities($extratitle).''; + echo' + F + K + D + S'; + if ($teams) echo 'TK'; + echo ' + Eff. + Acc. + Avg TTL + '; + } + + $eff = get_dp($r_players['eff']); + $acc = get_dp($r_players['accuracy']); + $ttl = GetMinutes($r_players['ttl']); + $kills = $r_players['frags'] + $r_players['suicides']; + $pname = $r_players['name']; + + $totals['gamescore'] += $r_players['gamescore']; + if ($extra) $totals[$extra] += $r_players[$extra]; + $totals['frags'] += $r_players['frags']; + $totals['kills'] += $kills; + $totals['deaths'] += $r_players['deaths']; + $totals['suicides'] += $r_players['suicides']; + $totals['teamkills'] += $r_players['teamkills']; + $totals['eff'] += $r_players['eff']; + $totals['acc'] += $r_players['accuracy']; + $totals['ttl'] += $r_players['ttl']; + $num++; + + if ($r_players['banned'] == 'Y') { + $eff = '-'; + $acc = '-'; + $ttl = '-'; + $kills = '-'; + $r_players['gamescore'] = '-'; + $r_players[$extra] = '-'; + $r_players['frags'] = '-'; + $r_players['deaths'] = '-'; + $r_players['suicides'] = '-'; + $r_players['teamkills'] = '-'; + } + + + $class = ($num % 2) ? 'grey' : 'grey2'; + echo ''; + if ($r_players['banned'] != 'Y') { + echo ''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''; + } else { + echo ''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''; + } + echo ''.GetMinutes($r_players[gametime]).''; + echo ''.$r_players[gamescore].''; + + if ($extra) echo ''.$r_players[$extra].''; + + echo ''.$r_players[frags].''; + echo ''.$kills.''; + echo ''.$r_players[deaths].''; + echo ''.$r_players[suicides].''; + + if ($teams) echo ''.$r_players[teamkills].''; + + echo ''.$eff.''; + echo ''.$acc.''; + echo ''.$ttl.''; + echo ''; + } + teamstats_team_totals($totals, $num, $teams, $extra, $teamscore[$oldteam]); + echo '
'; + +} + +function teamstats_init_totals(&$totals, &$num, $extra = null) { + $totals['gamescore'] = 0; + if ($extra) $totals[$extra] = 0; + $totals['frags'] = 0; + $totals['kills'] = 0; + $totals['deaths'] = 0; + $totals['suicides'] = 0; + $totals['teamkills'] = 0; + $totals['eff'] = 0; + $totals['acc'] = 0; + $totals['ttl'] = 0; + $num = 0; +} + +function teamstats_team_totals(&$totals, $num, $teams, $extra, $teamscore) { + if ($num == 0) $num = 1; + $eff = get_dp($totals['eff'] / $num); + $acc = get_dp($totals['acc'] / $num); + $ttl = GetMinutes($totals['ttl'] / $num); + + + echo ''; + echo 'Totals'; + echo ''; + if ($teams) { + echo ''.$teamscore.' ('.$totals[gamescore].')'; + } else { + echo ''.$totals[gamescore].''; + } + if ($extra) echo ''.$totals[$extra].''; + + echo ''.$totals[frags].''; + echo ''.$totals[kills].''; + echo ''.$totals[deaths].''; + echo ''.$totals[suicides].''; + + if ($teams) echo ''.$totals[teamkills].''; + + echo ''.$eff.''; + echo ''.$acc.''; + echo ''.$ttl.''; + echo ''; +} +?> diff --git a/html/includes/weaponstats.php b/html/includes/weaponstats.php new file mode 100755 index 0000000..872fa5a --- /dev/null +++ b/html/includes/weaponstats.php @@ -0,0 +1,216 @@ + 'Y'"; + + + if ($_pid == 0 and $_mid != 0) { + $sql_weapons = "SELECT w.matchid, + w.pid AS playerid, + w.weapon, + SUM(w.kills) AS kills, + SUM(w.shots) AS shots, + SUM(w.hits) AS hits, + SUM(w.damage) AS damage, + AVG(w.acc) AS acc, + pi.name AS playername, + pi.country AS country, + pi.banned AS banned, + wn.id AS weaponid, + wn.name AS weaponname, + wn.image AS weaponimg, + wn.sequence AS sequence, + wn.hide AS hideweapon +FROM uts_weapons AS wn, +uts_weaponstats AS w + LEFT JOIN uts_pinfo AS pi + ON w.pid = pi.id + WHERE w.matchid = '$_mid' + AND (wn.id = w.weapon) + AND wn.hide <> 'Y' + GROUP BY w.pid, + w.weapon"; + } + + $q_weapons = mysql_query($sql_weapons) or die(mysql_error()); + while ($r_weapons = zero_out(mysql_fetch_array($q_weapons))) { + $weaponid = intval($r_weapons['weaponid']); + $playerid = intval($r_weapons['playerid']); + // Don't include banned players + if ($r_weapons['banned'] != 'Y') $psort[$playerid] = strtolower($r_weapons['playername']); + + if ($r_weapons['damage'] > 1000000) $r_weapons['damage'] = round($r_weapons['damage'] / 1000, 0) .'K'; +// if ($r_weapons['damage'] > 1000) $r_weapons['damage'] = round($r_weapons['damage'] / 1000, 0) .'K'; + + $wd[$playerid]['playername'] = $r_weapons['playername']; + $wd[$playerid]['country'] = $r_weapons['country']; + $wd[$playerid]['banned'] = $r_weapons['banned']; + $wd[$playerid][$weaponid]['kills'] = $r_weapons['kills']; + $wd[$playerid][$weaponid]['shots'] = $r_weapons['shots']; + $wd[$playerid][$weaponid]['hits'] = $r_weapons['hits']; + $wd[$playerid][$weaponid]['damage'] = $r_weapons['damage']; + $wd[$playerid][$weaponid]['acc'] = ((!empty($r_weapons['acc'])) ? get_dp($r_weapons['acc']) : ''); + + if (!isset($wsort[$weaponid]) and $r_weapons['hideweapon'] != 'Y') { + $wsort[$weaponid] = intval($r_weapons['sequence']); + $weapons[$weaponid]['name'] = $r_weapons['weaponname']; + $weapons[$weaponid]['image'] = $r_weapons['weaponimg']; + $weapons[$weaponid]['sequence'] = $r_weapons['sequence']; + } + } + if (!isset($psort)) return; + + asort($psort); + asort($wsort); + + $playercol = 1; + if (count($wsort) < 3) { + $one = true; + $colspan = 5; + if (count($psort) == 1) { + $playercol = 0; + } + } else { + $one = false; + $colspan = 1; + } + + echo' + + + + + '; + + + if ($one) { + ws_header($wsort, $weapons, $colspan, $one, $playercol); + echo ''; + foreach($wsort as $wid => $bar) { + for ($i = 1; $i <= $colspan; $i++) { + switch($i) { + case 1: $extra = 'Kills'; break; + case 2: $extra = 'Shots'; break; + case 3: $extra = 'Hits'; break; + case 4: $extra = 'Acc'; break; + case 5: $extra = 'Dmg'; break; + } + $extra = ''. $extra .''; + echo ' + '; + } + } + echo ''; + + $i = 0; + foreach($psort as $pid => $foo) { + $i++; + echo ''; + if ($playercol) { + echo ' + '; + } + foreach($wsort as $wid => $bar) { + ws_cell($wd, $pid, $wid, 'kills', $i); + ws_cell($wd, $pid, $wid, 'shots', $i); + ws_cell($wd, $pid, $wid, 'hits', $i); + ws_cell($wd, $pid, $wid, 'acc', $i); + ws_cell($wd, $pid, $wid, 'damage', $i); + } + echo ''; + } + } + + if (!$one) { + ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Kills', 'kills'); + ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Shots', 'shots'); + ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Hits', 'hits'); + ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Damage', 'damage'); + ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Accuracy', 'acc'); + } + + + echo '
'.htmlentities($title).'
'.$extra.'
'.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).'
'; +} + +function ws_header(&$wsort, &$weapons, $colspan, $one, $playercol) { + echo ''; + if ($playercol and $playercol != -1) echo 'Player'; + if ($playercol == -1) echo ' '; + foreach($wsort as $wid => $bar) { + if (!empty($weapons[$wid]['image'])) { + $content = ''.$weapons[$wid]['name'].''; + } else { + $content = ''.$weapons[$wid]['name'].''; + } + echo ''.$content.''; + + } + echo ''; +} + + +function ws_cell(&$wd, $pid, $wid, $field, $i) { + $content = ''; + if (isset($wd[$pid][$wid][$field])) $content = $wd[$pid][$wid][$field]; + $class = ($i % 2) ? 'grey' : 'grey2'; + echo ' + '.$content.''; +} + + + + +function ws_block(&$wd, &$weapons, &$wsort, &$psort, &$colspan, $playercol, $one,$_mid, $gamename, $caption, $field) { + global $gamename, $gid; + if (count($psort) != 1) { + echo ' + + + + + '.$caption.' + '; + ws_header($wsort, $weapons, $colspan, $one, $playercol); + } + if (count($psort) == 1) { + $playercol = -1; + if ($field == 'kills') ws_header($wsort, $weapons, $colspan, $one, $playercol); + } + + $i = 0; + foreach($psort as $pid => $foo) { + $i++; + echo ''; + if ($playercol and $playercol != -1) echo ''.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).''; + if ($playercol == -1) echo ''.$caption.''; + foreach($wsort as $wid => $bar) { + ws_cell($wd, $pid, $wid, $field, $i); + } + echo ''; + } +} +?> \ No newline at end of file diff --git a/html/index.php b/html/index.php new file mode 100755 index 0000000..4b12de6 --- /dev/null +++ b/html/index.php @@ -0,0 +1,156 @@ + \ No newline at end of file diff --git a/html/logs/ac/index.htm b/html/logs/ac/index.htm new file mode 100755 index 0000000..c217ab3 --- /dev/null +++ b/html/logs/ac/index.htm @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/html/logs/ace/index.htm b/html/logs/ace/index.htm new file mode 100755 index 0000000..c217ab3 --- /dev/null +++ b/html/logs/ace/index.htm @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/html/logs/backup/.htaccess b/html/logs/backup/.htaccess new file mode 100755 index 0000000..fdda703 --- /dev/null +++ b/html/logs/backup/.htaccess @@ -0,0 +1,2 @@ +Order deny,allow +Deny from all diff --git a/html/logs/backup/index.htm b/html/logs/backup/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/logs/index.htm b/html/logs/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/logs/utdc/.htaccess b/html/logs/utdc/.htaccess new file mode 100755 index 0000000..fdda703 --- /dev/null +++ b/html/logs/utdc/.htaccess @@ -0,0 +1,2 @@ +Order deny,allow +Deny from all diff --git a/html/logs/utdc/index.htm b/html/logs/utdc/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/pages/admin/acelog.php b/html/pages/admin/acelog.php new file mode 100755 index 0000000..365174a --- /dev/null +++ b/html/pages/admin/acelog.php @@ -0,0 +1,318 @@ +'); +} + +// Get filter, order and set sorting +if (isset($_GET[order])) { + $order = my_addslashes($_GET[order]); + setcookie('uts_ace_order', $_GET['order'], time()+60*60*24*30*365); +} +else if (isset($_COOKIE['uts_ace_order'])){ + $order = $_REQUEST['uts_ace_order']; +} +else { + $order = "time"; +} + +if (isset($_GET[sort])) { + $sort = my_addslashes($_GET[sort]); + setcookie('uts_ace_sort', $_GET['sort'], time()+60*60*24*30*365); +} +else if (isset($_COOKIE['uts_ace_sort'])){ + $sort = $_REQUEST['uts_ace_sort']; +} +else { + $sort = ($order == "time") ? "DESC" : "ASC"; +} + +if (isset($_GET[timeout])) { + $timeout = my_addslashes($_GET[timeout]); + setcookie('uts_ace_timeout', $_GET['timeout'], time()+60*60*24*30*365); +} +else if (isset($_COOKIE['uts_ace_timeout'])){ + $timeout = $_REQUEST['uts_ace_timeout']; +} +else { + $timeout = 0; +} + +if (isset($_GET[show])) { + $show = my_addslashes($_GET[show]); + setcookie('uts_ace_show', $_GET['show'], time()+60*60*24*30*365); +} +else if (isset($_COOKIE['uts_ace_show'])){ + $show = $_REQUEST['uts_ace_show']; +} +else { + $show = "week"; +} + +if (!empty($filename)) { + if (!file_exists('logs/ace/'. $filename) or !is_file('logs/ace/'. $filename)) die('File not found'); + if (isset($_REQUEST['del'])) { + unlink('logs/ace/'. $filename); + $filename = ''; + } +} + +if (empty($filename)) { + echo ' + + +
+ + + + + + + + + + + + + '; + $logdir = opendir('logs/ace'); + $logs = array(); + $sortlogs = array(); + $i = 0; + while (false !== ($filename = readdir($logdir))) { + if (!is_file('logs/ace/'. $filename)) continue; + if ($filename == '.htaccess' or $filename == 'index.htm') continue; + + preg_match('/\d{4}\.\d{2}.\d{2}.\d{2}.\d{2}.\d{2}/', $filename, &$date); + $adate = preg_split('/\./', $date[0]); + // filter on days + if ($show != "all") { + // calculate days + $logAgeInDays = abs(strtotime(date("Y/m/d")) - strtotime("$adate[0]/$adate[1]/$adate[2]"))/68400-1; + if (($show == "day" and $logAgeInDays > 1) + or ($show == "week" and $logAgeInDays > 7) + or ($show == "month" and $logAgeInDays > 31)) { + continue; + } + } + + $i++; + $TimeStamp = "unknown"; + $PlayerName = "unknown"; + $KickReason = "unknown"; + if (substr($filename, strlen($filename) - strlen($import_ace_screenshot_extension)) == $import_ace_screenshot_extension + and substr($filename, 0, strlen($import_ace_screenshot_start)) == $import_ace_screenshot_start) { + // Screenshot + $TimeStamp = "$adate[2]-$adate[1]-$adate[0] / $adate[3]:$adate[4]:$adate[5]"; + $PlayerName = "Unknown"; + $KickReason = "Screenshot"; + } + else { + // logfile + + $fp = my_fopen('logs/ace/'.$filename, 'rb', $compression = NULL); + if (!$fp) die("Error opening file"); + + while (($line = my_fgets($fp, 5000, $compression)) !== FALSE) { + $info = preg_split('/\s/', $line, 3); + $info[2] = preg_replace('/[\r\n]+/', '', $info[2]); + if ($info[1] == "TimeStamp....:") { + $TimeStamp = $info[2]; + } + else if ($info[1] == "PlayerName...:") { + $PlayerName = $info[2]; + } + else if ($info[1] == "KickReason...:") { + $KickReason = $info[2]; + } + else if ($info[1] == "RequestedBy..:") { + $KickReason = "Requested Screenshot"; + } + else if ($info[1] == "WARNING:") { + $ainfo = preg_split('/\s/', $info[2]); + if ($ainfo[5] == "UDP") { + $TimeStamp = "$adate[2]-$adate[1]-$adate[0] / $adate[3]:$adate[4]:$adate[5]"; + $PlayerName = $ainfo[1]; + $KickReason = "Proxy/Tunnel"; + } + } + else if ($info[2] == ": Kicked - [REASON] Timeout during check spawn") { + $TimeStamp = "$adate[2]-$adate[1]-$adate[0] / $adate[3]:$adate[4]:$adate[5]"; + $PlayerName = preg_replace('/[\[\]]/', '', $info[1]); + $KickReason = "Timeout during check spawn"; + } + } + my_fclose($fp, $compression); + } + + // don't show timeout logs? + if (($timeout == 0) + and (($KickReason == "Timeout during check spawn") + or ($KickReason == "Timeout during checks") + or ($KickReason == "Timeout during initial check"))) { + continue; + } + + $logs[$i] = array($filename, $TimeStamp, $PlayerName, $KickReason); + $extra = 0; + if (substr($filename, -4) == '.bz2') $extra = 4; + if (substr($filename, -3) == '.gz') $extra = 3; + + if ($order == "time") { + $sortlogs[$i] = $date[0]; + } + else if ($order == "name") { + $sortlogs[$i] = strtolower($PlayerName); + } + else if ($order == "reason") { + $sortlogs[$i] = strtolower($KickReason); + } + } + closedir($logdir); + if (count($logs) == 0) { + echo ''; + } else { + if ($sort == "ASC") { + asort($sortlogs); + } + else { + arsort($sortlogs); + } + $i = 0; + foreach($sortlogs as $id => $date) { + $log = $logs[$id][0]; + if (empty($log)) { + continue; + } + $TimeStamp = $logs[$id][1]; + $PlayerName = $logs[$id][2]; + $KickReason = $logs[$id][3]; + $Screenshot = $logs[$id][4]; + $extra = 0; + if (substr($log, -4) == '.bz2') $extra = 4; + if (substr($log, -3) == '.gz') $extra = 3; + + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + } + } + echo ''; +} + + +if (!empty($filename)) { + if (!file_exists('logs/ace/'. $filename) or !is_file('logs/ace/'. $filename)) die('File not found (2)'); + echo'
Available ACE Logs:
Filter: + + Show timeouts
Time'.SortPic('time', $order, $sort).'Player Name'.SortPic('name', $order, $sort).'Kick Reason'.SortPic('reason', $order, $sort).'
No logs available!
'; + $tmp = substr($log, strlen($log) - (23 + $extra), 19); + $tmp = str_replace('.', '', $tmp); + // $ts = mtimestamp($tmp); + echo ' '.$TimeStamp.''; + echo ''; + echo ''.$PlayerName.''; + echo ''; + echo ''.$KickReason.''; + echo ''; + $d_size = file_size_info(filesize('logs/ace/'. $log)); + echo $d_size['size'] .' '. $d_size['type']; + echo ''; + echo 'Delete'; + echo '
+ + + + '; + if (substr($filename, strlen($filename) - strlen($import_ace_screenshot_extension)) == $import_ace_screenshot_extension + and substr($filename, 0, strlen($import_ace_screenshot_start)) == $import_ace_screenshot_start) { + // screenshot + echo ''; + } + else { + $fp = my_fopen('logs/ace/'.$filename, 'rb', $compression = NULL); + if (!$fp) die("Error opening file"); + + $i = 0; + echo ''; + */ + echo wordwrap(htmlentities($line), 80, '
', 1) ."
"; + $info = preg_split('/\s/', $line, 3); + $info[2] = preg_replace('/[\r\n]/', '', $info[2]); + if ($info[1] == "FileName.....:") { + $Screenshot = basename($info[2]); + } + + } + echo ''; + my_fclose($fp, $compression); + + // look for a matching ace screenshot + if (isset($Screenshot) and file_exists('logs/ace/' . $Screenshot)) { + echo ' + + + '; + + echo ''; + } + } +} + +echo ''; +if (!empty($filename)) echo''; +echo''; +echo '
'.$filename.''; + echo 'Delete'; + echo '
'; + echo ''; + echo '
'; + + while (($line = my_fgets($fp, 5000, $compression)) !== FALSE) { + /* + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo '
'; + echo ''; + echo htmlentities($line); + echo ''; + echo '
'.$Screenshot.''; + echo 'Delete'; + echo '
'; + echo ''; + echo '
Go Back To Logfile Overview
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/aclog.php b/html/pages/admin/aclog.php new file mode 100755 index 0000000..ada35c8 --- /dev/null +++ b/html/pages/admin/aclog.php @@ -0,0 +1,108 @@ + + + + '; + $logdir = opendir('logs/ac'); + $logs = array(); + $sort = array(); + $i = 0; + while (false !== ($filename = readdir($logdir))) { + if (!is_file('logs/ac/'. $filename)) continue; + if ($filename == '.htaccess' or $filename == 'index.htm') continue; + $i++; + $logs[$i] = $filename; + $extra = 0; + if (substr($filename, -4) == '.bz2') $extra = 4; + if (substr($filename, -3) == '.gz') $extra = 3; + + $sort[$i] = substr($filename, strlen($filename) - (23 + $extra), 19); + } + closedir($logdir); + if (count($logs) == 0) { + echo ''; + } else { + arsort($sort); + $i = 0; + foreach($sort as $id => $date) { + $log = $logs[$id]; + $extra = 0; + if (substr($log, -4) == '.bz2') $extra = 4; + if (substr($log, -3) == '.gz') $extra = 3; + + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + } + } +} + + +if (!empty($filename)) { + if (!file_exists('logs/ac/'. $filename) or !is_file('logs/ac/'. $filename)) die('bla'); + echo'
Available AnthChecker Logs:
No logs available!
'; + $tmp = substr($log, strlen($log) - (23 + $extra), 19); + $tmp = str_replace('.', '', $tmp); + $ts = mtimestamp($tmp); + echo ' '.date('Y-m-d H:i', $ts).''; + echo ''; + echo ''.substr($log, 6, strlen($log) - 30 - $extra).''; + echo ''; + $d_size = file_size_info(filesize('logs/ac/'. $log)); + echo $d_size['size'] .' '. $d_size['type']; + echo ''; + echo 'Delete'; + echo '
+ + + + '; + + $fp = my_fopen('logs/ac/'.$filename, 'rb', $compression = NULL); + if (!$fp) die("Error opening file"); + + $i = 0; + echo ''; + */ + echo wordwrap(htmlentities($line), 80, '
', 1) ."
"; + } + echo ''; + my_fclose($fp, $compression); +} + +echo ''; +if (!empty($filename)) echo''; +echo''; +echo '
'.$filename.''; + echo 'Delete'; + echo '
'; + + while (($line = my_fgets($fp, 5000, $compression)) !== FALSE) { + /* + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo '
'; + echo ''; + echo htmlentities($line); + echo ''; + echo '
Go Back To Logfile Overview
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/check.php b/html/pages/admin/check.php new file mode 100755 index 0000000..a03bf91 --- /dev/null +++ b/html/pages/admin/check.php @@ -0,0 +1,408 @@ + + + + +
Server configuration check

'; + +// Check access rights +echo ' + + + + '; + +// directories +foreach (array("logs", "logs/ac", "logs/backup", "logs/utdc", "logs/ace") as $dir) +{ + echo ' + + '; + if (!file_exists($dir)) { + if (mkdir($dir, 0777)) { + echo ' + '; + } + else { + echo ' + '; + } + } + else if (!is_dir($dir)) { + echo ' + '; + } + else if (!is_writable($dir)) { + if (@chmod($dir, 0777)) { + echo ' + '; + } + else { + echo ' + '; + } + } + else { + echo ' + '; + } +} + +// files: +foreach (array("includes/ftptimestamp.php") as $file) +{ + echo ' + + '; + if (!file_exists($file)) { + echo ' + '; + } + else if (!is_file($file)) { + echo ' + '; + } + else if (!is_writable($file)) { + if (@chmod($file, 0777)) { + echo ' + '; + } + else { + echo ' + '; + } + } + else { + echo ' + '; + } +} + +echo ' +
Checking access rights
', $dir, 'Created
Not found!
Not a directory!
SET
Incorrect access rights: ' , substr(sprintf('%o', fileperms($dir)), -4) , '
OK
', $file, 'Not found!
Not a file!
SET
Incorrect access rights: ' , substr(sprintf('%o', fileperms($file)), -4) , '
OK
+
* Might not work correctly on Windows systems *

'; + + +// connect to the database and check structure +echo ' + + + + '; + +// database creation array +// to add a database simply add $create_table['dbname'] = "database creation sql" +$create_table['uts_events'] = " +CREATE TABLE `uts_events` ( + `id` mediumint(10) NOT NULL auto_increment, + `matchid` mediumint(10) NOT NULL default '0', + `playerid` tinyint(3) NOT NULL default '0', + `col0` varchar(20) NOT NULL default '', + `col1` varchar(120) NOT NULL default '', + `col2` varchar(120) NOT NULL default '', + `col3` varchar(120) NOT NULL default '', + `col4` varchar(120) NOT NULL default '', + PRIMARY KEY (`id`) +); +"; + +$create_table['uts_games'] = " +CREATE TABLE `uts_games` ( + `id` tinyint(3) unsigned NOT NULL auto_increment, + `gamename` varchar(100) NOT NULL default '', + `name` varchar(100) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=9 ; +"; + +$create_table['uts_gamestype'] = " +CREATE TABLE `uts_gamestype` ( + `id` smallint(5) unsigned NOT NULL auto_increment, + `serverip` varchar(21) NOT NULL default '', + `gamename` varchar(100) NOT NULL default '', + `mutator` varchar(100) NOT NULL default '', + `gid` tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM; +"; + +$create_table['uts_ignoreips'] = " +CREATE TABLE IF NOT EXISTS `uts_ignoreips` ( + `ip` bigint(15) NOT NULL default '0', + PRIMARY KEY (`ip`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +"; + +$create_table['uts_killsmatrix'] = " +CREATE TABLE `uts_killsmatrix` ( + `matchid` mediumint(8) unsigned NOT NULL default '0', + `killer` tinyint(4) NOT NULL default '0', + `victim` tinyint(4) NOT NULL default '0', + `kills` tinyint(3) unsigned NOT NULL default '0', + KEY `matchid` (`matchid`) +) ENGINE=MyISAM; +"; + +$create_table['uts_match'] = " +CREATE TABLE `uts_match` ( + `id` mediumint(10) NOT NULL auto_increment, + `time` varchar(14) default NULL, + `servername` varchar(100) NOT NULL default '', + `serverip` varchar(21) NOT NULL default '0', + `gamename` varchar(100) NOT NULL default '0', + `gid` tinyint(3) unsigned NOT NULL default '0', + `gametime` float NOT NULL default '0', + `mutators` longtext NOT NULL, + `insta` tinyint(1) NOT NULL default '0', + `tournament` varchar(5) NOT NULL default '', + `teamgame` varchar(5) NOT NULL default '', + `mapname` varchar(100) NOT NULL default '', + `mapfile` varchar(100) NOT NULL default '', + `serverinfo` mediumtext NOT NULL, + `gameinfo` mediumtext NOT NULL, + `firstblood` int(10) unsigned NOT NULL default '0', + `frags` mediumint(5) NOT NULL default '0', + `deaths` mediumint(5) NOT NULL default '0', + `kills` mediumint(5) NOT NULL default '0', + `suicides` mediumint(5) NOT NULL default '0', + `teamkills` mediumint(5) NOT NULL default '0', + `assaultid` varchar(10) NOT NULL default '', + `ass_att` tinyint(1) NOT NULL default '0', + `ass_win` tinyint(4) NOT NULL default '0', + `t0` tinyint(1) NOT NULL default '0', + `t1` tinyint(1) NOT NULL default '0', + `t2` tinyint(1) NOT NULL default '0', + `t3` tinyint(1) NOT NULL default '0', + `t0score` mediumint(5) NOT NULL default '0', + `t1score` mediumint(5) NOT NULL default '0', + `t2score` mediumint(5) NOT NULL default '0', + `t3score` mediumint(5) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `serverip` (`serverip`) +) ENGINE=MyISAM AUTO_INCREMENT=83 ; +"; + +$create_table['uts_pinfo'] = " +CREATE TABLE `uts_pinfo` ( + `id` int(10) unsigned NOT NULL auto_increment, + `name` varchar(50) NOT NULL default '', + `country` char(2) NOT NULL default '', + `banned` enum('Y','N') NOT NULL default 'N', + PRIMARY KEY (`id`), + KEY `name` (`name`(22)) +) ENGINE=MyISAM AUTO_INCREMENT=136 ; +"; + +$create_table['uts_player'] = " +CREATE TABLE `uts_player` ( + `id` mediumint(10) NOT NULL auto_increment, + `matchid` mediumint(10) NOT NULL default '0', + `insta` tinyint(1) NOT NULL default '0', + `playerid` tinyint(3) NOT NULL default '0', + `pid` int(10) unsigned NOT NULL default '0', + `team` tinyint(2) unsigned NOT NULL default '0', + `isabot` tinyint(1) NOT NULL default '0', + `country` char(2) NOT NULL default '', + `ip` int(10) unsigned NOT NULL default '0', + `gid` tinyint(3) unsigned NOT NULL default '0', + `gametime` float NOT NULL default '0', + `gamescore` smallint(5) NOT NULL default '0', + `lowping` smallint(5) unsigned NOT NULL default '0', + `highping` smallint(5) unsigned NOT NULL default '0', + `avgping` smallint(5) unsigned NOT NULL default '0', + `frags` smallint(5) NOT NULL default '0', + `deaths` smallint(5) unsigned NOT NULL default '0', + `kills` smallint(5) unsigned NOT NULL default '0', + `suicides` smallint(5) unsigned NOT NULL default '0', + `teamkills` smallint(5) unsigned NOT NULL default '0', + `eff` float NOT NULL default '0', + `accuracy` float NOT NULL default '0', + `ttl` float NOT NULL default '0', + `flag_taken` smallint(5) unsigned NOT NULL default '0', + `flag_dropped` smallint(5) unsigned NOT NULL default '0', + `flag_return` smallint(5) unsigned NOT NULL default '0', + `flag_capture` tinyint(3) unsigned NOT NULL default '0', + `flag_cover` smallint(5) unsigned NOT NULL default '0', + `flag_seal` smallint(5) unsigned NOT NULL default '0', + `flag_assist` smallint(5) unsigned NOT NULL default '0', + `flag_kill` mediumint(5) unsigned NOT NULL default '0', + `flag_pickedup` smallint(5) unsigned NOT NULL default '0', + `dom_cp` smallint(5) unsigned NOT NULL default '0', + `ass_obj` smallint(5) unsigned NOT NULL default '0', + `spree_double` smallint(5) unsigned NOT NULL default '0', + `spree_triple` smallint(5) unsigned NOT NULL default '0', + `spree_multi` smallint(5) unsigned NOT NULL default '0', + `spree_mega` tinyint(3) unsigned NOT NULL default '0', + `spree_ultra` tinyint(3) unsigned NOT NULL default '0', + `spree_monster` tinyint(3) unsigned NOT NULL default '0', + `spree_kill` smallint(5) unsigned NOT NULL default '0', + `spree_rampage` smallint(5) unsigned NOT NULL default '0', + `spree_dom` tinyint(3) unsigned NOT NULL default '0', + `spree_uns` tinyint(3) unsigned NOT NULL default '0', + `spree_god` smallint(5) unsigned NOT NULL default '0', + `pu_pads` tinyint(3) unsigned NOT NULL default '0', + `pu_armour` tinyint(3) unsigned NOT NULL default '0', + `pu_keg` tinyint(3) unsigned NOT NULL default '0', + `pu_invis` tinyint(3) unsigned NOT NULL default '0', + `pu_belt` tinyint(3) unsigned NOT NULL default '0', + `pu_amp` tinyint(3) unsigned NOT NULL default '0', + `rank` float NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `matchid` (`matchid`,`team`), + KEY `pid` (`pid`), + KEY `gid` (`gid`) +) ENGINE=MyISAM AUTO_INCREMENT=615 ; +"; + +$create_table['uts_rank'] = " +CREATE TABLE `uts_rank` ( + `id` mediumint(10) NOT NULL auto_increment, + `time` float unsigned NOT NULL default '0', + `pid` int(10) unsigned NOT NULL default '0', + `gid` tinyint(3) unsigned NOT NULL default '0', + `rank` float NOT NULL default '0', + `prevrank` float NOT NULL default '0', + `matches` mediumint(5) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `name` (`pid`,`gid`), + KEY `rank` (`rank`), + KEY `gamename` (`gid`,`rank`) +) ENGINE=MyISAM AUTO_INCREMENT=173 ; +"; + +$create_table['uts_weapons'] = " +CREATE TABLE `uts_weapons` ( + `id` tinyint(3) unsigned NOT NULL auto_increment, + `name` varchar(100) NOT NULL default '', + `image` varchar(50) NOT NULL default '', + `sequence` tinyint(3) unsigned NOT NULL default '200', + `hide` enum('N','Y') NOT NULL default 'N', + PRIMARY KEY (`id`), + KEY `name` (`name`(20)) +) ENGINE=MyISAM AUTO_INCREMENT=20 ; +"; + +$create_table['uts_weaponstats'] = " +CREATE TABLE `uts_weaponstats` ( + `matchid` mediumint(8) unsigned NOT NULL default '0', + `pid` int(10) unsigned NOT NULL default '0', + `weapon` tinyint(3) unsigned NOT NULL default '0', + `kills` mediumint(8) unsigned NOT NULL default '0', + `shots` int(10) unsigned NOT NULL default '0', + `hits` int(10) unsigned NOT NULL default '0', + `damage` int(10) unsigned NOT NULL default '0', + `acc` float unsigned NOT NULL default '0', + KEY `full` (`matchid`,`pid`) +) ENGINE=MyISAM; +"; + +foreach ($create_table as $table => $query) { + echo ' + + '; + if (small_count("SHOW TABLES LIKE '$table'") == 1) { + // database exists, check columns + echo ' + '; + } + else { + if (mysql_query($query)) { + echo ' + '; + } + else { + echo ' + '; + } + } +} +echo ' +
Checking mysql tables
', $table, 'OK
Created
Not found!

'; + +// Check the weapons +$create_weapon['Translocator'] = "INSERT INTO `uts_weapons` VALUES (1, 'Translocator', 'trans.jpg', 1, 'N');"; +$create_weapon['Impact Hammer'] = "INSERT INTO `uts_weapons` VALUES (2, 'Impact Hammer', 'impact.jpg', 2, 'N');"; +$create_weapon['Enforcer'] = "INSERT INTO `uts_weapons` VALUES (3, 'Enforcer', 'enforcer.jpg', 3, 'N');"; +$create_weapon['Double Enforcer'] = "INSERT INTO `uts_weapons` VALUES (4, 'Double Enforcer', 'enforcer2.jpg', 4, 'N');"; +$create_weapon['GES Bio Rifle'] = "INSERT INTO `uts_weapons` VALUES (5, 'GES Bio Rifle', 'bio.jpg', 5, 'N');"; +$create_weapon['Ripper'] = "INSERT INTO `uts_weapons` VALUES (6, 'Ripper', 'ripper.jpg', 6, 'N');"; +$create_weapon['Shock Rifle'] = "INSERT INTO `uts_weapons` VALUES (7, 'Shock Rifle', 'shock.jpg', 7, 'N');"; +$create_weapon['Enhanced Shock Rifle'] = "INSERT INTO `uts_weapons` VALUES (8, 'Enhanced Shock Rifle', 'ishock.jpg', 8, 'N');"; +$create_weapon['Pulse Gun'] = "INSERT INTO `uts_weapons` VALUES (9, 'Pulse Gun', 'pulse.jpg', 9, 'N');"; +$create_weapon['Minigun'] = "INSERT INTO `uts_weapons` VALUES (10, 'Minigun', 'minigun.jpg', 10, 'N');"; +$create_weapon['Flak Cannon'] = "INSERT INTO `uts_weapons` VALUES (11, 'Flak Cannon', 'flak.jpg', 11, 'N');"; +$create_weapon['Rocket Launcher'] = "INSERT INTO `uts_weapons` VALUES (12, 'Rocket Launcher', 'rockets.jpg', 12, 'N');"; +$create_weapon['Sniper Rifle'] = "INSERT INTO `uts_weapons` VALUES (13, 'Sniper Rifle', 'sniper.jpg', 13, 'N');"; +$create_weapon['Redeemer'] = "INSERT INTO `uts_weapons` VALUES (14, 'Redeemer', 'deemer.jpg', 14, 'N');"; +$create_weapon['None'] = "INSERT INTO `uts_weapons` VALUES (15, 'None', 'blank.jpg', 15, 'N');"; +$create_weapon['Chainsaw'] = "INSERT INTO `uts_weapons` VALUES (16, 'Chainsaw', 'chainsaw.jpg', 16, 'N');"; + +echo ' + + + + '; +if (small_count("SHOW TABLES LIKE 'uts_weapons'") != 1) { + // database exists, check columns + echo ' + '; +} +else { + foreach ($create_weapon as $weapon => $query) { + echo ' + + '; + if (small_count("SELECT id FROM uts_weapons WHERE name = '$weapon' LIMIT 0,1") == 1) { + // database exists, check columns + echo ' + '; + } + else { + if (mysql_query($query)) { + echo ' + '; + } + else { + echo ' + '; + } + } + } +} +echo ' +
Checking supported weapons
Table uts_weapons does not exist!
', $weapon, 'OK
Added
Not found!

'; + +echo ' + + + + '; + + echo ' + + '; + + $q = mysql_query("UPDATE uts_events SET col3 = ROUND(CEILING((col3-1)*100/1.1) / 100, 2), col1 = 'btcap' WHERE col1 = 'cap'"); + $affected = mysql_affected_rows(); + + if ($affected == -1) { + echo ' + +
Checking data
Fix BT cap timesFailed
'; + } + else { + echo ' + +
Updated ' . $affected . ' rows.

'; + } + +echo ' +
+ '; +echo ''; +echo '
Go Back To Admin Page
'; + +?> \ No newline at end of file diff --git a/html/pages/admin/dmatch.php b/html/pages/admin/dmatch.php new file mode 100755 index 0000000..9fed97d --- /dev/null +++ b/html/pages/admin/dmatch.php @@ -0,0 +1,105 @@ + + + + + + '; +$sql_radjust = "SELECT pid, gid, rank FROM uts_player WHERE matchid = $matchid"; +$q_radjust = mysql_query($sql_radjust) or die(mysql_error()); +$pids = array(); +while ($r_radjust = mysql_fetch_array($q_radjust)) { + + $pid = $r_radjust[pid]; + $pids[] = $pid; + $gid = $r_radjust[gid]; + $rank = $r_radjust[rank]; + + $sql_crank = small_query("SELECT id, rank, matches FROM uts_rank WHERE pid = $pid AND gid = $gid"); + if (!$sql_crank) continue; + + $rid = $sql_crank[id]; + $newrank = $sql_crank[rank]-$rank; + $oldrank = $sql_crank[rank]; + $matchcount = $sql_crank[matches]-1; + + mysql_query("UPDATE uts_rank SET rank = $newrank, prevrank = $oldrank, matches = $matchcount WHERE id = $rid") or die(mysql_error()); + mysql_query("DELETE FROM uts_rank WHERE matches = 0") or die(mysql_error()); +} + echo' + + + '; +mysql_query("DELETE FROM uts_match WHERE id = $matchid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_player WHERE matchid = $matchid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_killsmatrix WHERE matchid = $matchid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid = $matchid") or die(mysql_error()); + echo' + + + '; +foreach($pids as $pid) { + mysql_query("DELETE FROM uts_weaponstats WHERE matchid IN ('$matchid','0') AND pid = '$pid'") or die(mysql_error()); + + $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$pid' GROUP BY weapon") or die(mysql_error()); + while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='$pid', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); + } +} + echo' + + + '; + mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid='0'") or die(mysql_error()); + + $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE matchid = '0' GROUP BY weapon") or die(mysql_error()); + while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='0', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); + } + + echo' + + + '; +mysql_query("DELETE FROM uts_events WHERE matchid = $matchid") or die(mysql_error()); + echo' + + + +
Deleting Match ID '.$matchid.'
Adjusting RankingsDone
Removing Match Record:Done
Removing Player Records:Done
Removing Kill Matrix Entries:Done
Removing Weapon Stats:Done
Amending Player Weapon Stats:Done
Amending Global Weapon Stats:Done
Removing events:Done
Match Deleted - Go Back To Admin Page
'; + + +?> diff --git a/html/pages/admin/dplayer.php b/html/pages/admin/dplayer.php new file mode 100755 index 0000000..0239e5d --- /dev/null +++ b/html/pages/admin/dplayer.php @@ -0,0 +1,76 @@ + + + Deleting Player + + + Removing Kill Matrix Entries:'; + $q_match = mysql_query("SELECT matchid, playerid FROM uts_player WHERE pid = '$pid'") or die(mysql_error()); + while ($r_match = mysql_fetch_array($q_match)) { + mysql_query("DELETE FROM uts_killsmatrix WHERE matchid = '${r_match['matchid']}' AND (killer = '${r_match['playerid']}' OR victim = '${r_match['playerid']}')") or die(mysql_error()); + } + echo'Done + + + + Removing Player Info:'; +$r_pinfo = small_query("SELECT banned FROM uts_pinfo WHERE id = $playerid"); +if ($r_pinfo['banned'] != 'Y') { + mysql_query("DELETE FROM uts_pinfo WHERE id = $playerid") or die(mysql_error()); + echo'Done'; +} else { + echo'No (player banned)'; +} +echo ' + + + Removing Player Match Events:'; +mysql_query("DELETE e.* FROM uts_player as p, uts_events as e WHERE p.pid = $playerid AND p.playerid = e.playerid AND p.matchid = e.matchid") or die(mysql_error()); + echo'Done + + + Removing Player Match Records:'; +mysql_query("DELETE FROM uts_player WHERE pid = $playerid") or die(mysql_error()); + echo'Done + + + Removing Player Rank:'; +mysql_query("DELETE FROM uts_rank WHERE pid = $playerid") or die(mysql_error()); + echo'Done + + + Removing Player Weapon Stats:'; +mysql_query("DELETE FROM uts_weaponstats WHERE pid = $playerid") or die(mysql_error()); + echo'Done + + + Amending Global Weapon Stats:'; + mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid='0'") or die(mysql_error()); + + $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE matchid = '0' GROUP BY weapon") or die(mysql_error()); + while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='0', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); + } + + echo'Done + + + Player Deleted - Go Back To Admin Page +'; +?> diff --git a/html/pages/admin/dpmatch.php b/html/pages/admin/dpmatch.php new file mode 100755 index 0000000..b021054 --- /dev/null +++ b/html/pages/admin/dpmatch.php @@ -0,0 +1,106 @@ + + + +'; + +echo' + '; + +$q_radjust = small_query("SELECT pid, gid, rank FROM uts_player WHERE id = $pid"); +if (!$q_radjust) { + $sql_crank = false; +} else { + $rank_pid = $q_radjust[pid]; + $rank_gid = $q_radjust[gid]; + $rank = $q_radjust[rank]; + + $sql_crank = small_query("SELECT id, rank, matches FROM uts_rank WHERE pid = $rank_pid AND gid = '$rank_gid'"); +} +if (!$sql_crank) { + echo''; +} else { + $rid = $sql_crank[id]; + $newrank = $sql_crank[rank]-$rank; + $oldrank = $sql_crank[rank]; + $matchcount = $sql_crank[matches]-1; + + mysql_query("UPDATE uts_rank SET rank = $newrank, prevrank = $oldrank, matches = $matchcount WHERE id = $rid") or die(mysql_error()); + mysql_query("DELETE FROM uts_rank WHERE matches = 0") or die(mysql_error()); + + echo''; +} +echo' + + '; + $q_match = mysql_query("SELECT matchid, playerid FROM uts_player WHERE pid = '$pid' and matchid = '$matchid'") or die(mysql_error()); + while ($r_match = mysql_fetch_array($q_match)) { + mysql_query("DELETE FROM uts_killsmatrix WHERE matchid = '${r_match['matchid']}' AND (killer = '${r_match['playerid']}' OR victim = '${r_match['playerid']}')") or die(mysql_error()); + } + echo' + + + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid = $matchid AND pid = $pid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE e.* FROM uts_events as e, uts_player as p WHERE p.pid = '$pid' AND e.matchid = $matchid AND p.playerid = e.playerid AND p.matchid = e.matchid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_player WHERE matchid IN ('$matchid','0') AND pid = '$pid'") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid IN ('$matchid','0') AND pid = '$pid'") or die(mysql_error()); + +$q_weaponstats = mysql_query("SELECT SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$pid' GROUP BY weapon") or die(mysql_error()); +while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='$pid', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); +} + echo' + + + '; + mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid='0'") or die(mysql_error()); + + $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE matchid = '0' GROUP BY weapon") or die(mysql_error()); + while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='0', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); + } + + echo' + + + +
Delete Player From Match ID '.$matchid.'
Amending Players Rank:Player not in rankingsDone
Removing Kill Matrix Entries:Done
Removing Player Weapon Stats:Done
Removing Player Events:Done
Removing Player From Match:Done
Amending Player Weapon Stats:Done
Amending Global Weapon Stats:Done
Match Deleted - Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/editgames.php b/html/pages/admin/editgames.php new file mode 100755 index 0000000..3f7a542 --- /dev/null +++ b/html/pages/admin/editgames.php @@ -0,0 +1,74 @@ + $bla) { + if ($id == 0) { + if (empty($_REQUEST['name'][$id])) continue; + mysql_query(" INSERT INTO uts_games + SET name = '". my_addslashes($_REQUEST['name'][$id]) ."', + gamename = '(user defined)';") or die(mysql_error()); + } else { + mysql_query(" UPDATE uts_games + SET name = '". my_addslashes($_REQUEST['name'][$id]) ."' + WHERE id = '$id';") or die(mysql_error()); + } + } +} + +echo'
+ + + + + + + + + + +'; + + +$sql_games = "SELECT id, gamename, name FROM uts_games ORDER BY gamename ASC;"; +$q_games = mysql_query($sql_games) or die(mysql_error()); +$i = 0; +while ($r_games = mysql_fetch_array($q_games)) { + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + echo ''; + echo ''; + echo ''; +} +echo' + + + + + + + + + + + + + + + + +'; + + +echo ''; +echo ''; +echo ''; + +echo' + + + +
Edit games
GameNameDisplayName
'.htmlentities($r_games['gamename']).'
 
Add new
(n/a)
 
Submit
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/editgamestype.php b/html/pages/admin/editgamestype.php new file mode 100755 index 0000000..d9e4ff1 --- /dev/null +++ b/html/pages/admin/editgamestype.php @@ -0,0 +1,228 @@ + ''); +$serverips = array('0' => '*'); +while ($r_server = mysql_fetch_array($q_server)) { + $servernames[$r_server['id']] = $r_server['servername']; + $serverips[$r_server['id']] = $r_server['serverip']; +} + +$sql_games = "SELECT id, gamename, name FROM uts_games ORDER BY gamename ASC"; +$q_games = mysql_query($sql_games) or die(mysql_error()); +$gamedisplaynames = array('0' => ''); +$gamenames = array('0' => '*'); +while ($r_games = mysql_fetch_array($q_games)) { + $gamenames[$r_games['id']] = $r_games['gamename']; + $gamedisplaynames[$r_games['id']] = $r_games['name']; +} + + +if (isset($_REQUEST['submit'])) { + mysql_query(" INSERT INTO uts_gamestype + SET serverip = '". my_addslashes($_REQUEST['serverip']) ."', + gamename = '". my_addslashes($_REQUEST['gamename']) ."', + mutator = '". my_addslashes($_REQUEST['mutator']) ."', + gid = '". my_addslashes($_REQUEST['gid']) ."' + ") or die(mysql_error()); + + if (isset($_REQUEST['update'])) { + echo'
+ + + + + + + + '; + $where = 'WHERE 1'; + if ($_REQUEST['serverip'] != '*') { + $where .= " AND m.serverip = '". my_addslashes($_REQUEST['serverip']) ."'"; + } + if ($_REQUEST['gamename'] != '*') { + $gids = array_keys($gamenames, my_stripslashes($_REQUEST['gamename'])); + $where .= " AND m.gid IN (".implode(',', $gids).")"; + } + if ($_REQUEST['mutator'] != '*') { + $where .= " AND m.mutators LIKE '%".my_addslashes($_REQUEST['mutator'])."%'"; + } + + mysql_query("UPDATE uts_player p, uts_match m SET p.gid = '". my_addslashes($_REQUEST['gid']) ."' $where AND m.id = p.matchid;") or die(mysql_error()); + echo' + + + + + + + '; + mysql_query("UPDATE uts_match m SET m.gid = '". my_addslashes($_REQUEST['gid']) ."' $where;") or die(mysql_error()); + echo' + + + + + + + + '; + + if ($_REQUEST['gamename'] != '*') { + $gids[] = $_REQUEST['gid']; + $where = "WHERE gid IN (".implode(',', $gids).")"; + } else { + $where = 'WHERE 1'; + } + mysql_query("DELETE FROM uts_rank $where;") or die(mysql_error()); + + $sql_nrank = "SELECT SUM(p.gametime) AS time, p.pid, p.gid, SUM(p.rank) AS rank, COUNT(p.matchid) AS matches FROM uts_player p, uts_pinfo pi $where AND pi.id = p.pid AND pi.banned <> 'Y' GROUP BY p.gid, p.pid"; + $q_nrank = mysql_query($sql_nrank) or die(mysql_error()); + $num_ranks = 0; + while ($r_nrank = mysql_fetch_array($q_nrank)) { + mysql_query("INSERT INTO uts_rank SET time = '${r_nrank['time']}', pid = ${r_nrank['pid']}, gid = ${r_nrank['gid']}, rank = '${r_nrank['rank']}', prevrank = '${r_nrank['rank']}', matches = ${r_nrank['matches']}") or die(mysql_error()); + $num_ranks++; + } + echo' + + + + +
Updating...
Updating Player RecordsDone (updated '.mysql_affected_rows().' records)
Updating MatchesDone (updated '.mysql_affected_rows().' matches)
Re-Calcuating RankingsDone (recalculated '.$num_ranks.' rankings)
Update finished..
'; + } +} + +if (isset($_REQUEST['del'])) { + mysql_query(" DELETE FROM uts_gamestype + WHERE id = '". my_addslashes($_REQUEST['del']) ."' + ") or die(mysql_error()); +} + + + +echo'
+ + + + + + + + + + + + +'; + + + + + + +$sql_gamestype = "SELECT id, serverip, gamename, mutator, gid FROM uts_gamestype ORDER BY id ASC;"; +$q_gamestype = mysql_query($sql_gamestype) or die(mysql_error()); +$i = 0; +while ($r_gamestype = mysql_fetch_array($q_gamestype)) { + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; +} + +echo '
Current Mappings
 Server IP Game Name Mutatorlist contains Game
 '.htmlentities($r_gamestype['serverip']).'+ '.htmlentities($r_gamestype['gamename']).'+ '.htmlentities($r_gamestype['mutator']).'= '.htmlentities($gamedisplaynames[$r_gamestype['gid']]).''; + echo ''; + echo 'Delete'; + echo ''; + echo '
'; + + + + + + + + +echo'
+ + + + + + +'; + +$class='grey'; +echo ''; +echo ''; +echo ''; + + +echo ''; +echo ''; + + +echo ''; +echo ''; + + +echo ''; +echo ''; + +echo ''; +echo ''; + + +echo ''; +echo ''; +echo ''; + +echo' + + + +
Add new gamestype
If server ='; +echo ''; +echo '
and gamename ='; + +echo ''; +echo '
and mutatorlist contains'; +echo ' (case insensitive substring)'; +echo '
==> assume gametype:'; + +echo ''; +echo '
Update existing matches:'; +echo ' (this cannot be undone easily!)'; +echo '
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/editweapons.php b/html/pages/admin/editweapons.php new file mode 100755 index 0000000..2baeab9 --- /dev/null +++ b/html/pages/admin/editweapons.php @@ -0,0 +1,58 @@ + $bla) { + mysql_query(" UPDATE uts_weapons + SET image = '". my_addslashes($_REQUEST['image'][$id]) ."', + sequence = '". my_addslashes($_REQUEST['sequence'][$id]) ."', + hide = '". (isset($_REQUEST['hide'][$id]) ? 'Y' : 'N') ."' + WHERE id = '$id';") or die(mysql_error()); + } +} + +echo'
+ + + + + + + + + + + + +'; + + +$sql_weapons = "SELECT id, name, image, sequence, hide FROM uts_weapons ORDER BY sequence ASC;"; +$q_weapons = mysql_query($sql_weapons) or die(mysql_error()); +$i = 0; +while ($r_weapons = mysql_fetch_array($q_weapons)) { + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; +} + +echo ''; +echo ''; +echo ''; + +echo' + + +
Edit weapons
NameShould exist in images/weapons/
Leave empty to display the weapon name').'>Image
OrderHide
'.htmlentities($r_weapons['name']).''; + echo '
'; + echo ''; + echo ''; + if (!empty($r_weapons['image'])) echo ' '; + echo'
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/emptydb.php b/html/pages/admin/emptydb.php new file mode 100755 index 0000000..9eee7d2 --- /dev/null +++ b/html/pages/admin/emptydb.php @@ -0,0 +1,62 @@ + + + + + + '; + mysql_query("TRUNCATE uts_events;") or die(mysql_error()); + mysql_query("TRUNCATE uts_games;") or die(mysql_error()); + mysql_query("TRUNCATE uts_gamestype;") or die(mysql_error()); + mysql_query("TRUNCATE uts_killsmatrix;") or die(mysql_error()); + mysql_query("TRUNCATE uts_match;") or die(mysql_error()); + mysql_query("TRUNCATE uts_pinfo;") or die(mysql_error()); + mysql_query("TRUNCATE uts_player;") or die(mysql_error()); + mysql_query("TRUNCATE uts_rank;") or die(mysql_error()); + mysql_query("DELETE FROM uts_weapons WHERE id > 19") or die(mysql_error()); + mysql_query("ALTER TABLE uts_weapons AUTO_INCREMENT=20") or die(mysql_error()); + mysql_query("TRUNCATE uts_weaponstats;") or die(mysql_error()); + echo' + + + +
Empty Database
Emptying All Tables but uts_ip2country and uts_weaponstatsDone
Database Emptied - Go Back To Admin Page
'; +} else { + echo'
+ + + + + + + + + +
Empty Database
Database Not EmptiedAnswer Was No
Database Not Emptied - Go Back To Admin Page
'; +} + + +?> diff --git a/html/pages/admin/index.htm b/html/pages/admin/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/pages/admin/ipsearch.php b/html/pages/admin/ipsearch.php new file mode 100755 index 0000000..4ac9731 --- /dev/null +++ b/html/pages/admin/ipsearch.php @@ -0,0 +1,58 @@ + + + +'; + + +$sql_players = "SELECT pi.name, pi.id AS pid FROM uts_player p, uts_pinfo pi WHERE p.pid = pi.id AND p.ip BETWEEN INET_ATON('$ip_from') AND INET_ATON('$ip_to') GROUP BY pid"; +$q_players = mysql_query($sql_players) or die(mysql_error()); +$j = 0; +while ($r_players = mysql_fetch_array($q_players)) { + echo ''; + echo ''; + $sql_recent = "SELECT m.time AS time, m.id AS mid, INET_NTOA(p.ip) AS ip FROM uts_player p, uts_match m WHERE m.id = p.matchid AND p.pid = '${r_players['pid']}' AND p.ip BETWEEN INET_ATON('$ip_from') AND INET_ATON('$ip_to') ORDER BY m.time DESC LIMIT 0,5"; + echo ''; +} + + +echo' + +
Players using IPs '.$ip_from.' - '.$ip_to.' and their last 5 matches using these IPs
'; + echo ''.$r_players['name'].''; + echo ''; + $q_recent= mysql_query($sql_recent) or die(mysql_error()); + while ($r_recent = mysql_fetch_array($q_recent)) { + $j++; + $class = ($j%2) ? 'grey' : 'grey2'; + echo ''; + } + echo '
'; + echo ''.mdate($r_recent['time']).''; + echo ''; + echo $r_recent['ip']; + echo '
Go Back To Admin Page
'; +?> diff --git a/html/pages/admin/main.php b/html/pages/admin/main.php new file mode 100755 index 0000000..4d60302 --- /dev/null +++ b/html/pages/admin/main.php @@ -0,0 +1,117 @@ + + + Database Statistics +'; + +$q_dbsize = mysql_query("SHOW table STATUS") or die(mysql_error()); +$tot_size = 0; +$tot_rows = 0; +$max_size = 0; +while ($r_dbsize = mysql_fetch_array($q_dbsize)) { + if (substr($r_dbsize['Name'], 0, 4) != 'uts_') continue; + $size = $r_dbsize['Data_length'] + $r_dbsize['Index_length']; + $rows = $r_dbsize['Rows']; + $tables[] = array ( + 'name' => $r_dbsize['Name'], + 'size' => $size, + 'rows' => $rows + ); + $tot_size += $size; + $tot_rows += $rows; + if ($max_size < $size) $max_size = $size; + +} + +$i = 0; +foreach($tables as $table) { + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + + $d_size = file_size_info($table['size']); + $title = get_dp($table['size'] / $tot_size * 100) .' %'; + echo' + '; + if (substr($table['name'], 0, 9) == 'uts_temp_' and strlen($table['name']) == 17) { + echo 'Delete'.$table['name'].''; + } else { + echo $table['name']; + } + echo ' + '.nf($table['rows']).' rows + '.$d_size['size'] .' '. $d_size['type'].' + '. $title .' + '; +} + +$d_size = file_size_info($tot_size); +echo' + Total Database Size + '.nf($tot_rows).' rows + '.$d_size['size'] .' '. $d_size['type'].' +   + +
'; + +echo' +
'; + +echo ' + +'; + + + +echo'
'; +?> diff --git a/html/pages/admin/mplayers.php b/html/pages/admin/mplayers.php new file mode 100755 index 0000000..3754d99 --- /dev/null +++ b/html/pages/admin/mplayers.php @@ -0,0 +1,91 @@ + + + + + + '; +mysql_query("DELETE FROM uts_pinfo WHERE id = $mplayer2") or die(mysql_error()); + echo' + + + '; +mysql_query("UPDATE uts_player SET pid = $mplayer1 WHERE pid = $mplayer2") or die(mysql_error()); + echo' + + + '; +mysql_query("UPDATE uts_weaponstats SET pid = $mplayer1 WHERE pid = $mplayer2") or die(mysql_error()); +mysql_query("DELETE FROM uts_weaponstats WHERE pid = $mplayer2") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid = '$mplayer1'") or die(mysql_error()); + +$q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$mplayer1' GROUP BY weapon") or die(mysql_error()); +while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='$mplayer1', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); +} + echo' + + + '; +mysql_query("UPDATE uts_match SET firstblood = $mplayer1 WHERE firstblood = $mplayer2") or die(mysql_error()); + echo' + + + '; +mysql_query("UPDATE uts_rank SET pid = $mplayer2 WHERE pid= $mplayer1") or die(mysql_error()); + echo' + + + '; + +$sql_nrank = "SELECT SUM(time) AS time, pid, gid, AVG(rank) AS rank, AVG(prevrank) AS prevrank, SUM(matches) AS matches FROM uts_rank WHERE pid = $mplayer2 GROUP BY pid, gid"; +$q_nrank = mysql_query($sql_nrank) or die(mysql_error()); +while ($r_nrank = mysql_fetch_array($q_nrank)) { + + mysql_query("INSERT INTO uts_rank SET time = '$r_nrank[time]', pid = $mplayer1, gid = $r_nrank[gid], rank = '$r_nrank[rank]', prevrank = '$r_nrank[prevrank]', matches = $r_nrank[matches]") or die(mysql_error()); +} + + echo' + + + '; +mysql_query("DELETE FROM uts_rank WHERE pid = $mplayer2") or die(mysql_error()); + echo' + + + + +
Merging '.$mp2name[name].' Into '.$mp1name[name].'
Removing Info RecordsDone
Updating Player RecordsDone
Updating Weapon RecordsDone
Amending Player Weapon Stats:Done
Updating First Blood RecordsDone
Temporary RankDone
Creating New RankDone
Removing Old RankDone
Player Record Merged - Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/mservers.php b/html/pages/admin/mservers.php new file mode 100755 index 0000000..b52a9d1 --- /dev/null +++ b/html/pages/admin/mservers.php @@ -0,0 +1,41 @@ + + + + + + '; +mysql_query("UPDATE uts_match SET serverip = '". addslashes($q_myserver1[serverip]) ."', servername = '". addslashes($q_myserver1[servername]) ."' WHERE serverip = '". addslashes($q_myserver2[serverip]) ."' and servername = '". addslashes($q_myserver2[servername]) ."'") or die(mysql_error()); + echo' + + + +
Merging '.$q_myserver2[servername].' ('.$q_myserver2[serverip].')
+ Into '.$q_myserver1[servername].' ('.$q_myserver1[serverip].')
Merging RecordsDone
Server Records Merged - Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/pban.php b/html/pages/admin/pban.php new file mode 100755 index 0000000..f421ef5 --- /dev/null +++ b/html/pages/admin/pban.php @@ -0,0 +1,74 @@ + + + + + + '; + mysql_query("DELETE FROM uts_rank WHERE pid = $pid") or die(mysql_error()); + echo' + + + '; + mysql_query("UPDATE uts_pinfo SET banned = 'Y' WHERE id = $pid") or die(mysql_error()); + echo' + + + + +
Banning Player
Removing Player Rank:Done
Updating Player Record:Done
Player Banned - Go Back To Admin Page
'; +} else { + echo' + + + + + '; + mysql_query("UPDATE uts_pinfo SET banned = 'N' WHERE id = $pid") or die(mysql_error()); + echo' + + + '; + + $sql_nrank = "SELECT SUM(gametime) AS time, pid, gid, SUM(rank) AS rank, COUNT(matchid) AS matches FROM uts_player WHERE pid = $pid GROUP BY pid, gid"; + $q_nrank = mysql_query($sql_nrank) or die(mysql_error()); + while ($r_nrank = mysql_fetch_array($q_nrank)) { + + mysql_query("INSERT INTO uts_rank SET time = '$r_nrank[time]', pid = $pid, gid = $r_nrank[gid], rank = '$r_nrank[rank]', prevrank = '$r_nrank[rank]', matches = $r_nrank[matches]") or die(mysql_error()); + } + + echo' + + + +
Unbanning Player
Updating Player Record:Done
Restoring RankingsDone
Player Unbanned - Go Back To Admin Page
'; +} + +?> diff --git a/html/pages/admin/pinfo.php b/html/pages/admin/pinfo.php new file mode 100755 index 0000000..7be13ae --- /dev/null +++ b/html/pages/admin/pinfo.php @@ -0,0 +1,91 @@ +'; + +$sql_ips = "SELECT INET_NTOA(p.ip) AS ip, COUNT(p.id) AS matches, MIN(m.time) AS first, MAX(m.time) AS last FROM uts_player AS p, uts_match AS m WHERE p.pid = ".$pid." AND m.id = p.matchid GROUP BY ip ORDER BY ip"; +$q_ips = mysql_query($sql_ips) or die("Can't get ip's: " . mysql_error()); +echo ' + + + + + + + + + + + + '; + +while ($r_ips = mysql_fetch_assoc($q_ips)) { + echo ' + + + + + + + '; +} + +echo ' + +
IP\'s used
IPHostnameMatchesFirstLast
'.$r_ips['ip'].''.gethostbyaddr($r_ips['ip']).''.$r_ips['matches'].''.mdate($r_ips['first']).''.mdate($r_ips['last']).'
+
* Hostnames are real time and might have been different at the time of playing. *
+
'; + +mysql_free_result($q_ips); + +$sql_fakes = "SELECT INET_NTOA(p1.ip) AS ip, pi.name FROM uts_player AS p1, uts_player AS p2, uts_pinfo AS pi WHERE p1.pid = ".$pid." AND p1.ip = p2.ip AND p1.pid <> p2.pid AND pi.id = p2.pid GROUP BY pi.name"; +$q_fakes = mysql_query($sql_fakes) or die("Can't retrieve fake nicks: " . mysql_error()); +echo ' + + + + + + + + + '; + +if (mysql_num_rows($q_fakes) == 0) { + echo ' + + + '; +} +else { + while($r_fakes = mysql_fetch_assoc($q_fakes)) { + echo ' + + + + '; + } +} +echo ' + +
Possible aliasses
NickIP
No other names found
'.$r_fakes[ip].''.$r_fakes[name].'

'; +?> diff --git a/html/pages/admin/plm.php b/html/pages/admin/plm.php new file mode 100755 index 0000000..68992e2 --- /dev/null +++ b/html/pages/admin/plm.php @@ -0,0 +1,329 @@ +Player merging tool

'; +echo "

Merge ip's - Merge ip's, limited on range - Manage ignored ip's - Manage ignored ip's - only range

"; + +// CASE: MANAGE IGNORED IPS +if($_GET['manignore'] == "true") { + if($_POST['submit'] == "Remove from ignored list") { + echo "

Stopped ignore ip's

"; + foreach($_POST as $key=>$value) { + if($key !='submit') { + $key = mysql_real_escape_string(str_replace("_",".",$key)); + $query = "DELETE FROM uts_ignoreips WHERE ip = (INET_ATON('".$key."'))"; + mysql_query($query) or die(mysql_error()); + echo "
$key"; + } + } + } else if($_GET['onlyrange'] == "true") { + if($_POST['submit'] == "Confirm") { + echo '

Ignored ip\'s in range '.htmlentities($_POST['from']).' to '.htmlentities($_POST['to']).'
If you want to stop ignoring some ip\'s, because for example you accidently ignored these, check these and press the button at the lower end to confirm this

'; + echo '
'; + + $from = mysql_real_escape_string($_POST['from']); + $to = mysql_real_escape_string($_POST['to']); + + $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to') ORDER BY ip ASC"); + + if(mysql_num_rows($ignore_ips) > 0) { + while ($r_pipcheck = mysql_fetch_array($ignore_ips)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + echo "
$trueplayerip"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + echo '
'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).' '; + } + echo '
'; + } + echo '
'; + } else { + echo "

No ignored ip's found

"; + } + } else { + echo "

Ignored ip's in range: Enter range to filter on

"; + echo '
'; + echo '
Ranging from to '; + echo '

'; + } + } else { + echo '

Ignored ip\'s
If you want to stop ignoring some ip\'s, because for example you accidently ignored these, check these and press the button at the lower end to confirm this

'; + echo '
'; + + $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips ORDER BY ip ASC"); + if(mysql_num_rows($ignore_ips) > 0) { + while ($r_pipcheck = mysql_fetch_array($ignore_ips)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + echo "
$trueplayerip"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + echo '
'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).' '; + } + echo '
'; + } + echo '
'; + } else { + echo "

No ignored ip's found

"; + } + } + +// CASE: IGNORE SUBMITTED IP'S +} else if($_POST['submit'] == "ignore") { + echo "

Ignored ips

"; + foreach($_POST as $key=>$value) { + if($key !='submit') { + $key = mysql_real_escape_string(str_replace("_",".",$key)); + $query = "INSERT INTO uts_ignoreips (ip) VALUES (INET_ATON('".$key."'))"; + mysql_query($query) or die(mysql_error()); + echo "
$key"; + } + } + echo "
"; + +// CASE: SHOW NICKS WITH GIVEN SHARED IP +} else if(substr($_POST['submit'],0,8) == "merge - ") { + echo "

Merge nicks with shared ip

"; + + $ip = mysql_real_escape_string(str_replace("_",".",substr($_POST['submit'],8))); + $sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player WHERE ip = INET_ATON('$ip') GROUP BY ip ORDER BY ip ASC"; + $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error()); + while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + // If there is more than one pid associated to an IP ... + IF ($pidcount > 1 ) { + echo '
'; + echo "
$trueplayerip"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + echo '
'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).' '; + $options .= ''; + } + echo '

Merge to: '; + echo "
"; + echo '
'; + } + } + +// CASE: MERGE NICKS WITH SHARED IP +} else if($_POST['submit'] == "Player merge") { + echo "

Merging nicks with shared ip

"; + + $ip = mysql_real_escape_string(str_replace("_",".",$_POST['ip'])); + $merge_to_pid = mysql_real_escape_string($_POST['merge_to']); + $sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player WHERE ip = INET_ATON('$ip') GROUP BY ip ORDER BY ip ASC"; + $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error()); + while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + // If there is more than one pid associated to an IP ... + IF ($pidcount > 1 ) { + echo "$trueplayerip

merge:
"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT p.pid FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + $i=0; + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + if($r_pcheck['pid'] != $merge_to_pid) { + $pid_from[$i] = $r_pcheck['pid']; + echo $pid_from[$i].'
'; + $i++; + } + } + echo '
merge to: '.$merge_to_pid; + } + } + if($debug) echo "
-- started merging"; + for($j=0;$j -- merging ended"; + +// CASE: SHOW ALL IP'S LINKED TO MORE THAN ONE NICK - ONLY RANGE +} else if($_GET['onlyrange'] == "true") { + if($_POST['submit'] == "Confirm") { + echo "

Showing all ip's in range ".htmlentities($_POST['from'])." to ".htmlentities($_POST['to'])."
If you want to ignore some ip's, because for example different but unrelated nicks are associated with it, check these and press the button at the lower end to confirm this

"; + $from = mysql_real_escape_string($_POST['from']); + $to = mysql_real_escape_string($_POST['to']); + + $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to')"); + $extended_query = "WHERE ip >= INET_ATON('$from') AND ip <= INET_ATON('$to')"; + $i=0; + while($ignore_ips_array = mysql_fetch_array($ignore_ips)) { + $ip = $ignore_ips_array[0]; + $extended_query .= " AND "; + $extended_query .= "ip <> '".$ip."'"; + $i++; + } + + echo '
'; + + + // Query for list of unique ips and player ids + $sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player ".$extended_query." GROUP BY ip ORDER BY ip ASC"; + $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error()); + if(mysql_num_rows($q_pipcheck) > 0) { + while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + // If there is more than one pid associated to an IP ... + IF ($pidcount > 1 ) { + + echo "
$trueplayerip"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + echo '
'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).' '; + } + echo "
"; + echo '
'; + } + } + + + echo '
'; + } else { + echo "


No ip's found with more than one nick linked to it and which are not ignored and are in this range

"; + } + + } else { + echo "

Showing all ip's in range - Enter range to filter on

"; + echo '
'; + echo '
Ranging from to '; + echo '

'; + } + +// CASE: SHOW ALL IP'S LINKED TO MORE THAN ONE NICK +} else { + echo "

IP's linked with more than one nick
If you want to ignore some ip's, because for example different but unrelated nicks are associated with it, check these and press the button at the lower end to confirm this

"; + + $ignore_ips = mysql_query("SELECT ip FROM uts_ignoreips"); + $extended_query = ""; + $i=0; + while($ignore_ips_array = mysql_fetch_array($ignore_ips)) { + $ip = $ignore_ips_array[0]; + if($i==0) + $extended_query = " WHERE "; + else + $extended_query .= " AND "; + $extended_query .= "ip <> '".$ip."'"; + $i++; + } + + echo '
'; + + + // Query for list of unique ips and player ids + $sql_pipcheck = "SELECT ip, COUNT(DISTINCT pid) AS pidcount FROM uts_player ".$extended_query." GROUP BY ip ORDER BY ip ASC"; + $q_pipcheck = mysql_query($sql_pipcheck) or die(mysql_error()); + if(mysql_num_rows($q_pipcheck) > 0) { + while ($r_pipcheck = mysql_fetch_array($q_pipcheck)) { + + $playerip = $r_pipcheck[ip]; + $trueplayerip = long2ip($playerip); + $pidcount = $r_pipcheck[pidcount]; + + // If there is more than one pid associated to an IP ... + IF ($pidcount > 1 ) { + + echo "
$trueplayerip"; + + // Query for player names and ids associated to that ip during the cycle + $sql_pcheck = "SELECT pi.id, pi.name, pi.country, p.pid, p.ip FROM uts_pinfo AS pi, uts_player AS p WHERE pi.id = p.pid AND p.ip = $playerip GROUP BY pi.id, pi.name, p.pid, p.ip, pi.country"; + $q_pcheck = mysql_query($sql_pcheck) or die(mysql_error()); + while ($r_pcheck = mysql_fetch_array($q_pcheck)) { + echo '
'.FormatPlayerName($r_pcheck[country], $r_pcheck['pid'], $r_pcheck['name']).' '; + } + echo "
"; + echo '
'; + } + } + echo '
'; + } else { + echo "


No ip's found with more than one nick linked to it and which are not ignored

"; + } +} + +// If debugmode is on, determine end time & output execution time +if($debug) { + $time = microtime(); + $time = explode(" ", $time); + $time = $time[1] + $time[0]; + $endtime = $time; + $totaltime = ($endtime - $begintime); + echo "
execution time: $totaltime"; +} +?> \ No newline at end of file diff --git a/html/pages/admin/recalcflags.php b/html/pages/admin/recalcflags.php new file mode 100755 index 0000000..073e648 --- /dev/null +++ b/html/pages/admin/recalcflags.php @@ -0,0 +1,72 @@ + + + +'; + +echo' + + '; + echo' + + + + +
Recalculating Countryflags
Recalculating Rankings:'; + + echo'Recalculating pinfo table...
'; + /* update pinfo table */ + $sql_pids = mysql_query("SELECT uts_pinfo.id as pid, uts_pinfo.country as country, uts_player.ip as ip FROM uts_pinfo, uts_player WHERE uts_pinfo.id = uts_player.pid GROUP BY uts_player.pid;") or die(mysql_error()); + while($sql_pid = mysql_fetch_array($sql_pids)) + { + $playercountry = strtolower(geoip_country_code_by_addr($gi,long2ip($sql_pid['ip']))); + + if ($playercountry != $sql_pid['country'] ) + { + mysql_query("UPDATE uts_pinfo SET country = '$playercountry' WHERE id = '".$sql_pid['pid']."'") or die(mysql_error()); + } + } + + echo'Recalculating player table...
'; + /* update player table */ + $sql_pids = mysql_query("SELECT pid, ip, country FROM uts_player"); + while ($sql_pid = mysql_fetch_array($sql_pids)) + { + $playercountry = strtolower(geoip_country_code_by_addr($gi,long2ip($sql_pid['ip']))); + + if ($playercountry != $sql_pid['country']) + { + mysql_query("UPDATE uts_player SET country = '$playercountry' WHERE pid = '".$sql_pid['pid']."'") or die(mysql_error()); + } + } + echo 'Done
Countryflags recalculated - Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/recalcranking.php b/html/pages/admin/recalcranking.php new file mode 100755 index 0000000..1cbc865 --- /dev/null +++ b/html/pages/admin/recalcranking.php @@ -0,0 +1,77 @@ + + + +'; + +echo' + '; + + mysql_query("TRUNCATE uts_rank") or die(mysql_error()); + + echo''; + +echo' + + '; + echo' + + + + +
Recalculating Rankings
Deleting rankingsDone
Recalculating Rankings:'; + $playerbanned = false; + $q_pm = mysql_query( " SELECT p.id, + p.matchid, + p.pid, + p.gid, + m.gamename + FROM uts_player p, + uts_pinfo pi, + uts_match m + WHERE pi.id = p.pid + AND pi.banned <> 'Y' + AND m.id = p.matchid + ORDER BY p.matchid ASC, + p.playerid ASC"); + $i = 0; + while ($r_pm = mysql_fetch_array($q_pm)) { + $i++; + if ($i%50 == 0) { + echo '. '; + flush(); + } + $playerecordid = $r_pm['id']; + $matchid = $r_pm['matchid']; + $pid = $r_pm['pid']; + $gid = $r_pm['gid']; + $gamename = $r_pm['gamename']; +// echo "$pid|$gid|$matchid
"; + include('import/import_ranking.php'); + } + echo 'Done
Rankings recalculated - Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/utdclog.php b/html/pages/admin/utdclog.php new file mode 100755 index 0000000..b22bfd7 --- /dev/null +++ b/html/pages/admin/utdclog.php @@ -0,0 +1,137 @@ + + + + '; + $logdir = opendir('logs/utdc'); + $logs = array(); + $sort = array(); + $i = 0; + while (false !== ($filename = readdir($logdir))) { + if (!is_file('logs/utdc/'. $filename)) continue; + if ($filename == '.htaccess' or $filename == 'index.htm') continue; + $i++; + $logs[$i] = $filename; + $extra = 0; + if (substr($filename, -4) == '.bz2') $extra = 4; + if (substr($filename, -3) == '.gz') $extra = 3; + + $sort[$i] = substr($filename, strlen($filename) - (23 + $extra), 19); + } + closedir($logdir); + if (count($logs) == 0) { + echo ''; + } else { + arsort($sort); + $i = 0; + foreach($sort as $id => $date) { + $log = $logs[$id]; + $extra = 0; + if (substr($log, -4) == '.bz2') $extra = 4; + if (substr($log, -3) == '.gz') $extra = 3; + + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ''; + } + } +} + + +if (!empty($filename)) { + if (!file_exists('logs/utdc/'. $filename) or !is_file('logs/utdc/'. $filename)) die('bla'); + echo'
Available UTDC Logs:
No logs available!
'; + $tmp = substr($log, strlen($log) - (23 + $extra), 19); + $tmp = str_replace('.', '', $tmp); + $ts = mtimestamp($tmp); + echo ' '.date('Y-m-d H:i', $ts).''; + echo ''; + echo ''.substr($log, 6, strlen($log) - 30 - $extra).''; + echo ''; + $d_size = file_size_info(filesize('logs/utdc/'. $log)); + echo $d_size['size'] .' '. $d_size['type']; + echo ''; + echo 'Delete'; + echo '
+ + + + '; + if (substr($filename, -4) == '.enc') { + echo ''; + } + else { + $fp = my_fopen('logs/utdc/'.$filename, 'rb', $compression = NULL); + if (!$fp) die("Error opening file"); + + $i = 0; + echo ''; + */ + echo wordwrap(htmlentities($line), 80, '
', 1) ."
"; + } + echo ''; + my_fclose($fp, $compression); + + // look for a matching utdc screenshot + $logdir = opendir('logs/utdc'); + if (substr($filename, -4) == '.bz2') $extra = 4; + if (substr($filename, -3) == '.gz') $extra = 3; + while (false !== ($file = readdir($logdir))) { + if (!is_file('logs/utdc/'. $filename)) continue; + if ($filename == '.htaccess' or $filename == 'index.htm') continue; + if ((substr($file, -4) == '.enc') and + ((substr($filename, strlen($filename)-(23 + $extra), 19) == substr($file, strlen($file)-23, 19)) or ((substr($filename, strlen($filename)-(23 + $extra), 17) == substr($file, strlen($file)-23, 17)) and (abs(intval(substr($file, strlen($file)- 6, 2)) - intval(substr($filename, strlen($filename)-(6 + $extra), 17))) <=3)))) { + echo ' + + + '; + + echo ''; + } + } + closedir($logdir); + } +} + +echo ''; +if (!empty($filename)) echo''; +echo''; +echo '
'.$filename.''; + echo 'Delete'; + echo '
'; + echo ''; + echo '
'; + + while (($line = my_fgets($fp, 5000, $compression)) !== FALSE) { + /* + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo '
'; + echo ''; + echo htmlentities($line); + echo ''; + echo '
'.$file.''; + echo 'Delete'; + echo '
'; + echo ''; + echo '
Go Back To Logfile Overview
Go Back To Admin Page
'; + +?> diff --git a/html/pages/admin/utdcshot.php b/html/pages/admin/utdcshot.php new file mode 100755 index 0000000..24b21f7 --- /dev/null +++ b/html/pages/admin/utdcshot.php @@ -0,0 +1,22 @@ + \ No newline at end of file diff --git a/html/pages/credits.php b/html/pages/credits.php new file mode 100755 index 0000000..e27de84 --- /dev/null +++ b/html/pages/credits.php @@ -0,0 +1,311 @@ + +

Credits

+ +

+ 1. Developers
+ 2. Change Log
+ 3. To Do List
+ 4. Thanks
+ 5. Copyright Notices
+

+ +

Developers

+

UTStats was developed by azazel, )°DoE°(-AnthraX, PJMODOS and toa.
+All original pages are W3C HTML 4.01 and +CSS compliant

+ +
+ +

Change Log

+

+

+
beta 4.2.8 (23/7/2011 by Rork)
+
Bug Fixes:
+ Fixed explain rankings (reported by Letylove49)
+ Fixed delete player (reported by The Cowboy)
+ Fixed delete player from match
+ Fixed support for LMS++

+ +
beta 4.2.7 (24/4/2011 by Rork)
+
Added:
+ IP Information in extended player info
+ Possible fake nicks in extended player info
+ Added support for LMS+

+ +
Bug Fixes:
+ Fixed player deletion
+ Fixed DOM import with bots
+ Fixed player info BT records
+ Fixed order players in playersearch
+ Fixed player time on server longer then gametime
+ Fixed lms player sorting
+ Fixed lms ttl
+ Fixed SQL table creation (reported by PopCorn)

+ +
beta 4.2.6 (04/12/2010 by Rork)
+
Bug Fixes:
+ Fixed serveral vulnerabilities
+ Fixed DOM specific map page not showing
+ Fix Assault Match looks
+ Add support for new BT times
+ Fixed CTF Match Reports

+ +
beta 4.2.5 (23/10/2010 by Rork)
+
Added:
+ Game time in match stats
+ Added applicable totals per gametype on the mappage
+ Bunny Track stats, BT++ support only
+ Server configuration checker/database setup
+ UTDC Screenshots viewer
+ ACE Logviewer
+ Added out time in LMS
+ Added number of players to recent matches
+ Hide not applicable statistics from player pages
+ Various lay-out improvements
+ Filters in maplist
+ Show Score under Match Totals for teamgames
+ Added debug messages

+ +
Bug Fixes:
+ Fixed delete player from match
+ Fixed bug where players are spec after merging or teamchange
+ Fixed effective rank after merging players
+ Dirty fix for divide by zero bug on logimport (was line 47) (gametime = 0)
+ Fixed dodgy import log recognition
+ Fixed playerlink in explain ranking
+ Two bug fixes by Enakin reported in the 4.2.3 release thread
+ Fixed LMS ttl by using the time until the player is out.
+ Sorted LMS players by ttl, the winner on top
+ Fixed php shorttag in import_playerstuff.php
+ Prevent removing files from ftp after error
+ Prevent importing empty log after ftp error
+ Made the main pages W3C HTML 4.01 Compliant
+ Fixed some vulnerabilities

+ +
beta 4.2.4 (10/04/2010 by Loki)
+
Added:
+ Breakdown of server occupation per weekday (By Loki)
+ Breakdown of country of origin (By Loki)
+ Included IpToCountry patch into the release, added GeoIP.dat from March 2010 (By Loki)

+
Bug Fixes:
+ Fixed PHP opening tags (By Loki)

+ +
beta 4.2.3 (18/01/09 by 2399Skillz)
+
Bug Fixes:
+ Lots of bug fixes/database corrections (By Enakin)

+ +
beta 4.2.2 (30/12/08 by 2399Skillz)
+
Added:
+ Option to import AnthChecker logs (admin viewable only) (Added by Skillz)
+ New player merger page for admins(Added by killereye)

+
Bug Fixes:
+ UT Stats DOM fix (Edited by killereye)

+ +
beta 4.2 (20/10/2005 by Azazel)
+
Added:
+ Ranking re-calculation option added to admin section
+ Import and display player pings
+ Explain Ranking page
+ Added an option to the admin page to delete temporary tables (if any)

+ +
Bug Fixes:
+ Import fix for MySQL v3.x
+ Partial Import delete fix
+ bbcode and Clanbase Report Fix - not showing high score win reports.
+ Ranking fix (was more than 300 mins to get full ranking points)
+ Spectator fix (was logging players as spectators)
+ Efficiency on Players Total worked out as SUM rather than AVG
+ Clanbase report fixed
+ Totals on Totals Page fixed
+ Events on Totals Page only show if they really happened
+ Number of matches on Totals Page fixed
+ Fixed a crash when trying to import logs that didnt contain IP records
+ Maps sometimes appeared twice on the maps list / incorrect map statistics
+ First/Prev/Next/Last links on map stas page were not working correctly
+ Improved server actor version uploaded (old one may have caused some server lag at times)
+ Updated import.php for new server actor
+ Few actor fixes
+ Weapon stats for second attacking team in assault games were not correct (reported by wgray8231)
+ Delete player from match didn\'t correctly remove the player from the match (reported by wgray8231)

+ +
beta 4.0
+
Added:
+ Many pages overhauled
+ Database overhauled
+ Option to import bots or not (off by default)
+ Command Line Interface now outputs to text not html
+ Ranking stuff on match and player pages include gold/silver/bronze cups for each gametype
+ Rankings tweaked so new players get even less points
+ Maps page now sortable
+ Flag Assists now show, get the new Smart CTF
+ Report generator outputting to Clanbase and bbcode format
+ Support added for custom weapons and gametypes
+ Admin page including server/player merging, deletion of players/matches, renaming of "game types" etc
+ Option to compress logs when backing them up (requires bzip/gzip support in php)
+ More debugging stuff added
+ Accuracy package optimised and recoded for better performance (it will not lag the server in anyway now)
+ More detailed weapon statistics added
+ Totals page expanded with information like on the old NGStats
+ JailBreak should now display its statistics properly
+ Purge logs option added
+ Graphs now display better regardless of data used
+ CTF4 Compatibility
+ Date and Game Type filtering on Recent Matches page
+ Ability to Ban players
+ Ability to ignore matches < X minues in length
+ IP Search within Administration
+ Ability to ignore matches less than X minutes in length
+ Option to import UTDC logs (admin viewable only)

+ +
Bug Fixes:
+ Ranking overhauled to better reflect average game play of players
+ Cleaned up the importer
+ Teamscores now shown correctly regardless of player switching activity
+ Kills matrix is now created on combined player records
+ Kills against bots no longer counted if bots are not imported
+ Domination logs only log when players are in
+ Teamkills identified as kills in non-team games (gg Epic :/)
+ Eff etc fixed because of above Teamkills bug
+ Last line not logging of buffer fixed

+ +
beta 3.2
+
Added:
+ Debugging Option
+ Better FTP Capabilities
+ Filters carried over on next last etc on player page

+ +
Bug Fixes:
+ Imports failing on some versions of php 4.3.x
+ Totals page fixed
+ Totals info at the top of match pages fixed

+ +
beta 3.1
+
Added:
+ Kills Matchup Matrix + Country Flags for Players
+ Hover Hints over key parts of the page (eg. K F D S)
+ Some Graphs

+ +
Bug Fixes:
+ Importer can now import unlimited logs
+ Kills on match pages not listed
+ Games where nothing happens no longer imported
+ Players who have 0 kills & 0 deaths no longer get imported
+ FTP script re-written
+ Pickups removed from insta pages
+ Translocator entries removed from logs (throws not kills)
+ Multis & Sprees report correct player now
+ Kills correctly worked out on non-Team Games
+ + Frags correctly worked out on all games

+ +
beta 3.0
+
Added:
+ SmartCTF events
+ UTGL Compatibility

+ Updated:
+ UTStats actor re-written from scratch, it now uses NGLog files
+ Database re-written from scratch
+ PHP code re-written from scratch

+ +
Bug Fixes:
+ Too many to think about

+ +
beta 2.0
+
Code rewritten from ground up then lost :(

+ + +
beta 1.2
+
Added:
+ Accuracy Code (best in insta but works on all weapons)
+ UT2004 spree scheme
+ Who killed the Flag Carrier
+
+ Updated:
+ Complete overhaul of pages/theme to mimic closley UT2004 Stats by Epic
+ Cap times added to Clanbase Report
+ Stats database, now at least 10-20x smaller
+
+ Bug Fixes:
+ TeamKills no longer appear in DM
+ TeamKills no longer mess up overall stats
+ Bot kills etc no longer included in overall stats
+ Sprees are unique

+ +
beta 1.1
+
Added:
+ Clanbse Reports for CTF Match\'s
+ 30 Recent Match\'s to Player View

+ +
beta 1
+
Stats output for:
+ Player Joins/Leaves
+ Match Start/End
+ Frags and Item Pickups
+ Sprees (Doubles/Multis and Domination/Monster etc)
+ Events
+ +
+ +

To Do List

+
+ "Requests"
+ Centralise stats
+ Web based installer
+ Other Anticheat log parser. (UTPure, EUT, etc..)
+ Multi language support
+ Add sftp support
+ Add siege support
+ Wins/Losses to the Career summary
+ Killgraph as in utstatsdb
+
+
+ +

Thanks

+
+
+
Epic for making a game that we still play
+ kostaki for the database pointers, scoring system and the inzane public servers :)
+ Limited for the late night sesions, the linux script and the original zero_out function
+ L0cky and Flash for the original FTP Script
+ Loph for the 6 different reports o/
+ Rush for the improved linux script, testing, suggestions and bug finding
+ TNSe for being TNSe
+ Truff for testing, suggestions and constant bug finding
+ Truff Community for testing, suggestions and input
+ UnrealAdmin.org testers and suggesters
+ +

Copyright Notices

+
+
UTStats
+ Copyright (C) 2004/2005 UTStats
+
+ This program is free software; you can redistribute and/or modify
+ it under the terms of the Open Unreal Mod License.
+
+ If you do make any changes, fixes or updates posting them on the
+ forum would be appreciated.
+
+ UT Query PHP script v1.01 by Almar Joling, 2003
+ www.persistentrealities.com
+
+ pemftp Class by Alexey Dotsenko <alex at paneuromedia dot com>
+ http://www.phpclasses.org/browse/package/1743.html
+
+ GeoLite data created by MaxMind
+ Available from http://www.maxmind.com/app/geolitecountry
+
+ overLIB by Erik Bosrup
+ http://www.bosrup.com/web/overlib/ +
+
+ + + + + +
Back to Top 
+'; +?> \ No newline at end of file diff --git a/html/pages/dpmatch.php b/html/pages/dpmatch.php new file mode 100755 index 0000000..b563fa0 --- /dev/null +++ b/html/pages/dpmatch.php @@ -0,0 +1,102 @@ + + + +'; + +echo' + '; + +$q_radjust = small_query("SELECT pid, gid, rank FROM uts_player WHERE id = $pid"); +if (!$q_radjust) { + $sql_crank = false; +} else { + $rank_pid = $q_radjust[pid]; + $rank_gid = $q_radjust[gid]; + $rank = $q_radjust[rank]; + + $sql_crank = small_query("SELECT id, rank, matches FROM uts_rank WHERE pid = $rank_pid AND gid = '$rank_gid'"); +} +if (!$sql_crank) { + echo''; +} else { + $rid = $sql_crank[id]; + $newrank = $sql_crank[rank]-$rank; + $oldrank = $sql_crank[rank]; + $matchcount = $sql_crank[matches]-1; + + mysql_query("UPDATE uts_rank SET rank = $newrank, prevrank = $oldrank, matches = $matchcount WHERE id = $rid") or die(mysql_error()); + mysql_query("DELETE FROM uts_rank WHERE matches = 0") or die(mysql_error()); + + echo''; +} +echo' + + '; + $q_match = mysql_query("SELECT matchid, playerid FROM uts_player WHERE pid = '$pid' and matchid = '$matchid'") or die(mysql_error()); + while ($r_match = mysql_fetch_array($q_match)) { + mysql_query("DELETE FROM uts_killsmatrix WHERE matchid = '${r_match['matchid']}' AND (killer = '${r_match['playerid']}' OR victim = '${r_match['playerid']}')") or die(mysql_error()); + } + echo' + + + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid = $matchid AND pid = $pid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_player WHERE matchid = $matchid AND pid = $pid") or die(mysql_error()); + echo' + + + '; +mysql_query("DELETE FROM uts_weaponstats WHERE matchid IN ('$matchid','0') AND pid = '$pid'") or die(mysql_error()); + +$q_weaponstats = mysql_query("SELECT SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE pid = '$pid' GROUP BY weapon") or die(mysql_error()); +while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='$pid', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); +} + echo' + + + '; + mysql_query("DELETE FROM uts_weaponstats WHERE matchid='0' AND pid='0'") or die(mysql_error()); + + $q_weaponstats = mysql_query("SELECT weapon, SUM(kills) AS kills, SUM(shots) AS shots, SUM(hits) as hits, SUM(damage) as damage, AVG(acc) AS acc FROM uts_weaponstats WHERE matchid = '0' GROUP BY weapon") or die(mysql_error()); + while ($r_weaponstats = mysql_fetch_array($q_weaponstats)) { + mysql_query("INSERT INTO uts_weaponstats SET matchid='0', pid='0', weapon='${r_weaponstats['weapon']}', kills='${r_weaponstats['kills']}', shots='${r_weaponstats['shots']}', hits='${r_weaponstats['hits']}', damage='${r_weaponstats['damage']}', acc='${r_weaponstats['acc']}'") or die(mysql_error()); + } + + echo' + + + + +
Delete Player From Match ID '.$matchid.'
Amending Players Rank:Player not in rankingsDone
Removing Kill Matrix Entries:Done
Removing Player Weapon Stats:Done
Removing Player From Match:Done
Amending Player Weapon Stats:Done
Amending Global Weapon Stats:Done
Match Deleted - Go Back To Admin Page
'; + +?> diff --git a/html/pages/graph_mbreakdown.php b/html/pages/graph_mbreakdown.php new file mode 100755 index 0000000..44ef717 --- /dev/null +++ b/html/pages/graph_mbreakdown.php @@ -0,0 +1,229 @@ + $hour_max) $hour_max = $r_ghours['res_count']; + $hour_sum += $r_ghours['res_count']; +} +if ($hour_max == 0) return; + +// Daily Breakdown +// We use WEEKDAY rather then DAYOFWEEK because now the week starts with Monday instead of Sunday +$sql_gdays = "SELECT WEEKDAY(time) AS res_day, COUNT(*) AS res_count +FROM uts_match WHERE $bgwhere GROUP by res_day"; +$q_gdays = mysql_query($sql_gdays) or die(mysql_error()); +$day_max = 0; +$day_sum = 0; +while ($r_gdays = mysql_fetch_array($q_gdays)) { + $gb_day[$r_gdays['res_day']] = $r_gdays['res_count']; + if ($r_gdays['res_count'] > $day_max) $day_max = $r_gdays['res_count']; + $day_sum += $r_gdays['res_count']; +} + +// Monthly Breakdown +$sql_gmonths = "SELECT MONTH(time) AS res_month, COUNT(*) AS res_count +FROM uts_match WHERE $bgwhere GROUP by res_month"; +$q_gmonths = mysql_query($sql_gmonths) or die(mysql_error()); +$month_max = 0; +$month_sum = 0; +while ($r_gmonths = mysql_fetch_array($q_gmonths)) { + $gb_month[$r_gmonths['res_month']] = $r_gmonths['res_count']; + if ($r_gmonths['res_count'] > $month_max) $month_max = $r_gmonths['res_count']; + $month_sum += $r_gmonths['res_count']; +} + +// very dirty hack, to deal with the $bgwhere containing an OR +// if it contains an OR, all literals should be prefixed with "m." +if (substr_count($bgwhere, ' or ') == 0){ + $bgwhere = 'm.' . $bgwhere; +} else { + $bgwhere = substr($bgwhere, 1, -1); + $part = explode(' or ', $bgwhere); + $bgwhere = ''; + foreach($part as $i){ + $bgwhere .= 'm.' . $i . ' OR '; + } + $bgwhere = '(' . substr($bgwhere, 0, -4) . ')'; +} + +// Country Breakdown +$sql_gcountries = "SELECT country AS res_country, COUNT(*) AS res_count FROM + (SELECT p.country AS country FROM uts_player AS p, uts_match AS m + WHERE m.id = p.matchid AND $bgwhere GROUP BY p.pid) AS res_table +GROUP BY res_country ORDER BY res_count DESC"; +$q_gcountries = mysql_query($sql_gcountries) or die(mysql_error()); +$country_max = 0; +$country_sum = 0; +$i = 0; +while ($r_gcountries = mysql_fetch_array($q_gcountries)) { + $gb_country[$i] = $r_gcountries['res_country'] . ";" . $r_gcountries['res_count']; + if ($r_gcountries['res_count'] > $country_max) $country_max = $r_gcountries['res_count']; + $country_sum += $r_gcountries['res_count']; + $i++; +} + +echo' + + + + +
+ + + + + + + + + + '; + +// Hourly +for ($i = 0; $i <= 23; $i++) { + if (!isset($gb_hour[$i])) $gb_hour[$i] = 0; + $title = $gb_hour[$i] .' ('. get_dp($gb_hour[$i] / $hour_sum * 100) .' %)'; + echo ''; +} + +echo ''; + +// Daily +for ($i = 0; $i <= 6; $i++) { + if (!isset($gb_day[$i])) $gb_day[$i] = 0; + $title = $gb_day[$i] .' ('. get_dp($gb_day[$i] / $day_sum * 100) .' %)'; + echo ''; +} + +echo ''; + +// Monthly +for ($i = 1; $i <= 12; $i++) { + if (!isset($gb_month[$i])) $gb_month[$i] = 0; + $title = $gb_month[$i] .' ('. get_dp($gb_month[$i] / $month_sum * 100) .' %)'; + echo ''; +} +echo ''; +echo' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hourly, Daily and Monthly Activity '.$gtitle.'
'. $title .''. $title .''. $title .'
01234567891011121314151617181920212223MTWTFSSJFMAMJJASOND
+
+

'; + +global $a_countries; +// The number of different countries we want to display +$no_countries = 20; + +// Check if there are more countries then $no_countries; if so, we can have a "others" column +if ( count($gb_country) < $no_countries ){ + $max_cntry = count($gb_country); + $collspan = $max_cntry + 2; + $others = false; +} else { + $max_cntry = $no_countries; + $collspan = $max_cntry + 3; + $others = true; +} + +echo' + + + + +
+ + + + + + + + + '; + +// Countries +$x = 0; +for ($i = 0; $i < $max_cntry; $i++) { + if (!isset($gb_hour[$i])) $gb_hour[$i] = 0; + $country = explode(";",$gb_country[$i]); + $title = $a_countries[$country[0]] .': ' . $country[1] . ' ('. get_dp($country[1] / $country_sum * 100) .' %)'; + echo ''; + $x += $country[1]; +} +if($others){ + $countries_left = $country_sum - $x; + $title = 'Other Countries: ' . $countries_left . ' ('. get_dp($countries_left / $country_sum * 100) .' %)'; + echo ''; +}; + +echo ''; +echo' + '; + for ($i = 0; $i < $max_cntry; $i++) { + $country = explode(";",$gb_country[$i]); + $country = strtoupper($country[0]); + echo ''; + } +if($others){ + echo ''; +} +echo' + +
  Origin of Players  
'. $title .''. $title .'
' . $country . '--
+
+
'; +?> \ No newline at end of file diff --git a/html/pages/graph_pbreakdown.php b/html/pages/graph_pbreakdown.php new file mode 100755 index 0000000..808c7cb --- /dev/null +++ b/html/pages/graph_pbreakdown.php @@ -0,0 +1,137 @@ + $hour_max) $hour_max = $r_ghours['res_count']; + $hour_sum += $r_ghours['res_count']; +} +if ($hour_max == 0) return; + +// Daily Breakdown +// We use WEEKDAY rather then DAYOFWEEK because now the week starts with Monday instead of Sunday +$sql_gdays = "SELECT WEEKDAY(time) AS res_day, COUNT(*) AS res_count +FROM uts_match m, uts_player p WHERE $bgwhere AND m.id = p.matchid GROUP by res_day"; +$q_gdays = mysql_query($sql_gdays) or die(mysql_error()); +$day_max = 0; +$day_sum = 0; +while ($r_gdays = mysql_fetch_array($q_gdays)) { + $gb_day[$r_gdays['res_day']] = $r_gdays['res_count']; + if ($r_gdays['res_count'] > $day_max) $day_max = $r_gdays['res_count']; + $day_sum += $r_gdays['res_count']; +} + +// Monthly Breakdown +$sql_gmonths = "SELECT MONTH(m.time) AS res_month, COUNT(p.id) AS res_count +FROM uts_match m, uts_player p WHERE $bgwhere AND m.id = p.matchid GROUP by res_month"; +$q_gmonths = mysql_query($sql_gmonths) or die(mysql_error()); +$month_max = 0; +$month_sum = 0; +while ($r_gmonths = mysql_fetch_array($q_gmonths)) { + $gb_month[$r_gmonths['res_month']] = $r_gmonths['res_count']; + if ($r_gmonths['res_count'] > $month_max) $month_max = $r_gmonths['res_count']; + $month_sum += $r_gmonths['res_count']; +} + + +echo' + + + + +
+ + + + + + + + + + '; + +// Hourly +for ($i = 0; $i <= 23; $i++) { + if (!isset($gb_hour[$i])) $gb_hour[$i] = 0; + $title = $gb_hour[$i] .' ('. get_dp($gb_hour[$i] / $hour_sum * 100) .' %)'; + echo ''; +} + +echo ''; + +// Daily +for ($i = 0; $i <= 6; $i++) { + if (!isset($gb_day[$i])) $gb_day[$i] = 0; + $title = $gb_day[$i] .' ('. get_dp($gb_day[$i] / $day_sum * 100) .' %)'; + echo ''; +} + +echo ''; + +// Monthly +for ($i = 1; $i <= 12; $i++) { + if (!isset($gb_month[$i])) $gb_month[$i] = 0; + $title = $gb_month[$i] .' ('. get_dp($gb_month[$i] / $month_sum * 100) .' %)'; + echo ''; +} +echo ''; +echo' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hourly, Daily and Monthly Activity '.$gtitle.'
'. $title .''. $title .''. $title .'
01234567891011121314151617181920212223MTWTFSSJFMAMJJASOND
+
+
'; +?> \ No newline at end of file diff --git a/html/pages/help.php b/html/pages/help.php new file mode 100755 index 0000000..fb7a923 --- /dev/null +++ b/html/pages/help.php @@ -0,0 +1,183 @@ + +

Frequently Asked Questions

+ +

+ 1. Stat Tracking Servers
+ 2. Enabling your personal stats tracking
+ 3. Information about how the stats work
+ 4. What are the \'official\' Unreal Tournament gametypes?
+ 5. How does ranking work?
+ 6. Scoring - Individual player points awarded?
+ 7. Team Scores?
+ 8. Glossary - Terms and abbreviations.
+ 9. Enabling Stats on a Server
+

+ +

Stat Tracking Servers

+

UTStats only does stats tracking for servers that have UTStats + installed.
+ To download and get the latest information, please click the forum link to + the left.

+ +

Enabling your personal stats tracking

+

Currently this is not possible, for now you need to use the same + nick for this group of servers.
+ If the server runs UTGL your stats nick always will be the one you registered + with so there are no stats tracking issues on UTGL servers.

+ +

Information about how the stats work

+

A server with stat tracking enabled will send information to the +stats server about the game - each frag, score, etc.  Once the game is +completed the match is processed and posted on the stats pages.  The best +way to look up a recent match you played is either by your stats ID or the +server ID.  You can search for your user ID or the server ID by name. +The user names used on the stats pages are based on the last player name you +used in a match - your stats user name you entered in the networking settings is +not displayed.

+

Bots are not logged, nor are any kills against them.

+
+ +

What are the \'official\' Unreal Tournament gametypes?

+

Out of the box Unreal Tournament features the gametypes +Deathmatch, Team Deathmatch, Capture the Flag, Assault and Domination.
+There are separate rankings for each of the official game types.

+ +

How does ranking work?

+

Ranking points are based on what you do in a game.
+Points are awarded for fragging and events (eg. flag captures).
+Points are deducted for deaths, suicides and teamkills

+Player ranking points are reduced until they have completed 300 minutes of games.

+ +

Scoring - Individual player points award:

+

These depend on the game type you are playing. There are +individual player scores awarded for special achievements, such as captures, +assists, etc.
+See the Score tables on the Players or Matches subpages to find +out how many points are actually awarded for each score type.

+ +

Team Scores?

+

Aside from the individual player scoring in team based gametypes +(CTF, AS, DOM), there are also Team Scores, that are awarded to +your team as a whole, for fulfilling a gametype specific objective:
+

    +
  • Capture the Flag - capturing, covering, killing and returning the flag.
  • +
  • Assault - achieving an objective.
  • +
  • Domination - \'holding\' domination points.
  • +
+Note: A team based game is won by the Team Score; the individual player score +sums do not matter!

+ +


Glossary

+
+ +

Abbreviations

+

Common abbreviations in UTStats.
+- K = Kills, S = Suicides, F = Frags, D = Deaths
+- E = Events, TK = Team Kills, TD = Team Deaths
+- DM = Deathmatch, TDM = Team Deathmatch, CTF = Capture the Flag,
+- AS = Assault, DOM = Domination
+- FPH = Frags per Hour, SPH = Score per Hour
+- [d] = Time in days, [h] = Time in hours,
+- [m],[min] = Time in minutes, [s],[sec] = Time in seconds

+ +

Deaths

+

Number of times a player gets killed by another player.
+- This does not include environment induced deaths, like trap doors. These and +self kills are counted separately, as suicides.
+- Team based deaths are counted as team deaths.
+- In tables with weapon specific information, deaths are the number of times a +player died holding that weapon.

+ +

Dodging

+

Special move in Unreal Tournament, that can be activated by +tapping any movement key twice.  Used by many good players to improve their +maneuverability.

+ +

Efficiency

+

A ratio that denotes the player\'s kill skill by comparing it with +his overall performance.  A perfect efficiency is equal to 1 (100%), +anything less than 0.5 (50%) is below average.
+Formula: Kills / (Kills + Deaths + Suicides [+Team Kills])

+ +

Events

+

Anything not related to frags, deaths, suicides or kills is +hereby defined as an event. Typical events would be a flag capture (score +related) or a flag drop (not score related). Events are mostly used to track all +the other things going on in a game, that are not frag-related.

+ +

First Blood

+

Special event awarded to the player who gets the first kill in a +newly started match.

+ +

Frags

+

A player\'s frag count is equal to their kills minus +suicides.  In team games team kills (not team suicides) are also subtracted +from the player\'s kills.

+ +

Frags Per Hour

+

A ratio between the number of frags a player scores per one +hour.  30 frags in 5 minutes will give you 360 FPH.
+Formula: Frags / (Time played in hours)

+ +

Kills

+

Number of times a player kills another player.
+Note: UTStats only tracks human vs. human kills. Bot kills and other bot +related events are tracked at the admins discretion.

+ +

Multi Kills

+

Special event awarded to the player for killing other players in +a certain time frame.  Every time a player scores a kill he has up to 3 +seconds to make another kill.  So 2 kills in 3 seconds gets you a Double +Kill, 3 kills within 3 seconds apart from another a Multi Kill and so on:
+- Double Kill = 2 kills
+- Multi Kill = 3 kills
+- Ultra Kill = 5 kills
+- Monster Kill = 6 kills

+ +

Ping

+

Measure of your connection quality.  Ping is the round trip +delay in milliseconds that your computer has to the game server.  Low +values are not important for a fun game, but it sure helps.

+ +

Killing Sprees

+

Special event: If you manage to kill 5 or more opponents without +dying yourself, you will be on a killing spree. If you kill more than 10 +opponents, you are on a rampage, etc.:
+- Killing Spree! 5 kills
+- Rampage! 10 kills
+- Dominating! 15 kills
+- Unstoppable! 20 kills
+- God Like! 25 kills

+ +

Suicides

+

Number of times a player dies due to action of their own cause. +Suicides can be environment induced (drowning, getting crushed, falling) or +weapon related (fatal splash damage from their own weapon).

+ +

Team Deaths

+

Number of times a player in a team based game is killed by +someone on their own team.

+ +

Team Kills

+

Number of times a player in a team based game kills someone on +their own team.
+Note: Team kills subtract from a player\'s personal frags and thus the team frags +as a whole.

+ +

TTL

+

TTL is Time to Live.
+Its the length of time you are in a game in seconds divided by how many times you die, +thus giving an average time of how long you will live.

+ +
+ +

Enabling Stats on a Server

+

Download and get the latest information on UTStats by clicking + the forum link to the left.

+ +
+Back to Top +'; +?> \ No newline at end of file diff --git a/html/pages/home.php b/html/pages/home.php new file mode 100755 index 0000000..3cb167d --- /dev/null +++ b/html/pages/home.php @@ -0,0 +1,100 @@ + + + UTStats Summary + + + Players + Servers + Maps + Matches Logged + Player Hours + '; + +// Get Summary Info +$r_playercount = small_query("SELECT COUNT(*) AS result FROM uts_pinfo"); +$playercount = $r_playercount['result']; +$servercount = small_count("SELECT DISTINCT servername FROM uts_match"); +$mapcount = small_count("SELECT COUNT(mapfile) AS result FROM uts_match GROUP BY mapfile"); +$r_matchcount = small_query("SELECT COUNT(*) AS result FROM uts_match"); +$matchcount= $r_matchcount['result']; +$hourscount = small_query("SELECT SUM(gametime) AS result FROM uts_player"); + +$gametime = sec2hour($hourscount[result]); + +echo' + + '.$playercount.' + '.$servercount.' + '.$mapcount.' + '.$matchcount.' + '.$gametime.' + + + + + +
+
+

Welcome to UTStats.
+ Here you can look up information on UT matches and players.
+ Select a category from the column on the left.

+
+ + + + + + + + + + + + + + '; + +$sql_gamesummary = "SELECT g.id AS gid, g.name AS gamename, SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, COUNT(DISTINCT p.matchid) AS matchcount +FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id GROUP BY gamename ORDER BY gamename ASC"; +$q_gamesummary = mysql_query($sql_gamesummary) or die(mysql_error()); +while ($r_gamesummary = mysql_fetch_array($q_gamesummary)) { + + $gid = $r_gamesummary[gid]; + + $q_gametime = small_query("SELECT SUM(gametime) AS gametime FROM uts_match WHERE gid = '$gid'"); + $gametime = sec2hour($q_gametime[gametime]); + + echo' + + + + + + '; +} + +$totalsummary = small_query("SELECT SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, COUNT(DISTINCT p.matchid) AS matchcount, SUM(p.gametime) AS gametime +FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id"); + +$q_gametime = small_query("SELECT SUM(gametime) AS gametime FROM uts_match"); +$gametime = sec2hour($q_gametime[gametime]); + +echo' + + + + + + + + +
Game Summary
Match TypeFragsKillsSuicidesTeam KillsMatchesGame Hours
'.$r_gamesummary[gamename].''.$r_gamesummary[frags].''.$r_gamesummary[kills].''.$r_gamesummary[suicides].''.$r_gamesummary[teamkills].''.$r_gamesummary[matchcount].''.$gametime.'
Totals for All Players'.$totalsummary[frags].''.$totalsummary[kills].''.$totalsummary[suicides].''.$totalsummary[teamkills].''.$totalsummary[matchcount].''.$gametime.'
+

'; + +// Do graph stuff +$gtitle = "Across All Servers"; +$bgwhere = "id >= 0"; +include("pages/graph_mbreakdown.php"); +?> \ No newline at end of file diff --git a/html/pages/index.htm b/html/pages/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/pages/maps.php b/html/pages/maps.php new file mode 100755 index 0000000..409398c --- /dev/null +++ b/html/pages/maps.php @@ -0,0 +1,143 @@ +'); +} + + +// Get filter and set sorting +$filter = my_addslashes($_GET[filter]); +$sort = my_addslashes($_GET[sort]); +$q = my_addslashes($_GET[q]); +$gid = preg_replace('/\D/', '', $_GET[gid]); + +IF (empty($filter) or (!in_array(strtolower($filter), array("mapfile", "matchcount", "frags", "matchscore", "gametime")))) { + $filter = "mapfile"; +} + +if (empty($sort) or ($sort != 'ASC' and $sort != 'DESC')) $sort = ($filter == "mapfile") ? "ASC" : "DESC"; + +if (isset($gid)) { + if ($gid != 0) { + $url_condition .= "&gid=".urlencode($gid); + $sql_condition = " WHERE gid = $gid"; + } +} +else { + $gid = 0; +} + +if (isset($q)) { + if ($gid != 0) { + $sql_condition .= ' AND mapfile LIKE "%' . $q . '%" '; + } + else { + $sql_condition .= ' WHERE mapfile LIKE "%' . $q . '%" '; + } + $url_condition .= "&q=".urlencode($q); +} + + +// Firstly we need to work out First Last Next Prev pages + +$mcount = small_count("SELECT mapfile FROM uts_match" . $sql_condition . " GROUP BY mapfile"); + +$ecount = $mcount/25; +$ecount2 = number_format($ecount, 0, '.', ''); + +IF($ecount > $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = preg_replace('/\D/', '', $_GET["page"]); +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*25; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +echo' +
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + + + + + '; + +$sql_maps = "SELECT IF(RIGHT(mapfile,4) LIKE '.unr', mapfile, CONCAT(mapfile, '.unr')) as mapfile, COUNT(id) AS matchcount, AVG(frags) AS frags, AVG(t0score+t1score+t2score+t3score) AS matchscore, SUM(gametime) AS gametime +FROM uts_match" . $sql_condition . " GROUP BY mapfile ORDER BY $filter $sort LIMIT $qpage,25"; +$q_maps = mysql_query($sql_maps) or die(mysql_error()); +while ($r_maps = mysql_fetch_array($q_maps)) { + + $r_mapfile = un_ut($r_maps[mapfile]); + $myurl = urlencode($r_mapfile); + $r_gametime = GetMinutes($r_maps[gametime]); + + echo' + + + + + + + '; +} + +echo' +
Unreal Tournament Maps List
+ + + + Filter: '; +echo ' '; +echo ' Search: '; +echo ' '; +echo ' +
Map Name'.SortPic('mapfile', $filter, $sort).'Matches'.SortPic('matchcount', $filter, $sort).'Avg. Frags'.SortPic('frags', $filter, $sort).'Avg. Score'.SortPic('matchscore', $filter, $sort).'Time'.SortPic('gametime', $filter, $sort).'
'.$r_mapfile.''.$r_maps[matchcount].''.get_dp($r_maps[frags]).''.get_dp($r_maps[matchscore]).''.$r_gametime.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+
'; +?> \ No newline at end of file diff --git a/html/pages/maps_info.php b/html/pages/maps_info.php new file mode 100755 index 0000000..329fcce --- /dev/null +++ b/html/pages/maps_info.php @@ -0,0 +1,321 @@ + + + Statistics for '.htmlentities($map).' + + + Matches + '.$map_matches[matchcount].' + '.htmlentities($map).' + + + Total Time + '.$map_tottime.' minutes + '; +// Show some gametype specific stuff +if ((strtolower(substr($map, 0, 7)) == "ctf-bt-") or (strtolower(substr($map, 0, 3)) == "bt-")) { + // Bunny Track + $record = small_query("SELECT pi.id, pi.name AS name, pi.country, e.col3 AS time, e.col4 AS date FROM uts_events AS e, uts_pinfo AS pi, uts_player AS p, uts_match AS m WHERE m.id = e.matchid AND m.id = p.matchid AND p.playerid = e.playerid AND pi.id = p.pid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap') AND e.col1 = 'btcap' GROUP BY pi.id ORDER BY (0 + e.col3) ASC, e.col4 ASC LIMIT 0,1"); + if (!empty($record['time'])) { + echo ' + + Fastest Capture + '.FormatPlayerName($record['country'], $record['id'], $record['name']).'
' . btcaptime($record['time']) . ' minutes
'.gmdate('d-m-Y h:i a', $record['date']).' + '; + } + else { + echo ' + + Fastest Capture + No record set! + '; + } + echo ' + + Total Flags Captured + '.$map_matches[gamescore].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +else if (strtolower(substr($map, 0, 4)) == "ctf-") { + // Capture the Flag + $totals = small_query("SELECT SUM(p.flag_taken) as flag_taken, SUM(p.flag_return) AS flag_return, SUM(p.flag_cover) AS flag_cover FROM uts_player AS p, uts_match AS m WHERE m.id = p.matchid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap')"); + echo ' + + Total Flags Captured + '.$map_matches[gamescore].' + + + Total Flags Taken + '.$totals['flag_taken'].' + + + Total Covers + '.$totals['flag_cover'].' + + + Total Flags Returned + '.$totals['flag_return'].' + + + Total Kills + '.$map_matches[kills].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +else if (strtolower(substr($map, 0, 3)) == "as-") { + // Assault + $totals = small_query("SELECT SUM(p.ass_obj) as ass_obj FROM uts_player AS p, uts_match AS m WHERE m.id = p.matchid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap')"); + echo ' + + Total Objectives Achieved + '.$totals[ass_obj].' + + + Total Kills + '.$map_matches[kills].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +else if (strtolower(substr($map, 0, 3)) == "jb-") { + // Assault + $totals = small_query("SELECT SUM(p.ass_obj) as ass_obj FROM uts_player AS p, uts_match AS m WHERE m.id = p.matchid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap')"); + echo ' + + Team Releases + '.$totals[ass_obj].' + + + Total Kills + '.$map_matches[kills].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +else if (strtolower(substr($map, 0, 4)) == "dom-") { + // Assault + $totals = small_query("SELECT SUM(p.dom_cp) as dom_cp FROM uts_player AS p, uts_match AS m WHERE m.id = p.matchid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap')"); + echo ' + + Total Control Points Captured + '.$totals['dom_cp'].' + + + Total Kills + '.$map_matches[kills].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +else { + echo ' + + Total Score + '.$map_matches[gamescore].' + + + Total Kills + '.$map_matches[kills].' + + + Total Teamkills + '.$map_matches[teamkills].' + + + Total Suicides + '.$map_matches[suicides].' + '; +} +echo ' + + Last Match + '.$map_lastmatch.' + + +
'; + +// Do graph stuff +$bgwhere = "(mapfile = '$realmap' or mapfile = '$bugmap')"; +include("pages/graph_mbreakdown.php"); + +// Show a list of BT records +if ((strtolower(substr($map, 0, 7)) == "ctf-bt-") or (strtolower(substr($map, 0, 3)) == "bt-")) { + $mcount = small_count("SELECT pi.id FROM uts_events AS e, uts_pinfo AS pi, uts_player AS p, uts_match AS m WHERE m.id = e.matchid AND m.id = p.matchid AND p.playerid = e.playerid AND pi.id = p.pid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap') GROUP BY pi.id"); + + $ecount = $mcount/25; + $ecount2 = number_format($ecount, 0, '.', ''); + + IF($ecount > $ecount2) { + $ecount2 = $ecount2+1; + } + + $fpage = 0; + IF($ecount < 1) { $lpage = 0; } + else { $lpage = $ecount2-1; } + + $cpage = preg_replace('/\D/', '', $_GET["rpage"]); + $qpage = $cpage*25; + + IF ($cpage == "") { $cpage = "0"; } + + $tfpage = $cpage+1; + $tlpage = $lpage+1; + + $ppage = $cpage-1; + $ppageurl = "[Previous]"; + IF ($ppage < "0") { $ppageurl = "[Previous]"; } + + $npage = $cpage+1; + $npageurl = "[Next]"; + IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + + $fpageurl = "[First]"; + IF ($cpage == "0") { $fpageurl = "[First]"; } + + $lpageurl = "[Last]"; + IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + + $sql_btrecords = "SELECT pi.id, pi.name AS name, pi.country, e.col3 AS time, e.col4 AS date FROM uts_events AS e, uts_pinfo AS pi, uts_player AS p, uts_match AS m WHERE m.id = e.matchid AND m.id = p.matchid AND p.playerid = e.playerid AND pi.id = p.pid AND (m.mapfile = '$realmap' OR m.mapfile = '$bugmap') AND e.col1 = 'btcap' GROUP BY pi.id ORDER BY (0 + e.col3) ASC, e.col4 ASC LIMIT $qpage,25"; + $q_btrecords = mysql_query($sql_btrecords) or die (mysql_error()); + if (mysql_num_rows($q_btrecords) > 0) { + echo ' +
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + + '; + $i = $qpage; + $lasttime = -1; + while ($r_btrecords = mysql_fetch_array($q_btrecords)) { + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + echo ' + + + + '; + $lasttime = $r_btrecords['time']; + } + echo ' + +
Fastest captures
NameTimeDate
'.($lasttime == $r_btrecords['time'] ? '' : $i).' ', FormatPlayerName($r_btrecords['country'], $r_btrecords['id'], $r_btrecords['name']), '', btcaptime($r_btrecords['time']), '', gmdate('d-m-Y h:i a', $r_btrecords['date']), '
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'

'; + } +} + + + +// Show a list of recent matches +$mcount = small_count("SELECT id FROM uts_match WHERE mapfile = '$realmap' OR mapfile = '$bugmap' GROUP BY id"); + +$ecount = $mcount/25; +$ecount2 = number_format($ecount, 0, '.', ''); + +IF($ecount > $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = preg_replace('/\D/', '', $_GET["page"]); +$qpage = $cpage*25; + +IF ($cpage == "") { $cpage = "0"; } + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +// list recent matches +echo' +
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + '; + +$sql_maps = "SELECT m.id, m.time, g.name AS gamename, m.gametime +FROM uts_match AS m, uts_games AS g WHERE (m.mapfile = '$realmap' OR m.mapfile = '$bugmap') AND m.gid = g.id ORDER BY time DESC LIMIT $qpage,25"; +$q_maps = mysql_query($sql_maps) or die(mysql_error()); +while ($r_maps = mysql_fetch_array($q_maps)) { + + $r_mapfile = un_ut($r_maps[mapfile]); + $r_matchtime = mdate($r_maps[time]); + $r_gametime = GetMinutes($r_maps[gametime]); + + $map_pcount = small_count("SELECT id FROM uts_player WHERE matchid = $r_maps[id]"); + + echo' + + + + + + '; +} + +echo' +
Recent Matches
DateMatch TypePlayer CountTime
'.$r_matchtime.''.$r_maps[gamename].''.$map_pcount.''.$r_gametime.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
'; +?> diff --git a/html/pages/match.php b/html/pages/match.php new file mode 100755 index 0000000..22a0399 --- /dev/null +++ b/html/pages/match.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/html/pages/match_info.php b/html/pages/match_info.php new file mode 100755 index 0000000..27b6669 --- /dev/null +++ b/html/pages/match_info.php @@ -0,0 +1,78 @@ + + + Unreal Tournament Match + + +
'; +include("pages/match_info_server.php"); + +$GLOBALS['gid'] = $gid; +$_GLOBALS['gid'] = $gid; +$GLOBALS['gamename'] = $gamename; +$_GLOBALS['gamename'] = $gamename; + +include('includes/teamstats.php'); +switch($real_gamename) { + case "Assault": + case "Assault (insta)": + include("pages/match_info_ass.php"); + break; + + case "Capture the Flag": + case "Capture the Flag (insta)": + include("pages/match_info_ctf.php"); + teamstats($mid, 'Match Summary'); + break; + + case "Domination": + case "Domination (insta)": + teamstats($mid, 'Match Summary', 'dom_cp', 'Dom Pts'); + break; + + case "JailBreak": + case "JailBreak (insta)": + teamstats($mid, 'Match Summary', 'ass_obj', 'Team Releases'); + break; + + case "Bunny Track": + include("pages/match_info_bt.php"); + break; + + case "Extended Last Man Standing": + case "Extended Last Man Standing (insta)": + case "Last Man Standing": + case "Last Man Standing (insta)": + case "Last Man Standing +": + case "Last Man Standing + (insta)": + case "Last Man Standing++": + case "Last Man Standing++ (insta)": + include("pages/match_info_lms.php"); + break; + + default: + if ($teamgame) { + teamstats($mid, 'Match Summary'); + } else { + teamstats($mid, 'Player Summary'); + } +} + + +if ($real_gamename == "Assault" or $real_gamename== "Assault (insta)") { + include("pages/match_info_other2.php"); +} +else if ($real_gamename != "Bunny Track") { + include("pages/match_info_other.php"); +} + +if ($real_gamename == "Capture the Flag" or $real_gamename== "Capture the Flag (insta)") { + include("pages/match_report.php"); +} + +?> \ No newline at end of file diff --git a/html/pages/match_info_ass.php b/html/pages/match_info_ass.php new file mode 100755 index 0000000..df968ec --- /dev/null +++ b/html/pages/match_info_ass.php @@ -0,0 +1,64 @@ + + + '.$asswin.' + + +
'; + +// The Other Game (if it happened) + +IF($mid2 != NULL) { + teamstats($mid2, 'Match Summary - '.$ass_att2.' Team Attacking', 'ass_obj', 'Ass Obj'); + + echo' + + + + +
'.$asswin2.'
+
'; +} +?> diff --git a/html/pages/match_info_bt.php b/html/pages/match_info_bt.php new file mode 100755 index 0000000..ed14e3d --- /dev/null +++ b/html/pages/match_info_bt.php @@ -0,0 +1,164 @@ + + + Game Summary + + + Team: Red + + + Player + Time + Score + Flag Captures + Fastest Capture + Suicides + + + Team + Player + '; + +$sql_msred = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.gametime, p.flag_capture, p.suicides, p.rank, MIN(e.col3) AS captime + FROM uts_pinfo AS pi, uts_player AS p + LEFT JOIN uts_events AS e + ON p.playerid = e.playerid AND p.matchid = e.matchid AND e.col1 = 'btcap' + WHERE p.pid = pi.id AND p.matchid = $mid AND team = 0 + GROUP BY p.playerid + ORDER BY e.col1 DESC, (0 + e.col3) ASC, gamescore DESC"; +$q_msred = mysql_query($sql_msred) or die(mysql_error()); +$i = 0; +while ($r_msred = zero_out(mysql_fetch_array($q_msred))) { + if (!$r_msred['playerid']) { + $r_msred['playerid'] = 0; + } + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $redpname = $r_msred[name]; + $myurl = urlencode($r_msred[name]); + + + + echo''; + if ($r_msred['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msred[country], $r_msred['pid'], $redpname, $gid, $gamename, true, $r_msred['rank']).''; + } else { + $r_msred ['gamescore'] = '-'; + $r_msred ['suicides'] = '-'; + $r_msred ['flag_capture'] = '-'; + echo ''.FormatPlayerName($r_msred[country], $r_msred['pid'], $redpname, $gid, $gamename, true, $r_msred['rank']).''; + } + + echo ' + '.GetMinutes($r_msred[gametime]).' + + '.$r_msred[gamescore].' + '.$r_msred[flag_capture].' + '.btcaptime($r_msred[captime]).' + '.$r_msred[suicides].' + '; +} + +$teamscore = small_query("SELECT t0score AS teamscore FROM uts_match WHERE id = $mid"); +$msredtot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(suicides) AS suicides, SUM(flag_capture) AS flag_capture FROM uts_player WHERE matchid = $mid AND team = 0 ORDER BY gamescore DESC"); + + +echo' + + Totals + + '.$teamscore[teamscore].' + '.$msredtot[gamescore].' + '.$msredtot[flag_capture].' + + '.$msredtot[suicides].' + '; + +echo' + + Team: Blue + + + Player + Time + Score + Flag Captures + Fastest Capture + Suicides + + + Team + Player + '; + +$sql_msblue = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.gametime, p.flag_capture, p.suicides, p.rank, MIN(e.col3) AS captime + FROM uts_pinfo AS pi, uts_player AS p + LEFT JOIN uts_events AS e + ON p.playerid = e.playerid AND p.matchid = e.matchid AND e.col1 = 'btcap' + WHERE p.pid = pi.id AND p.matchid = $mid AND team = 1 + GROUP BY p.playerid + ORDER BY e.col1 DESC, (0 + e.col3) ASC, gamescore DESC"; +$q_msblue = mysql_query($sql_msblue) or die(mysql_error()); +$i = 0; +while ($r_msblue = zero_out(mysql_fetch_array($q_msblue))) { + if (!$r_msblue['playerid']) { + $r_msblue['playerid'] = 0; + } + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $bluepname = $r_msblue[name]; + $myurl = urlencode($r_msblue[name]); + + + + echo''; + if ($r_msblue['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msblue[country], $r_msblue['pid'], $bluepname, $gid, $gamename, true, $r_msblue['rank']).''; + } else { + $r_msblue ['gamescore'] = '-'; + $r_msblue ['suicides'] = '-'; + $r_msblue ['flag_capture'] = '-'; + echo ''.FormatPlayerName($r_msblue[country], $r_msblue['pid'], $bluepname, $gid, $gamename, true, $r_msblue['rank']).''; + } + + echo ' + '.GetMinutes($r_msblue[gametime]).' + + '.$r_msblue[gamescore].' + '.$r_msblue[flag_capture].' + '.btcaptime($r_msblue[captime]).' + '.$r_msblue[suicides].' + '; +} + +$teamscore = small_query("SELECT t1score AS teamscore FROM uts_match WHERE id = $mid"); +$msbluetot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(suicides) AS suicides, SUM(flag_capture) AS flag_capture FROM uts_player WHERE matchid = $mid AND team = 1 ORDER BY gamescore DESC"); + + +echo' + + Totals + + '.$teamscore[teamscore].' + '.$msbluetot[gamescore].' + '.$msbluetot[flag_capture].' + + '.$msbluetot[suicides].' + '; + + +echo' +
'; + +?> diff --git a/html/pages/match_info_ctf.php b/html/pages/match_info_ctf.php new file mode 100755 index 0000000..7426a4e --- /dev/null +++ b/html/pages/match_info_ctf.php @@ -0,0 +1,362 @@ + + + Flag Event Summary + + + Team: Red + + + Player + Score + Flag Taken + Flag Pickup + Flag Drop + Flag Assist + Flag Cover + Flag Seal + Flag Capture + Flag Kill + Flag Return + + + Team + Player + '; + +$sql_msred = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.flag_taken, p.flag_pickedup, p.flag_dropped, p.flag_assist, p.flag_cover, p.flag_seal, p.flag_capture, p.flag_kill, p.flag_return, p.rank +FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid AND team = 0 ORDER BY gamescore DESC"; +$q_msred = mysql_query($sql_msred) or die(mysql_error()); +$i = 0; +while ($r_msred = zero_out(mysql_fetch_array($q_msred))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $redpname = $r_msred[name]; + $myurl = urlencode($r_msred[name]); + + + + echo''; + if ($r_msred['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msred[country], $r_msred['pid'], $redpname, $gid, $gamename, true, $r_msred['rank']).''; + } else { + $r_msred ['gamescore'] = '-'; + $r_msred ['flag_taken'] = '-'; + $r_msred ['flag_pickedup'] = '-'; + $r_msred ['flag_dropped'] = '-'; + $r_msred ['flag_assist'] = '-'; + $r_msred ['flag_cover'] = '-'; + $r_msred ['flag_seal'] = '-'; + $r_msred ['flag_capture'] = '-'; + $r_msred ['flag_kill'] = '-'; + $r_msred ['flag_return'] = '-'; + echo ''.FormatPlayerName($r_msred[country], $r_msred['pid'], $redpname, $gid, $gamename, true, $r_msred['rank']).''; + } + + echo ' + + '.$r_msred[gamescore].' + '.$r_msred[flag_taken].' + '.$r_msred[flag_pickedup].' + '.$r_msred[flag_dropped].' + '.$r_msred[flag_assist].' + '.$r_msred[flag_cover].' + '.$r_msred[flag_seal].' + '.$r_msred[flag_capture].' + '.$r_msred[flag_kill].' + '.$r_msred[flag_return].' + '; +} + +$teamscore = small_query("SELECT t0score AS teamscore FROM uts_match WHERE id = $mid"); +$msredtot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(flag_taken) AS flag_taken, SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, SUM(flag_return) AS flag_return +FROM uts_player WHERE matchid = $mid AND team = 0 ORDER BY gamescore DESC"); + + +echo' + + Totals + '.$teamscore[teamscore].' + '.$msredtot[gamescore].' + '.$msredtot[flag_taken].' + '.$msredtot[flag_pickedup].' + '.$msredtot[flag_dropped].' + '.$msredtot[flag_assist].' + '.$msredtot[flag_cover].' + '.$msredtot[flag_seal].' + '.$msredtot[flag_capture].' + '.$msredtot[flag_kill].' + '.$msredtot[flag_return].' + + + + + Team: Blue + + + Player + Score + Flag Taken + Flag Pickup + Flag Drop + Flag Assist + Flag Cover + Flag Seal + Flag Capture + Flag Kill + Flag Return + + + Team + Player + '; + +$sql_msblue = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.flag_taken, p.flag_pickedup, p.flag_dropped, p.flag_assist, p.flag_cover, p.flag_seal, p.flag_capture, p.flag_kill, p.flag_return, p.rank +FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid AND team = 1 ORDER BY gamescore DESC"; +$q_msblue = mysql_query($sql_msblue) or die(mysql_error()); +$i = 0; +while ($r_msblue = zero_out(mysql_fetch_array($q_msblue))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $bluepname = $r_msblue[name]; + $myurl = urlencode($r_msblue[name]); + + echo''; + if ($r_msblue['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msblue[country], $r_msblue['pid'], $bluepname, $gid, $gamename, true, $r_msblue['rank']).''; + } else { + $r_msblue ['gamescore'] = '-'; + $r_msblue ['flag_taken'] = '-'; + $r_msblue ['flag_pickedup'] = '-'; + $r_msblue ['flag_dropped'] = '-'; + $r_msblue ['flag_assist'] = '-'; + $r_msblue ['flag_cover'] = '-'; + $r_msblue ['flag_seal'] = '-'; + $r_msblue ['flag_capture'] = '-'; + $r_msblue ['flag_kill'] = '-'; + $r_msblue ['flag_return'] = '-'; + echo ''.FormatPlayerName($r_msblue[country], $r_msblue['pid'], $bluepname, $gid, $gamename, true, $r_msblue['rank']).''; + } + + echo ' + + '.$r_msblue[gamescore].' + '.$r_msblue[flag_taken].' + '.$r_msblue[flag_pickedup].' + '.$r_msblue[flag_dropped].' + '.$r_msblue[flag_assist].' + '.$r_msblue[flag_cover].' + '.$r_msblue[flag_seal].' + '.$r_msblue[flag_capture].' + '.$r_msblue[flag_kill].' + '.$r_msblue[flag_return].' + '; +} + +$teamscore = small_query("SELECT t1score AS teamscore FROM uts_match WHERE id = $mid"); +$msbluetot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(flag_taken) AS flag_taken, SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, SUM(flag_return) AS flag_return +FROM uts_player WHERE matchid = $mid AND team = 1 ORDER BY gamescore DESC"); + +echo' + + Totals + '.$teamscore[teamscore].' + '.$msbluetot[gamescore].' + '.$msbluetot[flag_taken].' + '.$msbluetot[flag_pickedup].' + '.$msbluetot[flag_dropped].' + '.$msbluetot[flag_assist].' + '.$msbluetot[flag_cover].' + '.$msbluetot[flag_seal].' + '.$msbluetot[flag_capture].' + '.$msbluetot[flag_kill].' + '.$msbluetot[flag_return].' + '; + +// Check If Green Team Were Used (CTF4 Compatibility) + +$greencheck = small_count("SELECT * FROM uts_player WHERE matchid = $mid AND team = 2"); +IF ($greencheck > 0) { + + echo' + Team: Green + + + Player + Score + Flag Taken + Flag Pickup + Flag Drop + Flag Assist + Flag Cover + Flag Seal + Flag Capture + Flag Kill + Flag Return + + + Team + Player + '; + + $sql_msgreen = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.flag_taken, p.flag_pickedup, p.flag_dropped, p.flag_assist, p.flag_cover, p.flag_seal, p.flag_capture, p.flag_kill, p.flag_return, p.rank + FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid AND team = 2 ORDER BY gamescore DESC"; + $q_msgreen = mysql_query($sql_msgreen) or die(mysql_error()); + $i = 0; + while ($r_msgreen = zero_out(mysql_fetch_array($q_msgreen))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $greenpname = $r_msgreen[name]; + $myurl = urlencode($r_msgreen[name]); + + echo''; + if ($r_msgreen['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msgreen[country], $r_msgreen['pid'], $greenpname, $gid, $gamename, true, $r_msgreen['rank']).''; + } else { + $r_msgreen ['gamescore'] = '-'; + $r_msgreen ['flag_taken'] = '-'; + $r_msgreen ['flag_pickedup'] = '-'; + $r_msgreen ['flag_dropped'] = '-'; + $r_msgreen ['flag_assist'] = '-'; + $r_msgreen ['flag_cover'] = '-'; + $r_msgreen ['flag_seal'] = '-'; + $r_msgreen ['flag_capture'] = '-'; + $r_msgreen ['flag_kill'] = '-'; + $r_msgreen ['flag_return'] = '-'; + echo ''.FormatPlayerName($r_msgreen[country], $r_msgreen['pid'], $greenpname, $gid, $gamename, true, $r_msgreen['rank']).''; + } + + echo ' + + '.$r_msgreen[gamescore].' + '.$r_msgreen[flag_taken].' + '.$r_msgreen[flag_pickedup].' + '.$r_msgreen[flag_dropped].' + '.$r_msgreen[flag_assist].' + '.$r_msgreen[flag_cover].' + '.$r_msgreen[flag_seal].' + '.$r_msgreen[flag_capture].' + '.$r_msgreen[flag_kill].' + '.$r_msgreen[flag_return].' + '; + } + + $teamscore = small_query("SELECT t1score AS teamscore FROM uts_match WHERE id = $mid"); + $msgreentot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(flag_taken) AS flag_taken, SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, SUM(flag_return) AS flag_return + FROM uts_player WHERE matchid = $mid AND team = 2 ORDER BY gamescore DESC"); + + echo' + + Totals + '.$teamscore[teamscore].' + '.$msgreentot[gamescore].' + '.$msgreentot[flag_taken].' + '.$msgreentot[flag_pickedup].' + '.$msgreentot[flag_dropped].' + '.$msgreentot[flag_assist].' + '.$msgreentot[flag_cover].' + '.$msgreentot[flag_seal].' + '.$msgreentot[flag_capture].' + '.$msgreentot[flag_kill].' + '.$msgreentot[flag_return].' + '; +} + +// Check If Gold Team Were Used (CTF4 Compatibility) + +$goldcheck = small_count("SELECT * FROM uts_player WHERE matchid = $mid AND team = 3"); +IF ($goldcheck > 0) { + + echo' + Team: Gold + + + Player + Score + Flag Taken + Flag Pickup + Flag Drop + Flag Assist + Flag Cover + Flag Seal + Flag Capture + Flag Kill + Flag Return + + + Team + Player + '; + + $sql_msgold = "SELECT p.playerid, pi.name, pi.banned, p.country, p.pid, p.gamescore, p.flag_taken, p.flag_pickedup, p.flag_dropped, p.flag_assist, p.flag_cover, p.flag_seal, p.flag_capture, p.flag_kill, p.flag_return, p.rank + FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $mid AND team = 3 ORDER BY gamescore DESC"; + $q_msgold = mysql_query($sql_msgold) or die(mysql_error()); + $i = 0; + while ($r_msgold = zero_out(mysql_fetch_array($q_msgold))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $goldpname = $r_msgold[name]; + $myurl = urlencode($r_msgold[name]); + + echo''; + if ($r_msgold['banned'] != 'Y') { + echo ''.FormatPlayerName($r_msgold[country], $r_msgold['pid'], $goldpname, $gid, $gamename, true, $r_msgold['rank']).''; + } else { + $r_msgold ['gamescore'] = '-'; + $r_msgold ['flag_taken'] = '-'; + $r_msgold ['flag_pickedup'] = '-'; + $r_msgold ['flag_dropped'] = '-'; + $r_msgold ['flag_assist'] = '-'; + $r_msgold ['flag_cover'] = '-'; + $r_msgold ['flag_seal'] = '-'; + $r_msgold ['flag_capture'] = '-'; + $r_msgold ['flag_kill'] = '-'; + $r_msgold ['flag_return'] = '-'; + echo ''.FormatPlayerName($r_msgold[country], $r_msgold['pid'], $goldpname, $gid, $gamename, true, $r_msgold['rank']).''; + } + + echo ' + + '.$r_msgold[gamescore].' + '.$r_msgold[flag_taken].' + '.$r_msgold[flag_pickedup].' + '.$r_msgold[flag_dropped].' + '.$r_msgold[flag_assist].' + '.$r_msgold[flag_cover].' + '.$r_msgold[flag_seal].' + '.$r_msgold[flag_capture].' + '.$r_msgold[flag_kill].' + '.$r_msgold[flag_return].' + '; + } + + $teamscore = small_query("SELECT t1score AS teamscore FROM uts_match WHERE id = $mid"); + $msgoldtot = small_query("SELECT SUM(gamescore) AS gamescore, SUM(flag_taken) AS flag_taken, SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, SUM(flag_return) AS flag_return + FROM uts_player WHERE matchid = $mid AND team = 3 ORDER BY gamescore DESC"); + + echo' + + Totals + '.$teamscore[teamscore].' + '.$msgoldtot[gamescore].' + '.$msgoldtot[flag_taken].' + '.$msgoldtot[flag_pickedup].' + '.$msgoldtot[flag_dropped].' + '.$msgoldtot[flag_assist].' + '.$msgoldtot[flag_cover].' + '.$msgoldtot[flag_seal].' + '.$msgoldtot[flag_capture].' + '.$msgoldtot[flag_kill].' + '.$msgoldtot[flag_return].' + '; +} + +echo' +
'; + +?> diff --git a/html/pages/match_info_killsmatrix.php b/html/pages/match_info_killsmatrix.php new file mode 100755 index 0000000..be16905 --- /dev/null +++ b/html/pages/match_info_killsmatrix.php @@ -0,0 +1,131 @@ +'; + } + return($ret); +} + +// Retrieve the killmatrix +$sql_km = " SELECT killer, + victim, + kills + FROM uts_killsmatrix + WHERE matchid = $mid;"; + +$q_km = mysql_query($sql_km) or die(mysql_error()); +while ($r_km = mysql_fetch_array($q_km)) { + $km[intval($r_km['killer'])][intval($r_km['victim'])] = $r_km['kills']; +} + +// No matrix: bye +if (!isset($km)) return; + +// Are we processing a teamgame? +$qm_teamgame = small_query("SELECT teamgame FROM uts_match WHERE id = '$mid';"); +$teamgame = $qm_teamgame['teamgame']; +$teamgame = ($teamgame == 'False') ? false : true; + +// Get the players of this match +$sql_players = " SELECT p.pid, + p.playerid, + pi.name, + pi.country, + pi.banned, + p.team, + p.suicides + FROM uts_player p, + uts_pinfo pi + WHERE (p.pid = pi.id) + AND matchid = '$mid' + ORDER BY team ASC, + gamescore DESC;"; +$q_players = mysql_query($sql_players) or die(mysql_error()); +while ($r_players = mysql_fetch_array($q_players)) { + $players[intval($r_players['playerid'])] = array( 'pid' => $r_players['pid'], + 'name' => $r_players['name'], + 'country' => $r_players['country'], + 'banned' => $r_players['banned'], + 'suicides' => intval($r_players['suicides']), + 'team' => intval($r_players['team'])); +} + + +// Table header +$extra = $teamgame ? 3 : 2; +echo ' + + + + + + + + '; + +// Victims +foreach($players as $player) { + + + echo ''; +} +echo ''; + +// Team colors victims +if ($teamgame) { + foreach($players as $player) { + switch($player['team']) { + case 0: $teamcolor = 'redteam'; break; + case 1: $teamcolor = 'blueteam'; break; + case 2: $teamcolor = 'greenteam'; break; + case 3: $teamcolor = 'goldteam'; break; + } + echo ''; + } + echo ''; +} + +// Killer rows +$first = true; +$i = 0; +foreach($players as $kid => $killer) { + if ($killer['banned'] == 'Y') continue; + $i++; + echo ''; + if ($first) echo''; + echo ''; + if ($teamgame) { + switch($killer['team']) { + case 0: $teamcolor = 'redteam'; break; + case 1: $teamcolor = 'blueteam'; break; + case 2: $teamcolor = 'greenteam'; break; + case 3: $teamcolor = 'goldteam'; break; + } + echo ''; + } + foreach($players as $vid => $victim) { + $class = ($kid == $vid) ? 'darkgrey' : 'grey'; + //if ($i % 2) $class .= '2'; + echo ''; + } + + $first = false; +} + +echo '
Kills Match Up
 Victim
+ '. + PrintVertical($player['name']) . + '
+  
K
i
l
l
e
r
'; + echo ''. + FormatPlayerName($killer['country'], $killer['pid'], $killer['name'], $gid, $gamename) .'  '; + if ($kid == $vid) { + $val = ($killer['suicides'] != 0) ? $killer['suicides'] : ' '; + } else { + $val = (isset($km[$kid][$vid])) ? $km[$kid][$vid] : ' '; + } + echo $val .'

'; +?> \ No newline at end of file diff --git a/html/pages/match_info_lms.php b/html/pages/match_info_lms.php new file mode 100755 index 0000000..1c6aa05 --- /dev/null +++ b/html/pages/match_info_lms.php @@ -0,0 +1,144 @@ + + + Player Summary + '; + + + $sql_players = "SELECT pi.name, pi.banned, p.playerid, p.pid, p.team, p.country, p.gametime, p.gamescore, p.frags, p.deaths, p.suicides, p.teamkills, p.eff, p.accuracy, p.ttl, p.rank, MAX(e.col2) + FROM uts_pinfo AS pi, uts_player AS p + LEFT JOIN uts_events AS e + ON p.playerid = e.playerid AND p.matchid = e.matchid AND e.col1 = 'out' AND p.gamescore = 0 + WHERE p.pid = pi.id AND p.matchid = $mid + GROUP BY p.playerid + ORDER BY p.gamescore DESC, (0+e.col2) DESC"; + + $q_players = mysql_query($sql_players) or die(mysql_error()); + $header = true; + + $totals['gamescore'] = 0; + if ($extra) $totals[$extra] = 0; + $totals['frags'] = 0; + $totals['kills'] = 0; + $totals['deaths'] = 0; + $totals['suicides'] = 0; + $totals['teamkills'] = 0; + $totals['eff'] = 0; + $totals['acc'] = 0; + $totals['ttl'] = 0; + $num = 0; + + while ($r_players = zero_out(mysql_fetch_array($q_players))) { + if ($header) { + $header = false; + echo ' + + Player + Time + Score + Out + F + K + D + S'; + if ($teams) echo 'TK'; + echo ' + Eff. + Acc. + Avg TTL + '; + } + + $eff = get_dp($r_players['eff']); + $acc = get_dp($r_players['accuracy']); + $ttl = GetMinutes($r_players['ttl']); + $kills = $r_players['frags'] + $r_players['suicides']; + $pname = $r_players['name']; + + $totals['gamescore'] += $r_players['gamescore']; + if ($extra) $totals[$extra] += $r_players[$extra]; + $totals['frags'] += $r_players['frags']; + $totals['kills'] += $kills; + $totals['deaths'] += $r_players['deaths']; + $totals['suicides'] += $r_players['suicides']; + $totals['teamkills'] += $r_players['teamkills']; + $totals['eff'] += $r_players['eff']; + $totals['acc'] += $r_players['accuracy']; + $totals['ttl'] += $r_players['ttl']; + $num++; + + if ($r_players['banned'] == 'Y') { + $eff = '-'; + $acc = '-'; + $ttl = '-'; + $kills = '-'; + $r_players['gamescore'] = '-'; + $r_players[$extra] = '-'; + $r_players['frags'] = '-'; + $r_players['deaths'] = '-'; + $r_players['suicides'] = '-'; + $r_players['teamkills'] = '-'; + } + + + $class = ($num % 2) ? 'grey' : 'grey2'; + echo ''; + if ($r_players['banned'] != 'Y') { + echo ''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''; + } else { + echo ''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''; + } + echo ''.GetMinutes($r_players[gametime]).''; + echo ''.$r_players[gamescore].''; + echo ''.(empty($r_players['MAX(e.col2)']) ? '' : GetMinutes($r_players['MAX(e.col2)'])).''; + + echo ''.$r_players[frags].''; + echo ''.$kills.''; + echo ''.$r_players[deaths].''; + echo ''.$r_players[suicides].''; + + echo ''.$eff.''; + echo ''.$acc.''; + echo ''.$ttl.''; + echo ''; + } + if ($num == 0) $num = 1; + $eff = get_dp($totals['eff'] / $num); + $acc = get_dp($totals['acc'] / $num); + $ttl = GetMinutes($totals['ttl'] / $num); + + + echo ''; + echo 'Totals'; + echo ''; + echo ''.$totals[gamescore].''; + echo ''; + echo ''.$totals[frags].''; + echo ''.$totals[kills].''; + echo ''.$totals[deaths].''; + echo ''.$totals[suicides].''; + + if ($teams) echo ''.$totals[teamkills].''; + + echo ''.$eff.''; + echo ''.$acc.''; + echo ''.$ttl.''; + echo ''; + echo '
'; diff --git a/html/pages/match_info_other.php b/html/pages/match_info_other.php new file mode 100755 index 0000000..d0a3527 --- /dev/null +++ b/html/pages/match_info_other.php @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + '; +$sql_firstblood = small_query("SELECT firstblood FROM uts_match WHERE id = $mid"); +$sql_multis = "SELECT p.pid, pi.name, p.country, SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, +SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster, +SUM(spree_kill) AS spree_kill, SUM(spree_rampage) AS spree_rampage, SUM(spree_dom) AS spree_dom, +SUM(spree_uns) AS spree_uns, SUM(spree_god) AS spree_god +FROM uts_player as p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND matchid = $mid GROUP BY pid ORDER BY name ASC"; +$q_multis = mysql_query($sql_multis) or die(mysql_error()); +$i = 0; +while ($r_multis = zero_out(mysql_fetch_array($q_multis))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + $r_pname = $r_multis[name]; + $myurl = urlencode($r_pname); + + echo' + + + + + + + + + + + + + '; +} + +// No items in insta matches or lms +if ((strpos($gamename, '(insta)') === false) && (strpos($gamename, "Last Man Standing") === false)) { + echo'
Special Events
PlayerFirst BloodMultisSprees
DblMultiUltraMonsKillRamDomUnsGod
'.FormatPlayerName($r_multis[country], $r_multis[pid], $r_pname, $gid, $gamename).'', ($sql_firstblood['firstblood'] == $r_multis['pid'] ? "Yes": ""), ''.$r_multis[spree_double].''.$r_multis[spree_multi].''.$r_multis[spree_ultra].''.$r_multis[spree_monster].''.$r_multis[spree_kill].''.$r_multis[spree_rampage].''.$r_multis[spree_dom].''.$r_multis[spree_uns].''.$r_multis[spree_god].'

+ + + + + + + + + + + + + '; + + $sql_pickups = "SELECT p.pid, pi.name, p.country, SUM(p.pu_pads) AS pu_pads, SUM(p.pu_armour) AS pu_armour, SUM(p.pu_keg) AS pu_keg, + SUM(p.pu_invis) AS pu_invis, SUM(p.pu_belt) AS pu_belt, SUM(p.pu_amp) AS pu_amp + FROM uts_player as p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND matchid = $mid GROUP BY pid ORDER BY name ASC"; + $q_pickups = mysql_query($sql_pickups) or die(mysql_error()); + $i = 0; + while ($r_pickups = zero_out(mysql_fetch_array($q_pickups))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + $r_pname = $r_pickups[name]; + $myurl = urlencode($r_pname); + + echo' + + + + + + + + + '; + } +} +echo'
Pickups Summary
PlayerPadsArmourKegInvisibilityShield
Belt
Damage Amp
'.FormatPlayerName($r_pickups[country], $r_pickups[pid], $r_pname, $gid, $gamename).''.$r_pickups[pu_pads].''.$r_pickups[pu_armour].''.$r_pickups[pu_keg].''.$r_pickups[pu_invis].''.$r_pickups[pu_belt].''.$r_pickups[pu_amp].'
'; + +/* $sql_firstblood = small_query("SELECT pi.name, pi.country, m.firstblood FROM uts_match AS m, uts_pinfo AS pi WHERE m.firstblood = pi.id AND m.id = $mid"); +if (!$sql_firstblood) $sql_firstblood = array('country' => '', 'name' => '(unknown)', 'firstblood' => NULL); + +echo' +
+ + + + + + + + +
First Blood
'.FormatPlayerName($sql_firstblood[country], $sql_firstblood[firstblood], $sql_firstblood[name], $gid, $gamename).'
'; */ +?> diff --git a/html/pages/match_info_other2.php b/html/pages/match_info_other2.php new file mode 100755 index 0000000..1f72fdd --- /dev/null +++ b/html/pages/match_info_other2.php @@ -0,0 +1,143 @@ +'; + weaponstats($mid2, 0, 'Weapons Summary - '.$ass_att2.' Attacking'); +} + +echo' +
+ + + + + + + + + + + + + '; + +$sql_pickups = "SELECT p.pid, pi.name, p.country, SUM(p.pu_pads) AS pu_pads, SUM(p.pu_armour) AS pu_armour, SUM(p.pu_keg) AS pu_keg, +SUM(p.pu_invis) AS pu_invis, SUM(p.pu_belt) AS pu_belt, SUM(p.pu_amp) AS pu_amp +FROM uts_player as p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND matchid = $mid GROUP BY pid ORDER BY name ASC"; +$q_pickups = mysql_query($sql_pickups) or die(mysql_error()); +$i = 0; +while ($r_pickups = zero_out(mysql_fetch_array($q_pickups))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $r_pname = $r_pickups[name]; + $myurl = urlencode($r_pname); + + echo' + + + + + + + + + '; +} + +IF($mid2 == NULL) { +} else { + echo'
Pickups Summary - '.$ass_att.' Attacking
PlayerPadsArmourKegInvisibilityShield BeltDamage Amp
'.FormatPlayerName($r_pickups[country], $r_pickups[pid], $r_pname, $gid, $gamename).''.$r_pickups[pu_pads].''.$r_pickups[pu_armour].''.$r_pickups[pu_keg].''.$r_pickups[pu_invis].''.$r_pickups[pu_belt].''.$r_pickups[pu_amp].'
+
+ + + + + + + + + + + + + '; + + $sql_pickups = "SELECT p.pid, pi.name, p.country, SUM(p.pu_pads) AS pu_pads, SUM(p.pu_armour) AS pu_armour, SUM(p.pu_keg) AS pu_keg, + SUM(p.pu_invis) AS pu_invis, SUM(p.pu_belt) AS pu_belt, SUM(p.pu_amp) AS pu_amp + FROM uts_player as p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND matchid = $mid2 GROUP BY pid ORDER BY name ASC"; + $q_pickups = mysql_query($sql_pickups) or die(mysql_error()); + $i = 0; + while ($r_pickups = zero_out(mysql_fetch_array($q_pickups))) { + $i++; + $class = ($i % 2) ? 'grey' : 'grey2'; + + $r_pname = $r_pickups[name]; + $myurl = urlencode($r_pname); + + echo' + + + + + + + + + '; + } +} + +$sql_firstblood = small_query("SELECT pi.name, pi.country, m.firstblood FROM uts_match AS m, uts_pinfo AS pi WHERE m.firstblood = pi.id AND m.id = $mid"); +if (!$sql_firstblood) $sql_firstblood = array('country' => '', 'name' => '(unknown)', 'firstblood' => NULL); +$sql_multis = small_query("SELECT SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster FROM uts_player WHERE matchid = $mid"); + +IF($mid2 == NULL) { +} else { +$sql_firstblood2 = small_query("SELECT pi.name, pi.country, m.firstblood FROM uts_match AS m, uts_pinfo AS pi WHERE m.firstblood = pi.id AND m.id = $mid2"); +if (!$sql_firstblood2) $sql_firstblood2 = array('country' => '', 'name' => '(unknown)', 'firstblood' => NULL); +$sql_multis2 = small_query("SELECT SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster FROM uts_player WHERE matchid = $mid2"); +} +echo'
Pickups Summary - '.$ass_att2.' Attacking
PlayerPadsArmourKegInvisibilityShield BeltDamage Amp
'.FormatPlayerName($r_pickups[country], $r_pickups[pid], $r_pname, $gid, $gamename).''.$r_pickups[pu_pads].''.$r_pickups[pu_armour].''.$r_pickups[pu_keg].''.$r_pickups[pu_invis].''.$r_pickups[pu_belt].''.$r_pickups[pu_amp].'
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Special Events - '.$ass_att.' AttackingSpecial Events - '.$ass_att2.' Attacking
First Blood'.FormatPlayerName($sql_firstblood[country], $sql_firstblood[firstblood], $sql_firstblood[name], $gid, $gamename).'First Blood'.FormatPlayerName($sql_firstblood2[country], $sql_firstblood[firstblood], $sql_firstblood2[name], $gid, $gamename).'
Double Kills'.$sql_multis[spree_double].'Double Kills'.$sql_multis2[spree_double].'
Multi Kills'.$sql_multis[spree_multi].'Multi Kills'.$sql_multis2[spree_multi].'
Ultra Kills'.$sql_multis[spree_ultra].'Ultra Kills'.$sql_multis2[spree_ultra].'
Monster Kills'.$sql_multis[spree_monster].'Monster Kills'.$sql_multis2[spree_monster].'
'; +?> diff --git a/html/pages/match_info_server.php b/html/pages/match_info_server.php new file mode 100755 index 0000000..fb92456 --- /dev/null +++ b/html/pages/match_info_server.php @@ -0,0 +1,114 @@ + + + Totals for This Match + + + Team Score + Player Score + Frags + Kills + Deaths + Suicides + '; + +// Get Summary Info +$teamscore = small_query("SELECT SUM(t0score + t1score + t2score + t3score) AS result FROM uts_match WHERE id = $mid"); +$playerscore = small_query("SELECT SUM(gamescore) AS result FROM uts_player WHERE matchid = $mid"); +$fragcount = small_query("SELECT SUM(frags) AS result FROM uts_match WHERE id = $mid"); +$killcount = small_query("SELECT SUM(kills) AS result FROM uts_match WHERE id = $mid"); +$deathcount = small_query("SELECT SUM(deaths) AS result FROM uts_match WHERE id = $mid"); +$suicidecount = small_query("SELECT SUM(suicides) AS result FROM uts_match WHERE id = $mid"); + +echo' + + '.$teamscore[result].' + '.$playerscore[result].' + '.$fragcount[result].' + '.$killcount[result].' + '.$deathcount[result].' + '.$suicidecount[result].' + '; + +// Teamgame? Then show score +if ($teamgame) { + echo ' + + '; + echo ' + Score:'; + if ($r_info[t0]) { + echo ' + '.$r_info[t0score]; + } + if ($r_info[t1]) { + echo ' + - '.$r_info[t1score]; + } + if ($r_info[t2]) { + echo ' + - '.$r_info[t2score]; + } + if ($r_info[t3]) { + echo ' + - '.$r_info[t3score]; + } + echo ' + + '; +} + +echo ' + +
+ + + + '; + +$matchinfo = small_query("SELECT m.time, m.servername, g.name AS gamename, m.gamename AS real_gamename, m.gid, m.mapname, m.mapfile, m.serverinfo, m.gameinfo, m.mutators, m.serverip FROM uts_match AS m, uts_games AS g WHERE m.gid = g.id AND m.id = $mid"); +$matchdate = mdate($matchinfo[time]); +$gamename = $matchinfo[gamename]; +$real_gamename = $matchinfo[real_gamename]; +$gid = $matchinfo[gid]; + +$mapname = un_ut($matchinfo[mapfile]); +$mappic = strtolower("images/maps/".$mapname.".jpg"); + +if (file_exists($mappic)) { +} else { + $mappic = ("images/maps/blank.jpg"); +} + + $myurl = urlencode($mapname); + + echo' + + + + + + + + + + + + + + + + + + + + + + + + + +
Unreal Tournament Match Stats
Match Date'.$matchdate.'Server'.$matchinfo[servername].'
Match Type'.$gamename.'Map Name'.$matchinfo[mapname].'
Server Info'.$matchinfo[serverinfo].''.$mapname.'
Game Info'.$matchinfo[gameinfo].'
Mutators'.$matchinfo[mutators].'
+
'; +?> diff --git a/html/pages/match_player.php b/html/pages/match_player.php new file mode 100755 index 0000000..4cc73a0 --- /dev/null +++ b/html/pages/match_player.php @@ -0,0 +1,151 @@ +"; + } else { + echo "Sorry, this player has been banned!"; + include("includes/footer.php"); + exit; + } +} + +$playerid = $r_infos['playerid']; +$playername = $r_infos['name']; +$country = $r_infos['country']; +$gamename = $r_infos['gamename']; +$gid = $r_infos['gid']; + +echo' + + + + +
Individual Match Stats for '.FlagImage($country) .' '. htmlentities($playername) .' + '. RankImageOrText($pid, $playername, NULL, $gid, $gamename, true, '(%IT% in %GN% with %RP% ranking points)') .' +
+
'; + +// Get Summary Info +include("pages/match_info_server.php"); + +echo ' +
+ + + + + + + + + + + + + + '; + +$r_gsumm = zero_out(small_query("SELECT gamescore, frags, SUM(frags+suicides) AS kills, deaths, suicides, teamkills, eff, accuracy, ttl, gametime, spree_kill, spree_rampage, spree_dom, spree_uns, spree_god +FROM uts_player WHERE matchid = $mid AND pid = '$pid' +GROUP BY pid")); + + echo' + + + + + + + + + + '; + +echo' +
Game Summary
FragsKillsDeathsSuicidesEfficiencyAccuracyAvg TTLTime
'.$r_gsumm[frags].''.$r_gsumm[kills].''.$r_gsumm[deaths].''.$r_gsumm[suicides].''.$r_gsumm[eff].''.$r_gsumm[accuracy].''.$r_gsumm[ttl].''.GetMinutes($r_gsumm[gametime]).'
+
+ + + + + + + + + + + + + + + + + + + + '; + +$r_gsumm = zero_out(small_query("SELECT spree_double, spree_multi, spree_ultra, spree_monster, spree_kill, spree_rampage, spree_dom, spree_uns, spree_god +FROM uts_player WHERE matchid = $mid AND pid = '$pid' +GROUP BY pid")); + +$sql_firstblood = small_query("SELECT firstblood FROM uts_match WHERE id = $mid"); + +IF ($sql_firstblood[firstblood] == $pid) { + $firstblood = "Yes"; +} else { + $firstblood = "No"; +} + + + echo' + + + + + + + + + + + + +
Special Events
First BloodMultisSprees
DblMultiUltraMonsKillRamDomUnsGod
'.$firstblood.''.$r_gsumm[spree_double].''.$r_gsumm[spree_multi].''.$r_gsumm[spree_ultra].''.$r_gsumm[spree_monster].''.$r_gsumm[spree_kill].''.$r_gsumm[spree_rampage].''.$r_gsumm[spree_dom].''.$r_gsumm[spree_uns].''.$r_gsumm[spree_god].'
+
'; + +include('includes/weaponstats.php'); +weaponstats($mid, $pid); + +$r_pings = small_query("SELECT lowping, avgping, highping FROM uts_player WHERE pid = $pid and matchid = $mid and lowping > 0"); +if ($r_pings and $r_pings['lowping']) { +echo ' +
+ + + + + + + + + + + + + + +
Pings
MinAvgMax
'.ceil($r_pings['lowping']).''.ceil($r_pings['avgping']).''.ceil($r_pings['highping']).'
'; +} + +?> diff --git a/html/pages/match_report.php b/html/pages/match_report.php new file mode 100755 index 0000000..0f452ba --- /dev/null +++ b/html/pages/match_report.php @@ -0,0 +1,17 @@ + + + + + + + + + + + + +
Match Reports
Clanbase Cup Format
Forum BBCode Format
'; +?> \ No newline at end of file diff --git a/html/pages/players.php b/html/pages/players.php new file mode 100755 index 0000000..1d9788a --- /dev/null +++ b/html/pages/players.php @@ -0,0 +1,124 @@ +'); +} + + +// Get filter and set sorting +$filter = my_addslashes($_GET[filter]); +$sort = my_addslashes($_GET[sort]); + +IF (empty($filter) or (!in_array(strtolower($filter), array("name", "games", "gamescore", "frags", "kills", "deaths", "suicides", "eff", "accuracy", "ttl", "gametime")))) { + $filter = "name"; +} + +if (empty($sort) or ($sort != 'ASC' and $sort != 'DESC')) $sort = ($filter == "name") ? "ASC" : "DESC"; + + +// Work out Prev, Next, First, Last Stuff + +$r_pcount = small_query("SELECT COUNT(*) AS pcount FROM uts_pinfo"); +$pcount = $r_pcount['pcount']; + +$ecount = $pcount/50; +$ecount2 = number_format($ecount, 0, '.', ''); + +IF($ecount > $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = preg_replace('/\D/', '', $_GET["page"]); +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*50; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +// Show information +echo' +
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+
* Click headings to change Sorting *
+ + + + + + + + + + + + + + + + + + + + '; + +$sql_plist = "SELECT pi.name AS name, pi.country AS country, p.pid, COUNT(p.id) AS games, SUM(p.gamescore) as gamescore, SUM(p.frags) AS frags, SUM(p.kills) AS kills, +SUM(p.deaths) AS deaths, SUM(p.suicides) as suicides, AVG(p.eff) AS eff, AVG(p.accuracy) AS accuracy, AVG(p.ttl) AS ttl, SUM(gametime) as gametime +FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY p.pid ORDER BY $filter $sort LIMIT $qpage,50"; +$q_plist = mysql_query($sql_plist) or die(mysql_error()); +while ($r_plist = mysql_fetch_array($q_plist)) { + + $gametime = sec2hour($r_plist[gametime]); + $eff = get_dp($r_plist[eff]); + $acc = get_dp($r_plist[accuracy]); + $ttl = GetMinutes($r_plist[ttl]); + $r_pname = $r_plist[name]; + $myurl = urlencode($r_pname); + + echo' + + + + + + + + + + + + + '; +} +echo' +
Unreal Tournament Player List
Name Search: + +
Player Name'.SortPic('name', $filter, $sort).'Matches'.SortPic('games', $filter, $sort).'Score'.SortPic('gamescore', $filter, $sort).'Frags'.SortPic('frags', $filter, $sort).'Kills'.SortPic('kills', $filter, $sort).'Deaths'.SortPic('deaths', $filter, $sort).'Suicides'.SortPic('suicides', $filter, $sort).'Eff.'.SortPic('eff', $filter, $sort).'Acc.'.SortPic('accuracy', $filter, $sort).'TTL'.SortPic('ttl', $filter, $sort).'Hours'.SortPic('gametime', $filter, $sort).'
'.FormatPlayerName($r_plist[country], $r_plist['pid'], $r_pname).''.$r_plist[games].''.$r_plist[gamescore].''.$r_plist[frags].''.$r_plist[kills].''.$r_plist[deaths].''.$r_plist[suicides].''.$eff.''.$acc.''.$ttl.''.$gametime.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+
'; +?> diff --git a/html/pages/players_explain_ranking.php b/html/pages/players_explain_ranking.php new file mode 100755 index 0000000..5930cfb --- /dev/null +++ b/html/pages/players_explain_ranking.php @@ -0,0 +1,190 @@ +'; + $i = 0; + return(0); + } + $i++; + $class = ($i%2) ? 'grey' : 'grey2'; + if ($extra_multiplier) $multiplier *= 600; + $points = $amount * $multiplier; + + $d_points = get_dp($points); + if ($points % 1 == 0) $d_points = ceil($points); + echo ''; + echo ''. htmlentities($name) .''; + echo ''. $amount .''; + echo ''. $multiplier .''; + echo ''. $d_points .''; + echo ''; + return($points); +} + +$pid = isset($pid) ? $pid : $_GET['pid']; +$gid = isset($gid) ? $gid : $_GET['gid']; + +$pid = preg_replace('/\D/', '', $pid); +$gid = preg_replace('/\D/', '', $gid); + +$r_info = small_query("SELECT name, country, banned FROM uts_pinfo WHERE id = '$pid'"); +if (!$r_info) { + echo "Player not found"; + include("includes/footer.php"); + exit; +} + +if ($r_info['banned'] == 'Y') { + if (isset($is_admin) and $is_admin) { + echo "Warning: Banned player - Admin override
"; + } else { + echo "Sorry, this player has been banned!"; + include("includes/footer.php"); + exit; + } +} + +$playername = $r_info['name']; + +$r_game = small_query("SELECT name, gamename FROM uts_games WHERE id = '$gid'"); +if (!$r_game) { + echo "Game ($gid) not found."; + include("includes/footer.php"); + exit; +} +$real_gamename = $r_game['gamename']; + + +$r_cnt = small_query("SELECT + SUM(frags) AS frags, SUM(deaths) AS deaths, SUM(suicides) AS suicides, SUM(teamkills) AS teamkills, + SUM(flag_taken) AS flag_taken, SUM(flag_pickedup) AS flag_pickedup, SUM(flag_return) AS flag_return, SUM(flag_capture) AS flag_capture, SUM(flag_cover) AS flag_cover, + SUM(flag_seal) AS flag_seal, SUM(flag_assist) AS flag_assist, SUM(flag_kill) AS flag_kill, + SUM(dom_cp) AS dom_cp, SUM(ass_obj) AS ass_obj, + SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster, + SUM(spree_kill) AS spree_kill, SUM(spree_rampage) AS spree_rampage, SUM(spree_dom) AS spree_dom, SUM(spree_uns) AS spree_uns, SUM(spree_god) AS spree_god, + SUM(gametime) AS gametime + FROM uts_player WHERE pid = $pid and gid = $gid"); + + + + +echo' + + + + +
'.FlagImage($r_info['country'], false).' '.htmlentities($playername).'\'s '. htmlentities($r_game['name']) .' ranking explained
'; +echo '

'; + + + + + +echo ' + + + + + + + '; + +if ($real_gamename == "Bunny Track") { + $sql_btmaprank = "SELECT e.col2 AS no, COUNT(e.col2) AS count FROM uts_events AS e, uts_player AS p WHERE p.pid = $pid AND p.gid = $gid AND p.playerid = e.playerid AND e.matchid = p.matchid AND e.col2 > 0 AND e.col2 <= 5 GROUP BY e.col2"; + $q_btmaprank = mysql_query($sql_btmaprank) or die ("Can't retrieve \$q_btmaprank: ". mysql_error()); + $mapranks = array(); + while($r_btmaprank = mysql_fetch_assoc($q_btmaprank)) { + $mapranks[$r_btmaprank[no]] = $r_btmaprank[count]; + } + + $t_points += row('First place', (!empty($mapranks[1]) ? $mapranks[1] : 0), 10); + $t_points += row('Second place', (!empty($mapranks[2]) ? $mapranks[2] : 0), 8); + $t_points += row('Third place', (!empty($mapranks[3]) ? $mapranks[3] : 0), 6); + $t_points += row('Fourth place', (!empty($mapranks[4]) ? $mapranks[4] : 0), 4); + $t_points += row('Fifth place', (!empty($mapranks[5]) ? $mapranks[5] : 0), 2); +} +else { + $t_points = 0; + $t_points += row('Frags', $r_cnt['frags'], 0.5); + $t_points += row('Deaths', $r_cnt['deaths'], -0.25); + $t_points += row('Suicides', $r_cnt['suicides'], -0.25 ); + $t_points += row('Teamkills', $r_cnt['teamkills'], -2); + row(); + $t_points += row('Flag Takes', $r_cnt['flag_taken'], 1); + $t_points += row('Flag Pickups', $r_cnt['flag_pickedup'], 1); + $t_points += row('Flag Returns', $r_cnt['flag_return'], 1); + $t_points += row('Flag Captures', $r_cnt['flag_capture'], 10); + $t_points += row('Flag Covers', $r_cnt['flag_cover'], 3); + $t_points += row('Flag Seals', $r_cnt['flag_seal'], 2); + $t_points += row('Flag Assists', $r_cnt['flag_assist'], 5); + $t_points += row('Flag Kills', $r_cnt['flag_kill'], 2); + row(); + $t_points += row('Controlpoint Captures', $r_cnt['dom_cp'], 10); + if (strpos($real_gamename, 'Assault') !== false) { + $t_points += row('Assault Objectives', $r_cnt['ass_obj'], 10); + } else { + $t_points += row('Assault Objectives', 0, 10); + } + if (strpos($real_gamename, 'JailBreak') !== false) { + $t_points += row('Team Releases', $r_cnt['ass_obj'], 1.5); + } else { + $t_points += row('Team Releases', 0, 1.5); + } + row(); + $t_points += row('Double Kills', $r_cnt['spree_double'], 1); + $t_points += row('Multi Kills', $r_cnt['spree_multi'], 1); + $t_points += row('Ultra Kills', $r_cnt['spree_ultra'], 1); + $t_points += row('Monster Kills', $r_cnt['spree_monster'], 2); + row(); + $t_points += row('Killing Sprees', $r_cnt['spree_kill'], 1); + $t_points += row('Rampages', $r_cnt['spree_rampage'], 1); + $t_points += row('Dominatings', $r_cnt['spree_dom'], 1.5); + $t_points += row('Unstoppables', $r_cnt['spree_uns'], 2); + $t_points += row('Godlikes', $r_cnt['spree_god'], 3); +} + +row(); +row(); +echo ' + + + + '; + +$gametime = ceil($r_cnt['gametime'] / 60); +$t_points = $t_points / $gametime; +echo ' + + + + '; + +IF ($gametime < 10) { + $t_points += row('Penalty for playing < 10 minutes', get_dp($t_points), 0, false); +} + +IF ($gametime >= 10 && $gametime < 50) { + $t_points += row('Penalty for playing < 50 minutes', get_dp($t_points), -0.75, false); +} + +IF ($gametime >= 50 && $gametime < 100) { + $t_points += row('Penalty for playing < 100 minutes', get_dp($t_points), -0.5, false); +} + +IF ($gametime >= 100 && $gametime < 200) { + $t_points += row('Penalty for playing < 200 minutes', get_dp($t_points), -0.3, false); +} + +IF ($gametime >= 200 && $gametime < 300) { + $t_points += row('Penalty for playing < 300 minutes', get_dp($t_points), -0.15, false); +} +row(); +echo ' + + + + '; +echo '
AmountMultiplierPoints +
Total'. ceil($t_points) .'
Divided by game minutes'.$gametime.''. get_dp($t_points) .'
Total'. get_dp($t_points) .'
'; +?> diff --git a/html/pages/players_info.php b/html/pages/players_info.php new file mode 100755 index 0000000..11064dc --- /dev/null +++ b/html/pages/players_info.php @@ -0,0 +1,442 @@ +"; + } else { + echo "Sorry, this player has been banned!"; + include("includes/footer.php"); + exit; + } +} + +$playername = $r_info['name']; + +if (isset($_GET['togglewatch'])) { + $status = ToggleWatchStatus($pid); + include('includes/header.php'); + if ($status == 1) { + echo htmlentities($playername) ." has been added to your watchlist"; + } else { + echo htmlentities($playername) ." has been removed from your watchlist"; + } + echo "
"; + $target = $PHP_SELF .'?p=pinfo&pid='. $pid; + echo 'You will be taken back to the '. htmlentities($playername) .'\'s page in a moment.'; + echo ''; + return; +} + + +if (isset($_GET['pics'])) { + $gid = $_GET['gid']; + $gid = preg_replace("/\D/", "", $gid); + if (!$pic_enable) { + echo "Sorry, pictures are disabled by the administrator"; + return; + } + $oururl = $_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF"]; + $oururl = str_replace("index.php", "", $oururl); + + echo '
'; + require('includes/config_pic.php'); + $disp = false; + foreach($pic as $num => $options) { + if (!$options['enabled']) continue; + if ($options['gidrequired'] and empty($gid)) continue; + $disp = true; + $pinfourl = "http://${oururl}?p=pinfo&pid=$pid"; + $lgid = ($options['gidrequired']) ? $gid : 0; + $imgurl = "http://${oururl}pic.php/$num/$pid/$lgid/.".$options['output']['type']; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
BB Code:
HTML Code:


'; + } + if (!$disp) echo "Sorry, no pictures in this category"; + echo '
'; + return; +} + + + + + +echo' + + + + + + + + + + + + + + + + + + '; + +$sql_plist = "SELECT g.name AS gamename, SUM(p.gamescore) AS gamescore, SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.deaths) AS deaths, +SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, SUM(kills+deaths+suicides+teamkills) AS sumeff, AVG(p.accuracy) AS accuracy, AVG(p.ttl) AS ttl, +COUNT(p.id) AS games, SUM(p.gametime) as gametime +FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id AND p.pid = '$pid' GROUP BY p.gid"; + +$q_plist = mysql_query($sql_plist) or die(mysql_error()); +while ($r_plist = mysql_fetch_array($q_plist)) { + + $gametime = sec2hour($r_plist[gametime]); + $eff = get_dp($r_plist[kills]/$r_plist[sumeff]*100); + $acc = get_dp($r_plist[accuracy]); + $ttl = GetMinutes($r_plist[ttl]); + + echo' + + + + + + + + + + + + + '; +} + +$r_sumplist = small_query("SELECT SUM(gamescore) AS gamescore, SUM(frags) AS frags, SUM(kills) AS kills, SUM(deaths) AS deaths, +SUM(suicides) AS suicides, SUM(teamkills) AS teamkills, SUM(kills+deaths+suicides+teamkills) AS sumeff, +AVG(accuracy) AS accuracy, AVG(ttl) AS ttl, COUNT(id) AS games, SUM(gametime) as gametime +FROM uts_player WHERE pid = '$pid'"); + +$gametime = sec2hour($r_sumplist[gametime]); +$eff = get_dp($r_sumplist[kills]/$r_sumplist[sumeff]*100); +$acc = get_dp($r_sumplist[accuracy]); +$ttl = GetMinutes($r_sumplist[ttl]); + + echo' + + + + + + + + + + + + + + +
Career Summary for '.FlagImage($r_info['country'], false).' '.htmlentities($playername).' '; + +if (PlayerOnWatchlist($pid)) { + echo ''; +} else { + echo ''; +} + +echo ' +
Match TypeScoreFKDSTKEff.Acc.Avg TTLMatchesHours
'.$r_plist[gamename].''.$r_plist[gamescore].''.$r_plist[frags].''.$r_plist[kills].''.$r_plist[deaths].''.$r_plist[suicides].''.$r_plist[teamkills].''.$eff.''.$acc.''.$ttl.''.$r_plist[games].''.$gametime.'
Totals'.$r_sumplist[gamescore].''.$r_sumplist[frags].''.$r_sumplist[kills].''.$r_sumplist[deaths].''.$r_sumplist[suicides].''.$r_sumplist[teamkills].''.$eff.''.$acc.''.$ttl.''.$r_sumplist[games].''.$gametime.'
+
'; + +$q_assgids = mysql_query("SELECT id FROM uts_games WHERE gamename LIKE '%Assault%';") or die(mysql_error()); +$assgids = array(); +while ($r_assgids = mysql_fetch_array($q_assgids)) { + $assgids[] = $r_assgids['id']; +} +$assquery = (count($assgids) > 0) ? 'SUM(IF (gid IN ('. implode(',', $assgids) .'), ass_obj, 0)) AS ass_obj' : '0 AS ass_obj'; + $sql_cdatot = zero_out(small_query("SELECT SUM(dom_cp) AS dom_cp, $assquery, SUM(flag_taken) AS flag_taken, +SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, +SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, +SUM(flag_return) AS flag_return FROM uts_player WHERE pid = '$pid'")); + +if ($sql_cdatot[ass_obj] || $sql_cdatot[dom_cp] || $sql_cdatot[flag_taken] || $sql_cdatot[flag_pickedup] || $sql_cdatot[flag_dropped] || $sql_cdatot[flag_assist] || $sql_cdatot[flag_cover] || $sql_cdatot[flag_seal] || $sql_cdatot[flag_capture] || $sql_cdatot[flag_kill] || $sql_cdatot[flag_return]) { + echo ' + + + + + + + + + + + + + + + + + + + + '; + + echo' + + + + + + + + + + + + + +
Assault, Domination and CTF Events Summary
Assault ObjectivesControl Point CapturesCapture The Flag
Flag TakesFlag PickupsFlag DropsFlag AssistsFlag CoversFlag SealsFlag CapturesFlag KillsFlag Returns
'.$sql_cdatot[ass_obj].''.$sql_cdatot[dom_cp].''.$sql_cdatot[flag_taken].''.$sql_cdatot[flag_pickedup].''.$sql_cdatot[flag_dropped].''.$sql_cdatot[flag_assist].''.$sql_cdatot[flag_cover].''.$sql_cdatot[flag_seal].''.$sql_cdatot[flag_capture].''.$sql_cdatot[flag_kill].''.$sql_cdatot[flag_return].'
+
'; +} + +$sql_firstblood = zero_out(small_query("SELECT COUNT(id) AS fbcount FROM uts_match WHERE firstblood = '$pid'")); +$sql_multis = zero_out(small_query("SELECT SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, +SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster, +SUM(spree_kill) AS spree_kill, SUM(spree_rampage) AS spree_rampage, SUM(spree_dom) AS spree_dom, +SUM(spree_uns) AS spree_uns, SUM(spree_god) AS spree_god +FROM uts_player WHERE pid = '$pid'")); + +if ($sql_firstblood[fbcount] || $sql_multis[spree_double] || $sql_multis[spree_multi] || $sql_multis[spree_ultra] || $sql_multis[spree_monster] || $sql_multis[spree_kill] || $sql_multis[spree_rampage] || $sql_multis[spree_dom] || $sql_multis[spree_uns] || $sql_multis[spree_god] ) { + echo ' + + + + + + + + + + + + + + + + + + + + '; + + echo' + + + + + + + + + + + + +
Special Events
First BloodMultisSprees
DblMultiUltraMonsKillRamDomUnsGod
'.$sql_firstblood[fbcount].''.$sql_multis[spree_double].''.$sql_multis[spree_multi].''.$sql_multis[spree_ultra].''.$sql_multis[spree_monster].''.$sql_multis[spree_kill].''.$sql_multis[spree_rampage].''.$sql_multis[spree_dom].''.$sql_multis[spree_uns].''.$sql_multis[spree_god].'
+
'; +} + +$r_pickups = zero_out(small_query("SELECT SUM(pu_pads) AS pu_pads, SUM(pu_armour) AS pu_armour, SUM(pu_keg) AS pu_keg, +SUM(pu_invis) AS pu_invis, SUM(pu_belt) AS pu_belt, SUM(pu_amp) AS pu_amp +FROM uts_player WHERE pid = '$pid'")); + +if ($r_pickups[pu_pads] || $r_pickups[pu_armour] || $r_pickups[pu_keg] || $r_pickups[pu_invis] || $r_pickups[pu_belt] || $r_pickups[pu_amp] ) { + echo ' + + + + + + + + + + + + + + + + + + + + +
Pickups Summary
PadsArmourKegInvisibilityShield BeltDamage Amp
'.$r_pickups[pu_pads].''.$r_pickups[pu_armour].''.$r_pickups[pu_keg].''.$r_pickups[pu_invis].''.$r_pickups[pu_belt].''.$r_pickups[pu_amp].'
+
'; +} + +include('includes/weaponstats.php'); +weaponstats(0, $pid); + +echo '
'; + +// bt records +$sql_btrecords = " +SELECT + m.mapfile AS map, + e.col3 AS time, + e.col4 AS date +FROM + uts_match AS m, + uts_events AS e, + uts_player AS p +WHERE + p.pid = $pid AND + p.playerid = e.playerid AND + e.matchid = p.matchid AND + m.id = p.matchid AND + e.col1 = 'btcap' +GROUP BY + m.mapfile +ORDER BY + m.mapfile, + 0 + e.col3 ASC"; + +$q_btrecords = mysql_query($sql_btrecords) or die (mysql_error()); +if (mysql_num_rows($q_btrecords) > 0) { + echo ' + + + + + + + + + + '; + while ($r_btrecords = mysql_fetch_array($q_btrecords)) { + $map = un_ut($r_btrecords['map']); + $myurl = urlencode($map); + $maprank = 1 + small_count("SELECT DISTINCT p.pid AS rank FROM uts_player as p, uts_events AS e, uts_match as m WHERE (m.mapfile = '" . addslashes($map) . "' OR m.mapfile = '" . addslashes($map) . ".unr') AND m.id = e.matchid AND e.matchid = p.matchid AND e.playerid = p.playerid AND e.col3 < ".$r_btrecords['time'] . " AND e.col1 = 'btcap'"); + echo ' + + + + '; + } + echo ' +
Bunny Track Personal Records
MapTimeDate
 '.htmlentities($map).'', $maprank, '', btcaptime($r_btrecords['time']), '', gmdate('d-m-Y h:i a', $r_btrecords['date']), '
+
'; +} + +// Do graph stuff +$bgwhere = "pid = '$pid'"; +include("pages/graph_pbreakdown.php"); + + +// Player's ranks +echo' + + + + + + + + + '; + if ($pic_enable and basename($_SERVER['PATH_TRANSLATED']) != 'admin.php') echo ''; +echo ''; + +$sql_rank = "SELECT g.name AS gamename, r.rank, r.prevrank, r.matches, r.gid, r.pid FROM uts_rank AS r, uts_games AS g WHERE r.gid = g.id AND r.pid = '$pid';"; +$q_rank = mysql_query($sql_rank) or die(mysql_error()); +while ($r_rank = mysql_fetch_array($q_rank)) { + $r_no = small_query("SELECT (COUNT(*) + 1) AS no FROM uts_rank WHERE gid= '${r_rank['gid']}' and rank > ". get_dp($r_rank['rank']) ."9"); + echo' + + + + '; + echo ''; + if ($pic_enable and basename($_SERVER['PATH_TRANSLATED']) != 'admin.php') echo ''; + echo ''; +} + +echo '
Ranking
Match TypeRankMatchesExplainPics
'.RankImageOrText($r_rank['pid'], $name, $r_no['no'], $r_rank['gid'], $r_rank['gamename'], false, '%IT%').''.$r_rank['gamename'].''.get_dp($r_rank['rank']) .' '. RankMovement($r_rank['rank'] - $r_rank['prevrank']) . ''.$r_rank['matches'].'(Click)(Click)
'; + + +$r_pings = small_query("SELECT MIN(lowping * 1) AS lowping, AVG(avgping * 1) AS avgping, MAX(highping * 1) AS highping FROM uts_player WHERE pid = $pid and lowping > 0"); +if ($r_pings and $r_pings['lowping']) { +echo ' +
+ + + + + + + + + + + + + + +
Pings
MinAvgMax
'.ceil($r_pings['lowping']).''.ceil($r_pings['avgping']).''.ceil($r_pings['highping']).'
'; +} + + + + +echo'
+ + + + + + + + '; + if (isset($is_admin) and $is_admin) echo ''; + echo''; + +$sql_recent = "SELECT m.id, m.time, g.name AS gamename, m.mapfile, INET_NTOA(p.ip) AS ip FROM uts_match m, uts_player p, uts_games g +WHERE p.pid = '$pid' AND m.id = p.matchid AND m.gid = g.id ORDER BY time DESC LIMIT 0,50"; +$q_recent = mysql_query($sql_recent) or die(mysql_error()); +while ($r_recent = mysql_fetch_array($q_recent)) { + + $r_time = mdate($r_recent[time]); + $r_mapfile = un_ut($r_recent[mapfile]); + + echo' + + + + + '; + if (isset($is_admin) and $is_admin) echo ''; + + echo ''; +} + +echo' +
Last 50 Games
Match IDDate/TimeMatch TypeMapIP Used
'.$r_recent[id].''.$r_time.''.$r_recent[gamename].''.$r_mapfile.''. $r_recent[ip].'
+'; +?> diff --git a/html/pages/players_search.php b/html/pages/players_search.php new file mode 100755 index 0000000..1791393 --- /dev/null +++ b/html/pages/players_search.php @@ -0,0 +1,83 @@ +'); +} + +// Get filter and set sorting +$playername = my_stripslashes($_REQUEST[name]); +$playersearch = my_addslashes($_REQUEST[name]); +$filter = my_addslashes($_GET[filter]); +$sort = my_addslashes($_GET[sort]); + +IF (empty($filter) or (!in_array(strtolower($filter), array("name", "games", "gamescore", "frags", "kills", "deaths", "suicides", "eff", "accuracy", "ttl", "gametime")))) { + $filter = "name"; +} + +if (empty($sort) or ($sort != 'ASC' and $sort != 'DESC')) $sort = ($filter == "name") ? "ASC" : "DESC"; + +echo' +
+
* Click headings to change Sorting *
+ + + + + + + + + + + + + + + + + + + + '; + +$sql_plist = "SELECT pi.name AS name, pi.country AS country, p.pid, COUNT(p.id) AS games, SUM(p.gamescore) as gamescore, SUM(p.frags) AS frags, SUM(p.kills) AS kills, +SUM(p.deaths) AS deaths, SUM(p.suicides) as suicides, AVG(p.eff) AS eff, AVG(p.accuracy) AS accuracy, AVG(p.ttl) AS ttl, SUM(gametime) as gametime +FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.name LIKE '%".$playersearch."%' AND pi.banned <> 'Y' GROUP BY name ORDER BY $filter $sort"; + +$q_plist = mysql_query($sql_plist) or die(mysql_error()); +while ($r_plist = mysql_fetch_array($q_plist)) { + + $gametime = sec2hour($r_plist[gametime]); + $eff = get_dp($r_plist[eff]); + $acc = get_dp($r_plist[accuracy]); + $ttl = GetMinutes($r_plist[ttl]); + + echo' + + + + + + + + + + + + + '; +} +echo' +
Player Search List
Name Search: + +
Player Name'.SortPic('name', $filter, $sort).'Matches'.SortPic('games', $filter, $sort).'Score'.SortPic('gamescore', $filter, $sort).'Frags'.SortPic('frags', $filter, $sort).'Kills'.SortPic('kills', $filter, $sort).'Deaths'.SortPic('deaths', $filter, $sort).'Suicides'.SortPic('suicides', $filter, $sort).'Eff.'.SortPic('eff', $filter, $sort).'Acc.'.SortPic('accuracy', $filter, $sort).'TTL'.SortPic('ttl', $filter, $sort).'Hours'.SortPic('gametime', $filter, $sort).'
'.FormatPlayerName($r_plist[country], $r_plist['pid'], $r_plist[name]).''.$r_plist[games].''.$r_plist[gamescore].''.$r_plist[frags].''.$r_plist[kills].''.$r_plist[deaths].''.$r_plist[suicides].''.$eff.''.$acc.''.$ttl.''.$gametime.'
'; +?> \ No newline at end of file diff --git a/html/pages/rank.php b/html/pages/rank.php new file mode 100755 index 0000000..6eacca0 --- /dev/null +++ b/html/pages/rank.php @@ -0,0 +1,56 @@ + + + + Top 10 '.$r_rgame['name'].' Players + + + N° + Player Name + Rank + Matches + + '; + + $ranking = 0; + + $sql_rplayer = "SELECT pi.id AS pid, pi.name, pi.country, r.rank, r.prevrank, r.matches FROM uts_rank AS r, uts_pinfo AS pi WHERE r.pid = pi.id AND r.gid = '$r_rgame[gid]' AND pi.banned <> 'Y' ORDER BY r.rank DESC LIMIT 0,10"; + $q_rplayer = mysql_query($sql_rplayer) or die(mysql_error()); + if (mysql_num_rows($q_rplayer) == 0) { + echo ' + + No players entered the rankings yet. + + +   + +
'; + + } + else { + while ($r_rplayer = mysql_fetch_array($q_rplayer)) { + + $ranking++; + $myurl = urlencode($r_rplayer[name]); + + echo' + + '.$ranking.' + '.FlagImage($r_rplayer[country]).' '.htmlspecialchars($r_rplayer[name], ENT_QUOTES) .' '. RankMovement($r_rplayer['rank'] - $r_rplayer['prevrank']).' + '.get_dp($r_rplayer[rank]).' + '.$r_rplayer[matches].' + '; + } + echo' + + Click Here To See All The Rankings + +
'; + } +} +?> \ No newline at end of file diff --git a/html/pages/rank_extended.php b/html/pages/rank_extended.php new file mode 100755 index 0000000..b41baf2 --- /dev/null +++ b/html/pages/rank_extended.php @@ -0,0 +1,75 @@ + $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = $_GET["page"]; +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*25; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +echo' +
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + + '; + + $ranking = $qpage; + + $sql_rplayer = "SELECT pi.name, pi.country, r.rank, r.prevrank, r.matches, r.pid FROM uts_rank AS r, uts_pinfo AS pi WHERE r.pid = pi.id AND r.gid = '$gid' AND pi.banned <> 'Y' ORDER BY rank DESC LIMIT $qpage,25"; + $q_rplayer = mysql_query($sql_rplayer) or die(mysql_error()); + while ($r_rplayer = mysql_fetch_array($q_rplayer)) { + + $ranking++; + echo' + + + + + + '; + +} +echo' +
'.$gamename.' Ranking Players
Player NameRankMatches
'.$ranking.''.FlagImage($r_rplayer[country]).' '.htmlspecialchars($r_rplayer[name]) .' '. RankMovement($r_rplayer['rank'] - $r_rplayer['prevrank']) .''.get_dp($r_rplayer[rank]).''.$r_rplayer[matches].'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
'; +?> \ No newline at end of file diff --git a/html/pages/recent.php b/html/pages/recent.php new file mode 100755 index 0000000..92fafb7 --- /dev/null +++ b/html/pages/recent.php @@ -0,0 +1,137 @@ + $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = preg_replace('/\D/', '', $_REQUEST["page"]); +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*25; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +echo ' +
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + '; + +echo ' + + '; + +echo ' + + + + + + + + '; + +$sql_recent = "SELECT m.id, m.time, g.name AS gamename, m.mapfile, m.gametime, (SELECT count(p.id) FROM uts_player AS p WHERE m.id = p.matchid) as players FROM uts_match AS m, uts_games AS g WHERE g.id = m.gid $where ORDER BY m.time DESC LIMIT $qpage,25"; +$q_recent = mysql_query($sql_recent) or die(mysql_error()); +while ($r_recent = mysql_fetch_array($q_recent)) { + + $r_time = mdate($r_recent[time]); + $r_mapfile = un_ut($r_recent[mapfile]); + $r_gametime = GetMinutes($r_recent[gametime]); + + echo' + + + + + + + + '; +} + + + +echo ' +
Unreal Tournament Match List
'; +echo ''; +echo ''; +echo ''; +//echo ''; +echo ''; + +echo ''; +echo ''; +echo ''; +echo '
Filter:Date:'; +echo ' '; +echo ''; +echo ' '; +echo 'Gametype:
'; +echo '
Match IDDate/TimeMatch TypeMapTimePlayers
'.$r_recent[id].''.$r_time.''.$r_recent[gamename].''.$r_mapfile.''.$r_gametime.''.$r_recent[players].'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+
'; +?> \ No newline at end of file diff --git a/html/pages/report.php b/html/pages/report.php new file mode 100755 index 0000000..946b847 --- /dev/null +++ b/html/pages/report.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/html/pages/report/bbcode.php b/html/pages/report/bbcode.php new file mode 100755 index 0000000..e07aa91 --- /dev/null +++ b/html/pages/report/bbcode.php @@ -0,0 +1,424 @@ +'; + +$id = preg_replace('/\D/', '', $_GET[id]); + +if (empty($id)) { + die("No ID given"); +} + +$sql_s = small_query("SELECT mapfile, gametime FROM uts_match WHERE id = '$id'"); + +$map = str_replace(".unr", "", "$sql_s[mapfile]"); +$mappic = strtolower("images/maps/".$map.".jpg"); +$actgamelength = $sql_s[gametime]; + +// Lets work out what kind of game this was from the scores + +$q_score = small_query("SELECT t0score, t1score FROM uts_match WHERE id = $id"); +$t0score = $q_score[t0score]; +$t1score = $q_score[t1score]; + +$teama = "Red Team"; +$teamb = "Blue Team"; + +IF ($t0score > $t1score) { + + $twin = 0; + $twin_team = $teama; + $twin_score = $t0score; + + $tlose = 1; + $tlose_team = $teamb; + $tdraw = "0"; + + $tdiff = $t0score+$t1score; + + IF ($tdiff <= 3) { + $reptype = "low"; + } elseIF ($tdiff >= 9) { + $reptype = "high"; + } else { + $reptype = "medium"; + } + +} elseIF ($t0score < $t1score) { + $twin = 1; + $twin_team = $teamb; + $twin_score = $t1score; + + $tlose = 0; + $tlose_team = $teama; + $tdraw = "0"; + + $tdiff = $t1score+$t0score; + + IF ($tdiff <= 2) { + $reptype = "low"; + } elseIF ($tdiff >= 9) { + $reptype = "high"; + } else { + $reptype = "medium"; + } + +} else { + $twin = "0"; + $tlose = "1"; + $tdraw = "1"; + + $tdiff = $t1score+$t0score; + $twin_team = $teama;; + $tlose_team = $teamb; + + IF ($tdiff <= 4) { + $reptype = "low"; + } elseIF ($tdiff >= 10) { + $reptype = "high"; + } else { + $reptype = "medium"; + } +} + +// Queries used within the report + +// First blood +$q_fblood = small_query("SELECT firstblood FROM uts_match WHERE id = $id"); + +// Player id of first blood +$t_fblood = small_query("SELECT name FROM uts_pinfo WHERE id = '".$q_fblood[firstblood]."'"); +$t_fbloodid = small_query("SELECT id FROM uts_player WHERE pid = '".$q_fblood[firstblood]."' AND matchid = $id"); +$r_fbloodid = $t_fbloodid[id]; +$r_fbloodname = $t_fblood[name]; + +// Belt count +$q_t0bcount = small_query("SELECT SUM(pu_belt) AS bcount FROM uts_player WHERE matchid = $id AND team = 0 AND pu_belt >0"); +$q_t1bcount = small_query("SELECT SUM(pu_belt) AS bcount FROM uts_player WHERE matchid = $id AND team = 1 AND pu_belt >0"); + +// Amp count +$q_t0acount = small_query("SELECT SUM(pu_amp) AS acount FROM uts_player WHERE matchid = $id AND team = 0 AND pu_amp >0"); +$q_t1acount = small_query("SELECT SUM(pu_amp) AS acount FROM uts_player WHERE matchid = $id AND team = 1 AND pu_amp >0"); + +// Cap count +$q_capsa = small_query("SELECT pi.name, SUM(p.flag_capture) AS flag_caps FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 AND flag_capture >= 1 GROUP BY name"); +$q_capsb = small_query("SELECT pi.name, SUM(p.flag_capture) AS flag_caps FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 AND flag_capture >= 1 GROUP BY name"); + +// Most Flag Grabs (W) +$q_topgrab = small_query("SELECT p.id, pi.name, p.flag_taken FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabid = $q_topgrab[id]; +$r_topgrabname = $q_topgrab[name]; + +// Most Flag Grabs (L) +$q_topgrabl = small_query("SELECT p.id, pi.name, p.flag_taken FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabidl = $q_topgrabl[id]; +$r_topgrabnamel = $q_topgrabl[name]; + +// Most Flag Grabs (D) +$q_topgrabd = small_query("SELECT p.id, pi.name, p.flag_taken, team FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabidd = $q_topgrabd[id]; +$r_topgrabnamed = $q_topgrabd[name]; + +IF ($redteam == $q_topgrabd[team]) { + $r_topgrabteamd = $warinfo[0][2]; + $r_topgrabteamdid = $warinfo[0][1]; +} else { + $r_topgrabteamd = $warinfo[1][2]; + $r_topgrabteamdid = $warinfo[1][1]; +} + + +// Most Flag Covers (W) +$q_topcover = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverid = $q_topcover[id]; +$r_topcovername = $q_topcover[name]; + +// Most Flag Covers (L) +$q_topcoverl = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverlid = $q_topcoverl[id]; +$r_topcoverlname = $q_topcoverl[name]; + +// Most Flag Covers (R) +$q_topcoverr = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverrid = $q_topcoverr[id]; +$r_topcoverrname = $q_topcoverr[name]; + +// Most Flag Covers (B) +$q_topcoverb = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverbid = $q_topcoverb[id]; +$r_topcoverbname = $q_topcoverb[name]; + +// Most Flag Assists (D) +$q_topassistd = small_query("SELECT p.id, pi.name, p.flag_assist, team FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topassistdid = $q_topassistd[id]; +$r_topassistdname = $q_topassistd[name]; + +IF ($q_topassistd[team] == $redteam) { + $r_topassistdteam = $teamb; +} else { + $r_topassistdteam = $teama; +} + +// Most Flag Seals (W) +$q_topseal = small_query("SELECT p.id, pi.name, p.flag_seal FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_seal DESC LIMIT 0,1"); +$r_topsealid = $q_topseal[id]; +$r_topsealname = $q_topseal[name]; + +// Most Flag Seals (L) +$q_topseall = small_query("SELECT p.id, pi.name, p.flag_seal FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_seal DESC LIMIT 0,1"); +$r_topseallid = $q_topseall[id]; +$r_topseallname = $q_topseall[name]; + +// Top Capper (W) +$q_topcap = small_query("SELECT p.id, pi.name, p.flag_capture FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_capture DESC LIMIT 0,1"); +$r_topcapid = $q_topcap[id]; +$r_topcapname = $q_topcap[name]; + +// Top Capper (D) +$q_topcapd = small_query("SELECT p.id, pi.name, p.flag_capture FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_capture DESC LIMIT 0,1"); +$r_topcapdid = $q_topcap[id]; +$r_topcapdname = $q_topcap[name]; + +// Most Flag Kills (L) +$q_topdefl = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_kill DESC LIMIT 0,1"); +$r_topdeflid = $q_topdefl[id]; +$r_topdeflname = $q_topdefl[name]; + +// Most Flag Kills (W) +$q_topfkill = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_kill DESC LIMIT 0,1"); +$r_topfkillid = $q_topfkill[id]; +$r_topfkillname = $q_topfkill[name]; + +// 2nd Most Flag Kills (W) +$q_topfkill2 = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_kill DESC LIMIT 1,1"); +$r_topfkillid2 = $q_topfkill2[id]; +$r_topfkillname2 = $q_topfkill2[name]; + +// Most Frags (D) +$q_topfrag = small_query("SELECT p.id, pi.name, p.frags FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY frags DESC LIMIT 0,1"); +$r_topfragid = $q_topfrag[id]; +$r_topfragname = $q_topfrag[name]; + +// Most Frags (W) +$q_topfragw = small_query("SELECT p.id, pi.name, p.frags FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY frags DESC LIMIT 0,1"); +$r_topfragwid = $q_topfkill2[id]; +$r_topfragwname = $q_topfkill2[name]; + +// Most Deaths (L) +$q_topdeath = small_query("SELECT p.id, pi.name, p.deaths FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY deaths DESC LIMIT 0,1"); +$r_topdeathid = $q_topdeath[id]; +$r_topdeathname = $q_topdeath[name]; + +// Player of the Match +$q_topstats = small_query("SELECT p.id, pi.name, p.rank AS prank FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id GROUP BY id, name ORDER BY prank DESC LIMIT 0,1"); +$r_topstatsid = $q_topstats[id]; +$r_topstatsname = $q_topstats[name]; + + +// Write the top of the report (non game specific) + +//Player List for Red Team +echo'[b]'.$teama.' Lineup[/b] +'; + +$sql_rplayer = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY pi.name ASC"; +$q_rplayer = mysql_query($sql_rplayer); +while ($r_rplayer = mysql_fetch_array($q_rplayer)) { + + echo''.$r_rplayer[name].' +'; +} + +//Player List for Blue Team + +echo' +[b]'.$teamb.' Lineup[/b] +'; + +$sql_bplayer = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY pi.name ASC"; +$q_bplayer = mysql_query($sql_bplayer); +while ($r_bplayer = mysql_fetch_array($q_bplayer)) { + + echo''.$r_bplayer[name].' +'; +} + +// Firstblood and Pickup stats + +echo ' +[b]Statistics[/b] +First Blood: '.$r_fbloodname.' +'.$teama.' Belts: '.$q_t0bcount[bcount].' +'.$teamb.' Belts: '.$q_t1bcount[bcount].' +'.$teama.' Amps: '.$q_t0acount[acount].' +'.$teamb.' Amps: '.$q_t1acount[acount].' + +[b]Match Report[/b] +'; + + +// Low Scores and a Draw +IF ($reptype == "low" && $tdraw == 1) { +echo'Neither team were better this map, scorline is proof of this. +[cl]'.$r_topgrabteamdid.','.$r_topgrabteamd.'[/cl] had the most chances to cap with '.$r_topgrabnamed.' taking the flag '.$q_topgrabd[flag_taken].' times, but unfortuantely couldnt cap as many as he took. + +Big credit to both teams defences; '; + +IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo ''.$r_topdeflname.' defended the flag and got '.$q_topdefl[flag_kill].' flagkills while '.$r_topfkillname.' also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers. + '; +} else { + echo ''.$r_topfkillname.' defended the flag and got '.$q_topfkill[flag_kill].' flagkills while '.$r_topdeflname.' also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers. + '; +} + +echo'Seems the attackers had a frustrating game on this map, credit to '; + +IF ($q_topcover[flag_cover] >= $q_topcoverl[flag_cover]) { + echo ''.$r_topcovername.' for covering his flag carrier '.$q_topcover[flag_cover].' times and also '.$r_topcoverlname.' for covering '.$q_topcoverl[flag_cover].' times. + '; +} else { + echo ''.$r_topcoverlname.' for covering his flag carrier '.$q_topcoverl[flag_cover].' times and also '.$r_topcovername.' for covering '.$q_topcover[flag_cover].' times. + '; +} + +echo'Well done '.$r_topfragname.' for ensuring a tight scoreline with '.$q_topfrag[frags].' frags. +If this map would be played again between these two clans, we might see a change of strategy in the attacking play, but the defenders were strong on both sides this time. + +Good game. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points. +Well played both teams.'; +} + +// Medium Scores and a Draw +IF ($reptype == "medium" && $tdraw == 1) { +echo'An excitingly close game with neither side having the upper hand. +Both clans teamplay was about even and the result shows that it could have easily gone either way. + +Capping opportunities came along time after time, with [cl]'.$r_topgrabid.','.$r_topgrabname.'[/cl] taking the flag '.$q_topgrab[flag_taken].' times and at the other end [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] taking the flag '.$q_topgrabl[flag_taken].' times. + +Help was at hand for the flag runners with '.$teama.'\'s '.$r_topcoverrname.' covering '.$q_topcoverr[flag_cover].' times and '.$r_topcoverbname.' covering '.$q_topcoverb[flag_cover].' times for '.$teamb.'. + +Big credit to both teams defences; '; + +IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo ''.$r_topdeflname.' defended the flag and got '.$q_topdefl[flag_kill].' flagkills while '.$r_topfkillname.' also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers. + '; +} else { + echo ''.$r_topfkillname.' defended the flag and got '.$q_topfkill[flag_kill].' flagkills while '.$r_topdeflname.' also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers. + '; +} + +echo'Both teams showed great teamplay and skill and the scoreline represents this. +Two even lineups for this map. + +Well done '.$r_topfragname.' who had '.$q_topfrag[frags].' frags. + +Good game. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points. +Well played both teams.'; +} + +// High Scores and a Draw +IF ($reptype == "high" && $tdraw == 1) { +echo'A very very exciting, close CTF game Im sure both clans will agree. +This high scoring draw proves that '.$teama.' and '.$teamb.' were evenly matched on this map. +Teamplay and strategy enabled both teams to cap quite a few times. +Well done to both teams attackers especially '.$r_topcapdname.' who capped '.$q_topcapd[flag_capture].' times. + +Capping opportunities came along time after time, with [cl]'.$r_topgrabid.','.$r_topgrabname.'[/cl] taking the flag '.$q_topgrab[flag_taken].' times and at the other end [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] taking the flag '.$q_topgrabl[flag_taken].' times. + +Help was at hand for the flag runners with '.$teama.'\'s '.$r_topcoverrname.' covering '.$q_topcoverr[flag_cover].' times and '.$r_topcoverbname.' covering '.$q_topcoverb[flag_cover].' times for '.$teamb.'. + +Although the defenders probably didnt have as good a game as the attackers on this map, credit should be awarded to '; + +IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo ''.$r_topdeflname.' for killing '.$q_topdefl[flag_kill].' flag carriers and also to '; +} else { + echo ''.$r_topfkillname.' for killing '.$q_topfkill[flag_kill].' flag carriers and also to '; +} + +IF ($q_topseall[flag_seal] >= $q_topseal[flag_seal]) { + echo ''.$r_topseallname.' for sealing the base '.$q_topseall[flag_seal].' times for his flag carrier to cap. +
'; +} else { + echo ''.$r_topsealname.' for sealing the base '.$q_topseal[flag_seal].' times for his flag carrier to cap. +
'; +} + +echo' '.$r_topassistdname.' helped '.$r_topassistdteam.' get as many caps as they did by assisting '.$q_topassistd[flag_assist].' times in their caps. +This shows great teamplay and cover, well played. + +Both teams showed great teamplay and skill and the scoreline represents this. +Well done '.$r_topfragname.' who had '.$q_topfrag[frags].' frags. + +Good game. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points. +Well played both teams.'; +} + +// Low Scores and not a Draw +IF ($reptype == "low" && $tdraw == 0) { +echo 'Not very many caps in this close game, but '.$twin_team.' emerge victorious. + +Big credit to both teams defences; '; + +IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo ''.$r_topdeflname.' defended the flag and got '.$q_topdefl[flag_kill].' flagkills while '.$r_topfkillname.' also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers. + '; +} else { + echo ''.$r_topfkillname.' defended the flag and got '.$q_topfkill[flag_kill].' flagkills while '.$r_topdeflname.' also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers. + '; +} + +echo 'Seems the attackers had a frustrating game on this map, especially [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] who took the flag '.$q_topgrabl[flag_taken].' and still lost the game :( + +Suportive play was made by '.$r_topcoverlname.' having '.$q_topcoverl[flag_cover].' covers, but even with covering play, the majority of the flags got returned and the game ended with '.$tlose_team.' losing out. + +Well done to '.$r_topcapname.' for capping '.$q_topcap[flag_capture].'. +On other days the outcome could have been different. + +Good game and congratulations '.$twin_team.'. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points. +Well played both teams.'; +} + +// Medium Scores and not a Draw +IF ($reptype == "medium" && $tdraw == 0) { +echo 'A nice game of Capture the Flag took place this map with both teams trying hard to get flags back but only occasionally succeeding. + +'.$twin_team.' however managed to succesfully cap more than '.$tlose_team.' with big help from '.$r_topcapname.' who capped '.$q_topcap[flag_capture].'. +'.$r_topgrabname.' made it hard for the '.$tlose_team.' defenders taking the flag a total of '.$q_topgrab[flag_taken].' times. +Not to say that the defence was bad at all, '.$r_topdeflname.' got '.$q_topdefl[flag_kill].' flag kills and this made attacking hard work for '.$twin_team.'. + +Sealing off the base for '.$twin_team.' was some nice defence including '.$r_topsealname.' who sealed the base '.$q_topseal[flag_seal].' times. +Covering the flag carrier for '.$twin_team.' mostly was '.$r_topcovername.' with '.$q_topcover[flag_cover].' covers. + +Attacking in vain at the other end of the map was '.$r_topgrabnamel.' who managed to take the '.$twin_team.' flag '.$q_topgrabl[flag_taken].' times, but unfortunately was unable to match the '.$twin_score.' caps made by '.$twin_team.'. +'.$r_topgrabnamel.' was also up against some heavy defence including '.$r_topfkillname.' with '.$q_topfkill[flag_kill].' flag kills and '.$r_topfkillname2.' with '.$q_topfkill2[flag_kill].' flag kills. + +Good game and congratulations '.$twin_team.'. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points. +Well played both teams.'; +} + +// High Scores and not a Draw +IF ($reptype == "high" && $tdraw == 0) { +echo ''.$twin_team.' were victorious thanks to some nice capping by '.$r_topcapname.' who capped '.$q_topcap[flag_capture].' and '.$r_topgrabname.' who took the flag'.$q_topgrab[flag_taken].' times. + +'.$r_topcapname.' probably could not have done it without the help of '.$r_topcovername.' who had '.$q_topcover[flag_cover].' covers and '.$r_topsealname.' for sealing the base off '.$q_topseal[flag_seal].' times. + +Although the '.$tlose_team.' defenders played well, the '.$q_topdefl[flag_kill].' flag kills by '.$r_topdeflname.' was just not enough to stop the '.$twin_team.' attackers succeeding. +Extra Credit should be given to '.$r_topfragwname.' for getting '.$q_topwfrag[frags].' frags. +Some sympathy should be given to '.$r_topdeathname.' who died a whopping '.$q_topdeath[deaths].' times - unlucky!. + +All in all, this was a great attacking game for '.$twin_team.', but all players deserve credit for playing well. + +Good game and congratulations '.$twin_team.'. +Stats player of the map was '.$r_topstatsname.' with '.$q_topstats[prank].' stat points.'; +} + +echo' + +This report was created with UTStats from the following game: +[url]http://'.$oururl.'?p=match&mid='.$id.'[/url] +'; +?> \ No newline at end of file diff --git a/html/pages/report/clanbase.php b/html/pages/report/clanbase.php new file mode 100755 index 0000000..6b7d412 --- /dev/null +++ b/html/pages/report/clanbase.php @@ -0,0 +1,530 @@ +'; + +$id = preg_replace('/\D/', '', $_GET[id]); + +if (empty($id)) { + die("No ID given"); +} + +function get_cbid($pid) { + $cbid = preg_replace('/\D/', '', $_GET[$pid]); + return $cbid; +} +$cbid = get_cbid; + +function get_cbnick($badtext) { + $badstuff = array("[","]"); + $goodtext = str_replace($badstuff, " ", $badtext); + return $goodtext; +} +$cbnick = get_cbnick; + +$warinfo = get_clans($wid); + +$redteam = $_GET["red"]; + +IF($redteam == $warinfo[0][1]) { + $teamaid = $warinfo[0][1]; + $teambid = $warinfo[1][1]; + $cbteama = $warinfo[0][2]; + $cbteamb = $warinfo[1][2]; + $redteam = 0; + $blueteam = 1; + +} else { + $teamaid = $warinfo[1][1]; + $teambid = $warinfo[0][1]; + $cbteama = $warinfo[1][2]; + $cbteamb = $warinfo[0][2]; + $redteam = 1; + $blueteam = 0; +} + +$teama = str_replace(" $t1score) { + + $twin = 0; + $twin_team = $teama; + $twin_score = $t0score; + + $tlose = 1; + $tlose_team = $teamb; + $tdraw = "0"; + + $tdiff = $t0score+$t1score; + + IF ($tdiff <= 3) { + $reptype = "low"; + } elseIF ($tdiff >= 9) { + $reptype = "high"; + } else { + $reptype = "medium"; + } + +} elseIF ($t0score < $t1score) { + $twin = 1; + $twin_team = $teamb; + $twin_score = $t1score; + + $tlose = 0; + $tlose_team = $teama; + $tdraw = "0"; + + $tdiff = $t1score+$t0score; + + IF ($tdiff <= 2) { + $reptype = "low"; + } elseIF ($tdiff >= 9) { + $reptype = "high"; + } else { + $reptype = "medium"; + } + +} else { + $twin = "0"; + $tlose = "1"; + $tdraw = "1"; + + $tdiff = $t1score+$t0score; + $twin_team = $teama; + $tlose_team = $teamb; + + IF ($tdiff <= 4) { + $reptype = "low"; + } elseIF ($tdiff >= 10) { + $reptype = "high"; + } else { + $reptype = "medium"; + } +} + +// Queries used within the report + +// First blood +$q_fblood = small_query("SELECT firstblood FROM uts_match WHERE id = $id"); + +// Player id of first blood +$t_fblood = small_query("SELECT name FROM uts_pinfo WHERE id = '".$q_fblood[firstblood]."'"); +$t_fbloodid = small_query("SELECT id FROM uts_player WHERE pid = '".$q_fblood[firstblood]."' AND matchid = $id"); +$r_fbloodid = $cbid($t_fbloodid[id]); +$r_fbloodname = $cbnick($t_fblood[name]); + +// Belt count +$q_t0bcount = small_query("SELECT SUM(pu_belt) AS bcount FROM uts_player WHERE matchid = $id AND team = 0 AND pu_belt >0"); +$q_t1bcount = small_query("SELECT SUM(pu_belt) AS bcount FROM uts_player WHERE matchid = $id AND team = 1 AND pu_belt >0"); + +// Amp count +$q_t0acount = small_query("SELECT SUM(pu_amp) AS acount FROM uts_player WHERE matchid = $id AND team = 0 AND pu_amp >0"); +$q_t1acount = small_query("SELECT SUM(pu_amp) AS acount FROM uts_player WHERE matchid = $id AND team = 1 AND pu_amp >0"); + +// Cap count +$q_capsa = small_query("SELECT pi.name, SUM(p.flag_capture) AS flag_caps FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 AND flag_capture >= 1 GROUP BY name"); +$q_capsb = small_query("SELECT pi.name, SUM(p.flag_capture) AS flag_caps FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 AND flag_capture >= 1 GROUP BY name"); + +// Most Flag Grabs (W) +$q_topgrab = small_query("SELECT p.id, pi.name, p.flag_taken FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabid = $cbid($q_topgrab[id]); +$r_topgrabname = $cbnick($q_topgrab[name]); + +// Most Flag Grabs (L) +$q_topgrabl = small_query("SELECT p.id, pi.name, p.flag_taken FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabidl = $cbid($q_topgrabl[id]); +$r_topgrabnamel = $cbnick($q_topgrabl[name]); + +// Most Flag Grabs (D) +$q_topgrabd = small_query("SELECT p.id, pi.name, p.flag_taken, team FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_taken DESC LIMIT 0,1"); +$r_topgrabidd = $cbid($q_topgrabd[id]); +$r_topgrabnamed = $cbnick($q_topgrabd[name]); + +IF ($redteam == $q_topgrabd[team]) { + $r_topgrabteamd = $warinfo[0][2]; + $r_topgrabteamdid = $warinfo[0][1]; +} else { + $r_topgrabteamd = $warinfo[1][2]; + $r_topgrabteamdid = $warinfo[1][1]; +} + + +// Most Flag Covers (W) +$q_topcover = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverid = $cbid($q_topcover[id]); +$r_topcovername = $cbnick($q_topcover[name]); + +// Most Flag Covers (L) +$q_topcoverl = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverlid = $cbid($q_topcoverl[id]); +$r_topcoverlname = $cbnick($q_topcoverl[name]); + +// Most Flag Covers (R) +$q_topcoverr = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverrid = $cbid($q_topcoverr[id]); +$r_topcoverrname = $cbnick($q_topcoverr[name]); + +// Most Flag Covers (B) +$q_topcoverb = small_query("SELECT p.id, pi.name, p.flag_cover FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topcoverbid = $cbid($q_topcoverb[id]); +$r_topcoverbname = $cbnick($q_topcoverb[name]); + +// Most Flag Assists (D) +$q_topassistd = small_query("SELECT p.id, pi.name, p.flag_assist, team FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_cover DESC LIMIT 0,1"); +$r_topassistdid = $cbid($q_topassistd[id]); +$r_topassistdname = $cbnick($q_topassistd[name]); + +IF ($q_topassistd[team] == $redteam) { + $r_topassistdteam = $teamb; +} else { + $r_topassistdteam = $teama; +} + +// Most Flag Seals (W) +$q_topseal = small_query("SELECT p.id, pi.name, p.flag_seal FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_seal DESC LIMIT 0,1"); +$r_topsealid = $cbid($q_topseal[id]); +$r_topsealname = $cbnick($q_topseal[name]); + +// Most Flag Seals (L) +$q_topseall = small_query("SELECT p.id, pi.name, p.flag_seal FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_seal DESC LIMIT 0,1"); +$r_topseallid = $cbid($q_topseall[id]); +$r_topseallname = $cbnick($q_topseall[name]); + +// Top Capper (W) +$q_topcap = small_query("SELECT p.id, pi.name, p.flag_capture FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_capture DESC LIMIT 0,1"); +$r_topcapid = $cbid($q_topcap[id]); +$r_topcapname = $cbnick($q_topcap[name]); + +// Top Capper (D) +$q_topcapd = small_query("SELECT p.id, pi.name, p.flag_capture FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY flag_capture DESC LIMIT 0,1"); +$r_topcapdid = $cbid($q_topcap[id]); +$r_topcapdname = $cbnick($q_topcap[name]); + +// Most Flag Kills (L) +$q_topdefl = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY flag_kill DESC LIMIT 0,1"); +$r_topdeflid = $cbid($q_topdefl[id]); +$r_topdeflname = $cbnick($q_topdefl[name]); + +// Most Flag Kills (W) +$q_topfkill = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_kill DESC LIMIT 0,1"); +$r_topfkillid = $cbid($q_topfkill[id]); +$r_topfkillname = $cbnick($q_topfkill[name]); + +// 2nd Most Flag Kills (W) +$q_topfkill2 = small_query("SELECT p.id, pi.name, p.flag_kill FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY flag_kill DESC LIMIT 1,1"); +$r_topfkillid2 = $cbid($q_topfkill2[id]); +$r_topfkillname2 = $cbnick($q_topfkill2[name]); + +// Most Frags (D) +$q_topfrag = small_query("SELECT p.id, pi.name, p.frags FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id ORDER BY frags DESC LIMIT 0,1"); +$r_topfragid = $cbid($q_topfrag[id]); +$r_topfragname = $cbnick($q_topfrag[name]); + +// Most Frags (W) +$q_topfragw = small_query("SELECT p.id, pi.name, p.frags FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $twin ORDER BY frags DESC LIMIT 0,1"); +$r_topfragwid = $cbid($q_topfkill2[id]); +$r_topfragwname = $cbnick($q_topfkill2[name]); + +// Most Deaths (L) +$q_topdeath = small_query("SELECT p.id, pi.name, p.deaths FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = $tlose ORDER BY deaths DESC LIMIT 0,1"); +$r_topdeathid = $cbid($q_topdeath[id]); +$r_topdeathname = $cbnick($q_topdeath[name]); + +// Player of the Match +$q_topstats = small_query("SELECT p.id, pi.name, p.rank AS prank FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id GROUP BY id, name ORDER BY prank DESC LIMIT 0,1"); +$r_topstatsid = $cbid($q_topstats[id]); +$r_topstatsname = $cbnick($q_topstats[name]); + + +// Write the top of the report (non game specific) + +//Player List for Red Team +echo'_______________________________________________________________________
+'.$teama.' Lineup:
+'; + +$sql_rplayer = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY pi.name ASC"; +$q_rplayer = mysql_query($sql_rplayer); +while ($r_rplayer = mysql_fetch_array($q_rplayer)) { + + echo'[pl]'.$cbid($r_rplayer[id]).','.$cbnick($r_rplayer[name]).'[/pl] '; +} + +//Player List for Blue Team + +echo'
_______________________________________________________________________
+'.$teamb.' Lineup:
+'; + +$sql_bplayer = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY pi.name ASC"; +$q_bplayer = mysql_query($sql_bplayer); +while ($r_bplayer = mysql_fetch_array($q_bplayer)) { + + echo'[pl]'.$cbid($r_bplayer[id]).','.$cbnick($r_bplayer[name]).'[/pl] '; +} +echo '_______________________________________________________________________
+
'; + +// Firstblood and Pickup stats + +echo 'First Blood: [pl]'.$r_fbloodid.','.$r_fbloodname.'[/pl]
+'.$teama.' Belts: '.$q_t0bcount[bcount].'
+'.$teamb.' Belts: '.$q_t1bcount[bcount].'
+'.$teama.' Amps: '.$q_t0acount[acount].'
+'.$teamb.' Amps: '.$q_t1acount[acount].'
+'; + +echo '_______________________________________________________________________
+
+'; + +// Low Scores and a Draw +IF ($reptype == "low" && $tdraw == 1) { + echo'Neither team were better this map, scorline is proof of this.
+ [cl]'.$r_topgrabteamdid.','.$r_topgrabteamd.'[/cl] had the most chances to cap with [pl]'.$r_topgrabidd.','.$r_topgrabnamed.'[/pl] + taking the flag '.$q_topgrabd[flag_taken].' times, but unfortuantely couldnt cap as many as he took.
+
+ Big credit to both teams defences; '; + + IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo '[pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] defended the flag + and got '.$q_topdefl[flag_kill].' flagkills while [pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] + also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers.
+
'; + } else { + echo '[pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] defended the flag + and got '.$q_topfkill[flag_kill].' flagkills while [pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] + also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers.
+
'; + } + + echo'Seems the attackers had a frustrating game on this map, credit to '; + + IF ($q_topcover[flag_cover] >= $q_topcoverl[flag_cover]) { + echo '[pl]'.$r_topcoverid.','.$r_topcovername.'[/pl] for covering his flag carrier + '.$q_topcover[flag_cover].' times and also [pl]'.$r_topcoverlid.','.$r_topcoverlname.'[/pl] + for covering '.$q_topcoverl[flag_cover].' times.
+
'; + } else { + echo '[pl]'.$r_topcoverlid.','.$r_topcoverlname.'[/pl] for covering his flag carrier + '.$q_topcoverl[flag_cover].' times and also [pl]'.$r_topcoverid.','.$r_topcovername.'[/pl] + for covering '.$q_topcover[flag_cover].' times.
+
'; + } + + echo'Well done [pl]'.$r_topfragid.','.$r_topfragname.'[/pl] for ensuring a tight scoreline with + '.$q_topfrag[frags].' frags.
+
+ If this map would be played again between these two clans, we might see a change of strategy + in the attacking play, but the defenders were strong on both sides this time.
+
+ Good game.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.
+ Well played both teams.'; +} + +// Medium Scores and a Draw +IF ($reptype == "medium" && $tdraw == 1) { + echo'An excitingly close game with neither side having the upper hand.
+ Both clans teamplay was about even and the result shows that it could have easily gone either way.
+
+ Capping opportunities came along time after time, with [cl]'.$r_topgrabid.','.$r_topgrabname.'[/cl] + taking the flag '.$q_topgrab[flag_taken].' times and at the other end [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] + taking the flag '.$q_topgrabl[flag_taken].' times. + + Help was at hand for the flag runners with '.$teama.'\'s [pl]'.$r_topcoverrid.','.$r_topcoverrname.'[/pl] + covering '.$q_topcoverr[flag_cover].' times and [pl]'.$r_topcoverbid.','.$r_topcoverbname.'[/pl] + covering '.$q_topcoverb[flag_cover].' times for '.$teamb.'.
+
+ Big credit to both teams defences; '; + + IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo '[pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] defended the flag + and got '.$q_topdefl[flag_kill].' flagkills while [pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] + also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers.
+
'; + } else { + echo '[pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] defended the flag + and got '.$q_topfkill[flag_kill].' flagkills while [pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] + also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers.
+
'; + } + + echo'Both teams showed great teamplay and skill and the scoreline represents this. + Two even lineups for this map.
+
+ Well done [pl]'.$r_topfragid.','.$r_topfragname.'[/pl] who had '.$q_topfrag[frags].' frags.
+
+ Good game.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.
+ Well played both teams.'; +} + +// High Scores and a Draw +IF ($reptype == "high" && $tdraw == 1) { +echo' A very very exciting, close CTF game Im sure both clans will agree.
+This high scoring draw proves that '.$teama.' and '.$teamb.' were evenly matched on this map.
+Teamplay and strategy enabled both teams to cap quite a few times.
+Well done to both teams attackers especially [pl]'.$r_topcapdid.','.$r_topcapdname.'[/pl] +who capped '.$q_topcapd[flag_capture].' times.
+
+ Capping opportunities came along time after time, with [cl]'.$r_topgrabid.','.$r_topgrabname.'[/cl] + taking the flag '.$q_topgrab[flag_taken].' times and at the other end [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] + taking the flag '.$q_topgrabl[flag_taken].' times.
+
+ Help was at hand for the flag runners with '.$teama.'\'s [pl]'.$r_topcoverrid.','.$r_topcoverrname.'[/pl] + covering '.$q_topcoverr[flag_cover].' times and [pl]'.$r_topcoverbid.','.$r_topcoverbname.'[/pl] + covering '.$q_topcoverb[flag_cover].' times for '.$teamb.'.
+
+ Although the defenders probably didnt have as good a game as the attackers on this map, + credit should be awarded to '; + + IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo '[pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] for killing '.$q_topdefl[flag_kill].' + flag carriers and also to '; + } else { + echo '[pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] for killing '.$q_topfkill[flag_kill].' + flag carriers and also to '; + } + + IF ($q_topseall[flag_seal] >= $q_topseal[flag_seal]) { + echo '[pl]'.$r_topseallid.','.$r_topseallname.'[/pl] for sealing the base '.$q_topseall[flag_seal].' + times for his flag carrier to cap.
+
'; + } else { + echo '[pl]'.$r_topsealid.','.$r_topsealname.'[/pl] for sealing the base '.$q_topseal[flag_seal].' + times for his flag carrier to cap.
+
'; + } + + echo' [pl]'.$r_topassistdid.','.$r_topassistdname.'[/pl] helped '.$r_topassistdteam.' get as many + caps as they did by assisting '.$q_topassistd[flag_assist].' times in their caps.
+ This shows great teamplay and cover, well played.
+
+ Both teams showed great teamplay and skill and the scoreline represents this.
+
+ Well done [pl]'.$r_topfragid.','.$r_topfragname.'[/pl] who had '.$q_topfrag[frags].' frags.
+
+ Good game.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.
+ Well played both teams.'; +} + +// Low Scores and not a Draw +IF ($reptype == "low" && $tdraw == 0) { + echo 'Not very many caps in this close game, but '.$twin_team.' emerge victorious.
+
+ Big credit to both teams defences; '; + + IF ($q_topdefl[flag_kill] >= $q_topfkill[flag_kill]) { + echo '[pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] defended the flag + and got '.$q_topdefl[flag_kill].' flagkills while [pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] + also had a pretty nice defensive game killing '.$q_topfkill[flag_kill].' flag carriers.
+
'; + } else { + echo '[pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] defended the flag + and got '.$q_topfkill[flag_kill].' flagkills while [pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] + also had a pretty nice defensive game killing '.$q_topdefl[flag_kill].' flag carriers.
+
'; + } + + echo 'Seems the attackers had a frustrating game on this map, + especially [cl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/cl] who took the flag '.$q_topgrabl[flag_taken].' + and still lost the game :(
+
+ Suportive play was made by [pl]'.$r_topcoverlid.','.$r_topcoverlname.'[/pl] having + '.$q_topcoverl[flag_cover].' covers, but even with covering play, + the majority of the flags got returned and the game ended with '.$tlose_team.' losing out.
+
+ Well done to [pl]'.$r_topcapid.','.$r_topcapname.'[/pl] for capping '.$q_topcap[flag_capture].'.
+ On other days the outcome could have been different.
+
+ Good game and congratualtions '.$twin_team.'.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.
+ Well played both teams.'; +} + +// Medium Scores and not a Draw +IF ($reptype == "medium" && $tdraw == 0) { + echo 'A nice game of Capture the Flag took place this map with both teams trying + hard to get flags back but only occasionally succeeding.
+
+ '.$twin_team.' however managed to succesfully cap more than '.$tlose_team.' with big help + from [pl]'.$r_topcapid.','.$r_topcapname.'[/pl] who capped '.$q_topcap[flag_capture].'. + [pl]'.$r_topgrabid.','.$r_topgrabname.'[/pl] made it hard for the '.$tlose_team.' defenders taking the + flag a total of '.$q_topgrab[flag_taken].' times.
+ Not to say that the defence was bad at all, [pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] + got '.$q_topdefl[flag_kill].' flag kills and this made attacking hard work for '.$twin_team.'.
+
+ Sealing off the base for '.$twin_team.' was some nice defence including + [pl]'.$r_topsealid.','.$r_topsealname.'[/pl] who sealed the base '.$q_topseal[flag_seal].' times.
+ Covering the flag carrier for '.$twin_team.' mostly was [pl]'.$r_topcoverid.','.$r_topcovername.'[/pl] + with '.$q_topcover[flag_cover].' covers.
+
+ Attacking in vain at the other end of the map was [pl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/pl] + who managed to take the '.$twin_team.' flag '.$q_topgrabl[flag_taken].' times, + but unfortunately was unable to match the '.$twin_score.' caps made by '.$twin_team.'.
+ [pl]'.$r_topgrabidl.','.$r_topgrabnamel.'[/pl] was also up against some heavy defence including + [pl]'.$r_topfkillid.','.$r_topfkillname.'[/pl] with '.$q_topfkill[flag_kill].' flag kills and + [pl]'.$r_topfkillid2.','.$r_topfkillname2.'[/pl] with '.$q_topfkill2[flag_kill].' flag kills.
+
+ Good game and congratualtions '.$twin_team.'.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.
+ Well played both teams.'; +} + +// High Scores and not a Draw +IF ($reptype == "high" && $tdraw == 0) { + echo ''.$twin_team.' were victorious thanks to some nice capping by + [pl]'.$r_topcapid.','.$r_topcapname.'[/pl] who capped '.$q_topcap[flag_capture].' and + [pl]'.$r_topgrabid.','.$r_topgrabname.'[/pl] who took the flag'.$q_topgrab[flag_taken].' times.
+
+ [pl]'.$r_topcapid.','.$r_topcapname.'[/pl] probably could not have done it without the help of + [pl]'.$r_topcoverid.','.$r_topcovername.'[/pl] who had '.$q_topcover[flag_cover].' covers and + [pl]'.$r_topsealid.','.$r_topsealname.'[/pl] for sealing the base off + '.$q_topseal[flag_seal].' times.
+
+ Although the '.$tlose_team.' defenders played well, the '.$q_topdefl[flag_kill].' flag kills by + [pl]'.$r_topdeflid.','.$r_topdeflname.'[/pl] was just not enough to stop the + '.$twin_team.' attackers succeeding. Extra Credit should be given to + [pl]'.$r_topfragwid.','.$r_topfragwname.'[/pl] for getting '.$q_topwfrag[frags].' frags.
+ Some sympathy should be given to [pl]'.$r_topdeathid.','.$r_topdeathname.'[/pl] + who died a whopping '.$q_topdeath[deaths].' times - unlucky!.
+
+ All in all, this was a great attacking game for '.$twin_team.', but all players deserve credit for + playing well.
+
+ Good game and congratualtions '.$twin_team.'.
+ Stats player of the map was [pl]'.$r_topstatsid.','.$r_topstatsname.'[/pl] with '.$q_topstats[prank].' + stat points.'; + +} + +echo'
+
+ This report was created with UTStats from the following game:
+ [el]http://'.$oururl.'?p=match&mid='.$id.',http://'.$oururl.'?p=match&mid='.$id.'[/el] + '; +?> \ No newline at end of file diff --git a/html/pages/report/index.htm b/html/pages/report/index.htm new file mode 100755 index 0000000..e69de29 diff --git a/html/pages/report_cb.php b/html/pages/report_cb.php new file mode 100755 index 0000000..ebde5a6 --- /dev/null +++ b/html/pages/report_cb.php @@ -0,0 +1,168 @@ + + + + + + + + + + + + +
Enter the Clanbase WarID
+ +
+'; + +echo' + + + + + + + + +
+ Team BreakDown of Match
Red TeamBlue Team
'; + +$sql_rteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY pi.name ASC"; +$q_rteam = mysql_query($sql_rteam); +while ($r_rteam = mysql_fetch_array($q_rteam)) { + echo''.$r_rteam[name].'
'; + } +echo'
'; + +$sql_bteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY pi.name ASC"; +$q_bteam = mysql_query($sql_bteam); +while ($r_bteam = mysql_fetch_array($q_bteam)) { + echo''.$r_bteam[name].'
'; + } +echo'

'; + +IF ($wid == "") { +} + +IF ($stage >= "1") { + include("includes/clanbase.php"); + $warinfo = get_clans($wid); +} + +IF ($stage == "1") { + $claninfo0 = get_players($warinfo[0][1]); + $claninfo1 = get_players($warinfo[1][1]); + + echo'
+ + + + + + + + + + + + + +
+ Who Played As Red Team?
+ +
+
'; +} + +IF ($stage == "2") { + $redteam = $_GET["red"]; + + IF($redteam == $warinfo[0][1]) { + $redcid = $warinfo[0][1]; + $redname = $warinfo[0][2]; + $redinfo = get_players($warinfo[0][1]); + $bluecid = $warinfo[1][1]; + $bluename = $warinfo[1][2]; + $blueinfo = get_players($warinfo[1][1]); + + } else { + $redcid = $warinfo[1][1]; + $redname = $warinfo[1][2]; + $redinfo = get_players($warinfo[1][1]); + $bluecid = $warinfo[0][1]; + $bluename = $warinfo[0][2]; + $blueinfo = get_players($warinfo[0][1]); + } + + echo'
+ + + + + + + + + + + + + '; + + $redcount = count($redinfo); + $bluecount = count($blueinfo); + + $sql_rteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY pi.name ASC"; + + $q_rteam = mysql_query($sql_rteam); + while($r_rteam = mysql_fetch_array($q_rteam)) { + + echo' + + + '; + } + + echo''; + + + $sql_bteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY pi.name ASC"; + + $q_bteam = mysql_query($sql_bteam); + while($r_bteam = mysql_fetch_array($q_bteam)) { + + echo' + + + '; + } + + echo' + + +
+ Clan and Player Info for Clanbase War ID '.$wid.'
+ '.$redname.'
'.$r_rteam[name].' +
+ '.$bluename.'
'.$r_bteam[name].' +
+ +
'; +} +?> \ No newline at end of file diff --git a/html/pages/servers.php b/html/pages/servers.php new file mode 100755 index 0000000..63d3721 --- /dev/null +++ b/html/pages/servers.php @@ -0,0 +1,74 @@ + $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = preg_replace('/\D/', '', $_GET["page"]); +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*25; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + +echo' +
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + + + '; + +$sql_servers = "SELECT servername, serverip, COUNT(*) AS matchcount, SUM(frags) AS frags, SUM(t0score+t1score+t2score+t3score) AS matchscore, SUM(gametime) AS gametime +FROM uts_match GROUP BY servername, serverip ORDER BY servername ASC LIMIT $qpage,25"; +$q_servers = mysql_query($sql_servers) or die(mysql_error()); +while ($r_servers = mysql_fetch_array($q_servers)) { + + $r_gametime = sec2hour($r_servers[gametime]); + + echo' + + + + + + + + '; +} + +echo' +
Unreal Tournament Server List
Server NameStatusMatchesFragsTeamScoreHours
'.$r_servers[servername].'Server Status'.$r_servers[matchcount].''.$r_servers[frags].''.$r_servers[matchscore].''.$r_gametime.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
'; +?> \ No newline at end of file diff --git a/html/pages/servers_info.php b/html/pages/servers_info.php new file mode 100755 index 0000000..2548197 --- /dev/null +++ b/html/pages/servers_info.php @@ -0,0 +1,104 @@ + $ecount2) { + $ecount2 = $ecount2+1; +} + +$fpage = 0; +IF($ecount < 1) { $lpage = 0; } +else { $lpage = $ecount2-1; } + +$cpage = $_GET["page"]; +IF ($cpage == "") { $cpage = "0"; } +$qpage = $cpage*25; + +$tfpage = $cpage+1; +$tlpage = $lpage+1; + +$ppage = $cpage-1; +$ppageurl = "[Previous]"; +IF ($ppage < "0") { $ppageurl = "[Previous]"; } + +$npage = $cpage+1; +$npageurl = "[Next]"; +IF ($npage >= "$ecount") { $npageurl = "[Next]"; } + +$fpageurl = "[First]"; +IF ($cpage == "0") { $fpageurl = "[First]"; } + +$lpageurl = "[Last]"; +IF ($cpage == "$lpage") { $lpageurl = "[Last]"; } + + +// Get the last match entry for this server + +$serverinfo = small_query("SELECT time, servername, serverinfo, gameinfo, mutators FROM uts_match WHERE serverip = '$serverip' ORDER BY time DESC LIMIT 0,1"); +$matchdate = mdate($serverinfo[time]); + +echo' + + + + + + + + + + + + + + + + + + +
'.$serverinfo[servername].'
Last Match'.$matchdate.'Game Info
Server Info'.$serverinfo[serverinfo].''.$serverinfo[gameinfo].'
Mutators'.$serverinfo[mutators].'
+
'; + +// Do graph stuff +$bgwhere = "serverip = '$serverip'"; +include("pages/graph_mbreakdown.php"); + +echo'
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
+ + + + + + + + + + '; + +$sql_recent = "SELECT m.id, m.time, g.name AS gamename, m.mapfile, m.gametime FROM uts_match AS m, uts_games AS g WHERE g.id = m.gid AND m.serverip = '$serverip' ORDER BY m.time DESC LIMIT $qpage,25"; +$q_recent = mysql_query($sql_recent) or die(mysql_error()); +while ($r_recent = mysql_fetch_array($q_recent)) { + + $r_time = mdate($r_recent[time]); + $r_mapfile = un_ut($r_recent[mapfile]); + $r_gametime = sec2min($r_recent[gametime]); + $myurl = urlencode($r_mapfile); + + echo' + + + + + + '; +} + +echo' +
Unreal Tournament Match List
Date/TimeMatch TypeMapTime
'.$r_time.''.$r_recent[gamename].''.$r_mapfile.''.$r_gametime.'
+
Page ['.$tfpage.'/'.$tlpage.'] Selection: '.$fpageurl.' / '.$ppageurl.' / '.$npageurl.' / '.$lpageurl.'
'; +?> \ No newline at end of file diff --git a/html/pages/servers_query.php b/html/pages/servers_query.php new file mode 100755 index 0000000..95265c6 --- /dev/null +++ b/html/pages/servers_query.php @@ -0,0 +1,176 @@ +\n"; + exit; +} + +fputs($sock,"\\status\\\player_property\Health\\\game_property\ElapsedTime\\\game_property\RemainingTime\\"); + +$gotfinal = False; +$data = ""; + +//Set starttime, for possible loop expiration, so the server doesn't get too much work. +$starttime = Time(); + +//Loop until final packet has been received. +while(!($gotfinal == True || feof($sock))) { + + //Get data + if(($buf = fgetc($sock)) == FALSE) { + usleep(100); // wait for additional data? :S whatever + } + + //Add to databuffer + $data .= $buf; + + //Check if final item (queryid) has been received + if (strpos($data,"final\\") != False) { + $gotfinal = True; + } + + //Protect webserver against massive loop. + if ((Time() - $starttime) > 5) { + echo "Data receiving took too long. Cancelled.

"; + $gotfinal = True; + } +} + +//Close socket +fclose ($sock); + + +//Split chunks by \ +$chunks = split('[\]', $data); + +$mappic = strtolower("images/maps/".$map.".jpg"); + +if (file_exists($mappic)) { +} else { + $mappic = ("images/maps/blank.jpg"); +} + +$mapname = getiteminfo("mapname",$chunks); +$mappic = strtolower("images/maps/".$mapname.".jpg"); +IF (file_exists($mappic)) { + } else { + $mappic = "images/maps/blank.jpg"; +} + +$r_hostname = getiteminfo("hostname",$chunks); +$r_gametype = getiteminfo("gametype",$chunks); + +$r_adminname = getiteminfo("adminname",$chunks); +$r_adminemail = getiteminfo("adminemail",$chunks); + +$r_password = getiteminfo("password",$chunks); +$r_timelimit = getiteminfo("timelimit",$chunks); +$r_remainingtime = GetMinutes(getiteminfo("RemainingTime",$chunks)) . " mins"; +$r_elapsedtime = GetMinutes(getiteminfo("ElapsedTime",$chunks)) . " mins"; + +$r_goalteamscore = getiteminfo("goalteamscore",$chunks); +$r_numplayers = getiteminfo("numplayers",$chunks); +$r_minplayers = getiteminfo("minplayers",$chunks); +$r_maxplayers = getiteminfo("maxplayers",$chunks); +$r_maxteams = getiteminfo("maxteams",$chunks); + +$r_balanceteams = getiteminfo("balanceteams",$chunks); +$r_tournament = getiteminfo("tournament",$chunks); +$r_friendlyfire = getiteminfo("friendlyfire",$chunks); +$r_gamestyle = getiteminfo("gamestyle",$chunks); + +echo' + + + + + + + + + + + + + + + + + + + + + + + + + +
Server Status for '.$r_hostname.'
Server IP'.$serverip.':'.$serverport.''.$mapname.'
Map Name'.$mapname.'
Match Type'.$r_gametype.'
Server InfoAdmin: '.$r_adminname.'
Email: '.$r_adminemail.'
Game Info + Goal Team Score: '.$r_goalteamscore.'
+ Min Players: '.$r_minplayers.'
+ Max Players: '.$r_maxplayers.'
+ Max Teams: '.$r_maxteams.'
+ Balanced Teams: '.$r_balanceteams.'
+ Tournament Mode: '.$r_tournament.'
+ Friendly Fire: '.$r_friendlyfire.'
+ Game Style: '.$r_gamestyle.'

+ Time Limit: '.$r_timelimit.'
+ Time Remaining: '.$r_remainingtime.'
+ Time Elapsed: '.$r_elapsedtime.'
+ Password Required: '.$r_password.'
+
+
+ + + + + + + + + + + + + '; + +//Loop through all players +for ($i = 0; $i < $r_numplayers; $i++) { + $actualid = $i; + $itemx = $i+1; + + $r_playername = getiteminfo("player_" . $actualid,$chunks); + $r_playerfrags = getiteminfo("frags_" . $actualid,$chunks); + $r_playerteam = getiteminfo("team_" . $actualid,$chunks); + $r_playerping = getiteminfo("ping_" . $actualid,$chunks); + $r_playerhealth = getiteminfo("Health_" . $itemx,$chunks); + + echo' + + + + + + '; +} + +echo'
Player Information
PlayerFragsTeamPingHealth
'.$r_playername.''.$r_playerfrags.''.$r_playerteam.''.$r_playerping.''.$r_playerhealth.'
'; +?> \ No newline at end of file diff --git a/html/pages/totals.php b/html/pages/totals.php new file mode 100755 index 0000000..64acedd --- /dev/null +++ b/html/pages/totals.php @@ -0,0 +1,606 @@ + + + Totals Summary + + +
+ + + + + + + + + + + + + + '; + +$sql_totsumm = "SELECT g.name AS gamename, SUM(p.gamescore) AS gamescore, SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, COUNT(DISTINCT p.matchid) AS matchcount, SUM(p.gametime) AS sumgametime +FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id GROUP BY gamename ORDER BY gamename ASC"; +$q_totsumm = mysql_query($sql_totsumm) or die(mysql_error()); +while ($r_totsumm = zero_out(mysql_fetch_array($q_totsumm))) { + + $gametime = sec2hour($r_totsumm[sumgametime]); + + echo' + + + + + + + + + + '; +} + +$sql_summtot = zero_out(small_query("SELECT SUM(gamescore) AS gamescore, SUM(frags) AS frags, SUM(kills) AS kills, SUM(suicides) AS suicides, SUM(teamkills) AS teamkills, COUNT(DISTINCT matchid) AS matchcount, SUM(gametime) AS sumgametime +FROM uts_player")); + +$gametime2 = sec2hour($sql_summtot[sumgametime]); + +echo' + + + + + + + + + + +
Summary
Game TypeScoreFragsKillsSuicidesTeam KillsMatchesHours
'.$r_totsumm[gamename].''.$r_totsumm[gamescore].''.$r_totsumm[frags].''.$r_totsumm[kills].''.$r_totsumm[suicides].''.$r_totsumm[teamkills].''.$r_totsumm[matchcount].''.$gametime.'
Totals'.$sql_summtot[gamescore].''.$sql_summtot[frags].''.$sql_summtot[kills].''.$sql_summtot[suicides].''.$sql_summtot[teamkills].''.$sql_summtot[matchcount].''.$gametime2.'
+
+ + + + + + + + + + + + + + + + + + + + '; + + $q_assgids = mysql_query("SELECT id FROM uts_games WHERE gamename LIKE '%Assault%';") or die(mysql_error()); + $assgids = array(); + while ($r_assgids = mysql_fetch_array($q_assgids)) { + $assgids[] = $r_assgids['id']; + } + $assquery = (count($assgids) > 0) ? 'SUM(IF (gid IN ('. implode(',', $assgids) .'), ass_obj, 0)) AS ass_obj' : '0 AS ass_obj'; + + $sql_cdatot = zero_out(small_query("SELECT SUM(dom_cp) AS dom_cp, $assquery, SUM(flag_taken) AS flag_taken, + SUM(flag_pickedup) AS flag_pickedup, SUM(flag_dropped) AS flag_dropped, SUM(flag_assist) AS flag_assist, SUM(flag_cover) AS flag_cover, + SUM(flag_seal) AS flag_seal, SUM(flag_capture) AS flag_capture, SUM(flag_kill)as flag_kill, + SUM(flag_return) AS flag_return FROM uts_player")); + + echo' + + + + + + + + + + + + + +
Assault, Domination and CTF Events Summary
Assault ObjectivesControl Point CapturesCapture The Flag
Flag TakesFlag PickupsFlag DropsFlag AssistsFlag CoversFlag SealsFlag CapturesFlag KillsFlag Returns
'.$sql_cdatot[ass_obj].''.$sql_cdatot[dom_cp].''.$sql_cdatot[flag_taken].''.$sql_cdatot[flag_pickedup].''.$sql_cdatot[flag_dropped].''.$sql_cdatot[flag_assist].''.$sql_cdatot[flag_cover].''.$sql_cdatot[flag_seal].''.$sql_cdatot[flag_capture].''.$sql_cdatot[flag_kill].''.$sql_cdatot[flag_return].'
+
+ + + + '; + +$sql_firstblood = zero_out(small_count("SELECT firstblood FROM uts_match WHERE firstblood != ''")); +$sql_multis = zero_out(small_query("SELECT SUM(spree_double) AS spree_double, SUM(spree_multi) AS spree_multi, SUM(spree_ultra) AS spree_ultra, SUM(spree_monster) AS spree_monster FROM uts_player")); +$sql_sprees = zero_out(small_query("SELECT SUM(spree_kill) AS spree_kill, SUM(spree_rampage) AS spree_rampage, SUM(spree_dom) AS spree_dom, SUM(spree_uns) AS spree_uns, SUM(spree_god) AS spree_god FROM uts_player")); + + echo' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Special Events
Special/MultisSprees
First Blood'.$sql_firstblood.'Killing Spree'.$sql_sprees[spree_kill].'
Double Kills'.$sql_multis[spree_double].'Rampage'.$sql_sprees[spree_rampage].'
Multi Kills'.$sql_multis[spree_multi].'Dominating'.$sql_sprees[spree_dom].'
Ultra Kills'.$sql_multis[spree_ultra].'Unstoppable'.$sql_sprees[spree_uns].'
Monster Kills'.$sql_multis[spree_monster].'Godlike'.$sql_sprees[spree_god].'
+
'; + +include('includes/weaponstats.php'); +weaponstats(0, 0); + +echo'
+ + + + +
Totals for Players
'; + +// NGStats Style Total Highs (All Time) + +$sql_chighfrags = small_query("SELECT p.pid, pi.name, p.country, SUM(frags) AS frags , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY frags DESC LIMIT 0,1"); +$sql_chighdeaths = small_query("SELECT p.pid, pi.name, p.country, SUM(deaths) AS deaths , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY deaths DESC LIMIT 0,1"); +$sql_chighkills = small_query("SELECT p.pid, pi.name, p.country, SUM(kills) AS kills , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY kills DESC LIMIT 0,1"); +$sql_chighsuicides = small_query("SELECT p.pid, pi.name, p.country, SUM(suicides) AS suicides , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY suicides DESC LIMIT 0,1"); +$sql_chighteamkills = small_query("SELECT p.pid, pi.name, p.country, SUM(teamkills) AS teamkills , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY teamkills DESC LIMIT 0,1"); +$sql_chigheff = small_query("SELECT p.pid, pi.name, p.country, AVG(eff) AS eff , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY eff DESC LIMIT 0,1"); +$sql_chighaccuracy = small_query("SELECT p.pid, pi.name, p.country, AVG(accuracy) AS accuracy , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY accuracy DESC LIMIT 0,1"); +$sql_chighttl = small_query("SELECT p.pid, pi.name, p.country, AVG(ttl) AS ttl , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY ttl DESC LIMIT 0,1"); +$sql_chighflag_capture = small_query("SELECT p.pid, pi.name, p.country, SUM(flag_capture) AS flag_capture , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY flag_capture DESC LIMIT 0,1"); +$sql_chighflag_kill = small_query("SELECT p.pid, pi.name, p.country, SUM(flag_kill) AS flag_kill , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY flag_kill DESC LIMIT 0,1"); +$sql_chighdom_cp = small_query("SELECT p.pid, pi.name, p.country, SUM(dom_cp) AS dom_cp , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY dom_cp DESC LIMIT 0,1"); + +$ass_obj_check = small_query("SELECT COUNT(id) AS idcount FROM uts_games WHERE gamename LIKE '%Assault%';") or die(mysql_error()); +IF ($ass_obj_check[idcount] > 0 ) { + $sql_chighass_obj = small_query("SELECT p.pid, pi.name, p.country, SUM(ass_obj) AS ass_obj , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY ass_obj DESC LIMIT 0,1"); +} else { + $sql_chighass_obj = ""; +} + +$sql_chighspree_monster = small_query("SELECT p.pid, pi.name, p.country, SUM(spree_monster) AS spree_monster , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY spree_monster DESC LIMIT 0,1"); +$sql_chighspree_god = small_query("SELECT p.pid, pi.name, p.country, SUM(spree_god) AS spree_god , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY spree_god DESC LIMIT 0,1"); +$sql_chighrank = small_query("SELECT p.pid, pi.name, p.country, SUM(rank) AS rank , SUM(gametime) AS sumgametime, COUNT(matchid) AS mcount FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' GROUP BY pid HAVING sumgametime > 1800 ORDER BY rank DESC LIMIT 0,1"); + +echo'
+ + + + + + + + + + + + '; +if ($sql_chighfrags and $sql_chighfrags[frags]) { + echo ' + + + + + + + '; +} +if ($sql_chighdeaths and $sql_chighdeaths[deaths]) { + echo ' + + + + + + + '; +} +if ($sql_chighkills and $sql_chighkills[kills]) { + echo ' + + + + + + + '; +} +if ($sql_chighsuicides and $sql_chighsuicides[suicides]) { + echo ' + + + + + + + '; +} +if ($sql_chighteamkills and $sql_chighteamkills[teamkills]) { + echo ' + + + + + + + '; +} +if ($sql_chigheff and $sql_chigheff[eff]) { + echo ' + + + + + + + '; +} +if ($sql_chighaccuracy and $sql_chighaccuracy[accuracy]) { + echo ' + + + + + + + '; +} +if ($sql_chighttl and $sql_chighttl[ttl]) { + echo ' + + + + + + + '; +} +if ($sql_chighflag_capture and $sql_chighflag_capture[flag_capture]) { + echo ' + + + + + + + '; +} +if ($sql_chighflag_kill and $sql_chighflag_kill[flag_kill]) { + echo ' + + + + + + + '; +} +if ($sql_chighdom_cp and $sql_chighdom_cp[dom_cp]) { + echo ' + + + + + + + '; +} +if ($sql_chighass_obj and $sql_chighass_obj[ass_obj]) { + echo ' + + + + + + + '; +} +if ($sql_chighspree_monster and $sql_chighspree_monster[spree_monster]) { + echo ' + + + + + + + '; +} +if ($sql_chighspree_god and $sql_chighspree_god[spree_god]) { + echo ' + + + + + + + '; +} +if ($sql_chighrank and $sql_chighrank[rank]) { + echo ' + + + + + + + '; +} +echo ' +
Career Highs
CategoryPlayerAmountHoursMatches
Frags'.FlagImage($sql_chighfrags['country'], false).' '.$sql_chighfrags[name].''.$sql_chighfrags[frags].''.sec2hour($sql_chighfrags[sumgametime]).''.$sql_chighfrags[mcount].'
Deaths'.FlagImage($sql_chighdeaths['country'], false).' '.$sql_chighdeaths[name].''.$sql_chighdeaths[deaths].''.sec2hour($sql_chighdeaths[sumgametime]).''.$sql_chighdeaths[mcount].'
Kills'.FlagImage($sql_chighkills['country'], false).' '.$sql_chighkills[name].''.$sql_chighkills[kills].''.sec2hour($sql_chighkills[sumgametime]).''.$sql_chighkills[mcount].'
Suicides'.FlagImage($sql_chighsuicides['country'], false).' '.$sql_chighsuicides[name].''.$sql_chighsuicides[suicides].''.sec2hour($sql_chighsuicides[sumgametime]).''.$sql_chighsuicides[mcount].'
Team Kills'.FlagImage($sql_chighteamkills['country'], false).' '.$sql_chighteamkills[name].''.$sql_chighteamkills[teamkills].''.sec2hour($sql_chighteamkills[sumgametime]).''.$sql_chighteamkills[mcount].'
Efficiency'.FlagImage($sql_chigheff['country'], false).' '.$sql_chigheff[name].''.get_dp($sql_chigheff[eff]).''.sec2hour($sql_chigheff[sumgametime]).''.$sql_chigheff[mcount].'
Accuracy'.FlagImage($sql_chighaccuracy['country'], false).' '.$sql_chighaccuracy[name].''.get_dp($sql_chighaccuracy[accuracy]).''.sec2hour($sql_chighaccuracy[sumgametime]).''.$sql_chighaccuracy[mcount].'
TTL'.FlagImage($sql_chighttl['country'], false).' '.$sql_chighttl[name].''.get_dp($sql_chighttl[ttl]).''.sec2hour($sql_chighttl[sumgametime]).''.$sql_chighttl[mcount].'
Flag Caps'.FlagImage($sql_chighflag_capture['country'], false).' '.$sql_chighflag_capture[name].''.$sql_chighflag_capture[flag_capture].''.sec2hour($sql_chighflag_capture[sumgametime]).''.$sql_chighflag_capture[mcount].'
Flag Kills'.FlagImage($sql_chighflag_kill['country'], false).' '.$sql_chighflag_kill[name].''.$sql_chighflag_kill[flag_kill].''.sec2hour($sql_chighflag_kill[sumgametime]).''.$sql_chighflag_kill[mcount].'
Domination Control Points'.FlagImage($sql_chighdom_cp['country'], false).' '.$sql_chighdom_cp[name].''.$sql_chighdom_cp[dom_cp].''.sec2hour($sql_chighdom_cp[sumgametime]).''.$sql_chighdom_cp[mcount].'
Assault Objectives'.FlagImage($sql_chighass_obj['country'], false).' '.$sql_chighass_obj[name].''.$sql_chighass_obj[ass_obj].''.sec2hour($sql_chighass_obj[sumgametime]).''.$sql_chighass_obj[mcount].'
Monster Kills'.FlagImage($sql_chighspree_monster['country'], false).' '.$sql_chighspree_monster[name].''.$sql_chighspree_monster[spree_monster].''.sec2hour($sql_chighspree_monster[sumgametime]).''.$sql_chighspree_monster[mcount].'
Godlikes'.FlagImage($sql_chighspree_god['country'], false).' '.$sql_chighspree_god[name].''.$sql_chighspree_god[spree_god].''.sec2hour($sql_chighspree_god[sumgametime]).''.$sql_chighspree_god[mcount].'
Rank Points'.FlagImage($sql_chighrank['country'], false).' '.$sql_chighrank[name].''.get_dp($sql_chighrank[rank]).''.sec2hour($sql_chighrank[sumgametime]).''.$sql_chighrank[mcount].'
+
'; + + +// NGStats Style Total Highs (Single Match) + +$sql_mhighfrags = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(frags) AS frags , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND frags > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY frags DESC LIMIT 0,1"); +$sql_mhighdeaths = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(deaths) AS deaths , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND deaths > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY deaths DESC LIMIT 0,1"); +$sql_mhighkills = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(kills) AS kills , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND kills > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY kills DESC LIMIT 0,1"); +$sql_mhighsuicides = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(suicides) AS suicides , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND suicides > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY suicides DESC LIMIT 0,1"); +$sql_mhighteamkills = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(teamkills) AS teamkills , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND teamkills > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY teamkills DESC LIMIT 0,1"); +$sql_mhigheff = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(eff) AS eff , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND eff > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY eff DESC LIMIT 0,1"); +$sql_mhighaccuracy = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(accuracy) AS accuracy , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND accuracy > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY accuracy DESC LIMIT 0,1"); +$sql_mhighttl = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(ttl) AS ttl , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND ttl > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY ttl DESC LIMIT 0,1"); +$sql_mhighflag_capture = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(flag_capture) AS flag_capture , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND flag_capture > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY flag_capture DESC LIMIT 0,1"); +$sql_mhighflag_kill = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(flag_kill) AS flag_kill , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND flag_kill > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY flag_kill DESC LIMIT 0,1"); +$sql_mhighdom_cp = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(dom_cp) AS dom_cp , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND dom_cp > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY dom_cp DESC LIMIT 0,1"); + +$ass_obj_check = small_query("SELECT COUNT(id) AS idcount FROM uts_games WHERE gamename LIKE '%Assault%';") or die(mysql_error()); +IF ($ass_obj_check[idcount] > 0 ) { + $sql_mhighass_obj = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(ass_obj) AS ass_obj , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND ass_obj > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY ass_obj DESC LIMIT 0,1"); +} else { + $sql_mhighass_obj = ""; +} + +$sql_mhighspree_monster = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(spree_monster) AS spree_monster , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND spree_monster > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY spree_monster DESC LIMIT 0,1"); +$sql_mhighspree_god = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(spree_god) AS spree_god , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND spree_god > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY spree_god DESC LIMIT 0,1"); +$sql_mhighrank = small_query("SELECT p.matchid, p.pid, pi.name, p.country, SUM(rank) AS rank , SUM(gametime) AS sumgametime FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND pi.banned <> 'Y' AND rank > 0 GROUP BY matchid, pid HAVING sumgametime > 600 ORDER BY rank DESC LIMIT 0,1"); + +echo' + + + + + + + + + + '; + +if ($sql_mhighfrags) { + echo ' + + + + + + '; +} +if ($sql_mhighdeaths) { + echo ' + + + + + + '; +} +if ($sql_mhighkills) { + echo ' + + + + + + '; +} +if ($sql_mhighsuicides) { + echo ' + + + + + + '; +} +if ($sql_mhighteamkills) { + echo ' + + + + + + '; +} +if ($sql_mhigheff) { + echo ' + + + + + + '; +} +if ($sql_mhighaccuracy) { + echo ' + + + + + + '; +} +if ($sql_mhighttl) { + echo ' + + + + + + '; +} +if ($sql_mhighflag_capture) { + echo ' + + + + + + '; +} +if ($sql_mhighflag_kill) { + echo ' + + + + + + '; +} +if ($sql_mhighdom_cp) { + echo ' + + + + + + '; +} +if ($sql_mhighass_obj) { + echo ' + + + + + + '; +} +if ($sql_mhighspree_monster) { + echo ' + + + + + + '; +} +if ($sql_mhighspree_god) { + echo ' + + + + + + '; +} +if ($sql_mhighrank) { + echo ' + + + + + + '; +} +echo ' +
Match Highs
CategoryPlayerAmountMatch
Frags'.FlagImage($sql_mhighfrags['country'], false).' '.$sql_mhighfrags[name].''.$sql_mhighfrags[frags].'(click)
Deaths'.FlagImage($sql_mhighdeaths['country'], false).' '.$sql_mhighdeaths[name].''.$sql_mhighdeaths[deaths].'(click)
Kills'.FlagImage($sql_mhighkills['country'], false).' '.$sql_mhighkills[name].''.$sql_mhighkills[kills].'(click)
Suicides'.FlagImage($sql_mhighsuicides['country'], false).' '.$sql_mhighsuicides[name].''.$sql_mhighsuicides[suicides].'(click)
Team Kills'.FlagImage($sql_mhighteamkills['country'], false).' '.$sql_mhighteamkills[name].''.$sql_mhighteamkills[teamkills].'(click)
Efficiency'.FlagImage($sql_mhigheff['country'], false).' '.$sql_mhigheff[name].''.get_dp($sql_mhigheff[eff]).'(click)
Accuracy'.FlagImage($sql_mhighaccuracy['country'], false).' '.$sql_mhighaccuracy[name].''.get_dp($sql_mhighaccuracy[accuracy]).'(click)
TTL'.FlagImage($sql_mhighttl['country'], false).' '.$sql_mhighttl[name].''.get_dp($sql_mhighttl[ttl]).'(click)
Flag Caps'.FlagImage($sql_mhighflag_capture['country'], false).' '.$sql_mhighflag_capture[name].''.$sql_mhighflag_capture[flag_capture].'(click)
Flag Kills'.FlagImage($sql_mhighflag_kill['country'], false).' '.$sql_mhighflag_kill[name].''.$sql_mhighflag_kill[flag_kill].'(click)
Domination Control Points'.FlagImage($sql_mhighdom_cp['country'], false).' '.$sql_mhighdom_cp[name].''.$sql_mhighdom_cp[dom_cp].'(click)
Assault Objectives'.FlagImage($sql_mhighass_obj['country'], false).' '.$sql_mhighass_obj[name].''.$sql_mhighass_obj[ass_obj].'(click)
Monster Kills'.FlagImage($sql_mhighspree_monster['country'], false).' '.$sql_mhighspree_monster[name].''.$sql_mhighspree_monster[spree_monster].'(click)
Godlikes'.FlagImage($sql_mhighspree_god['country'], false).' '.$sql_mhighspree_god[name].''.$sql_mhighspree_god[spree_god].'(click)
Rank Points'.FlagImage($sql_mhighrank['country'], false).' '.$sql_mhighrank[name].''.get_dp($sql_mhighrank[rank]).'(click)
+
+ + + + + + + + + + + +'; + +$sql_mweapons = "SELECT id, name, image FROM uts_weapons WHERE hide <> 'Y' ORDER BY sequence, id ASC"; +$q_mweapons = mysql_query($sql_mweapons) or die(mysql_error()); +while ($r_mweapons = mysql_fetch_array($q_mweapons)) { + + $wid = $r_mweapons[id]; + $sql_mweaponsl = "SELECT w.pid AS playerid, pi.name AS name, pi.country AS country, SUM(w.kills) as kills, COUNT(DISTINCT w.matchid) AS mcount FROM uts_weaponstats AS w LEFT JOIN uts_pinfo AS pi ON w.pid = pi.id WHERE w.weapon = '$wid' AND w.pid > 0 AND w.matchid <> 0 AND pi.banned <> 'Y' GROUP BY w.pid ORDER BY kills DESC LIMIT 0,1"; + $q_mweaponsl = mysql_query($sql_mweaponsl) or die(mysql_error()); + while ($r_mweaponsl = mysql_fetch_array($q_mweaponsl)) { + + echo ' + + + + + '; + + } +} + +echo '
Weapon Career Highs
CategoryPlayerKillsMatches
'.$r_mweapons[name].''.FlagImage($r_mweaponsl[country], false).' '.$r_mweaponsl[name].''.$r_mweaponsl[kills].''.$r_mweaponsl[mcount].'
+
'; + +// NGStats Style Weapon Highs (All Time) + +echo ' + + + + + + + + + + +'; + +$sql_mweapons = "SELECT id, name, image FROM uts_weapons WHERE hide <> 'Y' ORDER BY sequence, id ASC"; +$q_mweapons = mysql_query($sql_mweapons) or die(mysql_error()); +while ($r_mweapons = mysql_fetch_array($q_mweapons)) { + + $wid = $r_mweapons[id]; + $sql_mweaponsl = "SELECT w.matchid, w.pid AS playerid, pi.name AS name, pi.country AS country, w.kills FROM uts_weaponstats AS w LEFT JOIN uts_pinfo AS pi ON w.pid = pi.id WHERE w.weapon = '$wid' AND w.pid > 0 AND w.matchid > 0 AND pi.banned <> 'Y' ORDER BY w.kills DESC LIMIT 0,1"; + $q_mweaponsl = mysql_query($sql_mweaponsl) or die(mysql_error()); + while ($r_mweaponsl = mysql_fetch_array($q_mweaponsl)) { + + echo ' + + + + + '; + } +} + +// NGStats Style Weapon Highs (Single Match) +echo'
Weapon Match Highs
CategoryPlayerKillsMatch
'.$r_mweapons[name].''.FlagImage($r_mweaponsl[country], false).' '.$r_mweaponsl[name].''.$r_mweaponsl[kills].'(click)
'; +?> diff --git a/html/pages/watchlist.php b/html/pages/watchlist.php new file mode 100755 index 0000000..bfc8512 --- /dev/null +++ b/html/pages/watchlist.php @@ -0,0 +1,106 @@ + + + Your Watchlist + +'; +echo '


'; + + +$watchlist = GetCurrentWatchlist(); +if (count($watchlist) > 25) $watchlist = array_slice($watchlist, 0, 25); +if (count($watchlist) == 0) { + echo "

Your watchlist is empty!

You can add players to your watchlist by clicking the appropriate icon on the header of their career summary page.

"; + return; +} + +echo ' + + + + + + + + + + + + + + + + '; + + +$i = 0; +foreach($watchlist as $pid) { + $sql_players = "SELECT pi.id AS pid, + pi.name, + pi.country, + m.time, + m.id AS mid + FROM uts_pinfo pi, + uts_match m, + uts_player p + WHERE pi.id = '$pid' + AND p.matchid = m.id + AND p.pid = pi.id + ORDER BY m.time DESC + LIMIT 0,1 + "; + + $sql_pinfo = " SELECT COUNT(*) AS games, + SUM(p.gamescore) as gamescore, + SUM(p.frags) AS frags, + SUM(p.kills) AS kills, + SUM(p.deaths) AS deaths, + SUM(p.suicides) as suicides, + AVG(p.eff) AS eff, + AVG(p.accuracy) AS accuracy, + AVG(p.ttl) AS ttl, + SUM(gametime) as gametime + FROM uts_player AS p + WHERE p.pid = '$pid' + GROUP BY p.pid"; + $r_pinfo = small_query($sql_pinfo); + + $q_players = mysql_query($sql_players) or die(mysql_error()); + + + while ($r_players = mysql_fetch_array($q_players)) { + $i++; + $new = (mtimestamp($r_players['time']) > $s_lastvisit) ? true : false; + $class = ($i % 2) ? 'grey' : 'grey2'; + echo ''; + echo ''; + echo ''; + + echo ' + + + + + + + + + + '; + + echo ''; + } +} + +echo '
Player NameLast MatchMatchesScoreFragsKillsDeathsSuicidesEffAccTTLHours
'; + echo FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name']); + echo '';; + if ($new) echo ""; + echo date("Y-m-d H:i", mtimestamp($r_players['time'])); + if ($new) echo ""; + echo ''.$r_pinfo['games'].''.$r_pinfo['gamescore'].''.$r_pinfo['frags'].''.$r_pinfo['kills'].''.$r_pinfo['deaths'].''.$r_pinfo['suicides'].''.get_dp($r_pinfo['eff']).''.get_dp($r_pinfo['accuracy']).''.GetMinutes($r_pinfo['ttl']).''.sec2hour($r_pinfo['gametime']).'
'; + + +?> diff --git a/html/pic.php b/html/pic.php new file mode 100755 index 0000000..8123dd7 --- /dev/null +++ b/html/pic.php @@ -0,0 +1,348 @@ + $value) { + $search[] = $key; + $replace[] = $value; + } + } + + $text = str_replace($search, $replace, $text); + + if (!empty($searchrepl['%GID%'])) { + $rankingtext = RankImageOrText($searchrepl['%PID%'], $searchrepl['%PLAYERNAME%'], 0, $searchrepl['%GID%'], $searchrepl['%GAMENAME%'], false, $text, NULL); + if (!empty($rankingtext)) $text = $rankingtext; + } + return($text); +} + + + +function get_values($date_from, $date_to, $pid, $gid, $prefix, &$searchrepl) { + $sql_time = (empty($date_from)) ? '' : "AND m.time >= '".date("YmdHis", $week_start)."' and m.time <= '".date("YmdHis", $week_end); + $sql_gid = (empty($gid)) ? '' : "AND m.gid = '$gid'"; + $sql_order = ($prefix != 'LM') ? '' : 'ORDER BY m.time DESC LIMIT 0,1'; + $sql_groupby = ($prefix != 'LM') ? 'p.pid' : '1'; + $sql = " SELECT m.time AS gamedate, + COUNT(*) AS games, + SUM(p.gamescore) as gamescore, + SUM(p.frags) AS frags, + SUM(p.kills) AS kills, + SUM(p.deaths) AS deaths, + SUM(p.suicides) as suicides, + AVG(p.eff) AS eff, + AVG(p.accuracy) AS acc, + AVG(p.ttl) AS ttl, + SUM(p.gametime) as gametime, + SUM(p.flag_capture) as flag_capture, + SUM(p.flag_cover) as flag_cover, + SUM(p.flag_seal) as flag_cover, + SUM(p.flag_assist) as flag_assist, + SUM(p.flag_kill) as flag_kill, + SUM(p.flag_pickedup) as flag_pickedup, + SUM(p.dom_cp) as dom_cp, + SUM(p.ass_obj) as ass_obj, + SUM(p.spree_double) as spree_double, + SUM(p.spree_triple) as spree_triple, + SUM(p.spree_multi) as spree_multi, + SUM(p.spree_mega) as spree_mega, + SUM(p.spree_ultra) as spree_ultra, + SUM(p.spree_monster) as spree_monster, + SUM(p.spree_kill) as spree_kill, + SUM(p.spree_rampage) as spree_rampage, + SUM(p.spree_dom) as spree_dom, + SUM(p.spree_uns) as spree_uns, + SUM(p.spree_god) as spree_god, + SUM(p.pu_pads) as pu_pads, + SUM(p.pu_armour) as pu_armour, + SUM(p.pu_keg) as pu_keg, + SUM(p.pu_invis) as pu_invis, + SUM(p.pu_belt) as pu_belt, + SUM(p.pu_amp) as pu_amp, + SUM(p.rank) as rankmovement + FROM uts_match AS m, + uts_player AS p + WHERE m.id = p.matchid + $sql_time + $sql_gid + AND p.pid = '$pid' + GROUP BY $sql_groupby + $sql_order"; + $result = small_query($sql); + if (!$result) return; + foreach($result as $name => $value) { + $name = strtoupper($name); + switch($name) { + case 'EFF': $value = get_dp($value); break; + case 'ACC': $value = get_dp($value); break; + case 'TTL': $value = GetMinutes($value); break; + case 'GAMETIME': $value = sec2hour($value); break; + case 'GAMEDATE': $value = date("Y-m-d H:i", mtimestamp($value)); break; + case 'RANKMOVEMENT': $value = ($value >= 0) ? '+'.get_dp($value) : get_dp($value); break; + } + $searchrepl["%${prefix}_${name}%"] = $value; + } +} + + + + +?> + $gid, + '%PID%' => $pid, + '%GAMENAME%' => $gamename, + '%PLAYERNAME%' => $playername, + '%PLAYERCOUNTRY%' => strtoupper($playercountry) + ); +//$search = array('%RT%', '%RN%', '%RP%', '%RI%', '%GN%', '%PN%', '%IT%'); +//$replace = array($ranktext, $rank, $points, $img, $gamename, $name, $imageortext); + + +// Add all texts that are used in this pic to one big string +// We'll use this string to determine which values the user wants +// and hence which we'll have to provide +$textstrings = ''; +foreach ($pic[$num]['process'] as $process) { + if ($process['type'] != 'text') continue; + $textstrings .= $process['value']; +} + + +$ts = time(); +if (strpos($textstrings, '%WEEK_') !== false) { + $week_start = mktime(0,0,0, date('m', $ts), date('d', $ts) - date('w', $ts), date('Y', $ts)); + $week_end = mktime(23,59,59, date('m', $week_start), date('d', $week_start) + 6, date('Y', $ts)); + get_values($week_start, $week_end, $pid, $gid, 'WEEK', $searchrepl); +} + +if (strpos($textstrings, '%LWEEK_') !== false) { + $last_week_start = mktime(0,0,0, date('m', $ts), date('d', $ts) - date('w', $ts) - 7, date('Y', $ts)); + $last_week_end = mktime(23,59,59, date('m', $last_week_start), date('d', $last_week_start) + 6, date('Y', $ts)); + get_values($last_week_start, $last_week_end, $pid, $gid, 'LWEEK', $searchrepl); +} + +if (strpos($textstrings, '%MONTH_') !== false) { + $month_start = mktime(0,0,0, date('m', $ts), 1, date('Y', $ts)); + $month_end = mktime(23,59,59, date('m', $month_start) + 1, 0, date('Y', $month_start)); + get_values($month_start, $month_end, $pid, $gid, 'MONTH', $searchrepl); +} + +if (strpos($textstrings, '%LMONTH_') !== false) { + $last_month_start = mktime(0,0,0, date('m', $ts) - 1, 1, date('Y', $ts)); + $last_month_end = mktime(23,59,59, date('m', $last_month_start) + 1, 0, date('Y', $last_month_start)); + get_values($last_month_start, $last_month_end, $pid, $gid, 'LMONTH', $searchrepl); +} + +if (strpos($textstrings, '%YEAR_') !== false) { + $year_start = mktime(0,0,0, 1, 1, date('Y', $ts)); + $year_end = mktime(23,59,59, 12, 31, date('Y', $year_start)); + get_values($year_start, $year_end, $pid, $gid, 'YEAR', $searchrepl); +} + +if (strpos($textstrings, '%LYEAR_') !== false) { + $last_year_start = mktime(0,0,0, 1, 1, date('Y', $ts) - 1); + $last_year_end = mktime(23,59,59, 12, 31, date('Y', $last_year_start)); + get_values($last_year_start, $last_year_end, $pid, $gid, 'LYEAR', $searchrepl); +} + +if (strpos($textstrings, '%TOTAL_') !== false) { + get_values(0, 0, $pid, $gid, 'TOTAL', $searchrepl); +} + +if (strpos($textstrings, '%GTOTAL_') !== false) { + get_values(0, 0, $pid, 0, 'GTOTAL', $searchrepl); +} + +if (strpos($textstrings, '%LM_') !== false) { + get_values(0, 0, $pid, $gid, 'LM', $searchrepl); +} + +//echo "
"; var_dump($searchrepl); echo "
"; exit; + + +$im = image_create('images/templates/'. $load['template'], $load); + +$img_width = imagesx($im); +$img_height = imagesy($im); + +if (empty($std['align'])) $std['align'] = 'left'; +if (empty($std['angle'])) $std['angle'] = 0; +if (empty($std['font'])) $std['font'] = 'microsbe.ttf'; +if (empty($std['fontcolor'])) $std['fontcolor'] = 'FFFFFF'; +if (empty($std['fontsize'])) $std['fontsize'] = 12; + +foreach ($pic[$num]['process'] as $process) { + switch($process['type']) { + case 'text': + if (empty($process['align'])) $process['align'] = $std['align']; + if (empty($process['font'])) $process['font'] = $std['font']; + if (empty($process['fontcolor'])) $process['fontcolor'] = $std['fontcolor']; + if (empty($process['fontsize'])) $process['fontsize'] = $std['fontsize']; + if (empty($process['angle'])) $process['angle'] = $std['angle']; + if (empty($process['x_to'])) $process['x_to'] = $img_width; + if (empty($process['y_to'])) $process['y_to'] = $process['y_from']; + + $text = replace_vars($process['value'], $searchrepl); + place_text($im, $process['fontsize'], $process['angle'], $process['x_from'], $process['x_to'], $process['y_from'], $process['y_to'], $process['fontcolor'], 'images/fonts/'.$process['font'], $process['align'], $text); + break; + + default: + die("Don't know how to process: ". $process['type']); + } + +} + +output_image($im, $output); + +?> \ No newline at end of file diff --git a/html/style.css b/html/style.css new file mode 100755 index 0000000..a192541 --- /dev/null +++ b/html/style.css @@ -0,0 +1,107 @@ +BODY {BACKGROUND: #243954 url(images/sidebar.gif); background-repeat: repeat-y; COLOR: #ffffff} +a {FONT-FAMILY: Verdana,Geneva,Arial,Helvetica,sans-serif; FONT-SIZE: 10pt; COLOR: #ffcc66; TEXT-DECORATION: none} +a:hover {FONT-FAMILY: Verdana,Geneva,Arial,Helvetica,sans-serif; FONT-SIZE: 10pt; COLOR: #ffffff; TEXT-DECORATION: none} +.text {FONT-FAMILY: Verdana,Geneva,Arial,Helvetica,sans-serif; FONT-SIZE: 10pt; COLOR: #efefef} +.text2 {FONT-FAMILY: Verdana,Geneva,Arial,Helvetica,sans-serif; FONT-SIZE: 7pt; COLOR: #efefef} +.txttitle {FONT-FAMILY: Verdana,Geneva,Arial,Helvetica,sans-serif; FONT-SIZE: 14pt; COLOR: #eaeaea; FONT-WEIGHT: bold} +.rangtext {FONT-FAMILY: Verdana,Geneva,Arial,Helvetica,sans-serif; FONT-SIZE: 7pt; COLOR: #808080} + +.box {border: 1px #5d6c81 solid} +.darkbox {border: 1px #2C323A solid} +.heading {FONT-FAMILY: Arial, Helvetica, Sans-serif; FONT-SIZE: 12pt; COLOR: #ffffcc; background: #58677c; FONT-WEIGHT: bold} +a.heading {FONT-FAMILY: Arial, Helvetica, Sans-serif; FONT-SIZE: 12pt; COLOR: #ffee66; background: #58677c; FONT-WEIGHT: bold} +a.heading:hover {FONT-FAMILY: Arial, Helvetica, Sans-serif; FONT-SIZE: 12pt; COLOR: #ffffff; background: #58677c; FONT-WEIGHT: bold} +.medheading {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #f7fbff; background: #58677c; FONT-WEIGHT: bold} +.hlheading {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #dfedff; background: #58677c; FONT-WEIGHT: bold} +.smheading {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #f7fbff; background: #58677c; FONT-WEIGHT: bold; TEXT-DECORATION: none} +a.smheading:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #fdd932; BACKGROUND: #58677c; FONT-WEIGHT: bold; TEXT-DECORATION: none} +.smheadingx {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 7pt; COLOR: #f7fbff; background: #58677c; FONT-WEIGHT: bold; TEXT-DECORATION: none} +.blank {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #243954; background: #243954; FONT-WEIGHT: normal} + +.lggrey {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #dfedff; background: #485464; FONT-WEIGHT: bold} +a.lggrey {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #dfedff; background: #485464; FONT-WEIGHT: bold} +a.lggrey:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #485464; FONT-WEIGHT: bold} + +.dark {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #dfdfdf; background: #2E3038; FONT-WEIGHT: normal} +a.dark {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #dfdfdf; background: #2E3038; FONT-WEIGHT: normal} +a.dark:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #2E3038; FONT-WEIGHT: normal} + +.grey {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #6c6c6c; FONT-WEIGHT: normal} +a.grey {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #f4d01e; background: #6c6c6c; FONT-WEIGHT: normal} +a.grey:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #6c6c6c; FONT-WEIGHT: normal} + +.grey2 {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #606060; FONT-WEIGHT: normal} +a.grey2 {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #f4d01e; background: #606060; FONT-WEIGHT: normal} +a.grey2:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #606060; FONT-WEIGHT: normal} + +.darkgrey2 {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #000000; background: #747474; FONT-WEIGHT: normal} +a.dakgrey2 {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #f4d01e; background: #747474; FONT-WEIGHT: normal} +a.darkgrey2:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #747474; FONT-WEIGHT: normal} + + +.darkgrey {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #000000; background: #808080; FONT-WEIGHT: normal} +.warn {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #880000; background: #aeaeae; FONT-WEIGHT: bold} +.gselog {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #0f5465; background: #aeaeae; FONT-WEIGHT: bold} +.tclog {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #4d2821; background: #aeaeae; FONT-WEIGHT: bold} +.opnote {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #af3020; FONT-WEIGHT: bold} + +.chatlink {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #ffffff; background: #303441; FONT-WEIGHT: bold} +a.chatlink {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #ffff00; background: #303441; FONT-WEIGHT: bold} +a.chatlink:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #ffffff; background: #303441; FONT-WEIGHT: bold} + +.chat {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #000000; background: #cccccc; FONT-WEIGHT: bold} +.chatred {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #800000; background: #cccccc; FONT-WEIGHT: bold} +.chatblue {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #000080; background: #cccccc; FONT-WEIGHT: bold} +.chatsys {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #408040; background: #cccccc; FONT-WEIGHT: bold} +.chatkill {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #A4A21C; background: #cccccc; FONT-WEIGHT: bold} +.blueteamscore {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #505080; background: #cccccc; FONT-WEIGHT: bold} +.redteamscore {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #805050; background: #cccccc; FONT-WEIGHT: bold} + +.connect {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #6c6c6c; FONT-WEIGHT: normal} +.disconnect {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #880000; background: #9f9f9f; FONT-WEIGHT: bold} + +.greyhuman {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #e4bf12; background: #6c6c6c; FONT-WEIGHT: normal; TEXT-DECORATION: none} +a.greyhuman {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #e4bf12; background: #6c6c6c; FONT-WEIGHT: normal; TEXT-DECORATION: none} +a.greyhuman:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #6c6c6c; FONT-WEIGHT: normal; TEXT-DECORATION: none} +.darkhuman {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #fdd932; background: #2E3038; FONT-WEIGHT: normal; TEXT-DECORATION: none} +a.darkhuman {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #fdd932; background: #2E3038; FONT-WEIGHT: normal; TEXT-DECORATION: none} +a.darkhuman:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #2E3038; FONT-WEIGHT: normal; TEXT-DECORATION: none} + +.darkbot {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #0575dd; BACKGROUND: #2E3038; FONT-WEIGHT: normal; TEXT-DECORATION: none} +a.darkbot {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #0575dd; BACKGROUND: #2E3038; FONT-WEIGHT: normal; TEXT-DECORATION: none} +a.darkbot:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; BACKGROUND: #2E3038; FONT-WEIGHT: normal; TEXT-DECORATION: none} + +.darkid {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #dfdfdf; background: #2E3038; FONT-WEIGHT: normal; TEXT-DECORATION: none} +a.darkid {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #dfdfdf; background: #2E3038; FONT-WEIGHT: normal; TEXT-DECORATION: none} +a.darkid:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; background: #2E3038; FONT-WEIGHT: normal; TEXT-DECORATION: none} + +.sidebar {FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 10pt; COLOR: #000000; BACKGROUND: #58677C; FONT-WEIGHT: bold} +a.sidebar {FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 10pt; COLOR: #000000; BACKGROUND: #58677C; FONT-WEIGHT: bold; TEXT-DECORATION: none} +a.sidebar:hover {FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 10pt; COLOR: #ffffff; BACKGROUND: #58677C; FONT-WEIGHT: bold; TEXT-DECORATION: none} + +.pages {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #bdbd8c; FONT-WEIGHT: bold} +a.pages {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #eeeebb; FONT-WEIGHT: bold; TEXT-DECORATION: none} +a.pages:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; FONT-WEIGHT: bold; TEXT-DECORATION: none} + +.blueteam {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #000000; background: #0000ff; FONT-WEIGHT: bold} +.redteam {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #000000; background: #ff0000; FONT-WEIGHT: bold} +.greenteam {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #000000; background: #00ff00; FONT-WEIGHT: bold} +.goldteam {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #000000; background: #ffd700; FONT-WEIGHT: bold} + +.lglheading {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #fdd30d; background: #58677c; FONT-WEIGHT: bold} +a.lglheading {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #f7fbff; background: #58677c; FONT-WEIGHT: bold} +a.lglheading:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #ffffff; background: #58677c; FONT-WEIGHT: bold} + +.status {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 12px; border: 1px #666666 solid} +.statustitle {FONT-FAMILY: Verdana,Helvetica; FONT-SIZE: 12px; COLOR: #ffffcc; BACKGROUND: #303441} + +.searchform {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; FONT-WEIGHT: normal} +.searchformb {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; FONT-WEIGHT: bold} + +.titlemsg {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #efefef; FONT-WEIGHT: bold} +.mainbody {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #efefef; FONT-WEIGHT: bold} +a.mainbody {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #f4d01e; FONT-WEIGHT: bold} +a.mainbody:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 10pt; COLOR: #ffffff; FONT-WEIGHT: bold} +.epicinfo {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #efefef; FONT-WEIGHT: bold} +a.epicinfo {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #caad20; FONT-WEIGHT: bold; TEXT-DECORATION: none} +a.epicinfo:hover {FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt; COLOR: #ffffff; FONT-WEIGHT: bold; TEXT-DECORATION: none} diff --git a/info.txt b/info.txt new file mode 100755 index 0000000..ef1f220 --- /dev/null +++ b/info.txt @@ -0,0 +1,52 @@ +UTStats +Copyright (C) 2004/2005 azazel, )°DoE°(-AnthraX and toa + +This program is free software; you can redistribute and/or modify +it under the terms of the Open Unreal Mod License. +See license.txt for more information. + +=================== +UTStats Information +=================== + +What Is It +---------- +UTStats is a Serverside Actor and websystem for the original Unreal Tournament +that generates statistics from a custom NGStats log file. + + +What Does It Record +------------------- +Lots of stuff + + +What Will I Need +---------------- +Access to the logs +PHP & MySQL enabled website +PHP needs to allow ftpconnect etc if you wish to use auto-ftp of logs + + +What Game Types Does it Support +------------------------------- +All the official game types. + + +Do You Have A Preview Site? +------------------------------- +Yes. http://utstats.unrealadmin.org/ + + +Why Beta?/Any New Stuff to Come +------------------------------- +Possible new stuff, but until we're happy its 100% stable it stays as beta :) + + +I Want to Help What Can I Do? +----------------------------- +When the Beta is released please check the pages. +They might be able to be done more efficiently or other things could be added. +If you work something out, let us know, share, don't be one of the selfish people +in life who keeps it to themselves. +Remember, the maps you likely play, the mods you use, someone shared them. +If you can, now is your opportunity to share back. \ No newline at end of file diff --git a/install.txt b/install.txt new file mode 100755 index 0000000..7d2cd4d --- /dev/null +++ b/install.txt @@ -0,0 +1,186 @@ +UTStats +Copyright (C) 2004/2005 azazel, )°DoE°(-AnthraX and toa + +This program is free software; you can redistribute and/or modify +it under the terms of the Open Unreal Mod License. +See license.txt for more information. + +=============================================================================== +Contents +=============================================================================== + +1. Installing the Server Actor +2. Installing the web stuff (new install and upgrade) +3. Importing Logs +4. Known Bugs/Issues Still +5. License + +=============================================================================== +1. UTStats Actor Install Information +=============================================================================== + +From the System folder in the zip file, copy to your UTServer\System folder the +following files: + +UTSAccuBeta4_2.u +UTStatsBeta4_2.u + +Remove any previous entries for UTStats and UTSAccuBeta from [Engine.GameEngine] + +Add to [Engine.GameEngine] the following lines: + +ServerPackages=UTSAccuBeta4_2 +ServerActors=UTStatsBeta4_2.UTStatsSA + +Under the [Engine.GameInfo] check for: +bLocalLog=True or bLocalLog=False + +This line HAS to be: +bLocalLog=False + +Setting it to True will not give you complete logs (don't ask why it just won't). + +Log files are recorded to the UTServer\Logs folder. + + +=============================================================================== +2. UTStats Web Install Information +=============================================================================== + +UPGRADING from Version 4.2 and newer +------------------------------------------------------------------------------- +The current install is compatible with the database of version 4.2 and later. +However bunny track stats are only available from version 4.2.5. + +Just remove all the files/folders (apart from the logs folder, if you wish to +keep your backup logs), and upload all the files in the html folder to your +webserver. + +Then visit the admin area and click "Check Server Settings" near the bottom of +the list. This will install databases if they're missing and fix the Bunny +Track captimes to the new format if needed. + +If you use your old config.php make sure the following section is included: + +// ================ START OF ADDITINAL CONFIG.PHP OPTIONS ===================== +// Screenshot files start with... +$import_utdc_screenshot_start = "[UTDC]"; + +// Screenshot files end with... +$import_utdc_screenshot_extension = ".enc"; + +// UTStats can download and manage your ACE logs +// Enable downloading of ACE logs? +$import_ace_download_enable = false; + +// Log files start with... +$import_ace_log_start = "[ACE]"; + +// Log files end with... +$import_ace_log_extension = ".log"; + +// Log files start with... +$import_ace_screenshot_start = "[ACE]"; + +// Log files end with... +$import_ace_screenshot_extension = ".jpg"; + +// Compress ACE logfiles after download? [compress/gzip/no] +// (see $import_log_backup for available options) +$import_ace_log_compress = "compress"; + +// Purge old ACE logs after x days. 0 to disable. +$import_ace_log_purge_after = 0; +// ================= END OF ADDITINAL CONFIG.PHP OPTIONS ====================== + +UPGRADING from older versions: +------------------------------------------------------------------------------- +Firstly we don't advise using any old logs, you will not benefit from any new +features AND it will likely mess up some page data. +We apologise for not being able to save this information but there are a +massive amount of new features that are well worth ditching the old logs for :) + +If you do wish to keep the old logs you need to do a full install anyway, so +drop all the tables you had and remove all the +files/folders (making sure you don't delete the logs backups). +When you edit config.php make sure to change the option: +$import_incompatible_logs=false; +to +$import_incompatible_logs=true; + +If you are wisely going to ditch the old logs just clear out your old install +and all the tables and start from here. + +FULL INSTALL: +------------------------------------------------------------------------------- +From the html folder in the zip file, upload all the files to your webserver +wherever you like. I suggest under a folder called utstats. +After the files have uploaded browse to the stats folder where you should see +the following folders: + +\images +\import +\includes +\logs +\pages + +Now edit the config.php file. + +Enter in your mysql database, hostname, username and password at the top. +You must set an adminkey in here or you won't be able to import/use the admin +feature. +Check all the other options to see if they are as you wish (they are set to +what we consider the best options). +If you are going to use ftp transferring of log files amend the FTP connection +as required. + +Now visit the admin area and click "Check Server Settings" near the bottom. +This will setup the database, if the tables allready exist it will keep the +old tables. It will also check the file permissions. If it can't set +the file permissions you'll have to do it yourself, + +Using whatever means (usually the ftp client) you need to CHMOD the logs folder +to 777. +Now go into the logs folder. +Now CHMOD the backups, utdc, ac and ace folders to 777. + +Now go back a level and into the includes folder. +CHMOD the file ftptimestamp.php to 777. + +================= +3. Importing Logs +================= + +Depending on the level of access you have and how competent you are you can do this 4 ways. +*** Important *** +Make sure you edit config.php and set an adminkey at the top! + +Way 1: +If you don't have ftp access to your UT server or allowed to use ftp via php then upload your +logs manually to the logs folder and then run the importer via the Import link. + +Way 2: +If you have ftp access and can do ftp via php, edit the config.php file and input your UT servers ftp +information into there. +Now run the importer via the Import link. + +Way 3: +Automate the process using a cron job or scheduled task. +Just get this to run cd to the root of stats (where import.php is) and execute the import.php file +with php. + +Way 4: +Automate the web process using a web service cron job. + +==================== +4. Known Bugs/Issues +==================== + +If you find any bugs or issues please post them at our forums: +http://www.unrealadmin.org/forums/forumdisplay.php?f=173 + +==================== +5. License +==================== + +This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/. \ No newline at end of file diff --git a/license.txt b/license.txt new file mode 100755 index 0000000..05c6253 --- /dev/null +++ b/license.txt @@ -0,0 +1,79 @@ +Open Unreal Mod License +Version 1, March 2004 + + 0. Definitions + "Program" the work, either in binary or source form, that has a notice + attached to it stating that it has been released under this + license it by the copyright holder. + "Modification" a derivative of the Program or any other work based on the Program + "Linking" using parts of the Program, or using parts of any other work, + thus creating a direct dependency + "You" the licensee + "Runtime Environment" + the virtual machine or operating system required to run the + Program, as released by the Publisher or Creator of said + runtime environment. This includes any extentions or updates + for the runtime environment released by the Publisher or + Creator. + + 1. License + Herewith everybody is granted permission to copy and distribute verbatim copies + of this document. The only restriction lies on changing the content, with the + exception to translation of this license. + + This license applies to the Program that has been released under this license. + The license only applies to copying, distribution and modification of the + Program. Execution or output of the Program are not covered by this license, + however the right for additional limitations on the use (that do not cover + copying, distribution or modification) is granted to the copyright holder. + This license is only valid when all terms in this license comply with the + licenses of the dependecies of the Program. This includes the license of the + possible required runtime envoirement. + + 2. Copying and distribution + You are granted to copy or distribute verbatim copies of the Program, on any + medium, or in any format as you see fit. You are not limited to charging a fee + for the physical act of transferring the copy, nor are you limited to provide + warranty for the Program in return of a fee. Unless this is prohibited by the + license of the Runtime Envoirement. + + Any distribution of the program should be accompanied with a verbatim copy of + this license. + + 3. Modification + You are allowed to modify the Program, or portions of it, therefore making it a + derivative of the Program. You are allowed to distribute your modifications under + the following conditions: + - You must clearly state that it is a modification or derivative of the + Program + - The original copyright notice must be kept intact + - The modified files must contain notices of the changed made to it + - The Modification must be released under the same license as the Program + - Distribution happens in compliance with section 2 + + 4. Source + The original source of the Program or Modification must be freely available on + request. + + 5. Linking + The Program or Modification may only link with other work that have been + released as free software. + + The license grants exclusive right to link with any part of the Runtime + Environment, as provided by the publisher or creator of said Runtime + Environment. + Reusing pieces of source code available in the runtime environment in the + Program is only allowed under the following terms: + - the "borrowed" code is clearly marked to originate from the runtime + environment, quoting the original copyright. + - the following notice is added to the top of the file: + "This file contains portions of code from the runtime environment." + + The right to "port" the Program to another runtime environment is reserved for + the copyright holder. + + 6. NON WARRANTY + THIS SOFTWARE DOES NOT COME WITH A WARRANTY OF ANY KIND, UNLESS NOTED OTHERWISE + BY THE COPYRIGHT HOLDER OR WARRANTY PROVIDER. THE ENTIRE RISK OF THE PERFORMANCE + AND QUALITY OF THE PROGRAM LIES WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, + YOU WILL ASSUME ALL COSTS FOR REQUIRED REPAIR OR CORRECTION. \ No newline at end of file