<?php break; // case list // case list case 'view': $id = $_GET['id']; $t = mysql_fetch_array(mysql_query("SELECT * FROM tournaments WHERE id = '{$id}'")); $name = db_output($t['name']); $text = db_output($t['text']); $rating = $t['min_rating'] . " - " . $t['max_rating']; $date = date("m.d.y", $t['time']); $official = $t['official'] == 1 ? $MSG_LANG["yes"] : $MSG_LANG["no"]; $thematic = db_output($t['thematic']); $days = $t['days']; $players = get_players($id); $creator = get_userdata($t['creator']); ?> <table border="1" style="width: 100%"> <tr> <td> <h1><?php echo $name; ?> </h1> <?php if ($t['big'] != 0 || $t['big'] == 0 && $t['players'] == 16) { if ($t['big'] != 0) { $query = "SELECT * FROM tournaments WHERE id='" . $t['big'] . "'";
$body->set('deities', $deities); $body->set('anonymity', $anonymity); $vars = player_info(); if ($vars) { foreach ($vars as $key => $value) { $body->set($key, $value); } } } else { $curr_page = isset($_GET['page']) ? $_GET['page'] : $default_page; $curr_size = isset($_GET['size']) ? $_GET['size'] : $default_size; $curr_sort = isset($_GET['sort']) ? $columns[$_GET['sort']] : $columns[$default_sort]; $body = new Template("templates/player/player.default.tmpl.php"); $page_stats = getPageInfo("character_data", $curr_page, $curr_size, $_GET['sort']); if ($page_stats['page']) { $players = get_players($page_stats['page'], $curr_size, $curr_sort); } if ($players) { $body->set('players', $players); $body->set('classes', $classes); foreach ($page_stats as $key => $value) { $body->set($key, $value); } } else { $body->set('page', 0); $body->set('pages', 0); } } break; case 1: // Edit Player Profile
<?php require 'game-main-functions.php'; error_log($_GET['fn']); if ($_GET['fn'] === "get_players") { header('Content-Type: application/json'); echo json_encode(get_players()); } else { if ($_GET['fn'] === "get_active_player") { echo get_active_player(); } else { if ($_GET['fn'] === "get_player_positions") { header('Content-Type: application/json'); echo json_encode(get_player_positions()); } else { if ($_GET['fn'] === "update_player") { update_player($_GET['username'], $_GET['x'], $_GET['y']); } else { if ($_GET['fn'] === "make_suggestion") { header('Content-Type: application/json'); echo json_encode(make_suggestion($_GET['username'], $_GET['wep'], $_GET['loc'], $_GET['char'])); } else { if ($_GET['fn'] === "get_suggestions") { header('Content-Type: application/json'); echo json_encode(get_suggestions($_GET['username'])); } else { if ($_GET['fn'] === "show_card") { header('Content-Type: application/json'); echo show_card($_GET['username'], $_GET['player'], $_GET['card']); } else { if ($_GET['fn'] === "check_for_answer") {
function send_mails($id, $text="") { global $CFG_MAILADDRESS; $players = get_players($id); $query = "SELECT * FROM tournaments WHERE id = '$id'"; $t = mysql_query($query); $t = mysql_fetch_array($t); while (list($key, $vak) = each($players)) { $row = get_userdata($val); $mailsubject = "You hve entered the Finals"; $mailmsg = "Hello ". $row[firstName].", you have entered the Finals of ". $t['name'] ."."; mail("$row[firstName] <$row[email]>",$mailsubject,$mailmsg,"From: $CFG_MAILADDRESS"); } return; }
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.24/themes/base/jquery-ui.css"> <link rel="stylesheet" href="style.css" /> <link rel="apple-touch-icon" href="appicon.png" /> <link rel="apple-touch-startup-image" href="startup.png"> <script src="jquery-1.8.2.min.js"></script> <script src="http://code.jquery.com/ui/1.8.24/jquery-ui.js"></script> <script src="jquery.mobile-1.2.0.js"></script> </head> <body> <div data-role="header"> <h1>Players</h1> </div> <ul data-role="listview" data-filter="true" class="ui-listview"> <?php $players = get_players(); while ($player = mysql_fetch_array($players)) { ?> <li data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="div" data-icon="arrow-r" data-iconpos="right" data-theme="c" class="ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-btn-up-c"><div class="ui-btn-inner ui-li"><div class="ui-btn-text"><a href="index.html" class="ui-link-inherit"><?php echo $player['name']; ?> </a></div><span class="ui-icon ui-icon-arrow-r ui-icon-shadow"> </span></div></li> <?php } ?> <li data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="div" data-icon="arrow-r" data-iconpos="right" data-theme="c" class="ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-li-last ui-btn-up-c"><div class="ui-btn-inner ui-li"><div class="ui-btn-text"><a href="index.html" class="ui-link-inherit">Volvo</a></div><span class="ui-icon ui-icon-arrow-r ui-icon-shadow"> </span></div></li> </ul> <div data-role="footer" data-id="samebar" class="nav-glyphish-example" data-position="fixed" data-tap-toggle="false"> <div data-role="navbar" class="nav-glyphish-example" data-grid="d">
while ($row = $rs->fetch_assoc()) { $dx = $row['x'] - $spacegame['player']['x']; $dy = $row['y'] - $spacegame['player']['y']; $adx = abs($dx); $ady = abs($dy); $dist2 = max($adx, $ady); if ($dist2 < $spacegame['target_dist']) { $spacegame['target_dist'] = $dist2; $spacegame['target_dir'] = get_dir($dx, $dy); } } } // if ship_type <= 0 $spacegame['players']['safe'] = array(); $spacegame['players']['hostile'] = array(); $players = get_players($spacegame['player']); } while (false); function get_players($player) { global $spacegame; global $db; $db = isset($db) ? $db : new DB(); $rs = null; if ($player['base_id'] > 0) { $x = $player['base_x']; $y = $player['base_y']; $rs = $db->get_db()->query("select * from players where death = 0 and ship_type > 0 and base_id = '" . $player['base_id'] . "' and base_x >= {$x} - " . BASE_DISTANCE . " and base_x <= {$x} + " . BASE_DISTANCE . " and base_y >= {$y} - " . BASE_DISTANCE . " and base_y <= {$y} + " . BASE_DISTANCE . " order by rank desc, level desc, experience desc, caption"); } else { if (isset($spacegame['base'])) { $x = $player['x']; $y = $player['y'];
?> </td> <?php } ?> </tr> <?php } ?> </tbody> <thead class = "thead-inverse"> <tr> <th>Locations</th> <?php foreach (get_players() as $playa) { ?> <th> </th> <?php } ?> </tr> </thead> <tbody class = "locations"> <?php foreach (get_locations() as $char) { ?> <tr onmouseenter="hover(this)" onmouseleave="hover(this)" data-cardname = <?php echo '\'' . $char['name'] . '\'';