function anomaly_am_i_owner($anomaly_id)
{
    assert(is_numeric($anomaly_id));
    $anomaly = anomaly_get_anomaly($anomaly_id);
    if (user_ourself() == $anomaly['user_id']) {
        return true;
    }
    return false;
}
<?php

// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Sector view", "Here you will find all discovered sectors and planets on one single page. It will also let you claim sectors if appropriate.");
$cmd = input_check("show", "sid", "uid", 0, "claim", "!frmid", "!sid", "!ne_name", 0);
if ($uid == "") {
    $uid = user_ourself();
}
if ($cmd == "show") {
    if ($sid == "") {
        sector_show_all_sectors($uid);
    } else {
        sector_show_sector($sid, $uid);
    }
}
if ($cmd == "claim") {
    $ok = "";
    $errors['PARAMS'] = "Incorrect parameters specified..\n";
    $errors['NAME'] = "The sector name already exists.\n";
    $data['sector_id'] = $sid;
    $data['name'] = convert_crlf_to_px_tag($ne_name);
    comm_send_to_server("SECTOR", $data, $ok, $errors);
}
print_footer();
exit;
// ============================================================================================
//
<?php

// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Surface");
$cmd = input_check("show", "aid", 0);
if ($cmd == "show") {
    if ($aid == "") {
        $aid = user_get_home_planet(user_ourself());
    }
    show_surface($aid);
}
create_submenu(array("View Planet Info" => "anomaly.php?cmd=" . encrypt_get_vars("show") . "&aid=" . encrypt_get_vars($aid), "View Surface Info" => "surface.php?cmd=" . encrypt_get_vars("show") . "&aid=" . encrypt_get_vars($aid)));
print_footer();
exit;
// ============================================================================================
//
//
// Description:
//
//
// Parameters:
//
//
// Returns:
//
//
function show_surface($planet_id)
<?php

// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
comm_init_server();
$data['id'] = user_ourself();
$data['sess_id'] = session_id();
comm_s2s("LOGOUT", $data);
comm_fini_server();
session_destroy();
header("Location: login.php");
exit;
function input_check()
{
    $numargs = func_num_args();
    $arg_list = func_get_args();
    if (!validate_request_checksum()) {
        perihelion_die("Refresh Error", "You can only submit this form once.");
    }
    if (!isset($_REQUEST['cmd'])) {
        perihelion_die("", "No command requested.");
        return "";
    }
    // Command is needed. If not present... whooops.
    $cmd = decrypt_get_vars($_REQUEST['cmd']);
    // Browse through all numargs, check the command, if it is ours, decrypt all vars EXCEPT
    // the ne_* vars
    $i = 0;
    for (;;) {
        $tmp_cmd = $arg_list[$i];
        $i++;
        if ($tmp_cmd != $cmd) {
            while ($arg_list[$i] != "0") {
                $i++;
            }
        } else {
            while ($arg_list[$i] != "0") {
                $tmp_var = $arg_list[$i];
                $GLOBALS[$tmp_var] = "";
                // Error if we can't find a mandatory var
                if (substr($tmp_var, 0, 1) == "!") {
                    $tmp_var = substr($tmp_var, 1, 255);
                    if (!isset($_REQUEST[$tmp_var])) {
                        perihelion_die("Internal Error", "Mandatory var not found: " . $tmp_var);
                    }
                }
                if (isset($_REQUEST[$tmp_var])) {
                    // Check if we need decrypting or not
                    if (substr($tmp_var, 0, 3) == "ne_") {
                        $GLOBALS[$tmp_var] = $_REQUEST[$tmp_var];
                    } else {
                        $GLOBALS[$tmp_var] = decrypt_get_vars($_REQUEST[$tmp_var]);
                    }
                }
                $i++;
            }
            return $tmp_cmd;
        }
        $i++;
        if ($i >= $numargs) {
            break;
        }
    }
    // No command found :(
    if (user_is_admin(user_ourself())) {
        $str = "Illegal or no command requested.<br>Command issued: '{$cmd}'";
    } else {
        $str = "Illegal or no command requested.";
    }
    perihelion_die("Internal Error", $str);
}
Exemple #6
0
$cmd = input_check("show", "uid", 0, "showdetail", "uid", 0, "relation", "!frmid", "!uid", "!wid", 0);
if ($cmd == "show") {
    if ($uid == "") {
        $uid = user_ourself();
    }
    show_users($uid);
}
if ($cmd == "showdetail") {
    if ($uid == "") {
        $uid = user_ourself();
    }
    user_showinfo($uid, USER_SHOWINFO_NORMAL);
}
if ($cmd == "relation") {
    set_relation(user_ourself(), $uid, $wid);
    show_users(user_ourself());
}
print_footer();
exit;
// ============================================================================================
//
//
// Description:
//
//
// Parameters:
//
//
// Returns:
//
//
Exemple #7
0
<?php

// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
print_header();
print_title("Stock & upkeep information", "All information about your planet's stock and upkeep are located on this page. The 'Delta Upkeep' will show you wether or not your planet makes a profit. If this is a negative red number, you should increase the happieness rating of the planet, remove buildings or add more people to the planet. The 'ore upkeep per tick' should be on a white level, the more it tends to the red color, the less ore you have available for upkeep. If no ores are left for upkeep, buildings and vessels from that planet will be disabled until you replenish the ores.");
$cmd = input_check("show", "sid", 0);
if ($cmd == "show") {
    if ($sid == "") {
        stock_show_all_sectors(user_ourself());
    } else {
        stock_show_sector($sid);
    }
}
print_footer();
exit;
// ============================================================================================
//
//
// Description:
//
//
// Parameters:
//
//
// Returns:
//
//
function stock_show_all_sectors($user_id)
Exemple #8
0
$item[$i][0] = "General";
$item[$i][++$j]['item'] = "User Statistics";
$item[$i][$j]['href'] = "stats.php?cmd=" . encrypt_get_vars("show");
$item[$i][++$j]['item'] = "Show Rankings";
$item[$i][$j]['href'] = "score.php?cmd=" . encrypt_get_vars("show") . "&tbl=" . encrypt_get_vars("overall");
$item[$i][++$j]['item'] = "Show Users";
$item[$i][$j]['href'] = "user.php?cmd=" . encrypt_get_vars("show");
$item[$i][++$j]['item'] = "Show Alliances";
$item[$i][$j]['href'] = "alliance.php?cmd=" . encrypt_get_vars("show");
$item[$i][++$j]['item'] = "View Preferences";
$item[$i][$j]['href'] = "prefs.php?cmd=" . encrypt_get_vars("show");
$item[$i][++$j]['item'] = "View Manual";
$item[$i][$j]['href'] = "help/index.html";
$item[$i][++$j]['item'] = "Who's Online?";
$item[$i][$j]['href'] = "whoisonline.php";
if (user_is_admin(user_ourself())) {
    $item[$i][++$j]['item'] = "Admin Page";
    $item[$i][$j]['href'] = "admin/admin.php?cmd=" . encrypt_get_vars("choose");
}
$item[$i][++$j]['item'] = "Logout";
$item[$i][$j]['href'] = "logout.php\" target=\"_parent";
$i++;
$j = 0;
// Generate menu inside a string
$menu = "";
for ($i = 0; $i != count($item) + 1; $i++) {
    if (empty($item[$i][0])) {
        continue;
    }
    $menu .= "<nobr><b>" . $item[$i][0] . "</b></nobr><br>\n";
    for ($j = 1; $j != count($item[$i]); ++$j) {
// Session Identification
session_identification();
// Extra headers for TD..
$extra_headers = "<STYLE TYPE=\"text/css\" >      " . "  TH.red    { background-color: red }    " . "  TH.orange { background-color: orange } " . "  TH.white { background-color: white; color: black} " . "</STYLE>";
print_header($extra_headers);
print_title("Alliances", "An alliance is a coorperation between 2 or more users. Create your own alliance and increase it's size by let other users join in on your alliance.");
$cmd = input_check("create", 0, "show", "aid", 0, "partjoin", "!frmid", "aid", "uid", 0, "requestjoin", "!frmid", "rid", 0);
if ($cmd == "create") {
    create_alliance();
}
if ($cmd == "show") {
    show_alliance(user_ourself(), $aid);
}
if ($cmd == "partjoin") {
    partjoin_alliance($aid, $uid);
    show_alliance(user_ourself(), $aid);
}
if ($cmd == "requestjoin") {
    request_join_alliance($rid);
}
create_submenu(array("Show Alliances" => "alliance.php?cmd=" . encrypt_get_vars("show"), "Create New Alliance" => "alliance.php?cmd=" . encrypt_get_vars("create")));
print_footer();
exit;
// ============================================================================
// Show_Alliance()
//
// Description:
//   Shows the alliance $alliance_id in the context of the user_id.
//   When alliance_id is empty, all alliances known to the user are shown.
//
// Parameters:
<?php

// Include Files
include "includes.inc.php";
session_identification();
if (isset($_GET['user_id'])) {
    $user_id = decrypt_get_vars($_GET['id']);
} else {
    $user_id = user_ourself();
}
if (isset($_GET['zoom'])) {
    $zoom = decrypt_get_vars($_GET['zoom']);
} else {
    $zoom = 0;
}
if (isset($_GET['f'])) {
    $flags = decrypt_get_vars($_GET['f']);
} else {
    $flags = -1;
}
$name_array = array("alpha", "beta", "gamma", "delta");
if (substr($_GALAXY['image'], -4) == ".jpg") {
    $img2 = imagecreatefromjpeg($_CONFIG['PATH'] . $_GALAXY['image_dir'] . "/galaxy/" . $_GALAXY['image']);
    $width_scale = imagesx($img2) / 400;
    $height_scale = imagesy($img2) / 400;
} else {
    $img2 = imagecreatefromgif($_CONFIG['PATH'] . $_GALAXY['image_dir'] . "/galaxy/" . $_GALAXY['image']);
    $width_scale = imagesx($img2) / 400;
    $height_scale = imagesy($img2) / 400;
}
$img = imagecreate(400, 400);
        show_constructions($aid);
    }
}
if ($cmd == "build") {
    $ok = "";
    $errors['PARAMS'] = "Incorrect parameters specified..\n";
    $errors['CREDITS'] = "You don't have enough cash to construct the building...\n";
    $errors['ORE'] = "You don't have enough ores to construct the building...\n";
    $errors['POWER'] = "You need more (advanced) powerplants to construct the building...\n";
    $errors['MAX'] = "You cannot build anymore buildings of this type on the planet...\n";
    $errors['DEPS'] = "You cannot build this building before you have build all dependencies...\n";
    $errors['QUEUE'] = "Maximum number of constructions per planet reached. Wait until other buildings are finished...\n";
    $errors['SCIENCE'] = "You cannot build the construction since you haven't invented it yet...\n";
    $data['building_id'] = $bid;
    $data['anomaly_id'] = $aid;
    $data['user_id'] = user_ourself();
    if (comm_send_to_server("BUILD", $data, $ok, $errors) == 1) {
        $building = building_get_building($data['bid']);
        echo "<br><br><br><br>";
        echo "<table align=center border=0>";
        echo "  <tr><th>New construction in progress</th></tr>";
        echo "  <tr><td align=center><img align=center src=\"" . $_CONFIG['URL'] . $_GALAXY['image_dir'] . "/buildings/" . $building['image'] . ".jpg\" width=150 height=150></td></tr>";
        echo "</table>";
    }
}
print_footer();
exit;
// ============================================================================================
//
//
// Description:
function message_create($dst_user_id)
{
    $src_race = user_get_race(user_ourself());
    $dst_race = user_get_race($dst_uid);
    print_remark("Createmessage");
    form_start();
    echo "  <table align=center border=0 width=80%>\n";
    echo "    <tr><th>Send message</th></tr>\n";
    echo "    <tr><td>From:     </td><td>" . $src_race . " race</td></tr>\n";
    echo "    <tr><td>To:       </td><td>" . $dst_race . " race</td></tr>\n";
    echo "    <tr><td>Priority: </td><td><select name=priority><option value=1>Normal</option><option value=2>High</option></select></td></tr>\n";
    echo "    <tr><td>Subject:  </td><td><input type=text name=subject size=50 maxvalue=50></td></tr>\n";
    echo "    <tr><td>Msg:      </td><td><textarea name=msg rows=5 cols=60></textarea></td></tr>\n";
    echo "    <tr><td>&nbsp;    </td><td><input type=submit name=submit value='Send Message'></td></tr>\n";
    echo "  </table>\n";
    echo "  <br><br>\n";
    echo "\n";
    echo "<input type=hidden name=src_uid value=" . encrypt_get_vars($src_user_id) . ">\n";
    echo "<input type=hidden name=dst_uid value=" . encrypt_get_vars($dst_user_id) . ">\n";
    echo "<input type=hidden name=target value=" . encrypt_get_vars("USER") . ">\n";
    echo "<input type=hidden name=cmd value=" . encrypt_get_vars("post") . ">\n";
    form_end();
}
function vessel_get_current_status($vessel_id, $create_hyperlink = true)
{
    assert(is_numeric($vessel_id));
    assert(is_bool($create_hyperlink));
    $vessel = vessel_get_vessel($vessel_id);
    $status = "Unknown status";
    // Are we in orbit?
    if (vessel_is_in_orbit($vessel_id)) {
        $anomaly = anomaly_get_anomaly($vessel['planet_id']);
        if (anomaly_is_planet($anomaly['id'])) {
            if ($create_hyperlink) {
                $status = "Orbiting planet <a href=anomaly.php?cmd=" . encrypt_get_vars("show") . "&aid=" . encrypt_get_vars($anomaly['id']) . ">" . $anomaly['name'] . "</a>";
            } else {
                $status = "Orbiting planet " . $anomaly['name'];
            }
        }
        if (anomaly_is_nebula($anomaly['id'])) {
            if ($create_hyperlink) {
                $status = "Hiding in nebula <a href=anomaly.php?cmd=" . encrypt_get_vars("show") . "&aid=" . encrypt_get_vars($anomaly['id']) . ">" . $anomaly['name'] . "</a>";
            } else {
                $status = "Hiding in nebula " . $anomaly['name'];
            }
        }
        if (anomaly_is_starbase($anomaly['id'])) {
            if ($create_hyperlink) {
                $status = "Docking at starbase <a href=anomaly.php?cmd=" . encrypt_get_vars("show") . "&aid=" . encrypt_get_vars($anomaly['id']) . ">" . $anomaly['name'] . "</a>";
            } else {
                $status = "Docking at starbase " . $anomaly['name'];
            }
        }
    }
    // Is the vessel flying?
    if (vessel_is_flying($vessel_id)) {
        if ($vessel['dst_planet_id'] == 0) {
            // Are we flying to a sector or deep space?
            if ($vessel['dst_sector_id'] == 0) {
                $status = "Flying to " . $vessel['dst_distance'] . " / " . $vessel['dst_angle'];
            } else {
                $tmp = sector_get_sector($vessel['dst_sector_id']);
                if ($create_hyperlink) {
                    $status = "Flying to sector <a href=sector.php?id=" . encrypt_get_vars($tmp['id']) . ">" . $tmp['name'] . "</a>";
                } else {
                    $status = "Flying to sector " . $tmp['name'];
                }
            }
        } else {
            // Are we flying to a planet?
            $tmp_anomaly = anomaly_get_anomaly($vessel['dst_planet_id']);
            if (anomaly_is_planet($tmp_anomaly['id'])) {
                if (anomaly_is_discovered_by_user($tmp_anomaly['id'], user_ourself())) {
                    if ($create_hyperlink) {
                        $status = "Flying to planet <a href=anomaly.php?cmd=" . encrypt_get_vars("show") . "&aid=" . encrypt_get_vars($tmp_anomaly['id']) . ">" . $tmp_anomaly['name'] . "</a>";
                    } else {
                        $status = "Flying to planet " . $tmp_anomaly['name'];
                    }
                } else {
                    $status = "Flying to an unknown anomaly.";
                }
            }
            if (anomaly_is_starbase($tmp_anomaly['id'])) {
                $status = "Flying to starbase " . $tmp_anomaly['name'];
            }
            if (anomaly_is_nebula($tmp_anomaly['id'])) {
                $status = "Flying to nebula " . $tmp_anomaly['name'];
            }
            if (anomaly_is_wormhole($tmp_anomaly['id'])) {
                $status = "Flying to wormhole " . $tmp_anomaly['name'];
            }
        }
    }
    // Are we halted in deep space?
    if (vessel_is_in_space($vessel_id) and $vessel['sector_id'] == 0) {
        $status = "Located in deep space (" . $vessel['distance'] . " / " . $vessel['angle'] . ")";
    }
    // Or are we bordering a sector?
    if (vessel_is_in_space($vessel_id) and $vessel['sector_id'] != 0) {
        $sector = sector_get_sector($vessel['sector_id']);
        $status = "Bordering sector " . $sector['name'];
    }
    if (vessel_in_traderoute($vessel_id)) {
        $status = "Part of traderoute.";
    }
    // TODO: change this into vessel_is_in_convoy ($vessel_id)
    if ($vessel['status'] == "CONVOY") {
        $result = sql_query("SELECT * FROM s_convoys WHERE id=" . $vessel['convoy_id']);
        $tmp = sql_fetchrow($result);
        if ($create_hyperlink) {
            $status = "Part of convoy <a href=convoy.php?id=" . encrypt_get_vars($tmp['id']) . ">" . $tmp['name'] . "</a>";
        } else {
            $status = "Part of convoy " . $tmp['name'];
        }
    }
    return $status;
}
<?php

// Include Files
include "includes.inc.php";
// Session Identification
session_identification();
// Extra headers for TD..
$extra_headers = "<STYLE TYPE=\"text/css\" > " . "  TD.t { color : white}    " . "  TD.f { color : red}      " . "</STYLE>";
print_header($extra_headers);
print_title("Manufacturing");
$cmd = input_check("manufacture", "!frmid", "iid", "aid", 0, "show", "aid", 0);
if ($cmd == "show") {
    // Show homeworld when nothing is set...
    if ($aid == "") {
        show_inventions(user_get_home_planet(user_ourself()));
    } else {
        show_inventions($aid);
    }
}
if ($cmd == "manufacture") {
    $ok = "";
    $errors['PARAMS'] = "Incorrect parameters specified..\n";
    $errors['CREDITS'] = "You don't have enough cash to construct the item...\n";
    $errors['ORE'] = "You don't have enough ores to construct the item...\n";
    $errors['MAX'] = "You cannot build anymore items of this type on the planet...\n";
    $errors['DEPS'] = "You cannot build this item before you have build all dependencies...\n";
    $data['anomaly_id'] = $aid;
    $data['item_id'] = $iid;
    if (comm_send_to_server("MANUFACTURE", $data, $ok, $errors) == 1) {
        $invention = item_get_item($data['item_id']);
        echo "<br><br><br><br>";
function user_showinfo($user_id, $extended_info = USER_SHOWINFO_NORMAL)
{
    assert(is_numeric($user_id));
    $user = user_get_user($user_id);
    $px_user = user_get_perihelion_user($user_id);
    $result = sql_query("SELECT * FROM perihelion.u_access WHERE user_id=" . $user_id . " ORDER BY login DESC LIMIT 1");
    $access = sql_fetchrow($result);
    sql_query("USE " . $px_user['galaxy_db']);
    $result = sql_query("SELECT SUM(population) FROM s_anomalies WHERE user_id=" . $user_id);
    $row = sql_fetchrow($result);
    $people = $row['0'];
    $result = sql_query("SELECT COUNT(*) FROM s_sectors WHERE user_id=" . $user_id);
    $row = sql_fetchrow($result);
    $sectors_owned = $row['0'];
    $result = sql_query("SELECT COUNT(*) FROM s_anomalies WHERE user_id=" . $user_id);
    $row = sql_fetchrow($result);
    $planets_owned = $row['0'];
    $result = sql_query("SELECT DISTINCT sector_id, COUNT(*) FROM s_anomalies WHERE user_id=" . $user_id . " GROUP BY sector_id");
    $sector_count = sql_countrows($result);
    $sector = sector_get_sector(user_get_home_sector($user_id));
    $planet = anomaly_get_anomaly(user_get_home_planet($user_id));
    $race = user_get_race($user_id);
    $result = sql_query("SELECT * FROM g_alliance WHERE id=" . $user['alliance_id']);
    $alliance = sql_fetchrow($result);
    if ($user['alliance_id'] != 0) {
        $result = sql_query("SELECT COUNT(*) AS count FROM g_users WHERE alliance_id = " . $alliance['id']);
        $tmp = sql_fetchrow($result);
        $alliance_size = $tmp['count'];
    }
    $status = "Unknown";
    if (user_is_friend(user_ourself(), $user_id)) {
        $status = "Single side friend";
    }
    if (user_is_mutual_friend(user_ourself(), $user_id)) {
        $status = "Mutual friend";
    }
    if (user_is_neutral(user_ourself(), $user_id)) {
        $status = "Neutral";
    }
    if (user_is_enemy(user_ourself(), $user_id)) {
        $status = "Enemy";
    }
    if (user_ourself() == $user_id) {
        $status = "";
    }
    echo "<table border=0 align=center width=60%>";
    echo "<tr><th class=white colspan=2>" . $px_user['name'] . "</th><th>&nbsp;</th></tr>";
    echo "<tr><th colspan=2><b>" . $px_user['tag'] . "</b></th></tr>";
    echo "<tr valign=top>";
    echo "  <td width=120>";
    echo "    <img width=100 height=100 src='images/users/" . $px_user['avatar'] . "'><br>";
    echo "    <br>";
    if ($user['alliance_id'] != 0) {
        echo "    <img width=100 height=100 src='images/users/" . $alliance['avatar'] . "'><br>";
    }
    echo "  </td>";
    echo "  <td><table border=0 nowrap>";
    echo "        <tr class=bl><td>&nbsp;Full Name       &nbsp;</td><td>:</td><td>&nbsp;" . $px_user['name'] . "&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;User ID         &nbsp;</td><td>:</td><td>&nbsp;" . $px_user['id'] . "&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;City            &nbsp;</td><td>:</td><td>&nbsp;" . $px_user['city'] . "&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;Country         &nbsp;</td><td>:</td><td>&nbsp;" . $px_user['country'] . "&nbsp;</td></tr>";
    echo "        <tr><td colspan=3>&nbsp;</td></tr>";
    if ($status != "") {
        echo "        <tr class=bl><td>&nbsp;Diplomatic Status &nbsp;</td><td>:</td><td>&nbsp;" . $status . "&nbsp;</td></tr>";
    }
    echo "        <tr class=bl><td>&nbsp;Race              &nbsp;</td><td>:</td><td>&nbsp;" . $race . "&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;Home Planet       &nbsp;</td><td>:</td><td>&nbsp;" . $planet['name'] . "&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;Home Sector       &nbsp;</td><td>:</td><td>&nbsp;" . $sector['name'] . "&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;Population        &nbsp;</td><td>:</td><td>&nbsp;" . $people . "&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;Sectors Owned     &nbsp;</td><td>:</td><td>&nbsp;" . $sectors_owned . "&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;Planets Owned     &nbsp;</td><td>:</td><td>&nbsp;" . $planets_owned . " planet(s) in " . $sector_count . " sector(s)&nbsp;</td></tr>";
    if ($user['alliance_id'] != 0) {
        echo "        <tr class=bl><td>&nbsp;Alliance        &nbsp;</td><td>:</td><td>&nbsp;<a href=alliance.php?cmd=" . encrypt_get_vars("show") . "&aid=" . encrypt_get_vars($alliance['id']) . ">" . $alliance['name'] . "</a>&nbsp;</td></tr>";
        echo "        <tr class=bl><td>&nbsp;Alliance Size   &nbsp;</td><td>:</td><td>&nbsp;" . $alliance_size . " user(s)&nbsp;</td></tr>";
    }
    echo "        <tr><td colspan=3>&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;Times logged in   &nbsp;</td><td>:</td><td>&nbsp;" . $px_user['login_count'] . "&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;Last login        &nbsp;</td><td>:</td><td>&nbsp;" . $access['login'] . "&nbsp;</td></tr>";
    echo "        <tr class=bl><td>&nbsp;Last action       &nbsp;</td><td>:</td><td>&nbsp;" . $access['logout'] . "&nbsp;</td></tr>";
    if ($extended_info == USER_SHOWINFO_EXTENDED) {
        if ($px_user['gender'] == "M") {
            $gender = "Male";
        } else {
            $gender = "Female";
        }
        echo "        <tr><td colspan=3>&nbsp;</td></tr>";
        echo "        <tr class=bl><td>&nbsp;Email      &nbsp;</td><td>:</td><td>&nbsp;" . $px_user['email'] . "&nbsp;</td></tr>";
        echo "        <tr class=bl><td>&nbsp;Login Name &nbsp;</td><td>:</td><td>&nbsp;" . $px_user['login_name'] . "&nbsp;</td></tr>";
        echo "        <tr><td colspan=3>&nbsp;</td></tr>";
        echo "        <tr class=bl><td>&nbsp;City       &nbsp;</td><td>:</td><td>&nbsp;" . $px_user['city'] . "&nbsp;</td></tr>";
        echo "        <tr class=bl><td>&nbsp;Country    &nbsp;</td><td>:</td><td>&nbsp;" . $px_user['country'] . "&nbsp;</td></tr>";
        echo "        <tr><td colspan=3>&nbsp;</td></tr>";
        echo "        <tr class=bl><td>&nbsp;Birthday   &nbsp;</td><td>:</td><td>&nbsp;" . $px_user['birthday'] . "&nbsp;</td></tr>";
        echo "        <tr class=bl><td>&nbsp;Gender     &nbsp;</td><td>:</td><td>&nbsp;" . $gender . "&nbsp;</td></tr>";
    }
    if ($user_id != user_ourself()) {
        echo "<tr><th colspan=3>";
        echo "[ <a href=message.php?uid=" . encrypt_get_vars($user_id) . ">Send Message</a> ]";
        echo "</th></tr>";
        echo "<tr><th colspan=3>";
        echo "[ <a href=user.php?cmd=" . encrypt_get_vars("relation") . "&uid=" . encrypt_get_vars($user_id) . "&wid=" . encrypt_get_vars(RELATION_FRIEND) . ">Set as friend</a>  ] - ";
        echo "[ <a href=user.php?cmd=" . encrypt_get_vars("relation") . "&uid=" . encrypt_get_vars($user_id) . "&wid=" . encrypt_get_vars(RELATION_NEUTRAL) . ">Set as neutral</a>  ] - ";
        echo "[ <a href=user.php?cmd=" . encrypt_get_vars("relation") . "&uid=" . encrypt_get_vars($user_id) . "&wid=" . encrypt_get_vars(RELATION_ENEMY) . ">Set as enemy</a> ]";
        echo "</th></tr>";
    }
    echo "  </table></td>";
    echo "</tr>";
    echo "</table>";
    echo "<br><br>";
}
Exemple #16
0
if ($zoom < pow(16, 3)) {
    echo "  <map name='galaxy'>\n";
    $name = array("alpha", "beta", "gamma", "delta");
    $tmp = $zoom * 16;
    for ($dx = 0; $dx != 2; $dx++) {
        for ($dy = 0; $dy != 2; $dy++) {
            for ($ry = 0; $ry != 2; $ry++) {
                for ($rx = 0; $rx != 2; $rx++) {
                    $zoomid = $tmp + ($dy * 8 + $dx * 4 + $ry * 2 + $rx + 1);
                    $dname = $name[$dy * 2 + $dx];
                    $rname = $name[$ry * 2 + $rx];
                    $x1 = $dx * 200 + $rx * 100;
                    $y1 = $dy * 200 + $ry * 100;
                    $x2 = $x1 + 400 / 4;
                    $y2 = $y1 + 400 / 4;
                    echo "    <area href='main.php?id=" . encrypt_get_vars(user_ourself()) . "&zoom=" . encrypt_get_vars($zoomid) . "&f=" . encrypt_get_vars($flags) . "' alt='{$dname} / {$rname}' shape=rect coords='{$x1},{$y1},{$x2},{$y2}'>\n";
                }
            }
        }
    }
    echo "  </map>\n";
}
print_footer();
exit;
// ============================================================================================
//
//
// Description:
//
//
// Parameters: