/**
* Full Content Template
*
Template Name: Hunger Games
*
* @file hg.php
* @package MMC
* @author Kelly Hamlin
* @copyright 2003 - 2014 MMC
* @license license.txt
* @version Release: 1.0
* @filesource wp-content/themes/mmc/hg.php
* @link http://codex.wordpress.org/Theme_Development#Pages_.28page.php.29
* @since available since Release 1.0
*/
get_header();
the_breadcrumb();
$database_server['type'] = 'mysql';
$database_server['hostname'] = 'localhost';
$database_server['username'] = 'minecraft';
$database_server['password'] = 'n0s0upf0ry0u';
$database_server['database'] = 'minecraft_minigames';
$database_server['prefix'] = '';
//MySQL Functions
class db {
var $id;
function db() { }
function getq() { return $this->queries; }
function open($database, $host, $user, $password, $pconnect = 0) {
if ($pconnect) {
$this->id=mysql_pconnect($host, $user, $password);
} else {
$this->id=mysql_connect($host, $user, $password);
}
if ($this->id) {
if (!mysql_select_db($database)) { $this->error('Fatal Error: Could not find database on the server'); }
}
return $this->id;
}
function error($error = 0) {
global $lastquery;
print 'MMC Error
An Error has occured, please contact the system administrator.
Top 5 Killers
# |
Username |
Kills |
$top5killers = new query($SQL, "SELECT bg_players.NAME, COUNT(REF_KILLER) AS KILLS FROM bg_plays JOIN bg_players on bg_plays.REF_KILLER = bg_players.ID WHERE bg_plays.DEATH_REASON != \"WINNER\" AND bg_plays.REF_KILLER != 0 AND bg_players.NAME IS NOT NULL GROUP BY REF_KILLER ORDER BY KILLS DESC LIMIT 5");
$p = "1";
while ($top5killers->getrow()) {
$pname = $top5killers->field('NAME');
$pkills = $top5killers->field('KILLS');
?>
0 |
Notice: Undefined variable: pname in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 200
|
Notice: Undefined variable: pkills in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 201
|
$p++;;
}
?>
Top 5 Winners
# |
Username |
Wins |
$top5winners = new query($SQL, "SELECT bg_players.NAME, COUNT(DEATH_REASON) AS WINS FROM bg_plays JOIN bg_players on bg_plays.REF_PLAYER = bg_players.ID WHERE bg_plays.DEATH_REASON = \"WINNER\" AND bg_players.NAME IS NOT NULL GROUP BY REF_PLAYER ORDER BY WINS DESC LIMIT 5");
$p = "1";
while ($top5winners->getrow()) {
$pname = $top5winners->field('NAME');
$pwins = $top5winners->field('WINS');
?>
0 |
Notice: Undefined variable: pname in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 240
|
Notice: Undefined variable: pwins in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 241
|
$p++;;
}
?>
Most Deaths
# |
Username |
Deaths |
$top5deaths = new query($SQL, "SELECT bg_players.NAME, COUNT(DEATH_REASON) AS DEATHS FROM bg_plays JOIN bg_players on bg_plays.REF_PLAYER = bg_players.ID WHERE bg_plays.DEATH_REASON != \"WINNER\" AND bg_plays.DEATH_REASON != \"CRASH\" AND bg_players.NAME IS NOT NULL GROUP BY REF_PLAYER ORDER BY DEATHS DESC LIMIT 5");
$p = "1";
while ($top5deaths->getrow()) {
$pname = $top5deaths->field('NAME');
$pdeaths = $top5deaths->field('DEATHS');
?>
0 |
Notice: Undefined variable: pname in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 280
|
Notice: Undefined variable: pdeaths in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 281
|
$p++;;
}
?>
Most Rich
# |
Username |
Balance |
$top5bal = new query($SQL, "SELECT * FROM `bg_players` ORDER BY `bg_players`.`BALANCE` DESC limit 5");
$p = "1";
while ($top5bal->getrow()) {
$pname = $top5bal->field('NAME');
$pbal = $top5bal->field('BALANCE');
?>
0 |
Notice: Undefined variable: pname in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 321
|
Notice: Undefined variable: pbal in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 322
|
$p++;;
}
?>
$list_games = new query($SQL, "SELECT id, starttime, endtime from bg_games where endtime != '' order by ID desc limit 0,2");
while ($list_games->getrow()) {
$gid = $list_games->field('id');
$gstarttime = $list_games->field('starttime');
$gendtime = $list_games->field('endtime');
echo "
Game $gid [Started: $gstarttime] [Ended: $gendtime] |
";
//Get contents of individual game
$query_game = new query($SQL, "SELECT p.kit, p.deathtime, p.killer, p.death_reason, pl.name as ref_player, pl.balance, pl2.name as ref_killer
FROM `bg_plays` p
left join bg_players pl on p.ref_player = pl.id
left join bg_players pl2 on p.ref_killer = pl2.id
WHERE ref_game = $gid order by p.deathtime DESC");
while ($query_game->getrow()) {
$kit = $query_game->field('kit');
$deathtime = $query_game->field('deathtime');
$deathreason = $query_game->field('death_reason');
$ref_player = $query_game->field('ref_player');
$ref_killer = $query_game->field('ref_killer');
$killer = $query_game->field('killer');
$balance = $query_game->field('balance');
$img = "";
if ($deathreason == 'ENTITY_ATTACK') {
if ($kit == 'archer' OR $kit == 'bowman') {
$img = "http://www.myminecraft.com/bow.png";
} elseif($kit == 'zeus') {
$img = "http://www.myminecraft.com/blaze_rod.png";
} elseif($kit == 'king') {
$img = "http://www.myminecraft.com/diamond_sword.jpg";
} elseif($kit == 'martyr') {
$img = "";
} elseif($kit == 'cook') {
unset($img);
} elseif($kit == 'spiderman') {
unset($img);
} else {
unset($img);
}
} elseif($deathreason == 'PROJECTILE') {
if ($kit == 'archer' OR $kit == 'bowman') {
$img = "http://www.myminecraft.com/bow.png";
} elseif($kit == 'zeus') {
$img = "http://www.myminecraft.com/blaze_rod.png";
} elseif($kit == 'king') {
$img = "http://www.myminecraft.com/diamond_sword.jpg";
} elseif($kit == 'martyr') {
unset($img);
} elseif($kit == 'cook') {
unset($img);
} elseif($kit == 'spiderman') {
unset($img);
} else {
unset($img);
}
} elseif($deathreason == 'BLOCK_EXPLOSION') {
} elseif($deathreason == 'FALL') {
}
if (!isset($img)) { $image = $deathreason; } else { $image = "
"; }
if ($killer != "PLAYER") {
if ($deathreason == "WINNER") {?>
Notice: Undefined variable: ref_player in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 421
|

|
Balance:
Notice: Undefined variable: balance in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 423
|
Notice: Undefined variable: deathtime in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 424
|
} elseif ($deathreason == "QUIT") { ?>
Notice: Undefined variable: ref_player in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 428
|

|
Notice: Undefined variable: kit in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 430
|
Notice: Undefined variable: deathtime in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 431
|
}
} else { ?>
Notice: Undefined variable: ref_player in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 436
|
Notice: Undefined variable: image in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 437
Notice: Undefined variable: kit in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 437
|
Was Slaughtered by |
Notice: Undefined variable: ref_killer in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 439
|
Notice: Undefined variable: deathtime in /home/myminecraft/public_html/wp-content/themes/mmc_blue/hg.php on line 440
|
}
}?>
} ?>