Exemplo n.º 1
0
/**
 * GalaxyRowPlanetName.php
 *
 * @version 1.0
 * @copyright 2008 By Chlorel for XNova
 */
function GalaxyRowPlanetName($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType)
{
    global $lang, $user, $HavePhalanx, $CurrentSystem, $CurrentGalaxy;
    // Planete (Nom)
    $Result = "<th style=\"white-space: nowrap;\" width=130>";
    if ($GalaxyRowUser['ally_id'] == $user['ally_id'] and $GalaxyRowUser['id'] != $user['id'] and $user['ally_id'] != '') {
        $TextColor = "<font color=\"green\">";
        $EndColor = "</font>";
    } elseif ($GalaxyRowUser['id'] == $user['id']) {
        $TextColor = "<font color=\"red\">";
        $EndColor = "</font>";
    } else {
        $TextColor = '';
        $EndColor = "";
    }
    if ($HavePhalanx != 0) {
        if ($GalaxyRowPlanet["galaxy"] == $CurrentGalaxy) {
            $Range = GetPhalanxRange($HavePhalanx);
            if ($CurrentGalaxy + $Range <= $CurrentSystem and $CurrentSystem >= $CurrentGalaxy - $Range) {
                $PhalanxTypeLink = "<a href=# onclick=fenster('phalanx.php?galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;planettype=" . $PlanetType . "')  title=\"" . $lang['gl_phalanx'] . "\">" . $GalaxyRowPlanet['name'] . "</a><br />";
            } else {
                $PhalanxTypeLink = $GalaxyRowPlanet['name'];
            }
        } else {
            $PhalanxTypeLink = $GalaxyRowPlanet['name'];
        }
    } else {
        $PhalanxTypeLink = $GalaxyRowPlanet['name'];
    }
    $Result .= $TextColor . $PhalanxTypeLink . $EndColor;
    $Result .= "</th>";
    return $Result;
}
Exemplo n.º 2
0
/**
 * Tis file is part of XNova:Legacies
 *
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 * @see http://www.xnova-ng.org/
 *
 * Copyright (c) 2009-Present, XNova Support Team <http://www.xnova-ng.org>
 * All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *                                --> NOTICE <--
 *  This file is part of the core development branch, changing its contents will
 * make you unable to use the automatic updates manager. Please refer to the
 * documentation for further information about customizing XNova.
 *
 */
function GalaxyRowPlanetName($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType)
{
    global $lang, $user, $HavePhalanx, $CurrentSystem, $CurrentGalaxy;
    // Planete (Nom)
    $Result = "<th style=\"white-space: nowrap;\" width=130>";
    if ($GalaxyRowUser['ally_id'] == $user['ally_id'] and $GalaxyRowUser['id'] != $user['id'] and $user['ally_id'] != '') {
        $TextColor = "<font color=\"green\">";
        $EndColor = "</font>";
    } elseif ($GalaxyRowUser['id'] == $user['id']) {
        $TextColor = "<font color=\"red\">";
        $EndColor = "</font>";
    } else {
        $TextColor = '';
        $EndColor = "";
    }
    if ($GalaxyRowPlanet['last_update'] > time() - 59 * 60 and $GalaxyRowUser['id'] != $user['id']) {
        $Inactivity = pretty_time_hour(time() - $GalaxyRowPlanet['last_update']);
    }
    if ($GalaxyRow && $GalaxyRowPlanet["destruyed"] == 0) {
        if ($HavePhalanx != 0) {
            if ($GalaxyRowPlanet["galaxy"] == $CurrentGalaxy) {
                $Range = GetPhalanxRange($HavePhalanx);
                if ($CurrentGalaxy + $Range <= $CurrentSystem and $CurrentSystem >= $CurrentGalaxy - $Range) {
                    $PhalanxTypeLink = "<a href=# onclick=fenster('phalanx.php?galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;planettype=" . $PlanetType . "')  title=\"" . $lang['gl_phalanx'] . "\">" . $GalaxyRowPlanet['name'] . "</a><br />";
                } else {
                    $PhalanxTypeLink = stripslashes($GalaxyRowPlanet['name']);
                }
            } else {
                $PhalanxTypeLink = stripslashes($GalaxyRowPlanet['name']);
            }
        } else {
            $PhalanxTypeLink = stripslashes($GalaxyRowPlanet['name']);
        }
        $Result .= $TextColor . $PhalanxTypeLink . $EndColor;
        if ($GalaxyRowPlanet['last_update'] > time() - 59 * 60 and $GalaxyRowUser['id'] != $user['id']) {
            if ($GalaxyRowPlanet['last_update'] > time() - 10 * 60 and $GalaxyRowUser['id'] != $user['id']) {
                $Result .= "(*)";
            } else {
                $Result .= " (" . $Inactivity . ")";
            }
        }
    } elseif ($GalaxyRowPlanet["destruyed"] != 0) {
        $Result .= $lang['gl_destroyedplanet'];
    }
    $Result .= "</th>";
    return $Result;
}
Exemplo n.º 3
0
/**
 * GalaxyRowPlanetName.php
 * @Licence GNU (GPL)
 * @version 3.0
 * @copyright 2009
 * @Team Space Beginner
 *
 **/
function GalaxyRowPlanetName($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType)
{
    global $lang, $user, $HavePhalanx, $CurrentSystem, $CurrentGalaxy;
    $Result = "<td align='center' style='white-space: nowrap; width:150px; height:30px; font-size:100%;'>";
    if ($GalaxyRowUser['ally_id'] == $user['ally_id'] and $GalaxyRowUser['id'] != $user['id'] and $user['ally_id'] != '') {
        $TextColor = "<font color=\"#33B200\"><b>";
        $EndColor = "</b></font>";
    } elseif ($GalaxyRowUser['id'] == $user['id']) {
        $TextColor = "<font color=\"#00FF00\"><b>";
        $EndColor = "</b></font>";
    } else {
        $TextColor = "<b>";
        $EndColor = "</b>";
    }
    if ($GalaxyRowPlanet['last_update'] > time() - 59 * 60 and $GalaxyRowUser['id'] != $user['id']) {
        $Inactivity = pretty_time_hour(time() - $GalaxyRowPlanet['last_update']);
    }
    if ($GalaxyRow && $GalaxyRowPlanet["destruyed"] == 0) {
        if ($HavePhalanx != 0) {
            if ($GalaxyRowPlanet["galaxy"] == $CurrentGalaxy) {
                $Range = GetPhalanxRange($HavePhalanx);
                if ($CurrentGalaxy + $Range <= $CurrentSystem and $CurrentSystem >= $CurrentGalaxy - $Range) {
                    $PhalanxTypeLink = "<a href=# onclick=fenster(&#039;phalanx.php?galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;planettype=" . $PlanetType . "&#039;) >" . $GalaxyRowPlanet['name'] . "</a>";
                } else {
                    $PhalanxTypeLink = stripslashes($GalaxyRowPlanet['name']);
                }
            } else {
                $PhalanxTypeLink = stripslashes($GalaxyRowPlanet['name']);
            }
        } else {
            $PhalanxTypeLink = stripslashes($GalaxyRowPlanet['name']);
        }
        $Result .= $TextColor . $PhalanxTypeLink . $EndColor;
    } elseif ($GalaxyRowPlanet["destruyed"] != 0) {
        $Result .= $lang['gl_destroyedplanet'];
    }
    $Result .= "</td>";
    return $Result;
}
Exemplo n.º 4
0
if (!intval($sensorLevel)) {
    message($lang['phalanx_nosensoravailable'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
}
if ($planetrow['planet_type'] != PT_MOON) {
    message($lang['phalanx_onlyformoons'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
}
$scan_galaxy = sys_get_param_int('galaxy');
$scan_system = sys_get_param_int('system');
$scan_planet = sys_get_param_int('planet');
$scan_planet_type = 1;
// sys_get_param_int('planettype');
$id = sys_get_param_id('id');
$source_galaxy = $planetrow['galaxy'];
$source_system = $planetrow['system'];
$source_planet = $planetrow['planet'];
$sensorRange = GetPhalanxRange($sensorLevel);
$system_distance = abs($source_system - $scan_system);
if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) {
    message($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
}
$cost = $sensorLevel * 1000;
if ($planetrow['deuterium'] < $cost) {
    message($lang['phalanx_nodeuterium'], "phalanx", '', 3);
}
$planet_scanned = db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type);
if (!$planet_scanned['id']) {
    message($lang['phalanx_planet_not_exists'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
}
if ($planet_scanned['destruyed']) {
    message($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
}
Exemplo n.º 5
0
/**
 * This file is part of XNova:Legacies
 *
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 * @see http://www.xnova-ng.org/
 *
 * Copyright (c) 2009-2010, XNova Support Team <http://www.xnova-ng.org>
 * All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *                                --> NOTICE <--
 *  This file is part of the core development branch, changing its contents will
 * make you unable to use the automatic updates manager. Please refer to the
 * documentation for further information about customizing XNova.
 *
 */
function GalaxyRowPlanet($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType)
{
    global $lang, $dpath, $user, $HavePhalanx, $CurrentSystem, $CurrentGalaxy;
    // Planete (Image)
    $Result = "<th width=30>";
    $GalaxyRowUser = doquery("SELECT * FROM {{table}} WHERE id='" . $GalaxyRowPlanet['id_owner'] . "';", 'users', true);
    if ($GalaxyRow && $GalaxyRowPlanet["destruyed"] == 0 && $GalaxyRow["id_planet"] != 0) {
        if ($HavePhalanx != 0) {
            if ($GalaxyRowUser['id'] != $user['id']) {
                if ($GalaxyRowPlanet["galaxy"] == $CurrentGalaxy) {
                    $Range = GetPhalanxRange($HavePhalanx);
                    if ($SystemLimitMin < 1) {
                        $SystemLimitMin = 1;
                    }
                    $SystemLimitMax = $CurrentSystem + $Range;
                    if ($System <= $SystemLimitMax) {
                        if ($System >= $SystemLimitMin) {
                            $PhalanxTypeLink = "<a href=# onclick=fenster(&#039;phalanx.php?galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;planettype=" . $PlanetType . "&#039;) >" . $lang['gl_phalanx'] . "</a><br />";
                        } else {
                            $PhalanxTypeLink = "";
                        }
                    } else {
                        $PhalanxTypeLink = "";
                    }
                } else {
                    $PhalanxTypeLink = "";
                }
            } else {
                $PhalanxTypeLink = "";
            }
        } else {
            $PhalanxTypeLink = "";
        }
        if ($GalaxyRowUser['id'] != $user['id']) {
            $MissionType6Link = "<a href=# onclick=&#039javascript:doit(6, " . $Galaxy . ", " . $System . ", " . $Planet . ", " . $PlanetType . ", " . $user["spio_anz"] . ");&#039 >" . $lang['type_mission'][6] . "</a><br /><br />";
        } elseif ($GalaxyRowUser['id'] == $user['id']) {
            $MissionType6Link = "";
        }
        if ($GalaxyRowUser['id'] != $user['id']) {
            $MissionType1Link = "<a href=fleet.php?galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;planettype=" . $PlanetType . "&amp;target_mission=1>" . $lang['type_mission'][1] . "</a><br />";
        } elseif ($GalaxyRowUser['id'] == $user['id']) {
            $MissionType1Link = "";
        }
        if ($GalaxyRowUser['id'] != $user['id']) {
            $MissionType5Link = "<a href=fleet.php?galaxy=" . $Galaxy . "&system=" . $System . "&planet=" . $Planet . "&planettype=" . $PlanetType . "&target_mission=5>" . $lang['type_mission'][5] . "</a><br />";
        } elseif ($GalaxyRowUser['id'] == $user['id']) {
            $MissionType5Link = "";
        }
        if ($GalaxyRowUser['id'] == $user['id']) {
            $MissionType4Link = "<a href=fleet.php?galaxy=" . $Galaxy . "&system=" . $System . "&planet=" . $Planet . "&planettype=" . $PlanetType . "&target_mission=4>" . $lang['type_mission'][4] . "</a><br />";
        } elseif ($GalaxyRowUser['id'] != $user['id']) {
            $MissionType4Link = "";
        }
        $MissionType3Link = "<a href=fleet.php?galaxy=" . $Galaxy . "&system=" . $System . "&planet=" . $Planet . "&planettype=" . $PlanetType . "&target_mission=3>" . $lang['type_mission'][3] . "</a>";
        $Result .= "<a style=\"cursor: pointer;\"";
        $Result .= " onmouseover='return overlib(\"";
        $Result .= "<table width=240>";
        $Result .= "<tr>";
        $Result .= "<td class=c colspan=2>";
        $Result .= $lang['gl_planet'] . " " . stripslashes($GalaxyRowPlanet["name"]) . " [" . $Galaxy . ":" . $System . ":" . $Planet . "]";
        $Result .= "</td>";
        $Result .= "</tr>";
        $Result .= "<tr>";
        $Result .= "<th width=80>";
        $Result .= "<img src=" . $dpath . "planeten/small/s_" . $GalaxyRowPlanet["image"] . ".jpg height=75 width=75 />";
        $Result .= "</th>";
        $Result .= "<th align=left>";
        $Result .= $MissionType6Link;
        $Result .= $PhalanxTypeLink;
        $Result .= $MissionType1Link;
        $Result .= $MissionType5Link;
        $Result .= $MissionType4Link;
        $Result .= $MissionType3Link;
        $Result .= "</th>";
        $Result .= "</tr>";
        $Result .= "</table>\"";
        //		$Result .= ", STICKY, MOUSEOFF, DELAY, ". ($user["settings_tooltiptime"] * 1000) .", CENTER, OFFSETX, -40, OFFSETY, -40 );'";
        $Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'";
        $Result .= " onmouseout='return nd();'>";
        $Result .= "<img src=" . $dpath . "planeten/small/s_" . $GalaxyRowPlanet["image"] . ".jpg height=30 width=30>";
        //		$Result .= $GalaxyRowPlanet["name"];
        $Result .= "</a>";
    }
    $Result .= "</th>";
    return $Result;
}
Exemplo n.º 6
0
/**
 * GalaxyRowPlanet.php
 * @Licence GNU (GPL)
 * @version 3.0
 * @copyright 2009
 * @Team Space Beginner
 *
 **/
function GalaxyRowPlanet($GalaxyRow, $GalaxyRowPlanet, $GalaxyRowUser, $Galaxy, $System, $Planet, $PlanetType)
{
    global $lang, $dpath, $user, $CurrentMIP, $HavePhalanx, $CurrentSystem, $CurrentGalaxy, $game_config;
    $Result = "<td style='width:30px; height:30px;' align='center'>";
    $GalaxyRowUser = doquery("SELECT * FROM {{table}} WHERE id='" . $GalaxyRowPlanet['id_owner'] . "';", 'users', true);
    if ($GalaxyRow && $GalaxyRowPlanet["destruyed"] == 0 && $GalaxyRow["id_planet"] != 0) {
        if ($HavePhalanx != 0) {
            if ($GalaxyRowUser['id'] != $user['id']) {
                if ($GalaxyRowPlanet["galaxy"] == $CurrentGalaxy) {
                    $PhRange = GetPhalanxRange($HavePhalanx);
                    $SystemLimitMin = $CurrentSystem - $PhRange;
                    if ($SystemLimitMin < 1) {
                        $SystemLimitMin = 1;
                    }
                    $SystemLimitMax = $CurrentSystem + $PhRange;
                    if ($System <= $SystemLimitMax) {
                        if ($System >= $SystemLimitMin) {
                            $PhalanxTypeLink = "<a href=# onclick=fenster(&#039;phalanx.php?galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;planettype=" . $PlanetType . "&#039;) >" . $lang['gala']['0207'] . "</a>";
                        } else {
                            $PhalanxTypeLink = "";
                        }
                    } else {
                        $PhalanxTypeLink = "";
                    }
                } else {
                    $PhalanxTypeLink = "";
                }
            } else {
                $PhalanxTypeLink = "";
            }
        } else {
            $PhalanxTypeLink = "";
        }
        if ($CurrentMIP != 0) {
            if ($GalaxyRowUser['id'] != $user['id']) {
                if ($GalaxyRowPlanet["galaxy"] == $CurrentGalaxy) {
                    $MiRange = GetMissileRange();
                    $SystemLimitMin = $CurrentSystem - $MiRange;
                    if ($SystemLimitMin < 1) {
                        $SystemLimitMin = 1;
                    }
                    $SystemLimitMax = $CurrentSystem + $MiRange;
                    if ($System <= $SystemLimitMax) {
                        if ($System >= $SystemLimitMin) {
                            $MissileBtn = true;
                        } else {
                            $MissileBtn = false;
                        }
                    } else {
                        $MissileBtn = false;
                    }
                } else {
                    $MissileBtn = false;
                }
            } else {
                $MissileBtn = false;
            }
        } else {
            $MissileBtn = false;
        }
        if ($GalaxyRowUser['id'] != $user['id']) {
            $MissionType6Link = "<a href=# onclick=&#039;javascript:doit(6, " . $Galaxy . ", " . $System . ", " . $Planet . ", " . $PlanetType . ", " . $user["spio_anz"] . ");&#039; >              " . $lang['type_mission'][6] . "</a>";
        } elseif ($GalaxyRowUser['id'] == $user['id']) {
            $MissionType6Link = "";
        }
        if ($GalaxyRowUser['id'] != $user['id']) {
            $MissionType1Link = "<a href=fleet.php?galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;planettype=" . $PlanetType . "&amp;target_mission=1>         " . $lang['type_mission'][1] . "</a>";
        } elseif ($GalaxyRowUser['id'] == $user['id']) {
            $MissionType1Link = "";
        }
        if ($GalaxyRowUser['id'] != $user['id']) {
            $MissionType5Link = "<a href=fleet.php?galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;planettype=" . $PlanetType . "&amp;target_mission=5>         " . $lang['type_mission'][5] . "</a>";
        } elseif ($GalaxyRowUser['id'] == $user['id']) {
            $MissionType5Link = "";
        }
        if ($GalaxyRowUser['id'] == $user['id']) {
            $MissionType4Link = "<a href=fleet.php?galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;planettype=" . $PlanetType . "&amp;target_mission=4>         " . $lang['type_mission'][4] . "</a>";
        } elseif ($GalaxyRowUser['id'] != $user['id']) {
            $MissionType4Link = "";
        }
        if ($user["settings_mis"] == "1" and $MissileBtn == true && $GalaxyRowUser['id']) {
            $MissionType10Link = "<a href=galaxy.php?mode=2&amp;galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;current=" . $user['current_planet'] . " >       " . $lang['type_mission'][10] . "</a>";
        } elseif ($GalaxyRowUser['id'] != $user['id']) {
            $MissionType10Link = "";
        }
        $MissionType3Link = "<a href=fleet.php?galaxy=" . $Galaxy . "&amp;system=" . $System . "&amp;planet=" . $Planet . "&amp;planettype=" . $PlanetType . "&amp;target_mission=3>             " . $lang['type_mission'][3] . "</a>";
        $Result .= "<a style=\"cursor: pointer;\"";
        $Result .= " onmouseover='return overlib(\"";
        $Result .= "<table width=270px cellspacing=0px>";
        $Result .= "<tr><td class=c align=center rowspan=5 width=60px><img src=" . $dpath . "planeten/" . $GalaxyRowPlanet["image"] . ".gif height=60px width=60px alt=planet.gif>                                                                                                                                           </td></tr>";
        $Result .= "<tr><td class=c align=left width=140px>" . $lang['gala']['5003'] . " " . $lang['gala']['0201'] . "" . $lang['gala']['5002'] . " </td><td class=c align=left width=140px> " . $lang['gala']['5000'] . "" . $Galaxy . "" . $lang['gala']['5003'] . "" . $System . "" . $lang['gala']['5003'] . "" . $Planet . "" . $lang['gala']['5001'] . "   </td></tr>";
        $Result .= "<tr><td class=c align=left width=110px>" . $lang['gala']['5003'] . " " . $lang['gala']['0202'] . "" . $lang['gala']['5002'] . " </td><td class=c align=left width=110px> " . $GalaxyRowPlanet["name"] . "                                                                                                          </td></tr>";
        $Result .= "<tr><td class=c align=left width=110px>" . $lang['gala']['5003'] . " " . $lang['gala']['0203'] . "" . $lang['gala']['5002'] . " </td><td class=c align=left width=110px> " . number_format($GalaxyRowPlanet['diameter'], 0, '', '.') . " " . $lang['gala']['0205'] . "                                                 </td></tr>";
        $Result .= "<tr><td class=c align=left width=110px>" . $lang['gala']['5003'] . " " . $lang['gala']['0204'] . "" . $lang['gala']['5002'] . " </td><td class=c align=left width=110px> " . number_format($GalaxyRowPlanet['temp_min'], 0, '', '.') . " " . $lang['gala']['0206'] . "                                                 </td></tr>";
        $Result .= "</table><table width=270px cellspacing=0px>";
        $Result .= "<tr><td class=c align=left width=50%> " . $lang['gala']['5003'] . " ";
        $Result .= $MissionType1Link;
        // Angreifen
        $Result .= "</td><td class=c align=left width=50%>" . $lang['gala']['5003'] . " ";
        $Result .= $MissionType5Link;
        // Halten
        $Result .= "</td></tr> ";
        $Result .= "<tr><td class=c align=left width=50%> " . $lang['gala']['5003'] . " ";
        $Result .= $MissionType3Link;
        // Transportieren
        $Result .= "</td><td class=c align=left width=50%>" . $lang['gala']['5003'] . " ";
        $Result .= $MissionType6Link;
        // Spionage
        $Result .= "</td></tr> ";
        $Result .= "<tr><td class=c align=left width=50%> " . $lang['gala']['5003'] . " ";
        $Result .= $MissionType4Link;
        // Stationieren
        $Result .= "</td><td class=c align=left width=50%>" . $lang['gala']['5003'] . " ";
        $Result .= $PhalanxTypeLink;
        $Result .= "</td></tr> ";
        $Result .= "</table>\"";
        $Result .= ", STICKY, MOUSEOFF, DELAY, 750, CENTER, OFFSETX, -40, OFFSETY, -40 );'";
        $Result .= " onmouseout='return nd();'>";
        $Result .= "<img src='" . $dpath . "planeten/" . $GalaxyRowPlanet["image"] . ".gif' style='width:28px; height:28px;' alt='planet.gif'>";
        $Result .= "</a>";
    } else {
        $bild = array('s_dschjungelplanet01.gif', 's_dschjungelplanet02.gif', 's_dschjungelplanet03.gif', 's_dschjungelplanet04.gif', 's_dschjungelplanet05.gif', 's_dschjungelplanet06.gif', 's_dschjungelplanet07.gif', 's_dschjungelplanet08.gif', 's_dschjungelplanet09.gif', 's_dschjungelplanet10.gif', 's_eisplanet01.gif', 's_eisplanet02.gif', 's_eisplanet03.gif', 's_eisplanet04.gif', 's_eisplanet05.gif', 's_eisplanet06.gif', 's_eisplanet07.gif', 's_eisplanet08.gif', 's_eisplanet09.gif', 's_eisplanet10.gif', 's_gasplanet01.gif', 's_gasplanet02.gif', 's_gasplanet03.gif', 's_gasplanet04.gif', 's_gasplanet05.gif', 's_gasplanet06.gif', 's_gasplanet07.gif', 's_gasplanet08.gif', 's_gasplanet09.gif', 's_normaltempplanet01.gif', 's_normaltempplanet02.gif', 's_normaltempplanet03.gif', 's_normaltempplanet04.gif', 's_normaltempplanet05.gif', 's_normaltempplanet06.gif', 's_normaltempplanet07.gif', 's_normaltempplanet08.gif', 's_trockenplanet01.gif', 's_trockenplanet02.gif', 's_trockenplanet03.gif', 's_trockenplanet04.gif', 's_trockenplanet05.gif', 's_trockenplanet06.gif', 's_trockenplanet07.gif', 's_trockenplanet08.gif', 's_trockenplanet09.gif', 's_trockenplanet10.gif', 's_wasserplanet01.gif', 's_wasserplanet02.gif', 's_wasserplanet03.gif', 's_wasserplanet04.gif', 's_wasserplanet05.gif', 's_wasserplanet06.gif', 's_wasserplanet07.gif', 's_wasserplanet08.gif', 's_wasserplanet09.gif', 's_wuestenplanet01.gif', 's_wuestenplanet02.gif', 's_wuestenplanet03.gif', 's_wuestenplanet04.gif');
        shuffle($bild);
        $Result .= "<img src='" . $dpath . "planeten/small_planet/" . $bild[0] . "' style='height:20px; width:20px;' alt='planet01.gif'>";
    }
    $Result .= "</td>";
    return $Result;
}
Exemplo n.º 7
0
function ShowPhalanxPage($CurrentUser, $CurrentPlanet)
{
    global $xgp_root, $phpEx, $lang;
    include_once $xgp_root . 'includes/functions/InsertJavaScriptChronoApplet.' . $phpEx;
    include_once $xgp_root . 'includes/classes/class.FlyingFleetsTable.' . $phpEx;
    include_once $xgp_root . 'includes/classes/class.GalaxyRows.' . $phpEx;
    $FlyingFleetsTable = new FlyingFleetsTable();
    $GalaxyRows = new GalaxyRows();
    $parse = $lang;
    $radar_menzil_min = $CurrentPlanet['system'] - $GalaxyRows->GetPhalanxRange($CurrentPlanet['phalanx']);
    $radar_menzil_max = $CurrentPlanet['system'] + $GalaxyRows->GetPhalanxRange($CurrentPlanet['phalanx']);
    if ($radar_menzil_min < 1) {
        $radar_menzil_min = 1;
    }
    if ($radar_menzil_max > MAX_SYSTEM_IN_GALAXY) {
        $radar_menzil_max = MAX_SYSTEM_IN_GALAXY;
    }
    if (intval($_GET["system"]) < $radar_menzil_min or intval($_GET["system"]) > $radar_menzil_max) {
        $DoScan = false;
    }
    if ($CurrentPlanet['planet_type'] == 3) {
        $parse['phl_pl_galaxy'] = $CurrentPlanet['galaxy'];
        $parse['phl_pl_system'] = $CurrentPlanet['system'];
        $parse['phl_pl_place'] = $CurrentPlanet['planet'];
        $parse['phl_pl_name'] = $CurrentUser['username'];
        if ($CurrentPlanet['deuterium'] > 10000) {
            doquery("UPDATE {{table}} SET `deuterium` = `deuterium` - '10000' WHERE `id` = '" . $CurrentUser['current_planet'] . "';", 'planets');
            $parse['phl_er_deuter'] = "";
            $DoScan = true;
        } else {
            $parse['phl_er_deuter'] = $lang['px_no_deuterium'];
            $DoScan = false;
        }
        if ($DoScan == true) {
            $Galaxy = $_GET["galaxy"];
            if ($Galaxy != $CurrentPlanet['galaxy']) {
                $Galaxy = $CurrentPlanet['galaxy'];
            }
            $System = $_GET["system"];
            $Planet = $_GET["planet"];
            $PlType = 1;
            // ************
            function GetPhalanxRange($PhalanxLevel)
            {
                $PhalanxRange = 0;
                if ($PhalanxLevel > 1) {
                    $PhalanxRange = pow($PhalanxLevel, 2) - 1;
                } elseif ($PhalanxLevel == 1) {
                    $PhalanxRange = 1;
                }
                return $PhalanxRange;
            }
            $radar_kademesi = $CurrentPlanet['phalanx'];
            $menzil = GetPhalanxRange($radar_kademesi);
            $limit_min = $CurrentPlanet['system'] - $menzil;
            if ($limit_min < 1) {
                $limit_min = 1;
            }
            $limit_max = $CurrentPlanet['system'] + $menzil;
            if ($System < $limit_min || $System > $limit_max || $_GET["planettype"] != 1) {
                $Fleets = "<tr><th>Hedef menzil disinda!</th></tr>";
            } else {
                // **************
                $TargetInfo = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '" . mysql_escape_string($Galaxy) . "' AND `system` = '" . mysql_escape_string($System) . "' AND `planet` = '" . mysql_escape_string($Planet) . "' AND `planet_type` = '" . $PlType . "';", 'planets', true);
                $TargetName = $TargetInfo['name'];
                $QryLookFleets = "SELECT * ";
                $QryLookFleets .= "FROM {{table}} ";
                $QryLookFleets .= "WHERE ( ( ";
                $QryLookFleets .= "`fleet_start_galaxy` = '" . mysql_escape_string($Galaxy) . "' AND ";
                $QryLookFleets .= "`fleet_start_system` = '" . mysql_escape_string($System) . "' AND ";
                $QryLookFleets .= "`fleet_start_planet` = '" . mysql_escape_string($Planet) . "' AND ";
                $QryLookFleets .= "`fleet_start_type` = '" . $PlType . "' ";
                $QryLookFleets .= ") OR ( ";
                $QryLookFleets .= "`fleet_end_galaxy` = '" . mysql_escape_string($Galaxy) . "' AND ";
                $QryLookFleets .= "`fleet_end_system` = '" . mysql_escape_string($System) . "' AND ";
                $QryLookFleets .= "`fleet_end_planet` = '" . mysql_escape_string($Planet) . "' AND ";
                $QryLookFleets .= "`fleet_end_type` = '" . $PlType . "' ";
                $QryLookFleets .= ") ) ";
                $QryLookFleets .= "ORDER BY `fleet_start_time`;";
                $FleetToTarget = doquery($QryLookFleets, 'fleets');
                if (mysql_num_rows($FleetToTarget) != 0) {
                    while ($FleetRow = mysql_fetch_array($FleetToTarget)) {
                        $Record++;
                        $StartTime = $FleetRow['fleet_start_time'];
                        $StayTime = $FleetRow['fleet_end_stay'];
                        $EndTime = $FleetRow['fleet_end_time'];
                        if ($FleetRow['fleet_owner'] == $TargetInfo['id_owner']) {
                            $FleetType = true;
                        } else {
                            $FleetType = false;
                        }
                        $FleetRow['fleet_resource_metal'] = 0;
                        $FleetRow['fleet_resource_crystal'] = 0;
                        $FleetRow['fleet_resource_deuterium'] = 0;
                        $FleetRow['fleet_resource_darkmatter'] = 0;
                        $Label = "fs";
                        if ($StartTime > time()) {
                            $fpage[$StartTime] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 0, $FleetType, $Label, $Record);
                        }
                        if ($FleetRow['fleet_mission'] != 4) {
                            $Label = "ft";
                            if ($StayTime > time()) {
                                $fpage[$StayTime] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 1, $FleetType, $Label, $Record);
                            }
                            if ($FleetType == true) {
                                $Label = "fe";
                                if ($EndTime > time()) {
                                    $fpage[$EndTime] = $FlyingFleetsTable->BuildFleetEventTable($FleetRow, 2, $FleetType, $Label, $Record);
                                }
                            }
                        }
                    }
                }
                if (count($fpage) > 0) {
                    ksort($fpage);
                    foreach ($fpage as $FleetTime => $FleetContent) {
                        $Fleets .= $FleetContent . "\n";
                    }
                }
            }
            $parse['phl_fleets_table'] = $Fleets;
        }
    } else {
        header("location:game.php?page=overview");
    }
    return display(parsetemplate(gettemplate('galaxy/phalanx_body'), $parse), false, '', false, false);
}
Exemplo n.º 8
0
    $uni_system = $config->game_maxSystem;
}
if ($planet < 1) {
    $planet = 1;
}
if ($planet > $config->game_maxPlanet + 1) {
    $planet = $config->game_maxPlanet + 1;
}
$planetcount = 0;
$lunacount = 0;
$CurrentRC = $planetrow['recycler'];
$cached = array('users' => array(), 'allies' => array());
$template = gettemplate('universe', true);
$CurrentPoints = $user['total_points'];
$MissileRange = flt_get_missile_range($user);
$PhalanxRange = GetPhalanxRange($HavePhalanx);
$planet_precache_query = db_planet_list_in_system($uni_galaxy, $uni_system);
// while($planet_row = db_fetch($planet_precache_query))
if (!empty($planet_precache_query)) {
    foreach ($planet_precache_query as $planet_row) {
        $planet_list[$planet_row['planet']][$planet_row['planet_type']] = $planet_row;
    }
}
$fleet_precache_query = doquery("SELECT * FROM {{fleets}} WHERE\n    (fleet_start_galaxy = {$uni_galaxy} AND fleet_start_system = {$uni_system} AND fleet_mess = 1)\n    OR\n    (fleet_end_galaxy = {$uni_galaxy} AND fleet_end_system = {$uni_system} AND fleet_mess = 0);");
while ($fleet_row = db_fetch($fleet_precache_query)) {
    $fleet_planet = $fleet_row['fleet_mess'] == 0 ? $fleet_row['fleet_end_planet'] : $fleet_row['fleet_start_planet'];
    $fleet_type = $fleet_row['fleet_mess'] == 0 ? $fleet_row['fleet_end_type'] : $fleet_row['fleet_start_type'];
    $fleet_list[$fleet_planet][$fleet_type][] = $fleet_row;
}
$time_now_parsed = getdate(SN_TIME_NOW);
$recycler_info = array();
Exemplo n.º 9
0
    }
    return $MissileRange;
}
if ($_GET['type'] == "planetsize") {
    if (is_numeric($_GET['pos'])) {
        $size = PlanetSizeRandomiser($_GET['pos'], false, true);
        echo "<br /><font color=red>" . $size['field_max'] . "</font><br /><br /><br />";
        echo "<form action='' method='GET'>\r\n\t\t<input type='hidden' value='planetsize' name='type' />\r\n\t\t<input type='s' value='" . UNI . "' name='type' />\r\n\t\tPosition: <input type='text' name='pos' value='" . $_GET['pos'] . "' maxlenth='2' size='3' />\r\n\t\t<input type='submit' value='Go' />";
    } else {
        echo "<form action='' method='GET'>\r\n\t\t<input type='hidden' value='planetsize' name='type' />\r\n\t\t<input type='s' value='" . UNI . "' name='type' />\r\n\t\tPosition: <input type='text' name='pos' maxlenth='2' size='3' />\r\n\t\t<input type='submit' value='Go' />";
    }
} elseif ($_GET['type'] == "missilerange") {
    if (is_numeric($_GET['impulse'])) {
        $userimpulse = $user[$resource[117]];
        $user[$resource[117]] = $_GET['impulse'];
        $result = GetMissileRange();
        $user[$resource[117]] = $userimpulse;
        echo "<br /><font color=red>With Impulse drive level " . $_GET['impulse'] . " you can fire across " . $result . " systems</font><br /><br /><br />";
        echo "<form action='' method='GET'>\r\n\t\t<input type='hidden' value='missilerange' name='type' />\r\n\t\t<input type='s' value='" . UNI . "' name='type' />\r\n\t\tImpulse Drive: <input type='text' name='impulse' value='" . ($_GET['impulse'] + 1) . "' maxlenth='2' size='3' />\r\n\t\t<input type='submit' value='Go' />";
    } else {
        echo "<form action='' method='GET'>\r\n\t\t<input type='hidden' value='missilerange' name='type' />\r\n\t\t<input type='s' value='" . UNI . "' name='type' />\r\n\t\tImpulse Drive: <input type='text' name='impulse' maxlenth='2' size='3' />\r\n\t\t<input type='submit' value='Go' />";
    }
} elseif ($_GET['type'] == "phalanxrange") {
    if (is_numeric($_GET['level'])) {
        $result = GetPhalanxRange($_GET['level']);
        echo "<br /><font color=red>A Phalanx level " . $_GET['level'] . " has a range of " . $result . " systems.</font><br /><br /><br />";
        echo "<form action='' method='GET'>\r\n\t\t<input type='hidden' value='phalanxrange' name='type' />\r\n\t\t<input type='s' value='" . UNI . "' name='type' />\r\n\t\tSensor Phalanx Level: <input type='text' name='level' value='" . ($_GET['level'] + 1) . "' maxlenth='2' size='3' />\r\n\t\t<input type='submit' value='Go' />";
    } else {
        echo "<form action='' method='GET'>\r\n\t\t<input type='hidden' value='phalanxrange' name='type' />\r\n\t\t<input type='s' value='" . UNI . "' name='type' />\r\n\t\tSensor Phalanx Level: <input type='text' name='level' maxlenth='2' size='3' />\r\n\t\t<input type='submit' value='Go' />";
    }
}