public function testResolvePartialPath() { $resolver = $this->prophesize('asylgrp\\workbench\\PathResolver'); $resolver->resolve('foo')->willReturn('resolved'); $settings = new Settings(['baz' => '[path:foo]/bar'], $resolver->reveal()); $this->assertSame('resolved/bar', $settings->read('baz')); }
protected function _initDb() { $path = Settings::read("APP_PATH"); require_once $path . "/config/database.php"; if (isset($dbcfg)) { Settings::write("DB", $dbcfg); } }
/** function test_debug * This function tests the debug given by the * URL and checks it against the globals debug password * and if they do not match, doesn't debug * * @param void * @action tests debug pass * @return bool success */ function test_debug() { if (!isset($_GET['DEBUG'])) { return false; } if (!class_exists('Settings') || !Settings::test()) { return false; } if ('' == trim(Settings::read('debug_pass'))) { return false; } if (0 !== strcmp($_GET['DEBUG'], Settings::read('debug_pass'))) { return false; } $GLOBALS['_&_DEBUG_QUERY'] = '&DEBUG=' . $_GET['DEBUG']; $GLOBALS['_?_DEBUG_QUERY'] = '?DEBUG=' . $_GET['DEBUG']; return true; }
/** * pub static render * Render file contents * @param $path <string url> path to file to parse * @param $context <string> the route context info. * @return <string html, json, xml> return the output **/ public static function render($template, array $params = array()) { ob_start(); if (!empty($params)) { extract($params, EXTR_SKIP); } require Settings::read("APP_PATH") . "/views" . $template; $ret = ob_get_contents(); ob_end_clean(); return $ret; }
/** public function test_nudge * Tests if the current player can be nudged or not * * @param void * @return bool player can be nudged */ public function test_nudge() { call(__METHOD__); $player_id = (int) $this->_players['opponent']['player_id']; if ($this->get_my_turn() || in_array($this->state, array('Finished', 'Draw')) || $this->paused) { return false; } try { $nudge_time = Settings::read('nudge_flood_control'); } catch (MyException $e) { return false; } if (-1 == $nudge_time) { return false; } elseif (0 == $nudge_time) { return true; } // check the nudge status for this game/player // 'now' is taken from the DB because it may // have a different time from the PHP server $query = "\n\t\t\tSELECT NOW( ) AS now\n\t\t\t\t, G.modify_date AS move_date\n\t\t\t\t, GN.nudged\n\t\t\tFROM " . self::GAME_TABLE . " AS G\n\t\t\t\tLEFT JOIN " . self::GAME_NUDGE_TABLE . " AS GN\n\t\t\t\t\tON (GN.game_id = G.game_id\n\t\t\t\t\t\tAND GN.player_id = '{$player_id}')\n\t\t\tWHERE G.game_id = '{$this->id}'\n\t\t"; $dates = $this->_mysql->fetch_assoc($query); if (!$dates) { return false; } // check the dates // if the move date is far enough in the past // AND the player has not been nudged // OR the nudge date is far enough in the past if (strtotime($dates['move_date']) <= strtotime('-' . $nudge_time . ' hour', strtotime($dates['now'])) && (empty($dates['nudged']) || strtotime($dates['nudged']) <= strtotime('-' . $nudge_time . ' hour', strtotime($dates['now'])))) { return true; } return false; }
top: 2px; left: 5px; z-index: 1; color: #999; } </style> '; $date_format = 'D, M j, Y g:i a'; $approve_users = false; $new_users = true; $max_users = 0; if (class_exists('Settings') && Settings::test()) { $date_format = Settings::read('long_date'); $approve_users = Settings::read('approve_users'); $new_users = Settings::read('new_users'); $max_users = Settings::read('max_users'); } echo get_header($meta); ?> <div id="notes"> <div id="date"><?php echo date($date_format); ?> </div> <p><strong>Welcome to <?php echo GAME_NAME; ?> !</strong></p> <p>Please enter a valid username and password to enter.</p> <?php if ($approve_users) {
/** public function admin_reset_pass * Reset the password for the given players * * @param mixed csv or array of user ids * @action resets the password for the given players * @return void */ public function admin_reset_pass($user_ids) { // make sure the user doing this is an admin if (!$this->is_admin) { throw new MyException(__METHOD__ . ': Player is not an admin'); } array_trim($user_ids, 'int'); $data = array('password' => self::hash_password(Settings::read('default_pass')), 'alt_pass' => self::hash_alt_pass(Settings::read('default_pass'))); $this->_mysql->insert(self::PLAYER_TABLE, $data, " WHERE player_id IN (0," . implode(',', $user_ids) . ") "); }
$prev = $prev_item['message_id']; } $prev_item = $item; } $meta['title'] = 'Message Viewer'; $meta['head_data'] = ' <script type="text/javascript" src="scripts/messages.js"></script> '; echo get_header($meta); ?> <div id="content" class="msg"> <div class="link_date"> <a href="messages.php">Return to Inbox</a> Sent: <?php echo @ifdateor(Settings::read('long_date'), strtotime($message['send_date']), strtotime($message['create_date'])); ?> </div> <h2 class="subject"><?php echo $message['subject']; ?> <span class="sender">From: <?php echo $message['recipients'][0]['sender']; ?> </span></h2> <div class="sidebar"> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> "><div class="buttons"> <div class="prevnext">
/** function get_item * Generate the HTML content portion of the page * * @param string contents * @param string instructions for page * @param string [optional] title for page * @return string HTML content for page */ function get_item($contents, $hint, $title = '', $extra_html = '') { $hint_html = "\n\t\t\t<p><strong>Welcome"; if (!empty($GLOBALS['Player']) && !empty($_SESSION['player_id'])) { $hint_html .= ", {$GLOBALS['Player']->username}"; } $hint_html .= '</strong></p>'; if (is_array($hint)) { foreach ($hint as $line) { $hint_html .= "\n\t\t\t<p>{$line}</p>"; } } else { $hint_html .= "\n\t\t\t<p>{$hint}</p>"; } if ('' != $title) { $title = '<h2>' . $title . '</h2>'; } $long_date = class_exists('Settings') && Settings::test() ? Settings::read('long_date') : 'M j, Y g:i a'; $html = ' <aside id="info"> <div id="notes" class="box"> <div> <div id="date">' . date($long_date) . '</div> ' . $hint_html . ' </div> </div> ' . $extra_html . ' </aside><!-- #info --> <div id="content" class="box"> <div> ' . $title . ' ' . $contents . ' </div> </div><!-- #content --> '; return $html; }
<dl id="chats">'; if (is_array($chat_data)) { foreach ($chat_data as $chat) { if ('' == $chat['username']) { $chat['username'] = '******'; } $color = ''; if (isset($players[$chat['player_id']]['color'])) { $color = substr($players[$chat['player_id']]['color'], 0, 3); } // preserve spaces in the chat text $chat['message'] = htmlentities($chat['message'], ENT_QUOTES, 'UTF-8', false); $chat['message'] = str_replace("\t", ' ', $chat['message']); $chat['message'] = str_replace(' ', ' ', $chat['message']); $chat_html .= ' <dt class="' . $color . '"><span>' . ldate(Settings::read('short_date'), strtotime($chat['create_date'])) . '</span> ' . $chat['username'] . '</dt> <dd' . ($chat['private'] ? ' class="private"' : '') . '>' . $chat['message'] . '</dd>'; } } $chat_html .= ' </dl> <!-- #chats --> </div> <!-- #chatbox -->'; } $meta['title'] = htmlentities($Game->name, ENT_QUOTES, 'UTF-8', false) . ' - #' . $_SESSION['game_id']; $meta['show_menu'] = false; $meta['head_data'] = ' <link rel="stylesheet" type="text/css" media="screen" href="css/game.css" /> <script type="text/javascript">//<![CDATA[ var state = "' . (!$Game->watch_mode ? !$Game->paused ? strtolower($Game->get_player_state($_SESSION['player_id'])) : 'paused' : 'watching') . '"; /*]]>*/</script>
continue; } $recipient_options .= '<option value="' . $player['player_id'] . '"' . get_selected($recipient_id, $player['player_id']) . '>' . $player['username'] . '</option>'; } } echo get_header($meta); ?> <div id="content"> <div class="link_date"> <a href="messages.php<?php echo $GLOBALS['_?_DEBUG_QUERY']; ?> ">Return to Inbox</a> <?php echo date(Settings::read('long_date')); ?> </div> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?> "><div id="formdiv"> <input type="hidden" name="token" value="<?php echo $_SESSION['token']; ?> " /> <ol> <li> <div class="info">Press and hold CTRL while selecting to select multiple recipients</div> <label for="user_ids">Recipients</label><select name="user_ids[]" id="user_ids" multiple="multiple" size="5"> <?php
/** static public function write_game_file * Writes the game logs to a file for storage * * @param int game id * @action writes the game data to a file * @return bool success */ public static function write_game_file($game_id) { $game_id = (int) $game_id; if (!Settings::read('save_games')) { return false; } if (0 == $game_id) { return false; } $Mysql = Mysql::get_instance(); $query = "\n\t\t\tSELECT *\n\t\t\tFROM `" . self::GAME_TABLE . "`\n\t\t\tWHERE game_id = '{$game_id}'\n\t\t"; $game = $Mysql->fetch_assoc($query); if (!$game) { return false; } if (!in_array($game['state'], array('Playing', 'Finished'))) { return false; } $query = "\n\t\t\tSELECT P.player_id\n\t\t\t\t, P.username\n\t\t\t\t, GP.color\n\t\t\t\t, GP.order_num\n\t\t\tFROM `" . self::GAME_PLAYER_TABLE . "` AS `GP`\n\t\t\t\tJOIN `" . Player::PLAYER_TABLE . "` AS `P`\n\t\t\t\t\tON (P.player_id = GP.player_id)\n\t\t\tWHERE GP.game_id = '{$game_id}'\n\t\t\tORDER BY GP.order_num ASC\n\t\t"; $results = $Mysql->fetch_array($query); if (!$results) { return false; } $players = array(); foreach ($results as $result) { $players[$result['player_id']] = $result; } $logs = self::get_logs($game_id, false); if (empty($logs)) { return false; } $winner = 'Unknown'; if ('D' === $logs[0]['data'][0]) { $winner = (int) trim($logs[0]['data'], 'D '); $winner = "{$winner} - {$players[$winner]['username']}"; } // open the file for writing $filename = GAMES_DIR . GAME_NAME . '_' . $game_id . '_' . date('Ymd', strtotime($game['create_date'])) . '.dat'; // don't use ldate() here $file = fopen($filename, 'w'); if (false === $file) { return false; } fwrite($file, "{$game['game_id']} - {$game['name']} - {$game['game_type']}\n"); fwrite($file, date('Y-m-d', strtotime($game['create_date'])) . "\n"); // don't use ldate() here fwrite($file, date('Y-m-d', strtotime($game['modify_date'])) . "\n"); // don't use ldate() here fwrite($file, "{$winner}\n"); fwrite($file, $GLOBALS['_ROOT_URI'] . "\n"); fwrite($file, "=================================\n"); fwrite($file, $game['extra_info'] . "\n"); fwrite($file, "=================================\n"); foreach ($players as $player) { fwrite($file, "{$player['player_id']} - {$player['color']} - {$player['username']}\n"); } fwrite($file, "=================================\n"); $logs = array_reverse($logs); foreach ($logs as $log) { fwrite($file, $log['data'] . "\n"); } fwrite($file, "=================================\n"); fwrite($file, "KEY--- (plid = player_id, trid = territory_id, cid = continent_id, atk = attack, dfd = defend)\n"); fwrite($file, "A - Attack - [atk_plid]:[atk_trid]:[dfd_plid]:[dfd_trid]:[atk_rolls],[dfd_rolls]:[atk_lost],[dfd_lost]:[defeated]\n"); fwrite($file, "C - Card - [plid]:[card_id]\n"); fwrite($file, "D - Done (Game Over) - [winner_plid]\n"); fwrite($file, "E - Eradicated - [plid]:[killed_plid]:[cards_received (if any)]\n"); fwrite($file, "F - Fortify - [plid]:[armies_moved]:[from_trid]:[to_trid]\n"); fwrite($file, "I - Board Initialization - Ordered comma-separated list of plids ordered by trids (1-index).\n"); fwrite($file, "N - Next Player - [plid]\n"); fwrite($file, "O - Occupy - [plid]:[armies_moved]:[from_trid]:[to_trid]\n"); fwrite($file, "P - Placement - [plid]:[armies_placed]:[trid]\n"); fwrite($file, "Q - Quit - [plid]\n"); fwrite($file, "R - Reinforce - [plid]:[armies_given]:[num_territories_controlled]:[csv_cids_controlled (if any)]\n"); fwrite($file, "T - Trade - [plid]:[csv_card_list]:[armies_given]:[bonus_trid (if any)]\n"); fwrite($file, "V - Value for Trade - [next_trade_value]\n"); fwrite($file, "\n"); return fclose($file); }
</div></form>'; if (is_array($chat_data)) { $lobby .= ' <dl id="chats">'; foreach ($chat_data as $chat) { // preserve spaces in the chat text $chat['message'] = str_replace("\t", ' ', $chat['message']); $chat['message'] = str_replace(' ', ' ', $chat['message']); if (!isset($gravatars[$chat['email']])) { $gravatars[$chat['email']] = Gravatar::src($chat['email']); } $grav_img = '<img src="' . $gravatars[$chat['email']] . '" alt="" /> '; if ('' == $chat['username']) { $chat['username'] = '******'; } $lobby .= ' <dt>' . $grav_img . '<span>' . $chat['create_date'] . '</span> ' . $chat['username'] . '</dt> <dd>' . htmlentities($chat['message'], ENT_QUOTES, 'ISO-8859-1', false) . '</dd>'; } $lobby .= ' </dl> <!-- #chats -->'; } $lobby .= ' </div> <!-- #chatbox --> </div> <!-- #lobby -->'; $contents .= $lobby; $hints = array('Select a game from the list and resume play by clicking anywhere on the row.', 'Invite another player to a game by clicking on the Invitations menu item.', '<span class="highlight">Colored entries</span> indicate that it is your turn.', '<span class="warning">WARNING!</span><br />Games will be deleted after ' . Settings::read('expire_games') . ' days of inactivity.', 'Finished games will be deleted after ' . Settings::read('expire_finished_games') . ' days.'); echo get_header($meta); echo get_item($contents, $hints, $meta['title']); call($GLOBALS); echo get_footer($meta);
/** protected function _send * Sends email messages of various types [optional data contents] * * @param string message type * @param mixed player id OR email address OR mixed array of both * @param array optional message data * @action send emails * @return bool success */ protected function _send($type, $to, $data = array()) { call(__METHOD__); call($type); call($to); call($data); if (is_array($to)) { $return = true; foreach ($to as $player) { $return = $this->_send($type, trim($player), $data) && $return; } return $return; } elseif (preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i', $to)) { $email = $to; } else { // $to is a single player id $player_id = (int) $to; // test if this user accepts emails $query = "\n\t\t\t\tSELECT P.email\n\t\t\t\t\t, PE.allow_email\n\t\t\t\tFROM " . Player::PLAYER_TABLE . " AS P\n\t\t\t\t\tLEFT JOIN " . GamePlayer::EXTEND_TABLE . " AS PE\n\t\t\t\t\t\tON P.player_id = PE.player_id\n\t\t\t\tWHERE P.player_id = '{$player_id}'\n\t\t\t"; list($email, $allow) = Mysql::get_instance()->fetch_row($query); call($email); call($allow); if (empty($allow) || empty($email)) { // no exception, just quit return false; } } call($email); $site_name = Settings::read('site_name'); if (!in_array($type, array_keys($this->email_data))) { throw new MyException(__METHOD__ . ': Trying to send email with unsupported type (' . $type . ')'); } $subject = $this->email_data[$type]['subject']; $message = $this->email_data[$type]['message']; // replace the meta vars $replace = array('/\\[\\[\\[GAME_NAME\\]\\]\\]/' => GAME_NAME, '/\\[\\[\\[site_name\\]\\]\\]/' => $site_name, '/\\[\\[\\[opponent\\]\\]\\]/' => ife($data['opponent'], 'opponent'), '/\\[\\[\\[export_data\\]\\]\\]/' => var_export($data, true)); $message = preg_replace(array_keys($replace), $replace, $message); $subject = GAME_NAME . ' - ' . $subject; if (!empty($data['game_id'])) { $message .= "\n\n" . 'Game Link: ' . $GLOBALS['_ROOT_URI'] . 'game.php?id=' . (int) $data['game_id']; } elseif (!empty($data['page'])) { $message .= "\n\n" . 'Direct Link: ' . $GLOBALS['_ROOT_URI'] . $data['page']; } $message .= ' ============================================= This message was automatically sent by ' . $site_name . ' and should not be replied to. ============================================= ' . $GLOBALS['_ROOT_URI']; $from_email = Settings::read('from_email'); // send the email $headers = "From: " . GAME_NAME . " <{$from_email}>\r\n"; $message = html_entity_decode($message); $this->_log($email . "\n" . $headers . "\n" . $subject . "\n" . $message); call($subject); call($message); call($headers); if ($GLOBALS['_USEEMAIL']) { return mail($email, $subject, $message, $headers); } return false; }
/** function test_debug * This function tests the debug given by the * URL and checks it against the globals debug password * and if they do not match, doesn't debug * * @param void * @action tests debug pass * @return bool success */ function test_debug() { if (!isset($_GET['DEBUG'])) { return false; } if (!class_exists('Settings') || !Settings::test()) { return false; } if ('' == trim(Settings::read('debug_pass'))) { return false; } if (0 !== strcmp($_GET['DEBUG'], Settings::read('debug_pass'))) { return false; } return true; }
// set to true for output of debugging code } if (DEBUG) { if (isset($_GET['DEBUG'])) { $GLOBALS['_&_DEBUG_QUERY'] = '&DEBUG=' . $_GET['DEBUG']; $GLOBALS['_?_DEBUG_QUERY'] = '?DEBUG=' . $_GET['DEBUG']; } else { $GLOBALS['_&_DEBUG_QUERY'] = ''; $GLOBALS['_?_DEBUG_QUERY'] = '?z'; } } } $GLOBALS['_LOGGING'] = DEBUG; // do not change, rather, change debug value if (class_exists('Settings') && Settings::test()) { $Mysql->set_settings(array('log_errors' => Settings::read('DB_error_log'), 'email_errors' => Settings::read('DB_error_email'), 'email_from' => Settings::read('from_email'), 'email_to' => Settings::read('to_email'))); } if (defined('DEBUG') && DEBUG) { ini_set('display_errors', 'On'); error_reporting(-1); // everything if (isset($Mysql)) { $Mysql->set_error(3); } } // log the player in if ((!defined('LOGIN') || LOGIN) && isset($Mysql)) { $GLOBALS['Player'] = new GamePlayer(); // this will redirect to login if failed $GLOBALS['Player']->log_in(); if (0 != $_SESSION['player_id']) {
/** protected function _get_message_data * Retrieves the message from the database for sending * but makes sure this user can see this message first * and then appends data to the message so it can be sent * * @param int message id * @action tests to make sure this user can see this message * @action appends data to the subject and message so it can be sent * @return array [subject, message, to] */ protected function _get_message_data($message_id) { call(__METHOD__); try { $message = $this->get_message($message_id); } catch (MyExeption $e) { throw $e; } $message['from'] = Player::get_username($message['recipients'][0]['from_id']); $message['date'] = empty($message['send_date']) ? $message['create_date'] : $message['send_date']; $message['date'] = date(Settings::read('long_date'), strtotime($message['date'])); $message['subject'] = '' == $message['subject'] ? '<No Subject>' : $message['subject']; $message['message'] = "\n\n\n" . str_repeat('=', 50) . "\n\n{$message['from']} said: ({$message['date']})\n" . str_repeat('-', 50) . "\n{$message['message']}"; return $message; }
$meta['title'] = 'Registration'; $meta['head_data'] = ' <script type="text/javascript">//<![CDATA[ var profile = 0; //]]></script> <script type="text/javascript" src="scripts/register.js"></script> '; $meta['show_menu'] = false; echo get_header($meta); $hints = array('Please Register', 'You must remember your username and password to be able to gain access to ' . GAME_NAME . ' later.'); if (Settings::read('approve_users')) { $hints[] = '<span class="notice">NOTE</span>: You will be unable to log in if your account has not been approved yet.'; $hints[] = 'You should receive an email when your account has been approved.'; } if (Settings::read('expire_users')) { $hints[] = '<span class="warning">WARNING!</span><br />Inactive accounts will be deleted after ' . Settings::read('expire_users') . ' days.'; } $contents = <<<EOF \t<form method="post" action="{$_SERVER['REQUEST_URI']}"><div class="formdiv"> \t\t<input type="hidden" name="token" id="token" value="{$_SESSION['token']}" /> \t\t<input type="hidden" name="errors" id="errors" /> \t\t<ul> \t\t\t<li><label for="first_name">First Name</label><input type="text" id="first_name" name="first_name" maxlength="20" tabindex="1" /></li> \t\t\t<li><label for="last_name">Last Name</label><input type="text" id="last_name" name="last_name" maxlength="20" tabindex="2" /></li> \t\t\t<li><label for="username" class="req">Username</label><input type="text" id="username" name="username" maxlength="20" tabindex="3" /><span id="username_check" class="test"></span></li> \t\t\t<li><label for="email" class="req">Email</label><input type="text" id="email" name="email" tabindex="4" /><span id="email_check" class="test"></span></li> \t\t\t<li style="text-indent:-9999em;">Leave the next field blank (anti-spam).</li> \t\t\t<li style="text-indent:-9999em;"><label for="website">Leave Blank</label><input type="text" id="website" name="website" /></li>
</div></form>'; if (is_array($chat_data)) { $lobby .= ' <dl id="chats">'; foreach ($chat_data as $chat) { // preserve spaces in the chat text $chat['message'] = str_replace("\t", ' ', $chat['message']); $chat['message'] = str_replace(' ', ' ', $chat['message']); if (!isset($gravatars[$chat['email']])) { $gravatars[$chat['email']] = Gravatar::src($chat['email']); } $grav_img = '<img src="' . $gravatars[$chat['email']] . '" alt="" /> '; if ('' == $chat['username']) { $chat['username'] = '******'; } $lobby .= ' <dt>' . $grav_img . '<span>' . ldate(Settings::read('short_date'), strtotime($chat['create_date'])) . '</span> ' . $chat['username'] . '</dt> <dd>' . htmlentities($chat['message'], ENT_QUOTES, 'UTF-8', false) . '</dd>'; } $lobby .= ' </dl> <!-- #chats -->'; } $lobby .= ' </div> <!-- #chatbox --> </div> <!-- #lobby -->'; $contents .= $lobby; $hints = array('Select a game from the list and resume play by clicking anywhere on the row.', '<span class="highlight">Colored entries</span> indicate that it is your turn.', 'Games that are displayed: <span class="highlight password">Waiting</span>, are password protected', '<span class="warning">WARNING!</span><br />Games will be deleted after ' . Settings::read('expire_games') . ' days of inactivity.', 'Finished games will be deleted after ' . Settings::read('expire_finished_games') . ' days.'); echo get_header($meta); echo get_item($contents, $hints, $meta['title']); call($GLOBALS); echo get_footer($meta);
} $meta['title'] = 'Send Game Invitation'; $meta['head_data'] = ' <link rel="stylesheet" type="text/css" media="screen" href="css/board.css" /> '; $meta['foot_data'] = ' <script type="text/javascript">//<![CDATA[ var setups = { ' . $setup_javascript . ' }; /*]]>*/</script> <script type="text/javascript" src="scripts/board.js"></script> <script type="text/javascript" src="scripts/invite.js"></script> '; $hints = array('Invite a player to a game by filling out your desired game options.', '<span class="highlight">WARNING!</span><br />Games will be deleted after ' . Settings::read('expire_games') . ' days of inactivity.'); // make sure this user is not full $submit_button = '<div><input type="submit" name="invite" value="Send Invitation" /></div>'; $warning = ''; if ($GLOBALS['Player']->max_games && $GLOBALS['Player']->max_games <= $GLOBALS['Player']->current_games) { $submit_button = $warning = '<p class="warning">You have reached your maximum allowed games, you can not create this game !</p>'; } $contents = <<<EOF \t<form method="post" action="{$_SERVER['REQUEST_URI']}" id="send"><div class="formdiv"> \t\t<input type="hidden" name="token" value="{$_SESSION['token']}" /> \t\t<input type="hidden" name="player_id" value="{$_SESSION['player_id']}" /> \t\t{$warning} \t\t<div><label for="opponent">Opponent</label><select id="opponent" name="opponent">{$opponent_selection}</select></div>
title: null, beforeLoad: function( ) { $("#custom_trades_table").show( ); }, afterClose: function( ) { $("#custom_trades_table").hide( ); } }); // hide the fancybox tables $("#conquer_limit_table").hide( ); $("#custom_trades_table").hide( ); }); /*]]>*/</script> '; $hints = array('Join a game by filling out your desired game options.', 'WARNING!<br />Games will be deleted after ' . Settings::read('expire_games') . ' days of inactivity.', 'If the password field is displayed, this game is password protected, and requires a password to join.'); $fog_of_war = $Game->get_fog_of_war(); $extra_info = $Game->get_extra_info(); if ('none' != $extra_info['conquer_type']) { // pull our variables out to use them here foreach ($extra_info as $key => $value) { if ('conquer_' == substr($key, 0, 8)) { $key = substr($key, 8); ${$key} = $value; } } // the number of multipliers to skip before incrementing // e.g.- if it's 1 conquest per 10 trades, and skip is 1 // the conquest value won't increase until trade value reaches 20 // which is 10 trades past when it would increase at 10 if (empty($skip) || !(int) $skip) {