* Script that simply gives comprehensive details about a ship. * Created by Moriarty * On 7th Aug 2004 ******************/ //get ship id, and confirm is valid num. $s_id = (int) $_GET['s_id']; if (empty($s_id) || $s_id <= 0) { print_s_page($st[82]); } require_once "user.inc.php"; //select ship information db("select * from {$db_name}_ships where ship_id = '{$s_id}' && login_id = '{$user['login_id']}'"); $ship = dbr(1); //nothing found, so almost certainly not the players own ship. if (empty($ship)) { print_s_page($st[83]); } $text = sprintf($st[84], $ship[ship_name]); $text .= make_table(array("", "")); $text .= quick_row($cw['name'], $ship['ship_name']); $text .= quick_row($cw['type'], $ship['class_name']); $text .= quick_row($cw['location'], $cw['sys'] . " # {$ship['location']}"); $text .= quick_row($cw['fleet'] . " #", $ship['fleet_id']); $text .= quick_row("", ""); $text .= quick_row($cw['fighters'], "{$ship['fighters']}/{$ship['max_fighters']}"); $text .= quick_row($cw['shields'], "{$ship['shields']}/{$ship['max_shields']}"); $text .= quick_row($cw['armour'], "{$ship['armour']}/{$ship['max_armour']}"); $text .= quick_row($cw['size'], discern_size($ship['size'])); $text .= quick_row($cw['cargo_bays'], bay_storage($ship)); if ($GAME_VARS['alternate_play_1'] == 1) { $text .= quick_row($cw['mining_rate'] . ": " . $cw['metal'], $ship['mine_rate_metal']);
$aim_show = 0; } //if user has entered icq number they will quite probably want to see icq users. Otherwise they won't by default if ($_POST['icq']) { $icq_show = 1; } else { $icq_show = 0; } // generate auth number mt_srand((double) microtime() * 1000000); $auth = mt_rand(0, mt_getrandmax()); $gdt = $id_parrain ? 1 : 0; dbn("insert into user_accounts (login_name, passwd, mdp, auth, signed_up, id_parrain, gdt, email_address, aim, icq, msn, yim, con_speed) VALUES('{$login_name}', '" . md5($_POST['mdp']) . "', '" . $_POST['mdp'] . "', '{$auth}', '" . time() . "', {$id_parrain}, {$gdt}, '{$email_address}', '" . mysql_escape_string($_POST['aim']) . "', '" . (int) $_POST['icq'] . "', '" . mysql_escape_string($_POST['msn']) . "', '" . mysql_escape_string($_POST['yim']) . "', '" . (int) $_POST['con_speed'] . "')"); $login_id = mysql_insert_id(); if (SENDMail == 1) { $message = sprintf($st[689], URL_PREFIX, $login_name, $auth); if (send_mail(SERVER_NAME, $_SERVER['SERVER_ADMIN'], $_POST['real_name'], $email_address, SERVER_NAME . " Authorisation Code", $message)) { echo $st[690] . "<p />"; echo $st[691] . "<p />"; } else { echo $st[692] . "<p />"; echo $st[693] . "<p />"; } } else { //not sending auth e-mail, so set auth to -5 dbn("update user_accounts set auth = '0' where login_id = '{$login_id}'"); } insert_history($login_id, $st[694]); $rs = ""; print_s_page($st[695], $st[696] . " <br /><a href='" . URL_PREFIX . "/'>" . $cw['click_here'] . "</a>" . $st[697], 'inscription_ok'); }
$rs = "<p /><a href=\"javascript: history.back()\">" . $cw['back'] . "</a>"; print_s_page($cw['error'], sprintf($st[85], $max_sect[0])); } else { $map_url = "star_find.php?sys1={$user['location']}&sys2={$find}"; } //show dynamic big-map } elseif ($GAME_VARS['uv_explored'] == 0 && $user['explored_sys'] != -1 && $user['login_id'] != 1) { //trying to search unexplored map. if (isset($_POST['find'])) { print_s_page($cw['error'], $st[86]); } $map_url = "dynamic_map.php?exp_sys={$user['explored_sys']}&loc=1&large_map=1"; $key_text = "<p />" . $cw['star_numbers'] . ":<br /><font color=#00FFFF>" . $cw['light_blue'] . "</font> = " . $cw['explored_systems'] . ".<br /><font color=#0088FF>" . $cw['dark_blue'] . "</font> = " . $cw['unexplored_systems'] . ".<p />"; //show static big-map } else { $map_url = "{$directories['images']}/{$db_name}_maps/sm_full{$file_rand}.png"; } if (isset($_GET['print'])) { $link_url = "<a href='map.php'>" . $cw['normal_map'] . "</a> - "; } else { $link_url = "<a href='map.php?print=1'>" . $cw['printable_map'] . "</a> - "; } $out = "<center>\r\n<form action='map.php' method='POST'><b>" . $cw['find_system'] . ": </b><input type='text' size='4' name='find' /> <input type='submit' value='" . $cw['search'] . "' /></form><br />\r\n<img src='{$map_url}' border='0' alt='" . $st[87] . "'>\r\n<br />"; if ($GAME_VARS['uv_wormholes'] == 1) { $out .= $cw['key'] . ":<br />" . $cw['wormholes'] . ":<br /><font color=#FFFF44>" . $cw['yellow_lines'] . "</font> = " . $cw['one_way_wormholes'] . ".<br /><font color=#00FF00>" . $cw['green_lines'] . "</font> = " . $cw['double_way_wormholes'] . "<p />"; } $out .= $key_text; $out .= $link_url; $rs = "<a href='javascript:self.close();'>" . $cw['close_map'] . "</a>"; print_s_page($cw['universal_starmap'], $out);