From dfc4e20b8e9ca57340e24143539498fb82527697 Mon Sep 17 00:00:00 2001 From: randommonk Date: Thu, 4 Jan 2018 22:52:54 +0000 Subject: Bumped version to 4.3. Added jpgraph stats developed by killerEye --- html/pages/admin/check.php | 46 ++++++++++++++++++++++ html/pages/credits.php | 4 ++ html/pages/match_info.php | 17 ++++++-- html/pages/match_info_charts.php | 85 ++++++++++++++++++++++++++++++++++++++++ html/pages/match_info_server.php | 19 ++++++++- 5 files changed, 165 insertions(+), 6 deletions(-) create mode 100644 html/pages/match_info_charts.php (limited to 'html/pages') diff --git a/html/pages/admin/check.php b/html/pages/admin/check.php index a03bf91..2531cca 100755 --- a/html/pages/admin/check.php +++ b/html/pages/admin/check.php @@ -299,6 +299,52 @@ CREATE TABLE `uts_weaponstats` ( ) ENGINE=MyISAM; "; +$create_table['uts_chartdata'] = " +CREATE TABLE `uts_chartdata` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `mid` int(11) NOT NULL, + `chartid` mediumint(9) NOT NULL, + `title` varchar(50) NOT NULL, + `data` blob NOT NULL, + `labels` blob NOT NULL, + `categories` blob NOT NULL, + PRIMARY KEY (`id`), + KEY `mid` (`mid`), + KEY `mid_2` (`mid`) +) ENGINE=MyISAM; +"; + +$create_table['uts_charttypes'] = " +CREATE TABLE `uts_charttypes` ( + `id` mediumint(9) NOT NULL, + `category` varchar(25) NOT NULL, + `type` varchar(50) NOT NULL, + `color` varchar(10) NOT NULL, + `layout` text NOT NULL, + `charttype` varchar(15) NOT NULL, + `columns` int(11) NOT NULL DEFAULT '1', + PRIMARY KEY (`id`) +) ENGINE=MyISAM; +"; + +INSERT INTO `uts_charttypes` (`id`, `category`, `type`, `color`, `layout`, `charttype`, `columns`) VALUES +(90, 'Frags Team', 'teamScore', 'team', 'title: {\ntext: ''Battle for #1''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: false\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''',\nmin: 0\n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1), +(92, 'Frags Team', 'teamNormal', 'team', 'title: {\ntext: ''Spread vs #2 team''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: false\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''' \n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1), +(91, 'Frags Team', 'teamDeriv', 'team', ' title : {\n text : ''Battle for #1''\n },\n credits : {\n enabled : false\n },\n legend : {\n enabled : true\n },\n xAxis : {\n title : '''',\n min : 0\n },\n yAxis: [{\n \n title: {\n text: ''score''\n },\n min: 0,\n floor: 0,\n opposite: true\n },{\n title: {\n text: ''frags per min''\n },\n min: 0,\n floor: 0\n }],\n plotOptions : {\n column : {\n stacking : ''normal'',\n pointPadding : 0,\n groupPadding : 0,\n borderWidth : 0,\n shadow : false,\nenableMouseTracking: false\n },line: { stickyTracking: false }\n }', 'linecolumn', 1), +(93, 'Top fraggers', 'playerScore', 'player', 'title: {\ntext: ''Battle for #1''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: true\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''',\nmin: 0\n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1), +(94, 'Top fraggers', 'playerDeriv', 'player', 'title : {\n text : ''Battle for #1''\n },\n credits : {\n enabled : false\n },\n legend : {\n enabled : true\n },\n xAxis : {\n title : '''',\n min : 0\n },\n yAxis: [{\n \n title: {\n text: ''score''\n },allowDecimals : false,\n tickPositioner: function () {\n\n var maxDeviation = round_up(Math.max(Math.abs(this.dataMax), Math.abs(this.dataMin)),3);\n var thirdMaxDeviation = Math.ceil(maxDeviation / 3);\n\n return [-thirdMaxDeviation , 0, thirdMaxDeviation , 2*thirdMaxDeviation , maxDeviation];\n },\n \n \n opposite: true\n },{\n title: {\n text: ''frags per min''\n },allowDecimals : false, tickPositioner: function () {\n\n\n var maxDeviation = round_up(Math.max(Math.abs(this.dataMax), Math.abs(this.dataMin)),3);\n var thirdMaxDeviation = Math.ceil(maxDeviation / 3);\n\n return [-thirdMaxDeviation , 0, thirdMaxDeviation , 2*thirdMaxDeviation , maxDeviation];\n } \n }],\n plotOptions : {\n column : {\n stacking : ''normal'',\n pointPadding : 0,\n groupPadding : 0,\n borderWidth : 0,\n shadow : false,\nenableMouseTracking: false\n },line: { stickyTracking: false }\n }', 'linecolumn', 1), +(95, 'Top fraggers', 'playerNormal', 'player', 'title: {\ntext: ''Spread vs #2''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: true\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''' \n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1), +(96, 'Frags #5-8', 'playerScore5', 'player', 'title: {\ntext: ''Battle for #5''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: true\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''',\nmin: 0\n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1), +(97, 'Frags #5-8', 'playerNormal5', 'player', 'title: {\ntext: ''Spread vs #5''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: true\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''' \n}', 'line', 1), +(10, 'CTF Score', 'teamScore', 'team', 'title : {\n text : ''CTF Team Score''\n },\n\ntooltip: {\n\n positioner: function () {\n return { x: 10, y: 10 };\n },\nformatter:function() {\n\nif(this.point.tooltipdata === ''undefined'' || this.point.tooltipdata == null ) {\n return Math.floor(this.x)+''min ''+Math.round((this.x-Math.floor(this.x))*60)+''sec
● ''+this.series.name+'' : ''+this.y;\n} else {\nreturn Math.floor(this.x)+''min ''+Math.round((this.x-Math.floor(this.x))*60)+''sec
● ''+this.series.name+'' : ''+this.y+''
''+this.point.tooltipdata;\n}\n}\n\n},\n credits : {\n enabled : false\n },\n legend : {\n enabled : false\n },\n xAxis : {\n title : '''',\n min : 0\n },\n yAxis: [{\n \n title: {\n text: ''score''\n },\n min: 0,\n floor: 0,\n allowDecimals: false,\n opposite: true\n }, {\n title: {\n text: ''grabs per min''\n },\n min: 0,\n allowDecimals: false,\n floor: 0\n }],\n plotOptions : {\n column : {\n pointPlacement: ''between'',\n pointPadding : 0,\npointRange: 1, groupPadding : 0.2,\n borderWidth : 0,\n shadow : false,\nenableMouseTracking: false\n },line: { stickyTracking: false }\n }', 'linestepcolumn', 2), +(11, 'CTF Grabs', 'teamBreakdown', 'player', '\n title : {\n text : ''Grab conversion''\n },\n credits : {\n enabled : false\n },\n legend : {\n enabled : true\n },\n xAxis : {\n title : '''',\ncategories: [''Red'',''Blue'']\n },\n yAxis: {\n \n title: '''',allowDecimals: false,\n reversedStacks: false,stackLabels: {\n enabled: true }\n },\n plotOptions : {\n bar : { \n stacking : ''normal'', borderWidth : 0\n }\n }', 'bar', 2), +(100, 'Items', 'Team Pickups', 'team', '\n credits : {\n enabled : false\n },\n title: {\n text: ''''\n },\n \n pane: {\n size: ''100%''\n },\n\n plotOptions: {\n series: {\n fillOpacity: 0.4\n }\n },\nxAxis: {\n tickmarkPlacement: ''on'',\n lineWidth: 0\n },\n\n yAxis: {\n labels: {enabled:false},\n tickPixelInterval: 25,\n tickPositions: [0,25,50,75,100],\n gridLineInterpolation: ''polygon'',lineWidth: 0\n },\ntooltip: { \nvalueSuffix: '' %'' }', 'radar', 1), +(101, 'Items', 'Player Pickups', 'player', ' credits : {\n enabled : false\n },\n title: {\n text: ''''\n },\n \n pane: {\n size: ''100%''\n },\n\n plotOptions: {\n series: {\n fillOpacity: 0.4\n }\n },\nxAxis: {\n tickmarkPlacement: ''on'',\n lineWidth: 0\n },\n\n yAxis: {\n labels: {enabled:false},\n tickPixelInterval: 25,\n ickPositions: [0,25,50,75,100],\n gridLineInterpolation: ''polygon'',lineWidth: 0\n },\ntooltip: { \nvalueSuffix: '' %'' }', 'radar', 1), +(102, 'Items', 'ampRuns', 'team', 'title : {\n text : ''Amp runs net points''\n },\n credits : {\n enabled : false\n },\n legend : {\n enabled : false\n },\n xAxis : {\n title : '''',\n tickPosition: ''inside'',\n labels: {\n align: ''left'',\n overflow: false,\n x:5,\n y:3,\n style: { whiteSpace: ''nowrap'' }\n }\n },\n yAxis : {\n\n title : '''',\n allowDecimals : false,\n reversedStacks : false,\n tickPositioner: function () {\nvar maxDeviation = round_up(Math.max(Math.abs(this.dataMax), Math.abs(this.dataMin)),6);\n var thirdMaxDeviation = Math.ceil(maxDeviation / 3);\n\n return [-maxDeviation,-2*thirdMaxDeviation,-thirdMaxDeviation , 0, thirdMaxDeviation , 2*thirdMaxDeviation , maxDeviation];\n },\n stackLabels : {\n enabled : false\n }\n },\n plotOptions : {\n bar : {\n stacking : ''normal'',\n borderWidth : 0,\n pointPadding: 0.1,\n groupPadding: 0.1\n }\n },\n\ntooltip: {\nformatter:function() {\n return this.x+''
●''+this.series.name+ '' : ''+this.y;}\n\n}', 'bar', 1), +(20, 'Domination', 'teamScore', 'team', 'title: {\ntext: ''Score''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: false\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''',\nmin: 0\n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1), +(21, 'Domination', 'teamDeriv', 'team', ' title : {\n text : ''Score''\n },\n credits : {\n enabled : false\n },\n legend : {\n enabled : true\n },\n xAxis : {\n title : '''',\n min : 0\n },\n yAxis: [{\n \n title: {\n text: ''Dom Score''\n },\n min: 0,\n floor: 0,\n opposite: true\n },{\n title: {\n text: ''net dom points per min''\n },\n min: 0,\n floor: 0\n }],\n plotOptions : {\n column : {\n stacking : ''normal'',\npointPlacement: ''between'', pointPadding : 0,\npointRange: 1, groupPadding : 0.2, borderWidth : 0, shadow : false,\nenableMouseTracking: false\n },line: { stickyTracking: false }\n }', 'linecolumn', 1); + + foreach ($create_table as $table => $query) { echo ' diff --git a/html/pages/credits.php b/html/pages/credits.php index a123ac4..4f8f4c2 100755 --- a/html/pages/credits.php +++ b/html/pages/credits.php @@ -19,6 +19,10 @@ All original pages are W3C Change Log

+
4.3.0 (4/1/2018 by killerEye, imported by Monk)
+
Added:
+ Graphs of specific stats for CTF, DOM and DM game types.

+
beta 4.2.8 (23/7/2011 by Rork)
Bug Fixes:
Fixed explain rankings (reported by Letylove49)
diff --git a/html/pages/match_info.php b/html/pages/match_info.php index 7645077..31edc2d 100755 --- a/html/pages/match_info.php +++ b/html/pages/match_info.php @@ -11,6 +11,7 @@ echo '
'; include("pages/match_info_server.php"); +include("pages/match_info_charts.php"); $GLOBALS['gid'] = $gid; $_GLOBALS['gid'] = $gid; @@ -23,18 +24,18 @@ switch($real_gamename) { 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'); @@ -43,6 +44,13 @@ switch($real_gamename) { case "Bunny Track": include("pages/match_info_bt.php"); break; + + case "Tournament DeathMatch": + case "Tournament Team Game": + case "Tournament DeathMatch (insta)": + case "Tournament Team Game (insta)": + teamstats($mid, 'Match Summary'); + break; case "Extended Last Man Standing": case "Extended Last Man Standing (insta)": @@ -62,6 +70,7 @@ switch($real_gamename) { teamstats($mid, 'Player Summary'); } } + if ($real_gamename == "Assault" or $real_gamename== "Assault (insta)") { include("pages/match_info_other2.php"); @@ -74,4 +83,4 @@ if ($real_gamename == "Capture the Flag" or $real_gamename== "Capture the Flag ( include("pages/match_report.php"); } -?> +?> \ No newline at end of file diff --git a/html/pages/match_info_charts.php b/html/pages/match_info_charts.php new file mode 100644 index 0000000..a6170e7 --- /dev/null +++ b/html/pages/match_info_charts.php @@ -0,0 +1,85 @@ +0) { + $i = 0; + + // cycle over charts + while ($chart = mysql_fetch_array($charts)) { + + // retrieve both generic as the specific data + $category = $chart['category']; + $type = $chart['type']; + $color = $chart['color']; + $layout = $chart['layout']; + $charttype = $chart['charttype']; + $columns = $chart['columns']; + $title = $chart['title']; + $data = unserialize(gzdecode($chart['data'])); + $labels = unserialize(gzdecode($chart['labels'])); + $categories = unserialize(gzdecode($chart['categories'])); + + // append previous chart - this is done to ensure proper outlining (can only know in +1 round) + $chartOutput .= $prevRenderedChart; + + // print a new section if we're now in a different category + if($category != $prevCategory) { + + if(strlen($prevCategory)>0) + $chartOutput .= renderFootBlock(); + + $chartOutput .= renderHeaderBlock($category); + $prevCategory = $category; + + } else { + if($i>1 && $i%2 == 0) + $chartOutput .= ""; + else + $chartOutput .= ""; + } + + $prevRenderedChart = renderChart($mid."-".$i,$layout,$color,$title,$data,$labels,$categories,$renderer_width*$columns,$renderer_heigth,$charttype); + + $i++; + } + + // finishing up + $chartOutput .= $prevRenderedChart; + $chartOutput .= renderFootBlock(); + + echo " + + "; + + echo $chartOutput; +} + + + +?> \ No newline at end of file diff --git a/html/pages/match_info_server.php b/html/pages/match_info_server.php index fb92456..b3c6f40 100755 --- a/html/pages/match_info_server.php +++ b/html/pages/match_info_server.php @@ -81,7 +81,11 @@ if (file_exists($mappic)) { $mappic = ("images/maps/blank.jpg"); } - $myurl = urlencode($mapname); +$myurl = urlencode($mapname); + +$mapnameToPrint = $matchinfo['mapname']; +if($mapnameToPrint == "Untitled") + $mapnameToPrint = $mapname; echo' @@ -94,7 +98,7 @@ if (file_exists($mappic)) { Match Type '.$gamename.' Map Name - '.$matchinfo[mapname].' + '.$mapnameToPrint.' Server Info @@ -111,4 +115,15 @@ if (file_exists($mappic)) {
'; + + +// 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"); + + ?> -- cgit