From 3a58cb2802c8be14f78015105afe759b1c7ce692 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Tue, 9 Jan 2018 00:43:43 +0100 Subject: Implement design for pages and update includes --- html/includes/clanbase.php | 0 html/includes/config.php | 6 +- html/includes/config_pic.php | 0 html/includes/countries.php | 0 html/includes/ftp.php | 2 +- html/includes/ftp_class.php | 0 html/includes/ftp_class_native.php | 0 html/includes/ftp_class_pure.php | 0 html/includes/ftp_class_sockets.php | 0 html/includes/geoip.inc | 0 html/includes/hints.php | 6 +- html/includes/teamstats.php | 338 ++++++++++++++++++------------------ html/includes/weaponstats.php | 48 +++-- 13 files changed, 193 insertions(+), 207 deletions(-) mode change 100755 => 100644 html/includes/clanbase.php mode change 100755 => 100644 html/includes/config_pic.php mode change 100755 => 100644 html/includes/countries.php mode change 100755 => 100644 html/includes/ftp.php mode change 100755 => 100644 html/includes/ftp_class.php mode change 100755 => 100644 html/includes/ftp_class_native.php mode change 100755 => 100644 html/includes/ftp_class_pure.php mode change 100755 => 100644 html/includes/ftp_class_sockets.php mode change 100755 => 100644 html/includes/geoip.inc mode change 100755 => 100644 html/includes/hints.php mode change 100755 => 100644 html/includes/weaponstats.php (limited to 'html/includes') diff --git a/html/includes/clanbase.php b/html/includes/clanbase.php old mode 100755 new mode 100644 diff --git a/html/includes/config.php b/html/includes/config.php index 55b9ffe..77d42fa 100755 --- a/html/includes/config.php +++ b/html/includes/config.php @@ -1,9 +1,9 @@ '; + if ($html) echo' - - - '; - - $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''; - $header = true; - } - - if ($header) { - $header = false; - echo ' - - - - '; - if ($extra) echo ''; - echo' - - - - '; - if ($teams) echo ''; - echo ' - - - - '; - } - - $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 ''; - } else { - echo ''; - } - - echo ''; - echo ''; - - if ($extra) echo ''; - - echo ''; - echo ''; - echo ''; - echo ''; - - if ($teams) echo ''; - - echo ''; - echo ''; - echo ''; - echo ''; - } - - teamstats_team_totals($totals, $num, $teams, $extra, $teamscore[$oldteam]); - - echo '
'; echo "FTP Transferring Log Files...\n"; diff --git a/html/includes/ftp_class.php b/html/includes/ftp_class.php old mode 100755 new mode 100644 diff --git a/html/includes/ftp_class_native.php b/html/includes/ftp_class_native.php old mode 100755 new mode 100644 diff --git a/html/includes/ftp_class_pure.php b/html/includes/ftp_class_pure.php old mode 100755 new mode 100644 diff --git a/html/includes/ftp_class_sockets.php b/html/includes/ftp_class_sockets.php old mode 100755 new mode 100644 diff --git a/html/includes/geoip.inc b/html/includes/geoip.inc old mode 100755 new mode 100644 diff --git a/html/includes/hints.php b/html/includes/hints.php old mode 100755 new mode 100644 index b8da8de..7ba11a3 --- a/html/includes/hints.php +++ b/html/includes/hints.php @@ -24,10 +24,8 @@ $hint['Multis'] = "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['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." + ; $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])" diff --git a/html/includes/teamstats.php b/html/includes/teamstats.php index b2116b9..d0b1b58 100755 --- a/html/includes/teamstats.php +++ b/html/includes/teamstats.php @@ -1,182 +1,176 @@ -
'.htmlentities($title).'
Team: '.$teamname.'
PlayerTimeScore'.htmlentities($extratitle).'FKDSTKEff.Acc.Avg TTL
'.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''.GetMinutes($r_players['gametime'] / TIMERATIO).''.$r_players['gamescore'].''.$r_players[$extra].''.$r_players['frags'].''.$kills.''.$r_players['deaths'].''.$r_players['suicides'].''.$r_players['teamkills'].''.$eff.''.$acc.''.$ttl.'

'; + global $gamename, $gid; + $r_info = small_query("SELECT teamgame, t0score, t1score, t2score, t3score FROM uts_match WHERE id = '$mid'"); + if (!$r_info) die("Match not found"); + + $teams = ($r_info['teamgame'] == 'True') ? true : false; + $teamscore[-1] = 0; + $teamscore[0] = $r_info['t0score']; + $teamscore[1] = $r_info['t1score']; + $teamscore[2] = $r_info['t2score']; + $teamscore[3] = $r_info['t3score']; + + $cols = 10; + if ($teams) $cols++; + if ($extra) $cols++; + + $oldteam = -1; + + echo' + + + + '; + + $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''; + $header = true; + } + if ($header) { + $header = false; + echo ' + + + + '; + if ($extra) echo ''; + echo ' + + + + '; + if ($teams) echo ''; + echo ' + + + + '; + } + + $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 ''; + } else { + echo ''; + } + echo ''; + echo ''; + + if ($extra) echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + + if ($teams) echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + } + + teamstats_team_totals($totals, $num, $teams, $extra, $teamscore[$oldteam]); + echo '
'.htmlentities($title).'
Team: '.$teamname.'
PlayerTimeScore'.htmlentities($extratitle).'FKDSTKEff.Acc.Avg TTL
'.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''.FormatPlayerName($r_players['country'], $r_players['pid'], $r_players['name'], $gid, $gamename, true, $r_players['rank']).''.GetMinutes($r_players['gametime'] / TIMERATIO).''.$r_players['gamescore'].''.$r_players[$extra].''.$r_players['frags'].''.$kills.''.$r_players['deaths'].''.$r_players['suicides'].''.$r_players['teamkills'].''.$eff.''.$acc.''.$ttl.'

'; } 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; + $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 ''; + 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 old mode 100755 new mode 100644 index 872fa5a..bccdd6d --- a/html/includes/weaponstats.php +++ b/html/includes/weaponstats.php @@ -26,7 +26,6 @@ function weaponstats($_mid, $_pid, $title = 'Weapons Summary') { AND (wn.id = w.weapon) AND wn.hide <> 'Y'"; - if ($_pid == 0 and $_mid != 0) { $sql_weapons = "SELECT w.matchid, w.pid AS playerid, @@ -99,15 +98,15 @@ uts_weaponstats AS w } echo' - - - - - '; - +
'.htmlentities($title).'
+ + + + '; if ($one) { ws_header($wsort, $weapons, $colspan, $one, $playercol); + echo ''; foreach($wsort as $wid => $bar) { for ($i = 1; $i <= $colspan; $i++) { @@ -119,8 +118,7 @@ uts_weaponstats AS w case 5: $extra = 'Dmg'; break; } $extra = ''. $extra .''; - echo ' - '; + echo ''; } } echo ''; @@ -128,10 +126,10 @@ uts_weaponstats AS w $i = 0; foreach($psort as $pid => $foo) { $i++; - echo ''; + echo ''; if ($playercol) { echo ' - '; + '; } foreach($wsort as $wid => $bar) { ws_cell($wd, $pid, $wid, 'kills', $i); @@ -146,23 +144,22 @@ uts_weaponstats AS w 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, '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.''.$extra.'
'.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).''.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 ' '; + if ($playercol and $playercol != -1) echo ''; + if ($playercol == -1) echo ' '; foreach($wsort as $wid => $bar) { if (!empty($weapons[$wid]['image'])) { - $content = ''.$weapons[$wid]['name'].''; + $content = ''.$weapons[$wid]['name'].''; } else { $content = ''.$weapons[$wid]['name'].''; } @@ -172,27 +169,23 @@ function ws_header(&$wsort, &$weapons, $colspan, $one, $playercol) { 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.''; + '.$content.''; } - - - function ws_block(&$wd, &$weapons, &$wsort, &$psort, &$colspan, $playercol, $one,$_mid, $gamename, $caption, $field) { global $gamename, $gid; if (count($psort) != 1) { echo ' - + - '.$caption.' + '.$caption.' '; ws_header($wsort, $weapons, $colspan, $one, $playercol); } @@ -204,8 +197,8 @@ function ws_block(&$wd, &$weapons, &$wsort, &$psort, &$colspan, $playercol, $one $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).''; + 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); @@ -213,4 +206,5 @@ function ws_block(&$wd, &$weapons, &$wsort, &$psort, &$colspan, $playercol, $one echo ''; } } -?> \ No newline at end of file + +?> -- cgit