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


PHP colorRed函数代码示例

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


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

示例1: ShowModVersionPage

function ShowModVersionPage()
{
    global $LNG, $USER;
    $MVC = array();
    $Files = scandir(ROOT_PATH . 'includes/functions/mvc/');
    foreach ($Files as $File) {
        if (substr($File, 0, 4) == 'mvc_') {
            require ROOT_PATH . 'includes/functions/mvc/' . $File;
        }
    }
    foreach ($MVC as &$Mod) {
        $Mod['description'] = $Mod['description'][$USER['lang']];
        $Update = @simplexml_load_file($Mod['update']);
        $Update = $Update->{$Mod}['tag'];
        if (version_compare($Mod['version'], $Update->version, '<')) {
            $Mod['update'] = colorRed($LNG['mvc_update_yes']);
            $Mod['udetails'] = array('version' => $Update->version, 'date' => $Update->date, 'download' => $Update->download, 'announcement' => $Update->announcement);
        } else {
            $Mod['update'] = colorGreen($LNG['mvc_update_no']);
            $Mod['udetails'] = false;
        }
    }
    $template = new template();
    $template->assign_vars(array('MVC' => $MVC, 'mvc_title' => $LNG['mvc_title'], 'mvc_author' => $LNG['mvc_author'], 'mvc_version' => $LNG['mvc_version'], 'mvc_link' => $LNG['mvc_link'], 'mvc_update_version' => $LNG['mvc_update_version'], 'mvc_update_date' => $LNG['mvc_update_date'], 'mvc_announcement' => $LNG['mvc_announcement'], 'mvc_download' => $LNG['mvc_download'], 'mvc_desc' => $LNG['mvc_desc']));
    $template->show('adm/ModVersionPage.tpl');
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:26,代码来源:ShowModVersionPage.php

示例2: colorNumber

function colorNumber($n, $s = '')
{
    if ($n > 0) {
        if ($s != '') {
            $s = colorGreen($s);
        } else {
            $s = colorGreen($n);
        }
    } elseif ($n < 0) {
        if ($s != '') {
            $s = colorRed($s);
        } else {
            $s = colorRed($n);
        }
    } else {
        if ($s != '') {
            $s = $s;
        } else {
            $s = $n;
        }
    }
    return $s;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:23,代码来源:strings.php

示例3: colorNumber

function colorNumber($n, $s = '')
{
    if ($n > 0) {
        return empty($s) ? colorGreen($n) : colorGreen($s);
    } elseif ($n < 0) {
        return empty($s) ? colorRed($n) : colorRed($s);
    } else {
        return empty($s) ? $n : $s;
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:10,代码来源:GeneralFunctions.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);
        }
        // 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

示例5: 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

示例6: 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

示例7: ShowSearchAdmin


//.........这里部分代码省略.........
                                ++$count_query;
                            }
                        }
                        $QryUpdateOficer .= "WHERE ";
                        $QryUpdateOficer .= "`id` = '" . $id . "' ";
                        $count_query != 0 ? $db->query($QryUpdateOficer, "planets") : "";
                        $displays->message($lang['ad_sucess'], "admin.php?page=search&mode=oficers&search=" . $id . "", 2);
                    } else {
                        $displays->message($lang['ad_numeric'], "admin.php?page=search&mode=oficers&search=" . $id . "", 1);
                    }
                }
                break;
            case 'planets':
                $SelPlanet = $db->query("SELECT * FROM {{table}} WHERE `id` = '" . $id . "';", 'planets', true);
                $SelColos = $db->query("SELECT * FROM {{table}} WHERE `id_owner` = '" . $SelPlanet['id_owner'] . "' ORDER BY `galaxy`, `system`, `planet` ASC;", 'planets');
                while ($u = mysql_fetch_array($SelColos)) {
                    $displays->newblock("lista_colos_planets");
                    $i++;
                    foreach ($u as $key => $value) {
                        $displays->assign($key, $value);
                    }
                }
                $mode = $_POST['edit'];
                $lang['id'] = $id;
                $lang['name'] = $SelPlanet['name'];
                $lang['diameter'] = pretty_number($SelPlanet['diameter']);
                $lang['field_max'] = pretty_number($SelPlanet['field_max']);
                $lang['galaxy'] = $SelPlanet['galaxy'];
                $lang['system'] = $SelPlanet['system'];
                $lang['planet'] = $SelPlanet['planet'];
                $lang['temp_min'] = $SelPlanet['temp_min'];
                $lang['temp_max'] = $SelPlanet['temp_max'];
                if ($SelPlanet['b_building_id'] == 0) {
                    $lang['b_building_id'] = colorRed($lang['ad_empty']);
                } else {
                    $lang['b_building_id'] = $SelPlanet['b_building_id'];
                }
                if ($SelPlanet['b_hangar_id'] == "") {
                    $lang['b_hangar_id'] = colorRed($lang['ad_empty']);
                } else {
                    $lang['b_hangar_id'] = $SelPlanet['b_hangar_id'];
                }
                $mode = $_POST['edit'];
                if ($mode == 'addit') {
                    $name = $_POST['name'];
                    $change_id = $_POST['change_id'];
                    $diameter = $_POST['diameter'];
                    $fields = $_POST['fields'];
                    $galaxy = $_POST['g'];
                    $system = $_POST['s'];
                    $planet = $_POST['p'];
                    $t_min = $_POST['temp_min'];
                    $t_max = $_POST['temp_max'];
                    $buildings = $_POST['0_buildings'];
                    $ships = $_POST['0_ships'];
                    $defenses = $_POST['0_defenses'];
                    $c_hangar = $_POST['0_c_hangar'];
                    $c_buildings = $_POST['0_c_buildings'];
                    $change_pos = $_POST['change_position'];
                    $delete = $_POST['delete'];
                    $accion = $_POST['accion'];
                    if ($delete != 'on') {
                        if ($name != NULL) {
                            $QryUpdatePlanet = "UPDATE {{table}} SET ";
                            $QryUpdatePlanet .= "`name` =  '" . $name . "' ";
                            $QryUpdatePlanet .= "WHERE ";
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowSearchAdmin.php

示例8: ShowTopNavigationBar

 private function ShowTopNavigationBar($CurrentUser, $CurrentPlanet)
 {
     global $dpath, $svn_root, $lang;
     $this->gotoBlock("topnav");
     if ($CurrentUser['urlaubs_modus'] == 0 && isset($CurrentUser['urlaubs_modus'])) {
         PlanetResourceUpdate($CurrentUser, $CurrentPlanet, time());
     } else {
         $this->db->query("UPDATE {{table}} SET `deuterium_sintetizer_porcent` = 0, `metal_mine_porcent` = 0, `crystal_mine_porcent` = 0 WHERE id_owner = " . $CurrentUser['id'], "planets");
     }
     $ThisUsersPlanets = SortUserPlanets($CurrentUser);
     while ($CurPlanet = mysql_fetch_array($ThisUsersPlanets)) {
         if ($CurPlanet["destruyed"] == 0) {
             if ($CurPlanet['planet_type'] != 3) {
                 $this->newblock('planetlist');
             } else {
                 $this->newblock('moonlist');
             }
             if ($CurPlanet['id'] == $CurrentUser['current_planet']) {
                 $CurPlanet['select'] = "selected=\"selected\" ";
             }
             $CurPlanet['page_topnav'] = $_GET['page'];
             $CurPlanet['gid_topnav'] = $_GET['gid'];
             $CurPlanet['mode_topnav'] = $_GET['mode'];
             foreach ($CurPlanet as $name => $trans) {
                 $this->assign($name, $trans);
             }
             unset($CurPlanet);
         } else {
             if ($CurPlanet["destruyed"] < time()) {
                 $db->query("DELETE FROM `{{table}}` WHERE `id` = '{$CurPlanet['id']}'", "planets");
             }
         }
         //FIN FIX ABANDONO
     }
     $this->gotoBlock("_ROOT");
     $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>' : '';
     $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;
     }
     if ($CurrentUser["activate_status"] == 0) {
         $parse["show_umod_notice"] = '<table width="100%" style="border: 3px solid red;position:relative; text-align:center;z-index:10000"><tr><td>Debes activar tu cuenta si quieres seguir jugando. <a href="' . $svn_root . 'game.php?page=options&mode=activar">Activar tu Cuenta</a></td></tr></table>';
     }
     $parse['darkmatter'] = pretty_number($CurrentUser["darkmatter"]);
     foreach ($parse as $name => $trans) {
         $this->assign($name, $trans);
     }
     unset($parse);
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:74,代码来源:displays.php

示例9: echo_topnav

function echo_topnav()
{
    global $user, $planetrow, $galaxyrow, $mode, $messageziel, $gid, $lang;
    if (!$user) {
        return;
    }
    //if(!$planetrow){ $planetrow = doquery("SELECT * FROM {{table}} WHERE id ={$user['current_planet']}","planets",true);}
    //if(!$planetrow) $planetrow = (array)LWCore::getPlanet();
    //if($planetrow['galaxy'] == 3 && $planetrow['system'] == 139) echo print_r($planetrow, true).'<br /><br />';
    calculate_resources_planet($planetrow);
    //Actualizacion de rutina
    //if(!$galaxyrow){ $galaxyrow = doquery("SELECT * FROM {{table}} WHERE id_planet = '".$planetrow["id"]."'","galaxy",true);}
    $dpath = !$user["dpath"] ? DEFAULT_SKINPATH : $user["dpath"];
    //-[Arrays]------------------------------------------------
    $parse = $lang;
    $parse['dpath'] = $dpath;
    $parse['image'] = $planetrow['image'];
    /*
      pequeño loop para agregar todos los planetas disponibles del mismo jugador...
    */
    $parse['planetlist'] = '';
    //pedimos todos los planetas que coincidan con el id del due�.
    $planets_list = doquery("SELECT id,name,galaxy,system,planet FROM {{table}} WHERE id_owner='{$user['id']}' ORDER BY sortID ASC", "planets");
    while ($p = mysql_fetch_array($planets_list)) {
        /*
          Cuando alguien selecciona destruir planeta, hay un tiempo en el que se vacia el slot
          del planeta, es mas que nada para dar tiempo a posible problema de hackeo o robo de cuenta.
        */
        if ($p["destruyed"] == 0) {
            //$pos_galaxy = doquery("SELECT * FROM {{table}} WHERE id_planet = {$p[id]}","galaxy",true);
            $parse['planetlist'] .= "<option ";
            if ($p["id"] == $user["current_planet"]) {
                $parse['planetlist'] .= 'selected="selected" ';
            }
            //Se selecciona el planeta actual
            $parse['planetlist'] .= 'value="?cp=' . $p['id'];
            if (isset($_GET['mode'])) {
                $parse['planetlist'] .= '&amp;mode=' . $_GET['mode'];
            }
            if (isset($_GET['gid'])) {
                $parse['planetlist'] .= '&amp;gid=' . $_GET['gid'];
            }
            if (isset($_GET['messageziel'])) {
                $parse['planetlist'] .= '&amp;messageziel=' . $_GET['messageziel'];
            }
            $parse['planetlist'] .= '&amp;re=0">';
            //Nombre [galaxy:system:planet]
            $parse['planetlist'] .= "{$p['name']} [{$p['galaxy']}:{$p['system']}:{$p['planet']}]</option>";
        }
    }
    /*
      Muestra los recursos, e indica si estos sobrepasan la capacidad de los almacenes
    */
    $resourceProducer = LWCore::getPlanet()->getProductionHandler()->getProductorObject('resource');
    $energyProd = $resourceProducer->getProduction('energy');
    $energy = pretty_number(($energyProd[1] - $energyProd[0]) * -3600) . "/" . pretty_number($energyProd[0] * 3600);
    //energy
    if ($energyProd[1] > $energyProd[0]) {
        $parse['energy'] = colorRed($energy);
    } else {
        $parse['energy'] = $energy;
    }
    //metal
    $metal = pretty_number(LWCore::getPlanet()->metal);
    $red = false;
    if ($resourceProducer->getProduction('metal') < 0) {
        if (LWCore::getPlanet()->metal < $resourceProducer->getSignificantLimit('metal')) {
            $red = true;
        }
    } else {
        if (LWCore::getPlanet()->metal > $resourceProducer->getSignificantLimit('metal')) {
            $red = true;
        }
    }
    if ($red) {
        $parse['metal'] = colorRed($metal);
    } else {
        $parse['metal'] = $metal;
    }
    //cristal
    $crystal = pretty_number(LWCore::getPlanet()->crystal);
    $red = false;
    if ($resourceProducer->getProduction('crystal') < 0) {
        if (LWCore::getPlanet()->crystal < $resourceProducer->getSignificantLimit('crystal')) {
            $red = true;
        }
    } else {
        if (LWCore::getPlanet()->crystal > $resourceProducer->getSignificantLimit('crystal')) {
            $red = true;
        }
    }
    if ($red) {
        $parse['crystal'] = colorRed($crystal);
    } else {
        $parse['crystal'] = $crystal;
    }
    //deuterium
    $deuterium = pretty_number(LWCore::getPlanet()->deuterium);
    $red = false;
    if ($resourceProducer->getProduction('deuterium') < 0) {
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:functions.php

示例10: 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

示例11: header

    header("Location: login.php");
}
if ($user['authlevel'] != "3" && $user['authlevel'] != "1") {
    header("Location: ../login.php");
}
$dpath = !$user["dpath"] ? DEFAULT_SKINPATH : $user["dpath"];
includeLang('overview');
$parse = $lang;
$parse['dpath'] = $dpath;
$parse['mf'] = $mf;
//
// Obtenemos la ultima version,  pidiendo un pequeño archivo.
//
$parse['version'] = @file_get_contents('http://ugamela.sourceforge.net/lastversion.php?v=' . VERSION);
if ($parse['version'] != VERSION) {
    $parse['VERSION'] = colorRed(VERSION);
} else {
    $parse['VERSION'] = colorGreen(VERSION);
}
//
// Lista de usuarios conectados.
//
$query = doquery("SELECT * FROM {{table}} WHERE onlinetime>='" . (time() - 15 * 60) . "'", 'users');
$i = 0;
while ($u = mysql_fetch_array($query)) {
    $parse['online_list'] .= "<tr><td class=b>" . '<a href="../messages.php?mode=write&id=' . $u['id'] . '"><img src="' . $dpath . 'img/m.gif" alt="Escribir mensaje" title="Escribir mensaje" border="0"></a> ' . "<a href=\"\">{$u['username']}</a> " . "<a style=\"color:#7f7f7f;\" href=\"http://network-tools.com/default.asp?prog=trace&host={$u['user_lastip']}\">[{$u['user_lastip']}]</a></td>" . "<td class=b>{$u['ally_name']}</td>" . "<td class=m>" . pretty_number($u['points_points'] / 1000) . "</td>" . "<td class=b>" . pretty_time(time() - $u['onlinetime']) . "</td></tr>";
    $i++;
}
$parse['online_list'] .= "<tr><th class=b colspan=4>Hay {$i} usuario(s) en linea.</th></tr>";
display(parsetemplate(gettemplate('admin/overview_body'), $parse), "Overview", true);
// Created by Perberos. All rights reversed (C) 2006
开发者ID:sonicmaster,项目名称:RPG,代码行数:31,代码来源:overview.php

示例12: topnav

 private function topnav()
 {
     global $PLANET, $LNG, $USER, $CONF;
     $this->phpself = "?page=" . request_var('page', '') . "&amp;mode=" . request_var('mode', '');
     $this->loadscript("topnav.js");
     if (empty($this->UserPlanets)) {
         $this->getplanets();
     }
     foreach ($this->UserPlanets as $CurPlanetID => $CurPlanet) {
         $SelectorVaules[] = $this->phpself . "&amp;cp=" . $CurPlanet['id'];
         $SelectorNames[] = $CurPlanet['name'] . ($CurPlanet['planet_type'] == 3 ? " (" . $LNG['fcm_moon'] . ")" : "") . "&nbsp;[" . $CurPlanet['galaxy'] . ":" . $CurPlanet['system'] . ":" . $CurPlanet['planet'] . "]&nbsp;&nbsp;";
     }
     if ($USER['urlaubs_modus'] == 1) {
         $CONF['metal_basic_income'] = 0;
         $CONF['crystal_basic_income'] = 0;
         $CONF['deuterium_basic_income'] = 0;
     }
     $this->assign_vars(array('topnav' => true, 'metal' => $PLANET['metal'], 'crystal' => $PLANET['crystal'], 'deuterium' => $PLANET['deuterium'], 'energy' => $PLANET["energy_max"] + $PLANET["energy_used"] < 0 ? colorRed(pretty_number($PLANET["energy_max"] + $PLANET["energy_used"]) . "/" . pretty_number($PLANET["energy_max"])) : pretty_number($PLANET["energy_max"] + $PLANET["energy_used"]) . "/" . pretty_number($PLANET["energy_max"]), 'darkmatter' => pretty_number($USER["darkmatter"]), 'metal_max' => shortly_number($PLANET["metal_max"]), 'crystal_max' => shortly_number($PLANET["crystal_max"]), 'deuterium_max' => shortly_number($PLANET["deuterium_max"]), 'alt_metal_max' => pretty_number($PLANET["metal_max"]), 'alt_crystal_max' => pretty_number($PLANET["crystal_max"]), 'alt_deuterium_max' => pretty_number($PLANET["deuterium_max"]), 'js_metal_max' => floattostring($PLANET["metal_max"]), 'js_crystal_max' => floattostring($PLANET["crystal_max"]), 'js_deuterium_max' => floattostring($PLANET["deuterium_max"]), 'js_metal_hr' => floattostring($PLANET['metal_perhour'] + $CONF['metal_basic_income'] * $CONF['resource_multiplier']), 'js_crystal_hr' => floattostring($PLANET['crystal_perhour'] + $CONF['crystal_basic_income'] * $CONF['resource_multiplier']), 'js_deuterium_hr' => floattostring($PLANET['deuterium_perhour'] + $CONF['deuterium_basic_income'] * $CONF['resource_multiplier']), 'current_panet' => $this->phpself . "&amp;cp=" . $_SESSION['planet'], 'tn_vacation_mode' => $LNG['tn_vacation_mode'], 'closed' => !$CONF['game_disable'] ? $LNG['ov_closed'] : false, 'vacation' => $USER['urlaubs_modus'] ? date('d.m.Y H:i:s', $USER['urlaubs_until']) : false, 'delete' => $USER['db_deaktjava'] ? sprintf($LNG['tn_delete_mode'], date('d. M Y\\, H:i:s', strtotime("+7 day", $USER['db_deaktjava']))) : false, 'image' => $PLANET['image'], 'settings_tnstor' => $USER['settings_tnstor'], 'SelectorVaules' => $SelectorVaules, 'SelectorNames' => $SelectorNames, 'Metal' => $LNG['Metal'], 'Crystal' => $LNG['Crystal'], 'Deuterium' => $LNG['Deuterium'], 'Darkmatter' => $LNG['Darkmatter'], 'Energy' => $LNG['Energy']));
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:19,代码来源:class.template.php

示例13: brightnessL

    echo brightnessL($d, $imageHash);
}
if ($filterId == 5) {
    echo brightnessM($d, $imageHash);
}
if ($filterId == 6) {
    echo colorBlue($d, $imageHash);
}
if ($filterId == 7) {
    echo colorGreen($d, $imageHash);
}
if ($filterId == 8) {
    echo colorPink($d, $imageHash);
}
if ($filterId == 9) {
    echo colorRed($d, $imageHash);
}
if ($filterId == 10) {
    echo colorYellow($d, $imageHash);
}
if ($filterId == 11) {
    echo contrastH($d, $imageHash);
}
if ($filterId == 12) {
    echo contrastL($d, $imageHash);
}
if ($filterId == 13) {
    echo edgeD($d, $imageHash);
}
if ($filterId == 14) {
    echo gBlur($d, $imageHash);
开发者ID:sedatgoc,项目名称:php-jquery-photo-filter,代码行数:31,代码来源:filter.php

示例14: 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

示例15: echo_topnav

function echo_topnav()
{
    global $user, $planetrow, $galaxyrow, $mode, $messageziel, $gid, $lang;
    if (!$user) {
        return;
    }
    if (!$planetrow) {
        $planetrow = doquery("SELECT * FROM {{table}} WHERE id ={$user['current_planet']}", "planets", true);
    }
    calculate_resources_planet($planetrow);
    //Actualizacion de rutina
    //if(!$galaxyrow){ $galaxyrow = doquery("SELECT * FROM {{table}} WHERE id_planet = '".$planetrow["id"]."'","galaxy",true);}
    $dpath = !$user["dpath"] ? DEFAULT_SKINPATH : $user["dpath"];
    //-[Arrays]------------------------------------------------
    $parse = $lang;
    $parse['dpath'] = $dpath;
    $parse['image'] = $planetrow['image'];
    /*
      pequeño loop para agregar todos los planetas disponibles del mismo jugador...
    */
    ?>
<script language="JavaScript" src="scripts/flotten.js"></script>
<script language="JavaScript" src="scripts/ocnt.js"></script>
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/thickbox.js"></script>
<link rel="stylesheet" href="scripts/thickbox.css" type="text/css" media="screen" />
<?php 
    $parse['planetlist'] = '';
    //pedimos todos los planetas que coincidan con el id del due�.
    $planets_list = doquery("SELECT id,name,galaxy,system,planet FROM {{table}} WHERE id_owner='{$user['id']}'", "planets");
    while ($p = mysql_fetch_array($planets_list)) {
        /*
          Cuando alguien selecciona destruir planeta, hay un tiempo en el que se vacia el slot
          del planeta, es mas que nada para dar tiempo a posible problema de hackeo o robo de cuenta.
        */
        if ($p["destruyed"] == 0) {
            //$pos_galaxy = doquery("SELECT * FROM {{table}} WHERE id_planet = {$p[id]}","galaxy",true);
            $parse['planetlist'] .= "<option ";
            if ($p["id"] == $user["current_planet"]) {
                $parse['planetlist'] .= 'selected="selected" ';
            }
            //Se selecciona el planeta actual
            $parse['planetlist'] .= "value=\"?cp={$p['id']}&amp;mode={$mode}&amp;gid={$gid}&amp;messageziel={$messageziel}&amp;re=0\">";
            //Nombre [galaxy:system:planet]
            $parse['planetlist'] .= "{$p['name']} [{$p['galaxy']}:{$p['system']}:{$p['planet']}]</option>";
        }
    }
    /* 
      Muestra los recursos, e indica si estos sobrepasan la capacidad de los almacenes
    */
    $energy = pretty_number($planetrow["energy_max"] - $planetrow["energy_used"]) . "/" . pretty_number($planetrow["energy_max"]);
    //energy
    if ($planetrow["energy_max"] - $planetrow["energy_used"] < 0) {
        $parse['energy'] = colorRed($energy);
    } else {
        $parse['energy'] = $energy;
    }
    //metal
    $metal = pretty_number($planetrow["metal"]);
    if ($planetrow["metal"] > $planetrow["metal_max"]) {
        $parse['metal'] = colorRed($metal);
    } else {
        $parse['metal'] = $metal;
    }
    //cristal
    $crystal = pretty_number($planetrow["crystal"]);
    if ($planetrow["crystal"] > $planetrow["crystal_max"]) {
        $parse['crystal'] = colorRed($crystal);
    } else {
        $parse['crystal'] = $crystal;
    }
    //deuterium
    $deuterium = pretty_number($planetrow["deuterium"]);
    if ($planetrow["deuterium"] > $planetrow["deuterium_max"]) {
        $parse['deuterium'] = colorNumber($deuterium);
    } else {
        $parse['deuterium'] = $deuterium;
    }
    //esto es un hecho!
    echo parsetemplate(gettemplate('topnav'), $parse);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:81,代码来源:functions.php


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