当前位置: 首页>>代码示例>>PHP>>正文


PHP SortUserPlanets函数代码示例

本文整理汇总了PHP中SortUserPlanets函数的典型用法代码示例。如果您正苦于以下问题:PHP SortUserPlanets函数的具体用法?PHP SortUserPlanets怎么用?PHP SortUserPlanets使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SortUserPlanets函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ShowPlanetMenu

function ShowPlanetMenu($CurrentUser)
{
    global $dpath, $lang;
    $planets = SortUserPlanets($CurrentUser);
    while ($p = mysql_fetch_array($planets)) {
        if ($p["destruyed"] == 0) {
            $ct = $p["field_max"] + $p["terraformer"] * FIELDS_BY_TERRAFORMER;
            if ($p['planet_type'] == 3) {
                $ct = $p["field_max"];
            }
            if ($p['b_building'] != 0) {
                UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser);
                if ($p['b_building'] != 0) {
                    $BuildQueue = $p['b_building_id'];
                    $QueueArray = explode(";", $BuildQueue);
                    $CurrentBuild = explode(",", $QueueArray[0]);
                    $BuildElement = $CurrentBuild[0];
                    $BuildLevel = $CurrentBuild[1];
                    $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                    $construccion = "" . $lang['tech'][$BuildElement] . "<br>(Construyendo nivel " . $BuildLevel . ")<br>Tiempo restante:" . $BuildRestTime . "";
                } else {
                    CheckPlanetUsedFields($p);
                    $construccion = $lang['ov_free'];
                }
            } else {
                $construccion = $lang['ov_free'];
            }
            $popup = "" . $p['name'] . "&nbsp;[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]<br>Campos&nbsp;ocupados:&nbsp;" . $p['field_current'] . "/" . $ct . "<br>" . $construccion . "";
            if ($t == 0) {
                $parse['mplanet'] .= "<th text-decoration:none>";
            }
            if ($p['planet_type'] == 1 && $p["id"] != $CurrentUser["current_planet"]) {
                $parse['mplanet'] .= "<div align=center><a class=mplanet href=game.php?page={$_GET['page']}&gid={$_GET['gid']}&cp=" . $p['id'] . "&mode=" . $_GET['mode'] . "&re=0 onmouseover=\"return overlib('" . $popup . "', CENTER, OFFSETX, -80, OFFSETY, 20, WIDTH, 200)\" onmouseout=\"return nd();\"><img src=" . $dpath . "/planeten/" . $p['image'] . ".jpg border=0 height=78 width=78><br><font color=#2E9AFE>" . $p['name'] . "&nbsp;</font><font color=#58FA58><br>[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]</font></a>";
            } elseif ($p['planet_type'] == 3 && $p["id"] != $CurrentUser["current_planet"]) {
                $parse['mplanet'] .= "<div align=center><a class=mplanet href=game.php?page={$_GET['page']}&gid={$_GET['gid']}&cp=" . $p['id'] . "&mode=" . $_GET['mode'] . "&re=0 onmouseover=\"return overlib('" . $popup . "', CENTER, OFFSETX, -80, OFFSETY, 20, WIDTH, 200)\" onmouseout=\"return nd();\"><img src=" . $dpath . "/planeten/" . $p['image'] . ".jpg border=0 height=78 width=78><br>" . $p['name'] . " (Luna)&nbsp;<font color=#58FA58><br>[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]</font></a>";
            } else {
                $parse['mplanet'] .= "<div align=center><a class=mplanet href=# onmouseover=\"return overlib('" . $popup . "', CENTER, OFFSETX, -80, OFFSETY, 20, WIDTH, 200)\" onmouseout=\"return nd();\"><img src=" . $dpath . "/planeten/" . $p['image'] . ".jpg border=0 height=78 width=78><br><font color=#FFFF00>" . $p['name'] . "&nbsp;</font><font color=#FE9A2E><br>[" . $p['galaxy'] . ":" . $p['system'] . ":" . $p['planet'] . "]</font></a></div>";
            }
            if ($t == 6) {
                $parse['mplanet'] .= "</th>";
                $t = 0;
            } else {
                $t = $t + 1;
            }
        }
    }
    $parse['mplanet'] .= "</center></table>";
    return parsetemplate(gettemplate('planet_menu'), $parse);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:49,代码来源:ShowPlanetMenu.php

示例2: getplanets

 public function getplanets()
 {
     global $USER;
     $this->UserPlanets = SortUserPlanets($USER);
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:5,代码来源:class.template.php

示例3: ShowTopNavigationBar

/**
 * ShowTopNavigationBar.php
 *
 * @version 1
 * @copyright 2008 By Chlorel for XNova
 */
function ShowTopNavigationBar($CurrentUser, $CurrentPlanet)
{
    global $lang, $_GET, $game_config;
    if ($CurrentUser) {
        if (!$CurrentPlanet) {
            $CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $CurrentUser['current_planet'] . "';", 'planets', true);
        }
        // Aktualisieren der Planeten Ress
        PlanetResourceUpdate($CurrentUser, $CurrentPlanet, time());
        $NavigationTPL = gettemplate('topnav');
        $dpath = !$CurrentUser["dpath"] ? DEFAULT_SKINPATH : $CurrentUser["dpath"];
        $parse = $lang;
        $parse['dpath'] = $dpath;
        $parse['image'] = $CurrentPlanet['image'];
        // Genearation de la combo des planetes du joueur
        $parse['planetlist'] = '';
        $ThisUsersPlanets = SortUserPlanets($CurrentUser);
        while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
            if ($CurPlanet["destruyed"] == 0) {
                $parse['planetlist'] .= "\n<option ";
                if ($CurPlanet['id'] == $CurrentUser['current_planet']) {
                    // Bon puisque deja on s'y trouve autant le marquer
                    $parse['planetlist'] .= "selected=\"selected\" ";
                }
                $parse['planetlist'] .= "value=\"?cp=" . $CurPlanet['id'] . "";
                $parse['planetlist'] .= "&amp;mode=" . $_GET['mode'];
                $parse['planetlist'] .= "&amp;re=0\">";
                // Nom et coordonnées de la planete
                $parse['planetlist'] .= "" . $CurPlanet['name'];
                $parse['planetlist'] .= "&nbsp;[" . $CurPlanet['galaxy'] . ":";
                $parse['planetlist'] .= "" . $CurPlanet['system'] . ":";
                $parse['planetlist'] .= "" . $CurPlanet['planet'];
                $parse['planetlist'] .= "]&nbsp;&nbsp;</option>";
            }
        }
        if ($CurrentPlanet['energy_max'] == 0 && $CurrentPlanet['energy_used'] > 0) {
            $production_level = 0;
        } elseif ($CurrentPlanet['energy_max'] > 0 && abs($CurrentPlanet['energy_used']) > $CurrentPlanet['energy_max']) {
            $production_level = floor($CurrentPlanet['energy_max'] / abs($CurrentPlanet['energy_used']) * 100);
        } elseif ($CurrentPlanet['energy_max'] == 0 && abs($CurrentPlanet['energy_used']) > $CurrentPlanet['energy_max']) {
            $production_level = 0;
        } else {
            $production_level = 100;
        }
        if ($production_level > 100) {
            $production_level = 100;
        }
        $energy = pretty_number($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"]) . "/" . pretty_number($CurrentPlanet["energy_max"]);
        // Energie
        if ($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"] < 0) {
            $parse['energy'] = colorRed($energy);
        } else {
            $parse['energy'] = $energy;
        }
        // Metal
        $parse['metal'] = pretty_number($CurrentPlanet["metal"]);
        $parse['metal_js'] = str_replace(".", "", pretty_number($CurrentPlanet["metal"]));
        if ($CurrentPlanet["metal"] >= $CurrentPlanet["metal_max"]) {
            $parse['metal_per_hour'] = 0;
        } else {
            $metal = abs(floor($CurrentPlanet['metal_perhour'] * 0.01 * $production_level)) + $game_config['metal_basic_income'] * $game_config['resource_multiplier'];
            $parse['metal_per_hour'] = $metal / 3600;
        }
        // Cristal
        $parse['crystal'] = pretty_number($CurrentPlanet["crystal"]);
        $parse['crystal_js'] = str_replace(".", "", pretty_number($CurrentPlanet["crystal"]));
        if ($CurrentPlanet["crystal"] >= $CurrentPlanet["crystal_max"]) {
            $parse['crystal_per_hour'] = 0;
        } else {
            $crystal = abs(floor($CurrentPlanet['crystal_perhour'] * 0.01 * $production_level)) + $game_config['crystal_basic_income'] * $game_config['resource_multiplier'];
            $parse['crystal_per_hour'] = $crystal / 3600;
        }
        // Deuterium
        $parse['deuterium'] = pretty_number($CurrentPlanet["deuterium"]);
        $parse['deuterium_js'] = str_replace(".", "", pretty_number($CurrentPlanet["deuterium"]));
        if ($CurrentPlanet["deuterium"] >= $CurrentPlanet["deuterium_max"]) {
            $parse['deuterium_per_hour'] = 0;
        } else {
            $deuterium = abs(floor($CurrentPlanet['deuterium_perhour'] * 0.01 * $production_level)) + $game_config['deuterium_basic_income'] * $game_config['resource_multiplier'];
            $parse['deuterium_per_hour'] = $deuterium / 3600;
        }
        // Max Energie
        $energy_max = pretty_number($CurrentPlanet["energy_max"]);
        if ($CurrentPlanet["energy_max"] > $CurrentPlanet["energy_max"]) {
            $parse['energy_max'] = colorRed($energy_max);
        } else {
            $parse['energy_max'] = $energy_max;
        }
        $parse['energy_total'] = colorNumber(pretty_number(floor($CurrentPlanet['energy_max'] + $CurrentPlanet["energy_used"])) - $parse['energy_basic_income']);
        $parse['speed'] = $game_config['resource_multiplier'];
        // Metal maximum
        if ($CurrentPlanet["metal_max"] < $CurrentPlanet["metal"]) {
            $parse['metal_max'] = '<font color="#ff0000">';
        } else {
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowTopNavigationBar.php

示例4: ShowTopNavigationBar

/**
 * ShowTopNavigationBar.php
 *
 * @version 1
 * @copyright 2008 By Chlorel for XNova
 */
function ShowTopNavigationBar($CurrentUser, $CurrentPlanet)
{
    global $lang, $_GET, $game_config;
    if ($CurrentUser) {
        if (!$CurrentPlanet) {
            $CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $CurrentUser['current_planet'] . "';", 'planets', true);
        }
        // Actualisation des ressources de la planete
        if ($CurrentUser['urlaubs_modus'] == 0) {
            PlanetResourceUpdate($CurrentUser, $CurrentPlanet, time());
        } else {
            //doquery ( "UPDATE {{table}} SET `last_update` = ".time()." WHERE id_owner = ".$CurrentUser['id'],"planets");
            doquery("UPDATE {{table}} SET `deuterium_sintetizer_porcent` = 0, `metal_mine_porcent` = 0, `crystal_mine_porcent` = 0 WHERE id_owner = " . $CurrentUser['id'], "planets");
        }
        $NavigationTPL = gettemplate('topnav');
        $dpath = !$CurrentUser["dpath"] ? DEFAULT_SKINPATH : $CurrentUser["dpath"];
        $parse = $lang;
        $parse['dpath'] = $dpath;
        $parse['image'] = $CurrentPlanet['image'];
        $parse['show_umod_notice'] = $CurrentUser['urlaubs_modus'] ? '<table width="100%" style="border: 1px solid red; text-align:center;"><tr><td>Urlaubsmodus bis ' . date('d.m.Y h:i:s', $CurrentUser['urlaubs_modus_time']) . '</td></tr></table>' : '';
        // Genearation de la combo des planetes du joueur
        $parse['planetlist'] = '';
        $ThisUsersPlanets = SortUserPlanets($CurrentUser);
        while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
            if ($CurPlanet["destruyed"] == 0) {
                $parse['planetlist'] .= "\n<option ";
                if ($CurPlanet['id'] == $CurrentUser['current_planet']) {
                    // Bon puisque deja on s'y trouve autant le marquer
                    $parse['planetlist'] .= "selected=\"selected\" ";
                }
                $parse['planetlist'] .= "value=\"?cp=" . $CurPlanet['id'] . "";
                $parse['planetlist'] .= "&amp;mode=" . $_GET['mode'];
                $parse['planetlist'] .= "&amp;re=0\">";
                // Nom et coordonnées de la planete
                $parse['planetlist'] .= "" . $CurPlanet['name'];
                $parse['planetlist'] .= "&nbsp;[" . $CurPlanet['galaxy'] . ":";
                $parse['planetlist'] .= "" . $CurPlanet['system'] . ":";
                $parse['planetlist'] .= "" . $CurPlanet['planet'];
                $parse['planetlist'] .= "]&nbsp;&nbsp;</option>";
            }
        }
        $energy = $CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"] . "/" . pretty_number($CurrentPlanet["energy_max"]);
        // Energie
        if ($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"] < 0) {
            $parse['energy'] = colorRed($energy);
        } else {
            $parse['energy'] = $energy;
        }
        // Metal
        $metal = pretty_number($CurrentPlanet["metal"]);
        if ($CurrentPlanet["metal"] > $CurrentPlanet["metal_max"]) {
            $parse['metal'] = colorRed($metal);
        } else {
            $parse['metal'] = $metal;
        }
        // Cristal
        $crystal = pretty_number($CurrentPlanet["crystal"]);
        if ($CurrentPlanet["crystal"] > $CurrentPlanet["crystal_max"]) {
            $parse['crystal'] = colorRed($crystal);
        } else {
            $parse['crystal'] = $crystal;
        }
        // Deuterium
        $deuterium = pretty_number($CurrentPlanet["deuterium"]);
        if ($CurrentPlanet["deuterium"] > $CurrentPlanet["deuterium_max"]) {
            $parse['deuterium'] = colorRed($deuterium);
        } else {
            $parse['deuterium'] = $deuterium;
        }
        // JAVASCRIPT REALTIME RESS
        $parse['energy_total'] = colorNumber(pretty_number(floor($CurrentPlanet['energy_max'] + $CurrentPlanet["energy_used"]) - $parse['energy_basic_income']));
        // Metal maximo
        if ($CurrentPlanet["metal_max"] * MAX_OVERFLOW < $CurrentPlanet["metal"]) {
            $parse['metal_max'] = '<font color="#ff0000">';
        } else {
            $parse['metal_max'] = '<font color="#00ff00">';
        }
        $parse['metal_max'] .= pretty_number($CurrentPlanet["metal_max"] / 1) . " {$lang['']}</font>";
        // Cristal maximo
        if ($CurrentPlanet["crystal_max"] * MAX_OVERFLOW < $CurrentPlanet["crystal"]) {
            $parse['crystal_max'] = '<font color="#ff0000">';
        } else {
            $parse['crystal_max'] = '<font color="#00ff00">';
        }
        $parse['crystal_max'] .= pretty_number($CurrentPlanet["crystal_max"] / 1) . " {$lang['']}";
        // Deuterio maximo
        if ($CurrentPlanet["deuterium_max"] * MAX_OVERFLOW < $CurrentPlanet["deuterium"]) {
            $parse['deuterium_max'] = '<font color="#ff0000">';
        } else {
            $parse['deuterium_max'] = '<font color="#00ff00">';
        }
        $parse['deuterium_max'] .= pretty_number($CurrentPlanet["deuterium_max"] / 1) . " {$lang['']}";
        if ($CurrentPlanet['energy_max'] == 0 && abs($CurrentPlanet['energy_used']) >= 0) {
            $plevel = 0;
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowTopNavigationBar.php

示例5: ShowTopNavigationBar

/**
 * ShowTopNavigationBar.php
 *
 * @version 1
 * @copyright 2008 By Chlorel for XNova
 */
function ShowTopNavigationBar($CurrentUser, $CurrentPlanet)
{
    global $lang, $_GET;
    if ($CurrentUser) {
        if (!$CurrentPlanet) {
            $CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $CurrentUser['current_planet'] . "';", 'planets', true);
        }
        // Actualisation des ressources de la planete
        PlanetResourceUpdate($CurrentUser, $CurrentPlanet, time());
        $NavigationTPL = gettemplate('topnav');
        $dpath = !$CurrentUser["dpath"] ? DEFAULT_SKINPATH : $CurrentUser["dpath"];
        $parse = $lang;
        $parse['dpath'] = $dpath;
        $parse['image'] = $CurrentPlanet['image'];
        // Genearation de la combo des planetes du joueur
        $parse['planetlist'] = '';
        $ThisUsersPlanets = SortUserPlanets($CurrentUser);
        while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
            if ($CurPlanet["destruyed"] == 0) {
                $parse['planetlist'] .= "\n<option ";
                if ($CurPlanet['id'] == $CurrentUser['current_planet']) {
                    // Bon puisque deja on s'y trouve autant le marquer
                    $parse['planetlist'] .= "selected=\"selected\" ";
                }
                $parse['planetlist'] .= "value=\"?cp=" . $CurPlanet['id'] . "";
                $parse['planetlist'] .= "&amp;mode=" . $_GET['mode'];
                $parse['planetlist'] .= "&amp;re=0\">";
                // Nom et coordonnées de la planete
                $parse['planetlist'] .= "" . $CurPlanet['name'];
                $parse['planetlist'] .= "&nbsp;[" . $CurPlanet['galaxy'] . ":";
                $parse['planetlist'] .= "" . $CurPlanet['system'] . ":";
                $parse['planetlist'] .= "" . $CurPlanet['planet'];
                $parse['planetlist'] .= "]&nbsp;&nbsp;</option>";
            }
        }
        $energy = pretty_number($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"]) . "/" . pretty_number($CurrentPlanet["energy_max"]);
        // Energie
        if ($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"] < 0) {
            $parse['energy'] = colorRed($energy);
        } else {
            $parse['energy'] = $energy;
        }
        // Metal
        $metal = pretty_number($CurrentPlanet["metal"]);
        if ($CurrentPlanet["metal"] > $CurrentPlanet["metal_max"]) {
            $parse['metal'] = colorRed($metal);
        } else {
            $parse['metal'] = $metal;
        }
        // Cristal
        $crystal = pretty_number($CurrentPlanet["crystal"]);
        if ($CurrentPlanet["crystal"] > $CurrentPlanet["crystal_max"]) {
            $parse['crystal'] = colorRed($crystal);
        } else {
            $parse['crystal'] = $crystal;
        }
        // Deuterium
        $deuterium = pretty_number($CurrentPlanet["deuterium"]);
        if ($CurrentPlanet["deuterium"] > $CurrentPlanet["deuterium_max"]) {
            $parse['deuterium'] = colorRed($deuterium);
        } else {
            $parse['deuterium'] = $deuterium;
        }
        // Message
        if ($CurrentUser['new_message'] > 0) {
            $parse['message'] = "<a href=\"messages.php\">[ " . $CurrentUser['new_message'] . " ]</a>";
        } else {
            $parse['message'] = "0";
        }
        // Le tout passe dans la template
        $TopBar = parsetemplate($NavigationTPL, $parse);
    } else {
        $TopBar = "";
    }
    return $TopBar;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:82,代码来源:ShowTopNavigationBar.php

示例6: ShowTopNavigationBar

function ShowTopNavigationBar($CurrentUser, $CurrentPlanet)
{
    global $lang, $game_config, $dpath;
    if ($CurrentUser['urlaubs_modus'] == 0) {
        PlanetResourceUpdate($CurrentUser, $CurrentPlanet, time());
    } else {
        doquery("UPDATE {{table}} SET `deuterium_sintetizer_porcent` = 0, `metal_mine_porcent` = 0, `crystal_mine_porcent` = 0, `darkmatter_mine_porcent` = 0 WHERE id_owner = " . $CurrentUser['id'], "planets");
    }
    $parse = $lang;
    $parse['dpath'] = $dpath;
    $parse['image'] = $CurrentPlanet['image'];
    if ($CurrentUser['rpg_geologue'] > 0) {
        $parse['geologo'] = "geologue.gif";
    } else {
        $parse['geologo'] = "geologue_un.gif";
    }
    if ($CurrentUser['rpg_amiral'] > 0) {
        $parse['admirante'] = "admiral.gif";
    } else {
        $parse['admirante'] = "amiral_un.gif";
    }
    if ($CurrentUser['rpg_empereur'] > 0) {
        $parse['comandante'] = "empereur.gif";
    } else {
        $parse['comandante'] = "empereur_un.gif";
    }
    if ($CurrentUser['rpg_ingenieur'] > 0) {
        $parse['ingeniero'] = "ingenieur.gif";
    } else {
        $parse['ingeniero'] = "ingenieur_un.gif";
    }
    if ($CurrentUser['rpg_technocrate'] > 0) {
        $parse['tecnocrata'] = "technocrate.gif";
    } else {
        $parse['tecnocrata'] = "technocrate_un.gif";
    }
    if ($CurrentUser['urlaubs_modus'] && $CurrentUser['db_deaktjava']) {
        $parse['show_umod_notice'] .= $CurrentUser['db_deaktjava'] ? '<table width="100%" style="border: 2px solid red; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $lang['tn_delete_mode'] . date('d.m.Y h:i:s', $CurrentUser['db_deaktjava'] + 60 * 60 * 24 * 7) . '</td></tr></table>' : '';
    } else {
        $parse['show_umod_notice'] = $CurrentUser['urlaubs_modus'] ? '<table width="100%" style="border: 2px solid #1DF0F0; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $lang['tn_vacation_mode'] . date('d.m.Y h:i:s', $CurrentUser['urlaubs_until']) . '</td></tr></table><br>' : '';
        $parse['show_umod_notice'] .= $CurrentUser['db_deaktjava'] ? '<table width="100%" style="border: 2px solid red; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $lang['tn_delete_mode'] . date('d.m.Y h:i:s', $CurrentUser['db_deaktjava'] + 60 * 60 * 24 * 7) . '</td></tr></table>' : '';
    }
    $parse['planetlist'] = '';
    $ThisUsersPlanets = SortUserPlanets($CurrentUser);
    while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
        if ($CurPlanet["destruyed"] == 0) {
            $parse['planetlist'] .= "\n<option ";
            if ($CurPlanet['id'] == $CurrentUser['current_planet']) {
                $parse['planetlist'] .= "selected=\"selected\" ";
            }
            $parse['planetlist'] .= "value=\"game.php?page={$_GET['page']}&gid={$_GET['gid']}&cp=" . $CurPlanet['id'] . "";
            $parse['planetlist'] .= "&amp;mode=" . $_GET['mode'];
            $parse['planetlist'] .= "&amp;re=0\">";
            if ($CurPlanet['planet_type'] != 3) {
                $parse['planetlist'] .= "" . $CurPlanet['name'];
            } else {
                $parse['planetlist'] .= "" . $CurPlanet['name'] . " (" . $lang['fcm_moon'] . ")";
            }
            $parse['planetlist'] .= "&nbsp;[" . $CurPlanet['galaxy'] . ":";
            $parse['planetlist'] .= "" . $CurPlanet['system'] . ":";
            $parse['planetlist'] .= "" . $CurPlanet['planet'];
            $parse['planetlist'] .= "]&nbsp;&nbsp;</option>";
        }
    }
    $energy = pretty_number($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"]) . "/" . pretty_number($CurrentPlanet["energy_max"]);
    // Energie
    if ($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"] < 0) {
        $parse['energy'] = colorRed($energy);
    } else {
        $parse['energy'] = $energy;
    }
    // Metal
    $metal = pretty_number($CurrentPlanet["metal"]);
    if ($CurrentPlanet["metal"] >= $CurrentPlanet["metal_max"]) {
        $parse['metal'] = colorRed($metal);
    } else {
        $parse['metal'] = $metal;
    }
    // Cristal
    $crystal = pretty_number($CurrentPlanet["crystal"]);
    if ($CurrentPlanet["crystal"] >= $CurrentPlanet["crystal_max"]) {
        $parse['crystal'] = colorRed($crystal);
    } else {
        $parse['crystal'] = $crystal;
    }
    // Deuterium
    $deuterium = pretty_number($CurrentPlanet["deuterium"]);
    if ($CurrentPlanet["deuterium"] >= $CurrentPlanet["deuterium_max"]) {
        $parse['deuterium'] = colorRed($deuterium);
    } else {
        $parse['deuterium'] = $deuterium;
    }
    // Materia Oscura
    $darkmatter = pretty_number($CurrentPlanet["darkmatter"]);
    if ($CurrentPlanet["darkmatter"] >= $CurrentPlanet["darkmatter_max"]) {
        $parse['darkmatter'] = colorRed($darkmatter);
    } else {
        $parse['darkmatter'] = $darkmatter;
    }
    //$parse['darkmatter'] 		= pretty_number($CurrentUser["darkmatter"]);
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowTopNavigationBar.php

示例7: ShowTopNavigationBar

function ShowTopNavigationBar($CurrentUser, $CurrentPlanet)
{
    global $lang, $game_config, $dpath;
    if ($CurrentUser['urlaubs_modus'] == 0) {
        PlanetResourceUpdate($CurrentUser, $CurrentPlanet, time());
    } else {
        doquery("UPDATE {{table}} SET `deuterium_sintetizer_porcent` = 0, `tritium_sintetizer_porcent` = 0, `metal_mine_porcent` = 0, `crystal_mine_porcent` = 0 WHERE id_owner = " . intval($CurrentUser['id']), "planets");
    }
    $parse = $lang;
    $parse['dpath'] = $dpath;
    $parse['image'] = $CurrentPlanet['image'];
    if ($CurrentUser['urlaubs_modus'] && $CurrentUser['db_deaktjava']) {
        $parse['show_umod_notice'] .= $CurrentUser['db_deaktjava'] ? '<table width="100%" style="border: 2px solid red; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $lang['tn_delete_mode'] . date('d.m.Y h:i:s', $CurrentUser['db_deaktjava'] + 60 * 60 * 24 * 7) . '</td></tr></table>' : '';
    } else {
        $parse['show_umod_notice'] = $CurrentUser['urlaubs_modus'] ? '<table width="100%" style="border: 2px solid #1DF0F0; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $lang['tn_vacation_mode'] . date('d.m.Y h:i:s', $CurrentUser['urlaubs_until']) . '</td></tr></table><br>' : '';
        $parse['show_umod_notice'] .= $CurrentUser['db_deaktjava'] ? '<table width="100%" style="border: 2px solid red; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $lang['tn_delete_mode'] . date('d.m.Y h:i:s', $CurrentUser['db_deaktjava'] + 60 * 60 * 24 * 7) . '</td></tr></table>' : '';
    }
    $parse['planetlist'] = '';
    $ThisUsersPlanets = SortUserPlanets($CurrentUser);
    $parse['metal_max'] = pretty_number($CurrentPlanet['metal_max'] / 1000) . '&nbsp;K';
    $parse['crystal_max'] = pretty_number($CurrentPlanet['crystal_max'] / 1000) . '&nbsp;K';
    $parse['deuterium_max'] = pretty_number($CurrentPlanet['deuterium_max'] / 1000) . '&nbsp;K';
    $parse['tritium_max'] = pretty_number($CurrentPlanet['tritium_max'] / 1000) . '&nbsp;K';
    $parse['metal_bar'] = GetPercentBar($CurrentPlanet["metal"], $CurrentPlanet["metal_max"] * MAX_OVERFLOW);
    $parse['crystal_bar'] = GetPercentBar($CurrentPlanet["crystal"], $CurrentPlanet["crystal_max"] * MAX_OVERFLOW);
    $parse['deuterium_bar'] = GetPercentBar($CurrentPlanet["deuterium"], $CurrentPlanet["deuterium_max"] * MAX_OVERFLOW);
    $parse['tritium_bar'] = GetPercentBar($CurrentPlanet["tritium"], $CurrentPlanet["tritium_max"] * MAX_OVERFLOW);
    $parse['energy_bar'] = GetPercentBar(abs($CurrentPlanet["energy_used"] * (1 + $CurrentUser['rpg_ingenieur'] * 0.05)), $CurrentPlanet["energy_max"]);
    $planetas = 0;
    while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
        if ($CurPlanet["destruyed"] == 0) {
            $parse['planetlist'] .= "\n<option ";
            if ($CurPlanet['id'] == $CurrentUser['current_planet']) {
                $parse['planetlist'] .= "selected=\"selected\" ";
            }
            $parse['planetlist'] .= "value=\"game.php?page={$_GET['page']}&gid={$_GET['gid']}&cp=" . $CurPlanet['id'] . "";
            $parse['planetlist'] .= "&amp;mode=" . $_GET['mode'];
            $parse['planetlist'] .= "&amp;re=0\">";
            if ($CurPlanet['planet_type'] != 3) {
                $parse['planetlist'] .= "" . $CurPlanet['name'];
            } else {
                $parse['planetlist'] .= "" . $CurPlanet['name'] . " (" . $lang['fcm_moon'] . ")";
            }
            $parse['planetlist'] .= "&nbsp;[" . $CurPlanet['galaxy'] . ":";
            $parse['planetlist'] .= "" . $CurPlanet['system'] . ":";
            $parse['planetlist'] .= "" . $CurPlanet['planet'];
            $parse['planetlist'] .= "]&nbsp;&nbsp;</option>";
            ++$planetas;
            if ($planetas == 1) {
                $planet_first_id = $CurPlanet['id'];
            }
            $planet_last_id = $CurPlanet['id'];
        }
    }
    if ($planet_first_id == $CurrentPlanet['id'] and $planetas >= 2) {
        $parse['flechas'] = "<center><input value=\"&gt;&gt;\" onclick=\"window.location=document.getElementById('pselector').options[document.getElementById('pselector').selectedIndex+1].value+'';\" type=\"button\"></center>";
    } elseif ($planet_last_id == $CurrentPlanet['id'] and $planetas >= 2) {
        $parse['flechas'] = "<center><input value=\"&lt;&lt;\" onclick=\"window.location=document.getElementById('pselector').options[document.getElementById('pselector').selectedIndex-1].value+'';\" type=\"button\"></center>";
    } elseif ($planetas >= 2) {
        $parse['flechas'] = "<center><input value=\"&lt;&lt;\" onclick=\"window.location=document.getElementById('pselector').options[document.getElementById('pselector').selectedIndex-1].value+'';\" type=\"button\">&nbsp;<input value=\"&gt;&gt;\" onclick=\"window.location=document.getElementById('pselector').options[document.getElementById('pselector').selectedIndex+1].value+'';\" type=\"button\"></center>";
    } else {
        $parse['flechas'] = '';
    }
    $energy = pretty_number($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"]) . "/" . pretty_number($CurrentPlanet["energy_max"]);
    // Energie
    if ($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"] < 0) {
        $parse['energy'] = colorRed($energy);
    } else {
        $parse['energy'] = $energy;
    }
    // Metal
    $metal = pretty_number($CurrentPlanet["metal"]);
    if ($CurrentPlanet["metal"] >= $CurrentPlanet["metal_max"]) {
        $parse['metal'] = colorRed($metal);
    } else {
        $parse['metal'] = $metal;
    }
    // Cristal
    $crystal = pretty_number($CurrentPlanet["crystal"]);
    if ($CurrentPlanet["crystal"] >= $CurrentPlanet["crystal_max"]) {
        $parse['crystal'] = colorRed($crystal);
    } else {
        $parse['crystal'] = $crystal;
    }
    // Deuterium
    $deuterium = pretty_number($CurrentPlanet["deuterium"]);
    if ($CurrentPlanet["deuterium"] >= $CurrentPlanet["deuterium_max"]) {
        $parse['deuterium'] = colorRed($deuterium);
    } else {
        $parse['deuterium'] = $deuterium;
    }
    $tritium = pretty_number($CurrentPlanet["tritium"]);
    if ($CurrentPlanet["tritium"] >= $CurrentPlanet["tritium_max"]) {
        $parse['tritium'] = colorRed($tritium);
    } else {
        $parse['tritium'] = $tritium;
    }
    $parse['darkmatter'] = pretty_number($CurrentUser["darkmatter"]);
    $TopBar = parsetemplate(gettemplate('topnav'), $parse);
    return $TopBar;
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowTopNavigationBar.php

示例8: SortUserPlanets

            }
        }
    }
    if ($i == 1) {
        $page .= "<th></th></tr>";
    }
} else {
    $page .= "<tr height=\"20\">";
    $page .= "<th colspan=\"2\">" . $lang['fl_noshortc'] . "</th>";
    $page .= "</tr>";
}
$page .= "<tr height=\"20\">";
$page .= "<td colspan=\"2\" class=\"c\">" . $lang['fl_myplanets'] . "</td>";
$page .= "</tr>";
// Gestion des raccourcis vers ses propres colonies ou planetes
$kolonien = SortUserPlanets($user);
$currentplanet = doquery("SELECT * FROM {{table}} WHERE id = '" . $user['current_planet'] . "'", 'planets', true);
if (mysql_num_rows($kolonien) > 1) {
    $i = 0;
    $w = 0;
    $tr = true;
    while ($row = mysql_fetch_array($kolonien)) {
        if ($w == 0 && $tr) {
            $page .= "<tr height=\"20\">";
            $tr = false;
        }
        if ($w == 2) {
            $page .= "</tr>";
            $w = 0;
            $tr = true;
        }
开发者ID:sonicmaster,项目名称:RPG,代码行数:31,代码来源:floten1.php

示例9: ShowTopNavigationBar

function ShowTopNavigationBar($CurrentUser, $CurrentPlanet)
{
    global $lang, $game_config, $dpath, $user;
    if ($CurrentUser['urlaubs_modus'] == 0) {
        PlanetResourceUpdate($CurrentUser, $CurrentPlanet, time());
    } else {
        doquery("UPDATE {{table}} SET `deuterium_sintetizer_porcent` = 0, `metal_mine_porcent` = 0, `crystal_mine_porcent` = 0 WHERE id_owner = " . intval($CurrentUser['id']), "planets");
    }
    $parse = $lang;
    $parse['dpath'] = $dpath;
    $parse['image'] = $CurrentPlanet['image'];
    if ($user['authlevel'] > 0) {
        $parse['admin_link'] = "<tr><td><div align=\"center\"><a href=\"javascript:top.location.href='adm/index.php'\"> <font color=\"lime\">" . $lang['lm_administration'] . "</font></a></div></td></tr>";
    } else {
        $parse['admin_link'] = "";
    }
    if ($CurrentUser['urlaubs_modus'] && $CurrentUser['db_deaktjava']) {
        $parse['show_umod_notice'] .= $CurrentUser['db_deaktjava'] ? '<table width="100%" style="border: 2px solid red; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $lang['tn_delete_mode'] . date('d.m.Y h:i:s', $CurrentUser['db_deaktjava'] + 60 * 60 * 24 * 7) . '</td></tr></table>' : '';
    } else {
        $parse['show_umod_notice'] = $CurrentUser['urlaubs_modus'] ? '<table width="100%" style="border: 2px solid #1DF0F0; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $lang['tn_vacation_mode'] . date('d.m.Y h:i:s', $CurrentUser['urlaubs_until']) . '</td></tr></table><br>' : '';
        $parse['show_umod_notice'] .= $CurrentUser['db_deaktjava'] ? '<table width="100%" style="border: 2px solid red; text-align:center;background:transparent;"><tr style="background:transparent;"><td style="background:transparent;">' . $lang['tn_delete_mode'] . date('d.m.Y h:i:s', $CurrentUser['db_deaktjava'] + 60 * 60 * 24 * 7) . '</td></tr></table>' : '';
    }
    $parse['planetlist'] = '';
    $ThisUsersPlanets = SortUserPlanets($CurrentUser);
    while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
        if ($CurPlanet["destruyed"] == 0) {
            $parse['planetlist'] .= "\n<option ";
            if ($CurPlanet['id'] == $CurrentUser['current_planet']) {
                $parse['planetlist'] .= "selected=\"selected\" ";
            }
            $parse['planetlist'] .= "value=\"game.php?page={$_GET['page']}&gid={$_GET['gid']}&cp=" . $CurPlanet['id'] . "";
            $parse['planetlist'] .= "&amp;mode=" . $_GET['mode'];
            $parse['planetlist'] .= "&amp;re=0\">";
            if ($CurPlanet['planet_type'] != 3) {
                $parse['planetlist'] .= "" . $CurPlanet['name'];
            } else {
                $parse['planetlist'] .= "" . $CurPlanet['name'] . " (" . $lang['fcm_moon'] . ")";
            }
            $parse['planetlist'] .= "&nbsp;[" . $CurPlanet['galaxy'] . ":";
            $parse['planetlist'] .= "" . $CurPlanet['system'] . ":";
            $parse['planetlist'] .= "" . $CurPlanet['planet'];
            $parse['planetlist'] .= "]&nbsp;&nbsp;</option>";
        }
    }
    $energy = pretty_number($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"]) . "/" . pretty_number($CurrentPlanet["energy_max"]);
    // Energie
    if ($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"] < 0) {
        $parse['energy'] = colorRed($energy);
    } else {
        $parse['energy'] = $energy;
    }
    // Metal
    $metal = pretty_number($CurrentPlanet["metal"]);
    if ($CurrentPlanet["metal"] >= $CurrentPlanet["metal_max"]) {
        $parse['metal'] = colorRed($metal);
    } else {
        $parse['metal'] = $metal;
    }
    // Cristal
    $crystal = pretty_number($CurrentPlanet["crystal"]);
    if ($CurrentPlanet["crystal"] >= $CurrentPlanet["crystal_max"]) {
        $parse['crystal'] = colorRed($crystal);
    } else {
        $parse['crystal'] = $crystal;
    }
    // Deuterium
    $deuterium = pretty_number($CurrentPlanet["deuterium"]);
    if ($CurrentPlanet["deuterium"] >= $CurrentPlanet["deuterium_max"]) {
        $parse['deuterium'] = colorRed($deuterium);
    } else {
        $parse['deuterium'] = $deuterium;
    }
    $parse['darkmatter'] = pretty_number($CurrentUser["darkmatter"]);
    // Porcentaje de almacenes con bug fix almaneces negativos.
    $parse['metal_max'] .= pretty_number($CurrentPlanet["metal_max"] / 1) . " {$lang['']}";
    $parse['crystal_max'] .= pretty_number($CurrentPlanet["crystal_max"] / 1) . " {$lang['']}";
    $parse['deuterium_max'] .= pretty_number($CurrentPlanet["deuterium_max"] / 1) . " {$lang['']}";
    $parse['metal_perhour'] .= $CurrentPlanet["metal_perhour"] + $game_config['metal_basic_income'] * $game_config['resource_multiplier'];
    $parse['crystal_perhour'] .= $CurrentPlanet["crystal_perhour"] + $game_config['crystal_basic_income'] * $game_config['resource_multiplier'];
    $parse['deuterium_perhour'] .= $CurrentPlanet["deuterium_perhour"] + $game_config['deuterium_basic_income'] * $game_config['resource_multiplier'];
    $parse['metalh'] .= round($CurrentPlanet["metal"]);
    $parse['crystalh'] .= round($CurrentPlanet["crystal"]);
    $parse['deuteriumh'] .= round($CurrentPlanet["deuterium"]);
    $parse['metal_mmax'] .= $CurrentPlanet["metal_max"] * MAX_OVERFLOW;
    $parse['crystal_mmax'] .= $CurrentPlanet["crystal_max"] * MAX_OVERFLOW;
    $parse['deuterium_mmax'] .= $CurrentPlanet["deuterium_max"] * MAX_OVERFLOW;
    $parse['metal_storage'] = floor($CurrentPlanet['metal'] / $CurrentPlanet['metal_max'] * 100) . "%";
    $parse['crystal_storage'] = floor($CurrentPlanet['crystal'] / $CurrentPlanet['crystal_max'] * 100) . "%";
    $parse['deuterium_storage'] = floor($CurrentPlanet['deuterium'] / $CurrentPlanet['deuterium_max'] * 100) . "%";
    $parse['energy_storage'] = floor(($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"]) / (1 + $CurrentPlanet['energy_max']) * 100) . "%";
    $parse['metal_storage_bar'] = floor($CurrentPlanet['metal'] / $CurrentPlanet['metal_max'] * 100 * 0.7);
    $parse['crystal_storage_bar'] = floor($CurrentPlanet['crystal'] / $CurrentPlanet['crystal_max'] * 100 * 0.7);
    $parse['deuterium_storage_bar'] = floor($CurrentPlanet['deuterium'] / $CurrentPlanet['deuterium_max'] * 100 * 0.7);
    $parse['energy_storage_bar'] = floor(($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"]) / (1 + $CurrentPlanet['energy_max']) * 100 * 0.7);
    if ($parse['metal_storage_bar'] >= 100 * 0.7) {
        $parse['metal_storage_bar'] = 70;
        $parse['metal_storage'] = "100%";
        $parse['metal_storage_barcolor'] = '#FF0000';
    } elseif ($parse['metal_storage_bar'] > 100 * 0.63) {
        $parse['metal_storage_barcolor'] = '#FFCC00';
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowTopNavigationBar.php

示例10: ShowPlanetList

/**
 * PlanetList.php
 *
 * @version 1
 * @copyright 2008 By MadnessRed for XNova_Redisigned
 */
function ShowPlanetList($axah = false, $debug = false)
{
    global $lang, $_GET, $user, $formulas, $resource;
    if ($debug) {
        echo "Started function<br /><br />";
    }
    if ($user) {
        //Make a lsit of player planets.
        $planetlist = '<br />';
        $ThisUsersPlanets = SortUserPlanets($user);
        if ($debug) {
            print_r(mysql_fetch_array($ThisUsersPlanets));
        }
        $c = 0;
        while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
            if ($CurPlanet["destruyed"] == 0) {
                if ($CurPlanet['planet_type'] == 1) {
                    $CurMoon = doquery("SELECT `id`,`name`,`galaxy`,`system`,`planet`,`image` FROM {{table}} WHERE `galaxy` = '" . $CurPlanet['galaxy'] . "' AND `system` = '" . $CurPlanet['system'] . "' AND `planet` = '" . $CurPlanet['planet'] . "' AND `planet_type` = '3' LIMIT 1 ;", 'planets', true);
                    if ($CurPlanet['id'] == $user['current_planet'] || $CurMoon['id'] == $user['current_planet']) {
                        $active = ' active';
                    } else {
                        $active = '';
                    }
                    $c++;
                    $img = PlanetType($CurPlanet['image']);
                    $pl_img = "/img/planets/" . $img['type'] . "_" . $img['subtype'] . "_{size}.gif";
                    //is there a moon
                    if ($CurMoon['id'] > 0) {
                        $moon_type_array = PlanetType($CurMoon['image']);
                        $moonlink = "\t\t\t\t<a class=\"moonlink\" onclick=\"loadpage(this.href,'" . $lang['Overview'] . " - " . $CurMoon['name'] . "','overview'); document.getElementById('planet_ext').value = '-moon'; document.getElementById('resources_menu_link').style.display = 'none'; return false;\" href=\"./?cp=" . $CurMoon['id'] . "&re=0\" onmouseover=\"mrtooltip_large('" . $CurMoon['name'] . " [" . $CurMoon['galaxy'] . ":" . $CurMoon['system'] . ":" . $CurMoon['planet'] . "]')\" onmouseout=\"UnTip()\">\n";
                        $moonlink .= "\t\t\t\t\t<img class=\"icon-moon\" src=\"" . GAME_SKIN . "/img/planets/moon/" . $moon_type_array['type'] . "_" . $moon_type_array['subtype'] . "_small.gif\" />\n";
                        $moonlink .= "\t\t\t\t</a>\n";
                    } else {
                        $moonlink = "";
                    }
                    $planetlist .= "\n";
                    $planetlist .= "\t\t\t<div class=\"smallplanet\">\n";
                    $planetlist .= "\t\t\t\t<a onclick=\"loadpage(this.href,'" . $lang['Overview'] . " - " . $CurPlanet['name'] . "','overview'); document.getElementById('planet_ext').value = ''; document.getElementById('resources_menu_link').style.display = 'block'; return false;\" href=\"./?cp=" . $CurPlanet['id'] . "&re=0\" onmouseover=\"mrtooltip_large('" . $CurPlanet['name'] . " [" . $CurPlanet['galaxy'] . ":" . $CurPlanet['system'] . ":" . $CurPlanet['planet'] . "]')\" onmouseout=\"UnTip()\" class=\"planetlink" . $active . " tips reloadTips\">\n";
                    $planetlist .= "\t\t\t\t\t<img class=\"planetPic\" src=\"" . GAME_SKIN . $pl_img . "\" />\n";
                    $planetlist .= "\t\t\t\t\t<span class=\"planet-name\">" . $CurPlanet['name'] . "</span>\n";
                    $planetlist .= "\t\t\t\t\t<span class=\"planet-koords\">[" . $CurPlanet['galaxy'] . ":" . $CurPlanet['system'] . ":" . $CurPlanet['planet'] . "]</span>\n";
                    $planetlist .= "\t\t\t\t</a>\n";
                    $planetlist .= $moonlink;
                    $planetlist .= "\t\t\t</div>\n";
                }
            }
        }
        if ($c > 5) {
            $mode = 'cutty';
            $name = 'myPlanets';
            $size = '1';
        } else {
            $mode = 'norm';
            $name = 'myWorlds';
            $size = '3';
        }
        $planetlist = str_replace('{size}', $size, $planetlist);
        if ($axah) {
            $return = "\t<div id=\"" . $mode . "\">\n\t\t<div id=\"" . $name . "\">\n\n\t\t\t<div id=\"countColonies\">\n\t\t\t\t<p class=\"textCenter tips\" title=\"|\">\n\t\t\t\t\t<span>" . $c . "/" . eval($formulas['max_planets']) . "</span> Planets\n\t\t\t\t</p>\n\t\t\t</div>" . $planetlist . "\n\n\t\t</div>\n\t</div>\n";
        } else {
            $return = "<!-- RIGHTMENU -->\n<div id=\"rechts\">\n\n\t<div id=\"" . $mode . "\">\n\t\t<div id=\"" . $name . "\">\n\n\t\t\t<div id=\"countColonies\">\n\t\t\t\t<p class=\"textCenter tips\" title=\"|\">\n\t\t\t\t\t<span>" . $c . "/" . eval($formulas['max_planets']) . "</span> Planets\n\t\t\t\t</p>\n\t\t\t</div>" . $planetlist . "\n\n\t\t</div>\n\t</div>\n</div>\n<!-- END RIGHTMENU -->\n";
        }
    } else {
        $return = "";
        if ($debug) {
            echo "\$user returned <font color=blue><b>false</b></font><br /><br />";
            print_r($user);
        }
    }
    return $return;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:77,代码来源:planetlist.php

示例11: int_planet_pretemplate

         }
     }
     int_planet_pretemplate($planetrow, $template);
     foreach ($sn_data['groups']['governors'] as $governor_id) {
         $template->assign_block_vars('governors', array('ID' => $governor_id, 'NAME' => $lang['tech'][$governor_id]));
     }
     display(parsetemplate($template), $lang['rename_and_abandon_planet']);
     break;
 default:
     $template = gettemplate('planet_overview', true);
     rpg_level_up($user, RPG_STRUCTURE);
     rpg_level_up($user, RPG_RAID);
     $fleet_id = 1;
     int_get_fleet_to_planet("SELECT DISTINCT * FROM {{fleets}} WHERE `fleet_owner` = '{$user['id']}' OR `fleet_target_owner` = '{$user['id']}';");
     int_get_missile_to_planet("SELECT * FROM `{{iraks}}` WHERE `owner` = '{$user['id']}'");
     $planets_query = SortUserPlanets($user, false, '*');
     while ($UserPlanet = mysql_fetch_assoc($planets_query)) {
         if ($UserPlanet['planet_type'] == PT_MOON) {
             continue;
         }
         $UserPlanet = sys_o_get_updated($user, $UserPlanet, $time_now, true);
         $list_planet_que = $UserPlanet['que'];
         $UserPlanet = $UserPlanet['planet'];
         $template_planet = tpl_parse_planet($UserPlanet, $list_planet_que);
         $planet_fleet_id = 0;
         $fleet_list = $template_planet['fleet_list'];
         if ($fleet_list['own']['count']) {
             $planet_fleet_id = "p{$fleet_id}";
             $fleets[] = tpl_parse_fleet_sn($fleet_list['own']['total'], $planet_fleet_id);
             $fleet_id++;
         }
开发者ID:sonicmaster,项目名称:RPG,代码行数:31,代码来源:overview.php

示例12: ShowTopNavigationBar

function ShowTopNavigationBar($CurrentUser, $CurrentPlanet)
{
    global $lang, $_GET;
    //	CheckPlanetUsedFields ( $CurrentPlanet );
    if ($CurrentUser) {
        if (!$CurrentPlanet) {
            $CurrentPlanet = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $CurrentUser['current_planet'] . "';", 'planets', true);
        }
        PlanetResourceUpdate($CurrentUser, $CurrentPlanet, time());
        $NavigationTPL = gettemplate('topnav');
        $dpath = !$CurrentUser["dpath"] ? DEFAULT_SKINPATH : $CurrentUser["dpath"];
        $parse = $lang;
        $parse['dpath'] = $dpath;
        $parse['image'] = $CurrentPlanet['image'];
        $parse['planetlist'] = '';
        $ThisUsersPlanets = SortUserPlanets($CurrentUser);
        while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
            if ($CurPlanet["destruyed"] == 0) {
                $parse['planetlist'] .= "\n<option ";
                if ($CurPlanet['id'] == $CurrentUser['current_planet']) {
                    $parse['planetlist'] .= "selected=\"selected\" ";
                }
                if ($CurPlanet['planet_type'] == 3) {
                    $parse['planetlist'] .= "class=\"moon\" value=\"?cp=" . $CurPlanet['id'] . "";
                    $parse['planetlist'] .= "&amp;mode=" . $_GET['mode'];
                    $parse['planetlist'] .= "&amp;re=0\">";
                    $parse['planetlist'] .= "" . $CurPlanet['name'];
                    $parse['planetlist'] .= "&nbsp;[" . $CurPlanet['galaxy'] . ":";
                    $parse['planetlist'] .= "" . $CurPlanet['system'] . ":";
                    $parse['planetlist'] .= "" . $CurPlanet['planet'];
                    $parse['planetlist'] .= "]&nbsp;&nbsp;</span></option>";
                } else {
                    $parse['planetlist'] .= "class=\"planet\" value=\"?cp=" . $CurPlanet['id'] . "";
                    $parse['planetlist'] .= "&amp;mode=" . $_GET['mode'];
                    $parse['planetlist'] .= "&amp;re=0\">";
                    $parse['planetlist'] .= "" . $CurPlanet['name'];
                    $parse['planetlist'] .= "&nbsp;[" . $CurPlanet['galaxy'] . ":";
                    $parse['planetlist'] .= "" . $CurPlanet['system'] . ":";
                    $parse['planetlist'] .= "" . $CurPlanet['planet'];
                    $parse['planetlist'] .= "]&nbsp;&nbsp;</option>";
                }
            }
        }
        $energy = pretty_number($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"]) . "/" . pretty_number($CurrentPlanet["energy_max"]);
        if ($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"] < 0) {
            $parse['energy'] = colorRed($energy);
        } else {
            $parse['energy'] = $energy;
        }
        $metal = pretty_number($CurrentPlanet["metal"]);
        if ($CurrentPlanet["metal"] > $CurrentPlanet["metal_max"]) {
            $parse['metal'] = colorRed($metal);
        } else {
            $parse['metal'] = $metal;
        }
        $crystal = pretty_number($CurrentPlanet["crystal"]);
        if ($CurrentPlanet["crystal"] > $CurrentPlanet["crystal_max"]) {
            $parse['crystal'] = colorRed($crystal);
        } else {
            $parse['crystal'] = $crystal;
        }
        $deuterium = pretty_number($CurrentPlanet["deuterium"]);
        if ($CurrentPlanet["deuterium"] > $CurrentPlanet["deuterium_max"]) {
            $parse['deuterium'] = colorRed($deuterium);
        } else {
            $parse['deuterium'] = $deuterium;
        }
        $tachyon = pretty_number($CurrentPlanet["tachyon"]);
        if ($CurrentPlanet["tachyon"] > $CurrentPlanet["tachyon_max"]) {
            $parse['tachyon'] = colorRed($tachyon);
        } else {
            $parse['tachyon'] = $tachyon;
        }
        if ($CurrentUser['new_message'] > 0) {
            $parse['message'] = "<a href=\"messages.php\">[ " . $CurrentUser['new_message'] . " ]</a>";
        } else {
            $parse['message'] = "0";
        }
        $rpg_points = pretty_number($CurrentUser["rpg_points"]);
        if ($CurrentPlanet["rpg_points"] > $CurrentPlanet["deuterium_max"]) {
            $parse['rpg_points'] = colorRed($rpg_points);
        } else {
            $parse['rpg_points'] = $rpg_points;
        }
        $TopBar = parsetemplate($NavigationTPL, $parse);
    } else {
        $TopBar = "";
    }
    return $TopBar;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:90,代码来源:ShowTopNavigationBar.php

示例13: ShowTopNavigationBar

function ShowTopNavigationBar($user, $planetrow)
{
    if (!is_array($user)) {
        return '';
    }
    global $time_now, $lang, $config, $sn_data;
    $GET_mode = sys_get_param_str('mode');
    $template = gettemplate('topnav', true);
    $planetrow = $planetrow ? $planetrow : $user['current_planet'];
    $planetrow = sys_o_get_updated($user, $planetrow, $time_now, true);
    $planetrow = $planetrow['planet'];
    $ThisUsersPlanets = SortUserPlanets($user);
    while ($CurPlanet = mysql_fetch_assoc($ThisUsersPlanets)) {
        if (!$CurPlanet['destruyed']) {
            $template->assign_block_vars('topnav_planets', array('ID' => $CurPlanet['id'], 'NAME' => $CurPlanet['name'], 'COORDS' => uni_render_coordinates($CurPlanet), 'SELECTED' => $CurPlanet['id'] == $user['current_planet'] ? ' selected' : ''));
        }
    }
    $day_of_week = $lang['weekdays'][date('w')];
    $day = date('d');
    $month = $lang['months'][date('m')];
    $year = date('Y');
    $hour = date('H');
    $min = date('i');
    $sec = date('s');
    // Количество флотов и экспедиций, а так же события флотов
    $fleet_flying_list = flt_get_fleets_flying($user);
    tpl_topnav_event_build($template, $fleet_flying_list[0]);
    tpl_topnav_event_build($template, $fleet_flying_list[MT_EXPLORE], 'expedition');
    // Подсчет кол-ва онлайн и кто онлайн
    $time = $time_now - 15 * 60;
    $online_count = doquery("SELECT COUNT(*) AS users_online FROM {{users}} WHERE `onlinetime`>'{$time}';", '', true);
    $template->assign_vars(array('TIME_NOW' => $time_now, 'DATE_TEXT' => "{$day_of_week}, {$day} {$month} {$year} {$lang['top_of_year']},", 'TIME_TEXT' => "{$hour}:{$min}:{$sec}", 'USERS_ONLINE' => $online_count['users_online'], 'USERS_TOTAL' => $config->users_amount, 'TOPNAV_CURRENT_PLANET' => $user['current_planet'], 'TOPNAV_MODE' => $GET_mode, 'TOPNAV_METAL' => round($planetrow["metal"], 2), 'TOPNAV_METAL_MAX' => round($planetrow["metal_max"]), 'TOPNAV_METAL_PERHOUR' => round($planetrow["metal_perhour"], 5), 'TOPNAV_METAL_TEXT' => pretty_number($planetrow["metal"], 2), 'TOPNAV_METAL_MAX_TEXT' => pretty_number($planetrow["metal_max"], 2, -$planetrow["metal"]), 'TOPNAV_CRYSTAL' => round($planetrow["crystal"], 2), 'TOPNAV_CRYSTAL_MAX' => round($planetrow["crystal_max"]), 'TOPNAV_CRYSTAL_PERHOUR' => round($planetrow["crystal_perhour"], 5), 'TOPNAV_CRYSTAL_TEXT' => pretty_number($planetrow["crystal"], 2), 'TOPNAV_CRYSTAL_MAX_TEXT' => pretty_number($planetrow["crystal_max"], 2, -$planetrow["crystal"]), 'TOPNAV_DEUTERIUM' => round($planetrow["deuterium"], 2), 'TOPNAV_DEUTERIUM_MAX' => round($planetrow["deuterium_max"]), 'TOPNAV_DEUTERIUM_PERHOUR' => round($planetrow["deuterium_perhour"], 5), 'TOPNAV_DEUTERIUM_TEXT' => pretty_number($planetrow["deuterium"], 2), 'TOPNAV_DEUTERIUM_MAX_TEXT' => pretty_number($planetrow["deuterium_max"], 2, -$planetrow["deuterium"]), 'TOPNAV_DARK_MATTER' => pretty_number($user[$sn_data[RES_DARK_MATTER]['name']]), 'ENERGY_BALANCE' => pretty_number($planetrow['energy_max'] - $planetrow['energy_used'], true, 0), 'ENERGY_MAX' => pretty_number($planetrow['energy_max']), 'TOPNAV_MESSAGES_ADMIN' => $user['msg_admin'], 'TOPNAV_MESSAGES_PLAYER' => $user['mnl_joueur'], 'TOPNAV_MESSAGES_ALLIANCE' => $user['mnl_alliance'], 'TOPNAV_MESSAGES_ALL' => $user['new_message'], 'TOPNAV_FLEETS_FLYING' => count($fleet_flying_list[0]), 'TOPNAV_FLEETS_TOTAL' => GetMaxFleets($user), 'TOPNAV_EXPEDITIONS_FLYING' => count($fleet_flying_list[MT_EXPLORE]), 'TOPNAV_EXPEDITIONS_TOTAL' => GetMaxExpeditions($user), 'TOPNAV_QUEST_COMPLETE' => get_quest_amount_complete($user['id'])));
    return $template;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:34,代码来源:template.php

示例14: ShowTopNavigationBar

function ShowTopNavigationBar($CurrentUser, $CurrentPlanet)
{
    global $lang, $game_config, $dpath;
    if ($CurrentUser['urlaubs_modus'] == 0) {
        PlanetResourceUpdate($CurrentUser, $CurrentPlanet, time());
    } else {
        doquery("UPDATE {{table}} SET `deuterium_sintetizer_porcent` = 0, `metal_mine_porcent` = 0, `crystal_mine_porcent` = 0 WHERE id_owner = " . $CurrentUser['id'], "planets");
    }
    $parse = $lang;
    $parse['dpath'] = $dpath;
    $parse['image'] = $CurrentPlanet['image'];
    $parse['show_umod_notice'] = $CurrentUser['urlaubs_modus'] ? '<table width="100%" style="border: 3px solid red; text-align:center;"><tr><td>' . $lang['tn_vacation_mode'] . date('d.m.Y h:i:s', $CurrentUser['urlaubs_until']) . '</td></tr></table>' : '';
    $parse['show_umod_notice'] = $CurrentUser['db_deaktjava'] ? '<table width="100%" style="border: 3px solid red; text-align:center;"><tr><td>' . $lang['tn_delete_mode'] . date('d.m.Y h:i:s', $CurrentUser['db_deaktjava'] + 60 * 60 * 24 * 7) . '</td></tr></table>' : '';
    $parse['planetlist'] = '';
    $ThisUsersPlanets = SortUserPlanets($CurrentUser);
    while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
        if ($CurPlanet["destruyed"] == 0) {
            $parse['planetlist'] .= "\n<option ";
            if ($CurPlanet['id'] == $CurrentUser['current_planet']) {
                $parse['planetlist'] .= "selected=\"selected\" ";
            }
            $parse['planetlist'] .= "value=\"game.php?page={$_GET['page']}&gid={$_GET['gid']}&cp=" . $CurPlanet['id'] . "";
            $parse['planetlist'] .= "&amp;mode=" . $_GET['mode'];
            $parse['planetlist'] .= "&amp;re=0\">";
            if ($CurPlanet['planet_type'] != 3) {
                $parse['planetlist'] .= "" . $CurPlanet['name'];
            } else {
                $parse['planetlist'] .= "" . $CurPlanet['name'] . " (" . $lang['fcm_moon'] . ")";
            }
            $parse['planetlist'] .= "&nbsp;[" . $CurPlanet['galaxy'] . ":";
            $parse['planetlist'] .= "" . $CurPlanet['system'] . ":";
            $parse['planetlist'] .= "" . $CurPlanet['planet'];
            $parse['planetlist'] .= "]&nbsp;&nbsp;</option>";
        }
    }
    $energy = pretty_number($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"]) . "/" . pretty_number($CurrentPlanet["energy_max"]);
    // Energie
    if ($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"] < 0) {
        $parse['energy'] = colorRed($energy);
    } else {
        $parse['energy'] = $energy;
    }
    // Metal
    $metal = pretty_number($CurrentPlanet["metal"]);
    if ($CurrentPlanet["metal"] >= $CurrentPlanet["metal_max"]) {
        $parse['metal'] = colorRed($metal);
    } else {
        $parse['metal'] = $metal;
    }
    // Cristal
    $crystal = pretty_number($CurrentPlanet["crystal"]);
    if ($CurrentPlanet["crystal"] >= $CurrentPlanet["crystal_max"]) {
        $parse['crystal'] = colorRed($crystal);
    } else {
        $parse['crystal'] = $crystal;
    }
    // Deuterium
    $deuterium = pretty_number($CurrentPlanet["deuterium"]);
    if ($CurrentPlanet["deuterium"] >= $CurrentPlanet["deuterium_max"]) {
        $parse['deuterium'] = colorRed($deuterium);
    } else {
        $parse['deuterium'] = $deuterium;
    }
    $parse['darkmatter'] = pretty_number($CurrentUser["darkmatter"]);
    $parse['metal_max'] .= pretty_number($CurrentPlanet["metal_max"] / 1);
    $parse['crystal_max'] .= pretty_number($CurrentPlanet["crystal_max"] / 1);
    $parse['deuterium_max'] .= pretty_number($CurrentPlanet["deuterium_max"] / 1);
    $parse['metal_perhour'] .= $CurrentPlanet["metal_perhour"] + $game_config['metal_basic_income'] * $game_config['resource_multiplier'];
    $parse['crystal_perhour'] .= $CurrentPlanet["crystal_perhour"] + $game_config['crystal_basic_income'] * $game_config['resource_multiplier'];
    $parse['deuterium_perhour'] .= $CurrentPlanet["deuterium_perhour"] + $game_config['deuterium_basic_income'] * $game_config['resource_multiplier'];
    $parse['metalh'] .= round($CurrentPlanet["metal"]);
    $parse['crystalh'] .= round($CurrentPlanet["crystal"]);
    $parse['deuteriumh'] .= round($CurrentPlanet["deuterium"]);
    $parse['metal_mmax'] .= $CurrentPlanet["metal_max"] * MAX_OVERFLOW;
    $parse['crystal_mmax'] .= $CurrentPlanet["crystal_max"] * MAX_OVERFLOW;
    $parse['deuterium_mmax'] .= $CurrentPlanet["deuterium_max"] * MAX_OVERFLOW;
    $TopBar = parsetemplate(gettemplate('topnav'), $parse);
    return $TopBar;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:79,代码来源:ShowTopNavigationBar.php

示例15: ShowTopNavigationBar


//.........这里部分代码省略.........
            $parse['2be_bd'] = " <u>" . $lang['menu']['500'] . "</u>";
        }
        if ($game_config['decl'] == 1) {
            $parse['3be_ba'] = "<a href=\"add_declare.php\" target=\"_self\">                   " . $lang['menu']['209'] . "</a>";
        } else {
            $parse['3be_ba'] = " <u>" . $lang['menu']['500'] . "</u>";
        }
        if ($game_config['rule'] == 1) {
            $parse['3be_bb'] = "<a href=\"rules.html\" target=\"_self\">                         " . $lang['menu']['210'] . "</a>";
        } else {
            $parse['3be_bb'] = " <u>" . $lang['menu']['500'] . "</u>";
        }
        if ($game_config['conn'] == 1) {
            $parse['3be_bc'] = "<a href=\"contact.php\" target=\"_self\">                       " . $lang['menu']['211'] . "</a>";
        } else {
            $parse['3be_bc'] = " <u>" . $lang['menu']['500'] . "</u>";
        }
        if ($game_config['supp'] == 1) {
            $parse['3be_bd'] = "<a href=\"support.php\" target=\"_self\">                       " . $lang['menu']['212'] . "</a>";
        } else {
            $parse['3be_bd'] = " <u>" . $lang['menu']['500'] . "</u>";
        }
        if ($game_config['bann'] == 1) {
            $parse['4be_ba'] = "<a href=\"banned.php\" target=\"_self\">                        " . $lang['menu']['213'] . "</a>";
        } else {
            $parse['4be_ba'] = " <u>" . $lang['menu']['500'] . "</u>";
        }
        if ($game_config['opti'] == 1) {
            $parse['4be_bb'] = "<a href=\"options.php\" target=\"_self\">                       " . $lang['menu']['214'] . "</a>";
        } else {
            $parse['4be_bb'] = " <u>" . $lang['menu']['500'] . "</u>";
        }
        $parse['planetlist'] = '';
        $ThisUsersPlanets = SortUserPlanets($CurrentUser);
        while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
            if ($CurPlanet["destruyed"] == 0) {
                $parse['planetlist'] .= "\n<option ";
                if ($CurPlanet['id'] == $CurrentUser['current_planet']) {
                    $parse['planetlist'] .= "selected=\"selected\" ";
                }
                $parse['planetlist'] .= "value=\"?cp=" . $CurPlanet['id'] . "";
                $parse['planetlist'] .= "&amp;mode=" . $_GET['mode'];
                $parse['planetlist'] .= "&amp;re=0\">";
                $parse['planetlist'] .= "&nbsp;[" . $CurPlanet['galaxy'] . ":";
                $parse['planetlist'] .= "" . $CurPlanet['system'] . ":";
                $parse['planetlist'] .= "" . $CurPlanet['planet'];
                $parse['planetlist'] .= "]&nbsp;&nbsp;</option>";
            }
        }
        $parse['planet_name'] = "" . $CurrentPlanet['name'];
        $energy = pretty_number($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"]) . "/" . pretty_number($CurrentPlanet["energy_max"]);
        if ($CurrentPlanet["energy_max"] + $CurrentPlanet["energy_used"] < 0) {
            $parse['energy'] = colorRed($energy);
        } else {
            $parse['energy'] = $energy;
        }
        $metal = pretty_number($CurrentPlanet["metal"]);
        if ($CurrentPlanet["metal"] > $CurrentPlanet["metal_max"]) {
            $parse['metal'] = colorRed($metal);
        } else {
            $parse['metal'] = $metal;
        }
        $crystal = pretty_number($CurrentPlanet["crystal"]);
        if ($CurrentPlanet["crystal"] > $CurrentPlanet["crystal_max"]) {
            $parse['crystal'] = colorRed($crystal);
        } else {
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowTopNavigationBar.php


注:本文中的SortUserPlanets函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。