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


PHP InsertBuildListScript函数代码示例

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


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

示例1: __construct


//.........这里部分代码省略.........
         if ($_GET['r'] == 'overview') {
             header('location:game.php?page=overview');
         } else {
             header("Location: game.php?page=buildings&mode=buildings");
         }
     }
     SetNextQueueElementOnTop($CurrentPlanet, $CurrentUser);
     // $Queue = $this->ShowBuildingQueue($CurrentPlanet, $CurrentUser); // OLD CODE
     // START FIX BY JSTAR
     $Sprice = array();
     $Queue = $this->ShowBuildingQueue($CurrentPlanet, $CurrentUser, $Sprice);
     // END FIX BY JSTAR
     $this->BuildingSavePlanetRecord($CurrentPlanet);
     if ($Queue['lenght'] < MAX_BUILDING_QUEUE_SIZE) {
         $CanBuildElement = true;
     } else {
         $CanBuildElement = false;
     }
     $BuildingPage = "";
     $zaehler = 1;
     foreach ($lang['tech'] as $Element => $ElementName) {
         if (in_array($Element, $Allowed[$CurrentPlanet['planet_type']])) {
             $CurrentMaxFields = CalculateMaxPlanetFields($CurrentPlanet);
             if ($CurrentPlanet["field_current"] < $CurrentMaxFields - $Queue['lenght']) {
                 $RoomIsOk = true;
             } else {
                 $RoomIsOk = false;
             }
             if (IsTechnologieAccessible($CurrentUser, $CurrentPlanet, $Element)) {
                 $HaveRessources = IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, true, false);
                 $parse = array();
                 $parse = $lang;
                 $parse['dpath'] = $dpath;
                 $parse['i'] = $Element;
                 $BuildingLevel = $CurrentPlanet[$resource[$Element]];
                 $parse['nivel'] = $BuildingLevel == 0 ? "" : " (" . $lang['bd_lvl'] . " " . $BuildingLevel . ")";
                 $parse['n'] = $ElementName;
                 $parse['descriptions'] = $lang['res']['descriptions'][$Element];
                 /* OLD CODE ---------------------------------------------------- OLD CODE ------------------------------------- //
                 					$ElementBuildTime      	= GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
                 					$parse['time']         	= ShowBuildTime($ElementBuildTime);
                 					$parse['price']        	= GetElementPrice($CurrentUser, $CurrentPlanet, $Element);
                    OLD CODE ---------------------------------------------------- OLD CODE ------------------------------------- //
                 */
                 // START FIX BY JSTAR
                 $really_lvl = isset($Sprice[$Element]) ? $Sprice[$Element] : $BuildingLevel;
                 $ElementBuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element, $really_lvl);
                 $parse['price'] = GetElementPrice($CurrentUser, $CurrentPlanet, $Element, true, $really_lvl);
                 $parse['time'] = ShowBuildTime($ElementBuildTime);
                 // END FIX BY JSTAR
                 $parse['click'] = '';
                 $NextBuildLevel = $CurrentPlanet[$resource[$Element]] + 1;
                 if ($RoomIsOk && $CanBuildElement) {
                     if ($Queue['lenght'] == 0) {
                         if ($NextBuildLevel == 1) {
                             if ($HaveRessources == true) {
                                 $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_build'] . "</font></a>";
                             } else {
                                 $parse['click'] = "<font color=#FF0000>" . $lang['bd_build'] . "</font>";
                             }
                         } else {
                             if ($HaveRessources == true) {
                                 $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font></a>";
                             } else {
                                 $parse['click'] = "<font color=#FF0000>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font>";
                             }
                         }
                     } else {
                         $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_add_to_list'] . "</font></a>";
                     }
                 } elseif ($RoomIsOk && !$CanBuildElement) {
                     if ($NextBuildLevel == 1) {
                         $parse['click'] = "<font color=#FF0000>" . $lang['bd_build'] . "</font>";
                     } else {
                         $parse['click'] = "<font color=#FF0000>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font>";
                     }
                 } else {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_no_more_fields'] . "</font>";
                 }
                 if ($Element == 31 && $CurrentUser["b_tech_planet"] != 0) {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_working'] . "</font>";
                 }
                 if (($Element == 21 or $Element == 14 or $Element == 15) && $CurrentPlanet["b_hangar"] != 0) {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_working'] . "</font>";
                 }
                 $BuildingPage .= parsetemplate(gettemplate('buildings/buildings_builds_row'), $parse);
             }
         }
     }
     if ($Queue['lenght'] > 0) {
         include $xgp_root . 'includes/functions/InsertBuildListScript.' . $phpEx;
         $parse['BuildListScript'] = InsertBuildListScript("buildings");
         $parse['BuildList'] = $Queue['buildlist'];
     } else {
         $parse['BuildListScript'] = "";
         $parse['BuildList'] = "";
     }
     $parse['BuildingsList'] = $BuildingPage;
     display(parsetemplate(gettemplate('buildings/buildings_builds'), $parse));
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:class.ShowBuildingsPage.php

示例2: ShowOverviewPage


//.........这里部分代码省略.........
            }
            if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 1 && $CurrentPlanet['planet_type'] != 3) {
                if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) {
                    $moon = doquery("SELECT `id`,`name`,`image` FROM {{table}} WHERE `galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND `system` = '" . $CurrentPlanet['system'] . "' AND `planet` = '" . $CurrentPlanet['planet'] . "' AND `planet_type` = '3'", 'planets', true);
                    $parse['moon_img'] = "<a href=\"game.php?page=overview&cp=" . $moon['id'] . "&re=0\" title=\"" . $moon['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $moon['image'] . ".png\" height=\"90\" width=\"90\"></a>";
                    $parse['moon'] = $moon['name'] . "";
                } else {
                    $parse['moon_img'] = "";
                    $parse['moon'] = "";
                }
            } elseif ($CurrentPlanet['planet_type'] == 3) {
                $moon = doquery("SELECT `id`,`name`,`image` FROM {{table}} WHERE `galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND `system` = '" . $CurrentPlanet['system'] . "' AND `planet` = '" . $CurrentPlanet['planet'] . "' AND `planet_type` = '1'", 'planets', true);
                $parse['moon_img'] = "<a href=\"game.php?page=overview&cp=" . $moon['id'] . "&re=0\" title=\"" . $moon['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $moon['image'] . ".gif\" height=\"120\" width=\"120\"></a>";
                $parse['moon'] = $moon['name'] . "";
            } else {
                $parse['moon_img'] = "";
                $parse['moon'] = "";
            }
            $parse['planet_diameter'] = pretty_number($CurrentPlanet['diameter']);
            $parse['planet_field_current'] = $CurrentPlanet['field_current'];
            $parse['planet_field_max'] = CalculateMaxPlanetFields($CurrentPlanet);
            $parse['planet_temp_min'] = $CurrentPlanet['temp_min'];
            $parse['planet_temp_max'] = $CurrentPlanet['temp_max'];
            $StatRecord = doquery("SELECT `total_rank`,`total_points` FROM `{{table}}` WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $CurrentUser['id'] . "';", 'statpoints', true);
            $parse['user_username'] = $CurrentUser['username'];
            if (count($fpage) > 0) {
                ksort($fpage);
                foreach ($fpage as $time => $content) {
                    $flotten .= $content . "\n";
                }
            }
            // **** INICIA MOD {MOSTRAR TECNOLOGIA EN PROCESO EN VISTA GENERAL} ****
            if ($CurrentPlanet['b_building'] != 0) {
                include $xgp_root . 'includes/functions/InsertBuildListScript.' . $phpEx;
                UpdatePlanetBatimentQueueList($planetrow, $user);
                if ($CurrentPlanet['b_building'] != 0) {
                    $BuildQueue = explode(";", $CurrentPlanet['b_building_id']);
                    $CurrBuild = explode(",", $BuildQueue[0]);
                    $RestTime = $CurrentPlanet['b_building'] - time();
                    $PlanetID = $CurrentPlanet['id'];
                    $Build = InsertBuildListScript("buildings");
                    $Build .= "<table>";
                    $Build .= " <tr>";
                    $Build .= " <td colspan=\"2\">" . $lang['tech'][$CurrBuild[0]] . "</td>";
                    $Build .= " </tr>";
                    $Build .= " <tr>";
                    $Build .= " <td align=\"center\" valign=\"middle\"><img src=\"" . $dpath . "gebaeude/" . $CurrBuild[0] . ".gif\" width=\"40\" height=\"40\"></td>";
                    $Build .= " <td>" . $lang['pr_subiendo'] . " <span style=\"color:#FF8C00;\">Nivel " . $CurrBuild[1] . "</span><br />";
                    $Build .= " " . $lang['pr_duracion'] . ":<div id=\"blc\" class=\"z\" style=\"color:yellow;\">" . pretty_time($RestTime) . "</div>";
                    $Build .= " </td>";
                    $Build .= " </tr>";
                    $Build .= "</Table>";
                    $Build .= "\n<script language=\"JavaScript\">";
                    $Build .= "\n pp = \"" . $RestTime . "\";\n";
                    $Build .= "\n pk = \"" . 1 . "\";\n";
                    $Build .= "\n pm = \"cancel\";\n";
                    $Build .= "\n pl = \"" . $PlanetID . "\";\n";
                    $Build .= "\n t();\n";
                    $Build .= "\n</script>\n";
                    $parse['building'] = $Build;
                } else {
                    $parse['building'] = $lang['ov_free'];
                }
            } else {
                $parse['building'] = $lang['ov_free'];
            }
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowOverviewPage.php

示例3: BatimentBuildingPage


//.........这里部分代码省略.........
            $CurrentMaxFields = CalculateMaxPlanetFields($CurrentPlanet);
            if ($CurrentPlanet["field_current"] < $CurrentMaxFields - $Queue['lenght']) {
                $RoomIsOk = true;
            } else {
                $RoomIsOk = false;
            }
            if (IsTechnologieAccessible($CurrentUser, $CurrentPlanet, $Element)) {
                $HaveRessources = IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, true, false);
                $parse = array();
                $parse['dpath'] = $dpath;
                $parse['i'] = $Element;
                $BuildingLevel = $CurrentPlanet[$resource[$Element]];
                $parse['nivel'] = $BuildingLevel == 0 ? "" : " (" . $lang['level'] . " " . $BuildingLevel . ")";
                // show energy on BuildingPage
                $BuildLevelFactor = $CurrentPlanet[$resource[$Element] . "_porcent"];
                $BuildTemp = $CurrentPlanet['temp_max'];
                $CurrentBuildtLvl = $BuildingLevel;
                $BuildLevel = $CurrentBuildtLvl > 0 ? $CurrentBuildtLvl : 1;
                $Prod[4] = floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_ingenieur'] * 0.05);
                $ActualNeed = floor($Prod[4]);
                $BuildLevel++;
                $Prod[4] = floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_ingenieur'] * 0.05);
                $EnergyNeed = colorNumber(pretty_number(floor($Prod[4] - $ActualNeed)));
                if ($Element >= 1 && $Element <= 3) {
                    $parse['build_need_diff'] = "(" . "<font color=#FF0000>" . $EnergyNeed . " " . $lang['Energy'] . "</font>" . ")";
                    $BuildLevel = 0;
                } elseif ($Element == 4 || $Element == 12) {
                    $parse['build_need_diff'] = "(" . "<font color=#00FF00>+" . $EnergyNeed . " " . $lang['Energy'] . "</font>" . ")";
                    $BuildLevel = 0;
                }
                // end of 'show energy on BuildingPage'
                $parse['n'] = $ElementName;
                $parse['descriptions'] = $lang['res']['descriptions'][$Element];
                $ElementBuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
                $parse['time'] = ShowBuildTime($ElementBuildTime);
                $parse['price'] = GetElementPrice($CurrentUser, $CurrentPlanet, $Element);
                $parse['rest_price'] = GetRestPrice($CurrentUser, $CurrentPlanet, $Element);
                $parse['click'] = '';
                $NextBuildLevel = $CurrentPlanet[$resource[$Element]] + 1;
                if ($Element == 31) {
                    // Special Laboratoire
                    if ($CurrentUser["b_tech_planet"] != 0 && $game_config['BuildLabWhileRun'] != 1) {
                        // Variable qui contient le parametre
                        // On verifie si on a le droit d'evoluer pendant les recherches (Setting dans config)
                        $parse['click'] = "<font color=#FF0000>" . $lang['in_working'] . "</font>";
                    }
                }
                if ($parse['click'] != '') {
                    // Bin on ne fait rien, vu que l'on l'a deja fait au dessus !!
                } elseif ($RoomIsOk && $CanBuildElement) {
                    if ($Queue['lenght'] == 0) {
                        if ($NextBuildLevel == 1) {
                            if ($HaveRessources == true) {
                                $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['BuildFirstLevel'] . "</font></a>";
                            } else {
                                $parse['click'] = "<font color=#FF0000>" . $lang['BuildFirstLevel'] . "</font>";
                            }
                        } else {
                            if ($HaveRessources == true) {
                                $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font></a>";
                            } else {
                                $parse['click'] = "<font color=#FF0000>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>";
                            }
                        }
                    } else {
                        if ($HaveRessources == true) {
                            $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['InBuildQueue'] . "</font></a>";
                        } else {
                            $parse['click'] = "<font color=#FF0000>" . $lang['InBuildQueue'] . "</font>";
                        }
                    }
                } elseif ($RoomIsOk && !$CanBuildElement) {
                    if ($NextBuildLevel == 1) {
                        $parse['click'] = "<font color=#FF0000>" . $lang['BuildFirstLevel'] . "</font>";
                    } else {
                        $parse['click'] = "<font color=#FF0000>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>";
                    }
                } else {
                    $parse['click'] = "<font color=#FF0000>" . $lang['NoMoreSpace'] . "</font>";
                }
                $BuildingPage .= parsetemplate($SubTemplate, $parse);
            }
        }
    }
    $parse = $lang;
    // Faut il afficher la liste de construction ??
    if ($Queue['lenght'] > 0) {
        $parse['BuildListScript'] = InsertBuildListScript("buildings");
        $parse['BuildList'] = $Queue['buildlist'];
    } else {
        $parse['BuildListScript'] = "";
        $parse['BuildList'] = "";
    }
    $parse['planet_field_current'] = $CurrentPlanet["field_current"];
    $parse['planet_field_max'] = $CurrentPlanet['field_max'] + $CurrentPlanet[$resource[33]] * 5;
    $parse['field_libre'] = $parse['planet_field_max'] - $CurrentPlanet['field_current'];
    $parse['BuildingsList'] = $BuildingPage;
    $page .= parsetemplate(gettemplate('buildings_builds'), $parse);
    display($page, $lang['Builds']);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:BatimentBuildingPage.php

示例4: BatimentBuildingPage


//.........这里部分代码省略.........
                    break;
            }
            // switch
        } elseif ($bThisIsCheated == true) {
            ResetThisFuckingCheater($CurrentUser['id']);
        }
    }
    SetNextQueueElementOnTop($CurrentPlanet, $CurrentUser);
    $Queue = ShowBuildingQueue($CurrentPlanet, $CurrentUser);
    // On enregistre ce que l'on a modifi&eacute; dans planet !
    BuildingSavePlanetRecord($CurrentPlanet);
    // On enregistre ce que l'on a eventuellement modifi&eacute; dans users
    BuildingSaveUserRecord($CurrentUser);
    if ($Queue['lenght'] < MAX_BUILDING_QUEUE_SIZE) {
        $CanBuildElement = true;
    } else {
        $CanBuildElement = false;
    }
    $SubTemplate = gettemplate('buildings_builds_row');
    $BuildingPage = "";
    foreach ($lang['tech'] as $Element => $ElementName) {
        if (in_array($Element, $Allowed[$CurrentPlanet['planet_type']])) {
            $CurrentMaxFields = CalculateMaxPlanetFields($CurrentPlanet);
            if ($CurrentPlanet["field_current"] < $CurrentMaxFields - $Queue['lenght']) {
                $RoomIsOk = true;
            } else {
                $RoomIsOk = false;
            }
            if (IsTechnologieAccessible($CurrentUser, $CurrentPlanet, $Element)) {
                $HaveRessources = IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, true, false);
                $parse = array();
                $parse['dpath'] = $dpath;
                $parse['i'] = $Element;
                $BuildingLevel = $CurrentPlanet[$resource[$Element]];
                $parse['nivel'] = $BuildingLevel == 0 ? "" : " (" . $lang['level'] . " " . $BuildingLevel . ")";
                $parse['n'] = $ElementName;
                $parse['descriptions'] = $lang['res']['descriptions'][$Element];
                $ElementBuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
                $parse['time'] = ShowBuildTime($ElementBuildTime);
                $parse['price'] = GetElementPrice($CurrentUser, $CurrentPlanet, $Element);
                $parse['rest_price'] = GetRestPrice($CurrentUser, $CurrentPlanet, $Element);
                $parse['click'] = '';
                $NextBuildLevel = $CurrentPlanet[$resource[$Element]] + 1;
                if ($Element == 31) {
                    // Sp&eacute;cial Laboratoire
                    if ($CurrentUser["b_tech_planet"] != 0 && $game_config['BuildLabWhileRun'] != 1) {
                        // Variable qui contient le parametre
                        // On verifie si on a le droit d'evoluer pendant les recherches (Setting dans config)
                        $parse['click'] = "<font color=#FF0000>" . $lang['in_working'] . "</font>";
                    }
                }
                if ($parse['click'] != '') {
                    // Bin on ne fait rien, vu que l'on l'a deja fait au dessus !!
                } elseif ($RoomIsOk && $CanBuildElement) {
                    if ($Queue['lenght'] == 0) {
                        if ($NextBuildLevel == 1) {
                            if ($HaveRessources == true) {
                                $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['BuildFirstLevel'] . "</font></a>";
                            } else {
                                $parse['click'] = "<font color=#FF0000>" . $lang['BuildFirstLevel'] . "</font>";
                            }
                        } else {
                            if ($HaveRessources == true) {
                                $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font></a>";
                            } else {
                                $parse['click'] = "<font color=#FF0000>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>";
                            }
                        }
                    } else {
                        $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['InBuildQueue'] . "</font></a>";
                    }
                } elseif ($RoomIsOk && !$CanBuildElement) {
                    if ($NextBuildLevel == 1) {
                        $parse['click'] = "<font color=#FF0000>" . $lang['BuildFirstLevel'] . "</font>";
                    } else {
                        $parse['click'] = "<font color=#FF0000>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>";
                    }
                } else {
                    $parse['click'] = "<font color=#FF0000>" . $lang['NoMoreSpace'] . "</font>";
                }
                $BuildingPage .= parsetemplate($SubTemplate, $parse);
            }
        }
    }
    $parse = $lang;
    // Faut il afficher la liste de construction ??
    if ($Queue['lenght'] > 0) {
        $parse['BuildListScript'] = InsertBuildListScript("buildings");
        $parse['BuildList'] = $Queue['buildlist'];
    } else {
        $parse['BuildListScript'] = "";
        $parse['BuildList'] = "";
    }
    $parse['planet_field_current'] = $CurrentPlanet["field_current"];
    $parse['planet_field_max'] = $CurrentPlanet['field_max'] + $CurrentPlanet[$resource[33]] * 5;
    $parse['field_libre'] = $parse['planet_field_max'] - $CurrentPlanet['field_current'];
    $parse['BuildingsList'] = $BuildingPage;
    $page .= parsetemplate(gettemplate('buildings_builds'), $parse);
    display($page, $lang['Builds']);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:BatimentBuildingPage.php

示例5: ShowOverviewPage


//.........这里部分代码省略.........
                    $AllPlanets .= "<th>" . $CurrentUserPlanet['name'] . "<br>";
                    $AllPlanets .= "<a href=\"game.php?page=overview&cp=" . $CurrentUserPlanet['id'] . "&re=0\" title=\"" . $CurrentUserPlanet['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $CurrentUserPlanet['image'] . ".jpg\" height=\"50\" width=\"50\"></a><br>";
                    $AllPlanets .= "<center>";
                    if ($CurrentUserPlanet['b_building'] != 0) {
                        UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser);
                        if ($CurrentUserPlanet['b_building'] != 0) {
                            $BuildQueue = $CurrentUserPlanet['b_building_id'];
                            $QueueArray = explode(";", $BuildQueue);
                            $CurrentBuild = explode(",", $QueueArray[0]);
                            $BuildElement = $CurrentBuild[0];
                            $BuildLevel = $CurrentBuild[1];
                            $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                            $AllPlanets .= '' . $lang['tech'][$BuildElement] . ' (' . $BuildLevel . ')';
                            $AllPlanets .= "<br><font color=\"#7f7f7f\">(" . $BuildRestTime . ")</font>";
                        } else {
                            CheckPlanetUsedFields($CurrentUserPlanet);
                            $AllPlanets .= $lang['ov_free'];
                        }
                    } else {
                        $AllPlanets .= $lang['ov_free'];
                    }
                    $AllPlanets .= "</center></th>";
                    if ($Colone <= 1) {
                        $Colone++;
                    } else {
                        $AllPlanets .= "</tr><tr>";
                        $Colone = 1;
                    }
                }
            }
            mysql_free_result($planets_query);
            $AllPlanets .= "</tr>";
            if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 1 && $CurrentPlanet['planet_type'] != 3) {
                if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) {
                    $moon = doquery("SELECT `id`,`name`,`image` FROM {{table}} WHERE `galaxy` = '" . intval($CurrentPlanet['galaxy']) . "' AND `system` = '" . intval($CurrentPlanet['system']) . "' AND `planet` = '" . intval($CurrentPlanet['planet']) . "' AND `planet_type` = '3'", 'planets', true);
                    $parse['moon_img'] = "<a href=\"game.php?page=overview&cp=" . $moon['id'] . "&re=0\" title=\"" . $moon['name'] . "\"><img src=\"" . $dpath . "planeten/" . $moon['image'] . ".jpg\" height=\"50\" width=\"50\"></a>";
                    $parse['moon'] = $moon['name'] . " (" . $lang['fcm_moon'] . ")";
                } else {
                    $parse['moon_img'] = "";
                    $parse['moon'] = "";
                }
            } else {
                $parse['moon_img'] = "";
                $parse['moon'] = "";
            }
            $parse['planet_diameter'] = pretty_number($CurrentPlanet['diameter']);
            $parse['planet_field_current'] = $CurrentPlanet['field_current'];
            $parse['planet_field_max'] = CalculateMaxPlanetFields($CurrentPlanet);
            $parse['planet_temp_min'] = $CurrentPlanet['temp_min'];
            $parse['planet_temp_max'] = $CurrentPlanet['temp_max'];
            $StatRecord = doquery("SELECT `total_rank`,`total_points` FROM `{{table}}` WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . intval($CurrentUser['id']) . "';", 'statpoints', true);
            $parse['user_username'] = $CurrentUser['username'];
            if (count($fpage) > 0) {
                ksort($fpage);
                foreach ($fpage as $time => $content) {
                    $flotten .= $content . "\n";
                }
            }
            if ($CurrentPlanet['b_building'] != 0) {
                include $xgp_root . 'includes/functions/InsertBuildListScript.' . $phpEx;
                UpdatePlanetBatimentQueueList($planetrow, $user);
                if ($CurrentPlanet['b_building'] != 0) {
                    $BuildQueue = explode(";", $CurrentPlanet['b_building_id']);
                    $CurrBuild = explode(",", $BuildQueue[0]);
                    $RestTime = $CurrentPlanet['b_building'] - time();
                    $PlanetID = $CurrentPlanet['id'];
                    $Build = InsertBuildListScript("overview");
                    $Build .= $lang['tech'][$CurrBuild[0]] . ' (' . $CurrBuild[1] . ')';
                    $Build .= "<br /><div id=\"blc\" class=\"z\">" . pretty_time($RestTime) . "</div>";
                    $Build .= "\n<script language=\"JavaScript\">";
                    $Build .= "\n\tpp = \"" . $RestTime . "\";\n";
                    $Build .= "\n\tpk = \"" . 1 . "\";\n";
                    $Build .= "\n\tpm = \"cancel\";\n";
                    $Build .= "\n\tpl = \"" . $PlanetID . "\";\n";
                    $Build .= "\n\tt();\n";
                    $Build .= "\n</script>\n";
                    $parse['building'] = $Build;
                } else {
                    $parse['building'] = $lang['ov_free'];
                }
            } else {
                $parse['building'] = $lang['ov_free'];
            }
            $parse['fleet_list'] = $flotten;
            $parse['Have_new_message'] = $Have_new_message;
            $parse['planet_image'] = $CurrentPlanet['image'];
            $parse['anothers_planets'] = $AllPlanets;
            $parse["dpath"] = $dpath;
            if ($game_config['stat'] == 0) {
                $parse['user_rank'] = pretty_number($StatRecord['total_points']) . " (" . $lang['ov_place'] . " <a href=\"game.php?page=statistics&range=" . $StatRecord['total_rank'] . "\">" . $StatRecord['total_rank'] . "</a> " . $lang['ov_of'] . " " . $game_config['users_amount'] . ")";
            } elseif ($game_config['stat'] == 1 && $CurrentUser['authlevel'] < $game_config['stat_level']) {
                $parse['user_rank'] = pretty_number($StatRecord['total_points']) . " (" . $lang['ov_place'] . " <a href=\"game.php?page=statistics&range=" . $StatRecord['total_rank'] . "\">" . $StatRecord['total_rank'] . "</a> " . $lang['ov_of'] . " " . $game_config['users_amount'] . ")";
            } else {
                $parse['user_rank'] = "-";
            }
            $parse['date_time'] = date("D M j H:i:s", time());
            return display(parsetemplate(gettemplate('overview/overview_body'), $parse));
            break;
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowOverviewPage.php

示例6: pretty_number

 $parse['max_users'] = $game_config['users_amount'];
 $parse['metal_debris'] = pretty_number($galaxyrow['metal']);
 $parse['crystal_debris'] = pretty_number($galaxyrow['crystal']);
 if (($galaxyrow['metal'] != 0 || $galaxyrow['crystal'] != 0) && $planetrow[$resource[209]] != 0) {
     $parse['get_link'] = " (<a href=\"quickfleet.php?mode=8&g=" . $galaxyrow['galaxy'] . "&s=" . $galaxyrow['system'] . "&p=" . $galaxyrow['planet'] . "&t=2\">" . $lang['type_mission'][8] . "</a>)";
 } else {
     $parse['get_link'] = '';
 }
 if ($planetrow['b_building'] != 0) {
     UpdatePlanetBatimentQueueList($planetrow, $user);
     if ($planetrow['b_building'] != 0) {
         $BuildQueue = explode(";", $planetrow['b_building_id']);
         $CurrBuild = explode(",", $BuildQueue[0]);
         $RestTime = $planetrow['b_building'] - time();
         $PlanetID = $planetrow['id'];
         $Build = InsertBuildListScript("overview");
         $Build .= $lang['tech'][$CurrBuild[0]] . ' (' . $CurrBuild[1] . ')';
         $Build .= "<br /><div id=\"blc\" class=\"z\">" . pretty_time($RestTime) . "</div>";
         $Build .= "\n<script language=\"JavaScript\">";
         $Build .= "\n\tpp = \"" . $RestTime . "\";\n";
         // temps necessaire (a compter de maintenant et sans ajouter time() )
         $Build .= "\n\tpk = \"" . 1 . "\";\n";
         // id index (dans la liste de construction)
         $Build .= "\n\tpm = \"cancel\";\n";
         // mot de controle
         $Build .= "\n\tpl = \"" . $PlanetID . "\";\n";
         // id planete
         $Build .= "\n\tt();\n";
         $Build .= "\n</script>\n";
         $parse['building'] = $Build;
     } else {
开发者ID:sonicmaster,项目名称:RPG,代码行数:31,代码来源:overview.php

示例7: BatimentBuildingPage


//.........这里部分代码省略.........
                $BuildLevel++;
                $Prod[3] = floor(eval($ProdGrid[$Element]['formule']['deuterium']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_geologue'] * 0.05);
                $Prod[11] = floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_ingenieur'] * 0.05);
                if ($Element != 12) {
                    $bloc['build_prod'] = pretty_number(floor($Prod[$BuildID]));
                    $bloc['build_prod_diff'] = colorNumber(pretty_number(floor($Prod[$BuildID] - $ActualProd)));
                    $bloc['build_need'] = colorNumber(pretty_number(floor($Prod[11])));
                    $EnergyNeed = colorNumber(pretty_number(floor($Prod[11] - $ActualNeed)));
                } else {
                    $bloc['build_prod'] = pretty_number(floor($Prod[11]));
                    $bloc['build_prod_diff'] = colorNumber(pretty_number(floor($Prod[11] - $ActualProd)));
                    $bloc['build_need'] = colorNumber(pretty_number(floor($Prod[3])));
                    $EnergyNeed = colorNumber(pretty_number(floor($Prod[3] - $ActualNeed)));
                }
                if ($Element >= 1 && $Element <= 4) {
                    $parse['build_need_diff'] = "(" . "<font color=#FF0000>" . $EnergyNeed . " " . $lang['Energy'] . "</font>" . ")";
                    $BuildLevel = 0;
                } elseif ($Element == 11 || $Element == 12) {
                    $parse['build_need_diff'] = "(" . "<font color=#00FF00>+" . $EnergyNeed . " " . $lang['Energy'] . "</font>" . ")";
                    $BuildLevel = 0;
                }
                //================================
                if ($Element == 31) {
                    // Sp&eacute;cial Laboratoire
                    if ($CurrentUser['b_tech_planet'] != 0 && $game_config['BuildLabWhileRun'] != 1) {
                        // Variable qui contient le parametre
                        // On verifie si on a le droit d'evoluer pendant les recherches (Setting dans config)
                        $parse['click'] = "<font color=#FF0000>" . $lang['in_working'] . "</font>";
                    }
                }
                if ($Element == 15) {
                    // Spezialgebäude Nanitenfabrik
                    if ($CurrentPlanet['robot_factory'] <= 9) {
                        // On verifie si on a le droit d'evoluer pendant les recherches (Setting dans config)
                        $parse['click'] = "<font color=#FF0000>" . $lang['no Nani'] . "</font>";
                    }
                }
                if ($Element == 45) {
                    // Spezialgebäude Mondtransformer
                    if ($CurrentPlanet['mondtransformer'] == 1) {
                        // Es darf nur ein Mondtransformer pro Planet gebaut werden
                        $parse['click'] = "<font color=#FF0000>" . $lang['only_one_mondtransformer'] . "</font>";
                    }
                }
                if ($parse['click'] != '') {
                    // Bin on ne fait rien, vu que l'on l'a deja fait au dessus !!
                } elseif ($RoomIsOk && $CanBuildElement) {
                    if ($Queue['lenght'] == 0) {
                        if ($NextBuildLevel == 1) {
                            if ($HaveRessources == true) {
                                $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['BuildFirstLevel'] . "</font></a>";
                            } else {
                                $parse['click'] = "<font color=#FF0000>" . $lang['BuildFirstLevel'] . "</font>";
                            }
                        } else {
                            if ($HaveRessources == true) {
                                $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font></a>";
                            } else {
                                $parse['click'] = "<font color=#FF0000>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>";
                            }
                        }
                    } else {
                        $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['InBuildQueue'] . "</font></a>";
                    }
                } elseif ($RoomIsOk && !$CanBuildElement) {
                    if ($NextBuildLevel == 1) {
                        $parse['click'] = "<font color=#FF0000>" . $lang['BuildFirstLevel'] . "</font>";
                    } else {
                        $parse['click'] = "<font color=#FF0000>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>";
                    }
                } else {
                    $parse['click'] = "<font color=#FF0000>" . $lang['NoMoreSpace'] . "</font>";
                }
                if ($zaehler % 3 == 0) {
                    $parse['trclose'] = '</tr>';
                    $zaehler++;
                } else {
                    $parse['trclose'] = '';
                    $zaehler++;
                }
                $BuildingPage .= parsetemplate($SubTemplate, $parse);
            }
        }
    }
    $parse = $lang;
    // Faut il afficher la liste de construction ??
    if ($Queue['lenght'] > 0) {
        $parse['BuildListScript'] = InsertBuildListScript("buildings");
        $parse['BuildList'] = $Queue['buildlist'];
    } else {
        $parse['BuildListScript'] = "";
        $parse['BuildList'] = "";
    }
    $parse['planet_field_current'] = $CurrentPlanet['field_current'];
    $parse['planet_field_max'] = $CurrentPlanet['field_max'];
    $parse['field_libre'] = $parse['planet_field_max'] - $CurrentPlanet['field_current'];
    $parse['BuildingsList'] = $BuildingPage;
    $page .= parsetemplate(gettemplate('buildings_builds'), $parse);
    display($page, $lang['Builds']);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:BatimentBuildingPage.php

示例8: ShowBuildingsPage


//.........这里部分代码省略.........
                 if ($siguiente == 1) {
                     $parse['abrirtr'] = "<tr>";
                 }
                 $parse['i'] = $Element;
                 $BuildingLevel = $CurrentPlanet[$resource[$Element]];
                 $parse['nivel'] = $BuildingLevel == 0 ? " (" . $lang['bd_lvl'] . " 0)" : " (" . $lang['bd_lvl'] . " " . $BuildingLevel . ")";
                 $BuildLevelFactor = $CurrentPlanet[$resource[$Element] . "_porcent"];
                 $BuildTemp = $CurrentPlanet['temp_max'];
                 $CurrentBuildtLvl = $BuildingLevel;
                 $BuildLevel = $CurrentBuildtLvl > 0 ? $CurrentBuildtLvl : 1;
                 $Prod[3] = floor(eval($ProdGrid[$Element]['formule']['deuterium']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_geologue'] * 0.05);
                 $Prod[4] = floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_ingenieur'] * 0.05);
                 if ($Element != 12) {
                     $ActualNeed = floor($Prod[4]);
                 } else {
                     $ActualNeed = floor($Prod[3]);
                 }
                 $BuildLevel++;
                 $Prod[3] = floor(eval($ProdGrid[$Element]['formule']['deuterium']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_geologue'] * 0.05);
                 $Prod[4] = floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_ingenieur'] * 0.05);
                 if ($Element != 12) {
                     $EnergyNeed = pretty_number(abs(floor($Prod[4] - $ActualNeed)));
                 } else {
                     $EnergyNeed = pretty_number(abs(floor($Prod[3] - $ActualNeed)));
                 }
                 if ($Element >= 1 && $Element <= 3) {
                     $parse['build_need_diff'] = "Next Level:<br>Verbraucht <font color=#FF0000>" . $EnergyNeed . "</font> " . $lang['Energy'] . " mehr";
                     $BuildLevel = 0;
                 } elseif ($Element == 4 || $Element == 12) {
                     $parse['build_need_diff'] = "Next Level:<br>Produziert <font color=#00FF00>" . $EnergyNeed . "</font> mehr " . $lang['Energy'];
                     $BuildLevel = 0;
                 } elseif ($Element == 43 && $BuildingLevel != 0) {
                     $parse['build_need_diff'] = "<a href=\"javascript:f('game.php?page=infos&gid=43','');\">Springen</a>";
                     $BuildLevel = 0;
                 }
                 if ($BuildingLevel != 0) {
                     $parse['cancel'] = "<a href=\"javascript:infodiv('" . $Element . "-cancel');javascript:animatedcollapse.toggle('" . $Element . "-cancel')\">Abrei&szlig;en</a>";
                 }
                 $parse['n'] = $ElementName;
                 $parse['descriptions'] = $lang['res']['descriptions'][$Element];
                 $ElementBuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
                 $parse['time'] = ShowBuildTime($ElementBuildTime);
                 $parse['price'] = GetElementPrice($CurrentUser, $CurrentPlanet, $Element, true, true);
                 $parse['click'] = '';
                 $NextBuildLevel = $CurrentPlanet[$resource[$Element]] + 1;
                 if ($RoomIsOk && $CanBuildElement) {
                     if ($Queue['lenght'] == 0) {
                         if ($NextBuildLevel == 1) {
                             if ($HaveRessources == true) {
                                 $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_build'] . "</font></a>";
                             } else {
                                 $parse['click'] = "<font color=#FF0000>" . $lang['bd_build'] . "</font>";
                             }
                         } else {
                             if ($HaveRessources == true) {
                                 $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font></a>";
                             } else {
                                 $parse['click'] = "<font color=#FF0000>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font>";
                             }
                         }
                     } else {
                         $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_add_to_list'] . "</font></a>";
                     }
                 } elseif ($RoomIsOk && !$CanBuildElement) {
                     if ($NextBuildLevel == 1) {
                         $parse['click'] = "<font color=#FF0000>" . $lang['bd_build'] . "</font>";
                     } else {
                         $parse['click'] = "<font color=#FF0000>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font>";
                     }
                 } else {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_no_more_fields'] . "</font>";
                 }
                 if ($Element == 31 && $CurrentUser["b_tech_planet"] != 0) {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_working'] . "</font>";
                 }
                 if ($Element == 21 && $CurrentPlanet["b_hangar"] != 0) {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_working'] . "</font>";
                 }
                 if ($siguiente == 3) {
                     $parse['cerrartr'] = "</tr>";
                     $siguiente = 1;
                 } else {
                     $siguiente++;
                 }
                 $BuildingPage .= parsetemplate(gettemplate('buildings/buildings_builds_row'), $parse);
             }
         }
     }
     if ($Queue['lenght'] > 0) {
         include $xgp_root . 'includes/functions/InsertBuildListScript.' . $phpEx;
         $parse['BuildListScript'] = InsertBuildListScript("buildings");
         $parse['BuildList'] = $Queue['buildlist'];
     } else {
         $parse['BuildListScript'] = "";
         $parse['BuildList'] = "";
     }
     $parse['BuildingsList'] = $BuildingPage;
     $parse['infodiv'] = $infodiv;
     display(parsetemplate(gettemplate('buildings/buildings_builds'), $parse));
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:class.ShowBuildingsPage.php

示例9: BatimentBuildingPage


//.........这里部分代码省略.........
                case 'remove':
                    RemoveBuildingFromQueue($CurrentPlanet, $CurrentUser, $ListID);
                    break;
                case 'insert':
                    AddBuildingToQueue($CurrentPlanet, $CurrentUser, $Element, true);
                    break;
                case 'destroy':
                    AddBuildingToQueue($CurrentPlanet, $CurrentUser, $Element, false);
                    break;
                default:
                    break;
            }
        }
    }
    SetNextQueueElementOnTop($CurrentPlanet, $CurrentUser);
    $Queue = ShowBuildingQueue($CurrentPlanet, $CurrentUser);
    BuildingSavePlanetRecord($CurrentPlanet);
    BuildingSaveUserRecord($CurrentUser);
    if ($Queue['lenght'] < MAX_BUILDING_QUEUE_SIZE) {
        $CanBuildElement = true;
    } else {
        $CanBuildElement = false;
    }
    $SubTemplate = gettemplate('buildings_builds_row');
    $BuildingPage = "";
    foreach ($lang['tech'] as $Element => $ElementName) {
        if (in_array($Element, $Allowed[$CurrentPlanet['planet_type']])) {
            $CurrentMaxFields = CalculateMaxPlanetFields($CurrentPlanet);
            if ($CurrentPlanet["field_current"] < $CurrentMaxFields - $Queue['lenght']) {
                $RoomIsOk = true;
            } else {
                $RoomIsOk = false;
            }
            if (IsTechnologieAccessible($CurrentUser, $CurrentPlanet, $Element)) {
                $HaveRessources = IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, true, false);
                $parse = array();
                $parse['dpath'] = $dpath;
                $parse['i'] = $Element;
                $BuildingLevel = $CurrentPlanet[$resource[$Element]];
                $parse['nivel'] = $BuildingLevel == 0 ? "" : " (" . $lang['level'] . " " . $BuildingLevel . ")";
                $parse['n'] = $ElementName;
                $parse['descriptions'] = $lang['res']['descriptions'][$Element];
                $ElementBuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
                $parse['time'] = ShowBuildTime($ElementBuildTime);
                $parse['price'] = GetElementPrice($CurrentUser, $CurrentPlanet, $Element);
                $parse['rest_price'] = GetRestPrice($CurrentUser, $CurrentPlanet, $Element);
                $parse['click'] = '';
                $NextBuildLevel = $CurrentPlanet[$resource[$Element]] + 1;
                if ($Element == 31) {
                    if ($CurrentUser["b_tech_planet"] != 0 && $game_config['BuildLabWhileRun'] != 1) {
                        $parse['click'] = "<font color=#FF0000>" . $lang['in_working'] . "</font>";
                    }
                }
                if ($parse['click'] != '') {
                } elseif ($RoomIsOk && $CanBuildElement) {
                    if ($Queue['lenght'] == 0) {
                        if ($NextBuildLevel == 1) {
                            if ($HaveRessources == true) {
                                $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['BuildFirstLevel'] . "</font></a>";
                            } else {
                                $parse['click'] = "<font color=#FF0000>" . $lang['BuildFirstLevel'] . "</font>";
                            }
                        } else {
                            if ($HaveRessources == true) {
                                $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font></a>";
                            } else {
                                $parse['click'] = "<font color=#FF0000>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>";
                            }
                        }
                    } else {
                        $parse['click'] = "<a href=\"?cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['InBuildQueue'] . "</font></a>";
                    }
                } elseif ($RoomIsOk && !$CanBuildElement) {
                    if ($NextBuildLevel == 1) {
                        $parse['click'] = "<font color=#FF0000>" . $lang['BuildFirstLevel'] . "</font>";
                    } else {
                        $parse['click'] = "<font color=#FF0000>" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>";
                    }
                } else {
                    $parse['click'] = "<font color=#FF0000>" . $lang['NoMoreSpace'] . "</font>";
                }
                $BuildingPage .= parsetemplate($SubTemplate, $parse);
            }
        }
    }
    $parse = $lang;
    if ($Queue['lenght'] > 0) {
        $parse['BuildListScript'] = InsertBuildListScript("buildings");
        $parse['BuildList'] = $Queue['buildlist'];
    } else {
        $parse['BuildListScript'] = "";
        $parse['BuildList'] = "";
    }
    $parse['planet_field_current'] = $CurrentPlanet["field_current"];
    $parse['planet_field_max'] = $CurrentPlanet['field_max'] + $CurrentPlanet[$resource[33]] * 5;
    $parse['field_libre'] = $parse['planet_field_max'] - $CurrentPlanet['field_current'];
    $parse['BuildingsList'] = $BuildingPage;
    $page .= parsetemplate(gettemplate('buildings_builds'), $parse);
    display($page, $lang['Builds']);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:BatimentBuildingPage.php

示例10: ShowOverviewPage


//.........这里部分代码省略.........
                            CheckPlanetUsedFields($CurrentUserPlanet);
                            $AllPlanets .= $lang['ov_free'];
                        }
                    } else {
                        $AllPlanets .= $lang['ov_free'];
                    }
                    $AllPlanets .= "</center></th>";
                    if ($Coloneshow % 6 == 0) {
                        $AllPlanets .= "</tr><tr>";
                    }
                }
            }
            if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 0 && $CurrentPlanet['planet_type'] != 3) {
                if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) {
                    $displays->newblock('moon');
                    $displays->assign('moon_img', "<a href=\"game.php?page=overview&cp=" . $lunarow['id'] . "&re=0\" title=\"" . $lunarow['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $lunarow['image'] . ".png\" height=\"50\" width=\"50\"></a>");
                    $displays->assign('moon', $lunarow['name'] . " (" . $lang['fcm_moon'] . ")");
                }
            }
            $parse['planet_diameter'] = pretty_number($CurrentPlanet['diameter']);
            $parse['planet_field_current'] = $CurrentPlanet['field_current'];
            $parse['planet_field_max'] = CalculateMaxPlanetFields($CurrentPlanet);
            $parse['planet_temp_min'] = $CurrentPlanet['temp_min'];
            $parse['planet_temp_max'] = $CurrentPlanet['temp_max'];
            $parse['user_username'] = $CurrentUser['username'];
            if (count($fpage) > 0) {
                $flotten = "";
                ksort($fpage);
                foreach ($fpage as $time => $content) {
                    $flotten .= $content . "\n";
                }
            }
            if ($CurrentPlanet['b_building'] != 0) {
                include $svn_root . 'includes/functions/InsertBuildListScript.' . $phpEx;
                UpdatePlanetBatimentQueueList($planetrow, $users->user);
                if ($CurrentPlanet['b_building'] != 0) {
                    $BuildQueue = explode(";", $CurrentPlanet['b_building_id']);
                    $CurrBuild = explode(",", $BuildQueue[0]);
                    $RestTime = $CurrentPlanet['b_building'] - time();
                    $PlanetID = $CurrentPlanet['id'];
                    $Build = InsertBuildListScript("buildings");
                    $Build .= "<table>";
                    $Build .= "    <tr>";
                    $Build .= "        <th colspan=\"2\">" . $lang['tech'][$CurrBuild[0]] . "</th>";
                    $Build .= "    </tr>";
                    $Build .= "    <tr>";
                    $Build .= "        <th class='anything' align=\"center\" style=\"background-image: url(" . $dpath . "gebaeude/" . $CurrBuild[0] . ".gif);background-repeat:no-repeat;width:60px; height:60;\"   valign=\"middle\"></th>";
                    $Build .= "        <th class='anything'>" . $lang['pr_subiendo'] . " <span style=\"color:#FF8C00;\">Nivel " . $CurrBuild[1] . "</span><br />";
                    $Build .= "            " . $lang['pr_duracion'] . ":<div id=\"blc\" class=\"z\" style=\"color:yellow;\">" . pretty_time($RestTime) . "</div>";
                    $Build .= "        </th>";
                    $Build .= "    </tr>";
                    $Build .= "</Table>";
                    $Build .= "\n<script language=\"JavaScript\">";
                    $Build .= "\n\tpp = \"" . $RestTime . "\";\n";
                    $Build .= "\n\tpk = \"" . 1 . "\";\n";
                    $Build .= "\n\tpm = \"cancel\";\n";
                    $Build .= "\n\tpl = \"" . $PlanetID . "\";\n";
                    $Build .= "\n\tt();\n";
                    $Build .= "\n</script>\n";
                    $parse['building'] = $Build;
                } else {
                    $parse['building'] = $lang['ov_free'];
                }
            } else {
                $parse['building'] = $lang['ov_free'];
            }
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowOverviewPage.php

示例11: BatimentBuildingPage


//.........这里部分代码省略.........
    // Änderungen in den Planeten Rekorden übernehmen
    BuildingSavePlanetRecord($CurrentPlanet);
    // Änderungen in den Userrekorden übernehmen
    BuildingSaveUserRecord($CurrentUser);
    if ($Queue['lenght'] < MAX_BUILDING_QUEUE_SIZE) {
        //Solange noch Platz in der Bauischleife ist...
        $CanBuildElement = true;
        // ...kann man bauen
    } else {
        $CanBuildElement = false;
    }
    $SubTemplate = gettemplate('buildings_builds_row');
    $BuildingPage = "";
    foreach ($lang['tech'] as $Element => $ElementName) {
        if (in_array($Element, $Allowed[$CurrentPlanet['planet_type']])) {
            $CurrentMaxFields = CalculateMaxPlanetFields($CurrentPlanet);
            if ($CurrentPlanet["field_current"] < $CurrentMaxFields - $Queue['lenght']) {
                $RoomIsOk = true;
            } else {
                $RoomIsOk = false;
            }
            if (IsTechnologieAccessible($CurrentUser, $CurrentPlanet, $Element)) {
                $HaveRessources = IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, true, false);
                $parse = array();
                $parse['dpath'] = $dpath;
                $parse['i'] = $Element;
                $BuildingLevel = $CurrentPlanet[$resource[$Element]];
                $parse['nivel'] = $BuildingLevel == 0 ? "" : " (" . $lang['level'] . " " . $BuildingLevel . ")";
                $parse['n'] = $ElementName;
                $parse['descriptions'] = $lang['res']['descriptions'][$Element];
                $ElementBuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
                $ElementBuildTimeWithoutTechs = GetBuildingTimeWithoutTechs($CurrentUser, $CurrentPlanet, $Element);
                //Bauzeiten parsen
                $parse['timewithouttechs'] = ShowBuildTimeWithoutTechs($ElementBuildTimeWithoutTechs);
                $parse['technobonus'] = ShowBuildTime($ElementBuildTimeWithoutTechs - $ElementBuildTime);
                $parse['time'] = ShowBuildTime($ElementBuildTime);
                //Sprachvariablen für die Bauzeit laden
                $parse['BuildingTime'] = $lang['BuildingTime'];
                $parse['NeededRess'] = $lang['NeededRess'];
                $parse['ConstructionTimeWithoutTechs'] = $lang['ConstructionTimeWithoutTechs'];
                $parse['TechBonus'] = $lang['TechBonus'];
                $parse['ConstructionTime'] = $lang['ConstructionTime'];
                $parse['price'] = GetElementPrice($CurrentUser, $CurrentPlanet, $Element);
                $parse['rest_price'] = GetRestPrice($CurrentUser, $CurrentPlanet, $Element);
                $parse['click'] = '';
                $NextBuildLevel = $CurrentPlanet[$resource[$Element]] + 1;
                if ($Element == 31) {
                    // Sonderstatus fürs FOrschungslabor
                    if ($CurrentUser["b_tech_planet"] != 0 && $game_config['BuildLabWhileRun'] != 1) {
                        // Config Einstellung die das Forschen während des Ausbaus erlaubt
                        $parse['click'] = "<font color=\"#FF0000\">" . $lang['in_working'] . "</font>";
                    }
                }
                if ($parse['click'] != '') {
                } elseif ($RoomIsOk && $CanBuildElement) {
                    if ($Queue['lenght'] == 0) {
                        if ($NextBuildLevel == 1) {
                            if ($HaveRessources == true) {
                                $parse['click'] = "<a href=\"?action=internalBuildings&amp;cmd=insert&amp;building=" . $Element . "\"><font color=\"#00FF00\">" . $lang['BuildFirstLevel'] . "</font></a>";
                            } else {
                                $parse['click'] = "<font color=\"#FF0000\">" . $lang['BuildFirstLevel'] . "</font>";
                            }
                        } else {
                            if ($HaveRessources == true) {
                                $parse['click'] = "<a href=\"?action=internalBuildings&amp;cmd=insert&amp;building=" . $Element . "\"><font color=\"#00FF00\">" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font></a>";
                            } else {
                                $parse['click'] = "<font color=\"#FF0000\">" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>";
                            }
                        }
                    } else {
                        $parse['click'] = "<a href=\"?action=internalBuildings&amp;cmd=insert&amp;building=" . $Element . "\"><font color=\"#00FF00\">" . $lang['InBuildQueue'] . "</font></a>";
                    }
                } elseif ($RoomIsOk && !$CanBuildElement) {
                    if ($NextBuildLevel == 1) {
                        $parse['click'] = "<font color=\"#FF0000\">" . $lang['BuildFirstLevel'] . "</font>";
                    } else {
                        $parse['click'] = "<font color=\"#FF0000\">" . $lang['BuildNextLevel'] . " " . $NextBuildLevel . "</font>";
                    }
                } else {
                    $parse['click'] = "<font color=\"#FF0000\">" . $lang['NoMoreSpace'] . "</font>";
                }
                $BuildingPage .= parsetemplate($SubTemplate, $parse);
            }
        }
    }
    $parse = $lang;
    if ($Queue['lenght'] > 0) {
        $parse['BuildListScript'] = InsertBuildListScript("?action=internalBuildings");
        $parse['BuildList'] = $Queue['buildlist'];
    } else {
        $parse['BuildListScript'] = "";
        $parse['BuildList'] = "";
    }
    $parse['planet_field_current'] = $CurrentPlanet["field_current"];
    $parse['planet_field_max'] = $CurrentPlanet['field_max'] + $CurrentPlanet[$resource[33]] * 5;
    $parse['field_libre'] = $parse['planet_field_max'] - $CurrentPlanet['field_current'];
    $parse['BuildingsList'] = $BuildingPage;
    $page .= parsetemplate(gettemplate('buildings_builds'), $parse);
    display($page, $lang['Builds']);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:BatimentBuildingPage.php

示例12: ShowBuildingsPage


//.........这里部分代码省略.........
                     $this->AddBuildingToQueue($CurrentPlanet, $CurrentUser, $Element, true);
                     break;
                 case 'destroy':
                     $this->AddBuildingToQueue($CurrentPlanet, $CurrentUser, $Element, false);
                     break;
             }
             header("location:game.php?page=buildings");
         }
     }
     SetNextQueueElementOnTop($CurrentPlanet, $CurrentUser);
     $Queue = $this->ShowBuildingQueue($CurrentPlanet, $CurrentUser);
     $this->BuildingSavePlanetRecord($CurrentPlanet);
     if ($Queue['lenght'] < MAX_BUILDING_QUEUE_SIZE) {
         $CanBuildElement = true;
     } else {
         $CanBuildElement = false;
     }
     $siguiente = 1;
     foreach ($reslist['build'] as $Element) {
         if (in_array($Element, $Allowed[$CurrentPlanet['planet_type']])) {
             $CurrentMaxFields = CalculateMaxPlanetFields($CurrentPlanet);
             if ($CurrentPlanet["field_current"] < $CurrentMaxFields - $Queue['lenght']) {
                 $RoomIsOk = true;
             } else {
                 $RoomIsOk = false;
             }
             if (IsTechnologieAccessible($CurrentUser, $CurrentPlanet, $Element)) {
                 $displays->newblock('build');
                 $HaveRessources = IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, true, false);
                 $parse['i'] = $Element;
                 $BuildingLevel = $CurrentPlanet[$resource[$Element]];
                 $parse['nivel'] = $BuildingLevel == 0 ? "" : " (" . $lang['bd_lvl'] . " " . $BuildingLevel . ")";
                 $parse['n'] = $lang['tech'][$Element];
                 $parse['descriptionss'] = $lang['res']['descriptions'][$Element];
                 $ElementBuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
                 $parse['time'] = ShowBuildTime($ElementBuildTime);
                 $parse['price'] = GetElementPrice($CurrentUser, $CurrentPlanet, $Element);
                 $NextBuildLevel = $CurrentPlanet[$resource[$Element]] + 1;
                 if ($RoomIsOk && $CanBuildElement) {
                     if ($Queue['lenght'] == 0) {
                         if ($NextBuildLevel == 1) {
                             if ($HaveRessources == true) {
                                 $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_build'] . "</font></a>";
                             } else {
                                 $parse['click'] = "<font color=#FF0000>" . $lang['bd_build'] . "</font>";
                             }
                         } else {
                             if ($HaveRessources == true) {
                                 $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font></a>";
                             } else {
                                 $parse['click'] = "<font color=#FF0000>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font>";
                             }
                         }
                     } else {
                         $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_add_to_list'] . "</font></a>";
                     }
                 } elseif ($RoomIsOk && !$CanBuildElement) {
                     if ($NextBuildLevel == 1) {
                         $parse['click'] = "<font color=#FF0000>" . $lang['bd_build'] . "</font>";
                     } else {
                         $parse['click'] = "<font color=#FF0000>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font>";
                     }
                 } else {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_no_more_fields'] . "</font>";
                 }
                 if ($siguiente % 3 == 0) {
                     $parse['cerrar'] = "</tr><tr>";
                 }
                 $siguiente++;
                 if ($Element == 31 && $CurrentUser["b_tech_planet"] != 0) {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_working'] . "</font>";
                 }
                 if (($Element == 21 or $Element == 14 or $Element == 15) && $CurrentPlanet["b_hangar"] != 0) {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_working'] . "</font>";
                 }
                 foreach ($parse as $name => $trans) {
                     $displays->assign($name, $trans);
                 }
                 unset($parse);
             }
         }
     }
     if ($Queue['lenght'] > 0) {
         include $svn_root . 'includes/functions/InsertBuildListScript.' . $phpEx;
         $parse['BuildListScript'] = InsertBuildListScript("buildings");
         $parse['BuildList'] = $Queue['buildlist'];
         $parse['ScriptList'] = $Queue['scriptlist'];
     } else {
         $parse['BuildListScript'] = "";
         $parse['BuildList'] = "";
     }
     $displays->gotoBlock("_ROOT");
     $displays->assign("planet_field_current", $CurrentPlanet['field_current']);
     $displays->assign("planet_field_max", CalculateMaxPlanetFields($CurrentPlanet));
     $displays->assign("BuildListScript", $parse['BuildListScript']);
     $displays->assign("BuildList", $Queue['buildlist']);
     $displays->assign("ScriptList", $Queue['scriptlist']);
     $displays->assign("time_time", time() * 1000);
     $displays->display('Construcciones');
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:class.ShowBuildingsPage.php

示例13: ShowOverviewPage


//.........这里部分代码省略.........
                $parse['STAATSFORM_LINK'] = "\r\n<tr><center>\r\n    <th colspan=\"2\">Forma de gobierno:</th>\r\n    <th colspan=\"2\"><a href=\"game.php?page=gouv\" accesskey=\"d\" style=\"font-size:100%\">" . $lang['aristocratie'] . "</a></th>\r\n</tr>";
            } else {
                $parse['STAATSFORM_LINK'] = "\r\n<tr><center>\r\n    <th colspan=\"2\">Forma de gobierno:</th>\r\n    <th colspan=\"2\"><a href=\"game.php?page=gouv\" accesskey=\"d\" style=\"font-size:100%\">" . $lang['barbarisch'] . "</a></th>\r\n</tr>";
            }
            if ($user['humano'] == 1) {
                $parse['race'] = 'Raza: Humano';
                $parse['imgrace'] = 'images/human.gif';
            } else {
                if ($user['vampiro'] == 1) {
                    $parse['race'] = 'Raza: Vampiro';
                    $parse['imgrace'] = 'images/vampiro.gif';
                } else {
                    if ($user['lobo'] == 1) {
                        $parse['race'] = 'Raza : Lobo';
                        $parse['imgrace'] = 'images/lobo.gif';
                    } else {
                        if ($user['asgard'] == 1) {
                            $parse['race'] = 'Raza : Asgard';
                            $parse['imgrace'] = 'images/asgard.gif';
                        }
                    }
                }
            }
            $StatRecord = doquery("SELECT `total_rank`,`total_points` FROM `{{table}}` WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . intval($CurrentUser['id']) . "';", 'statpoints', true);
            $parse['user_username'] = $CurrentUser['username'];
            if (count($fpage) > 0) {
                ksort($fpage);
                foreach ($fpage as $time => $content) {
                    $flotten .= $content . "\n";
                }
            }
            // **** INICIA MOD {MOSTRAR TECNOLOGIA EN PROCESO EN VISTA GENERAL} ****
            if ($CurrentPlanet['b_building'] != 0) {
                include $xgp_root . 'includes/functions/InsertBuildListScript.' . $phpEx;
                UpdatePlanetBatimentQueueList($planetrow, $user);
                if ($CurrentPlanet['b_building'] != 0) {
                    $BuildQueue = explode(";", $CurrentPlanet['b_building_id']);
                    $CurrBuild = explode(",", $BuildQueue[0]);
                    $RestTime = $CurrentPlanet['b_building'] - time();
                    $PlanetID = $CurrentPlanet['id'];
                    $Build = InsertBuildListScript("buildings");
                    $Build .= "<table>";
                    $Build .= "    <tr>";
                    $Build .= "        <td colspan=\"2\">" . $lang['tech'][$CurrBuild[0]] . "</td>";
                    $Build .= "    </tr>";
                    $Build .= "    <tr>";
                    $Build .= "        <td align=\"center\" valign=\"middle\"><img src=\"" . $dpath . "gebaeude/" . $CurrBuild[0] . ".gif\" width=\"40\" height=\"40\"></td>";
                    $Build .= "        <td>" . $lang['pr_subiendo'] . " <span style=\"color:#FF8C00;\">Nivel " . $CurrBuild[1] . "</span><br />";
                    $Build .= "            " . $lang['pr_duracion'] . ":<div id=\"blc\" class=\"z\" style=\"color:yellow;\">" . pretty_time($RestTime) . "</div>";
                    $Build .= "        </td>";
                    $Build .= "    </tr>";
                    $Build .= "</Table>";
                    $Build .= "\n<script language=\"JavaScript\">";
                    $Build .= "\n    pp = \"" . $RestTime . "\";\n";
                    $Build .= "\n    pk = \"" . 1 . "\";\n";
                    $Build .= "\n    pm = \"cancel\";\n";
                    $Build .= "\n    pl = \"" . $PlanetID . "\";\n";
                    $Build .= "\n    t();\n";
                    $Build .= "\n</script>\n";
                    $parse['building'] = $Build;
                } else {
                    $parse['building'] = $lang['ov_free'];
                }
            } else {
                $parse['building'] = $lang['ov_free'];
            }
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:ShowOverviewPage.php

示例14: __construct


//.........这里部分代码省略.........
     $this->BuildingSavePlanetRecord($CurrentPlanet);
     if ($Queue['lenght'] < MAX_BUILDING_QUEUE_SIZE) {
         $CanBuildElement = true;
     } else {
         $CanBuildElement = false;
     }
     $BuildingPage = "";
     $zaehler = 1;
     foreach ($lang['tech'] as $Element => $ElementName) {
         if (in_array($Element, $Allowed[$CurrentPlanet['planet_type']])) {
             $CurrentMaxFields = CalculateMaxPlanetFields($CurrentPlanet);
             if ($CurrentPlanet["field_current"] < $CurrentMaxFields - $Queue['lenght']) {
                 $RoomIsOk = true;
             } else {
                 $RoomIsOk = false;
             }
             if (IsTechnologieAccessible($CurrentUser, $CurrentPlanet, $Element)) {
                 $HaveRessources = IsElementBuyable($CurrentUser, $CurrentPlanet, $Element, true, false);
                 $parse = array();
                 $parse = $lang;
                 $parse['dpath'] = $dpath;
                 $parse['i'] = $Element;
                 $BuildingLevel = $CurrentPlanet[$resource[$Element]];
                 $parse['nivel'] = $BuildingLevel == 0 ? "" : " (" . $lang['bd_lvl'] . " " . $BuildingLevel . ")";
                 $BuildLevelFactor = 10;
                 $BuildTemp = $CurrentPlanet['temp_max'];
                 $CurrentBuildtLvl = $BuildingLevel;
                 $BuildLevel = $CurrentBuildtLvl > 0 ? $CurrentBuildtLvl : 1;
                 $EnergyTechLevel = $CurrentUser["energy_tech"];
                 $Prod[4] = floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_ingenieur'] * 0.05);
                 $ActualNeed = floor($Prod[4]);
                 $BuildLevel++;
                 $Prod[4] = floor(eval($ProdGrid[$Element]['formule']['energy']) * $game_config['resource_multiplier']) * (1 + $CurrentUser['rpg_ingenieur'] * 0.05);
                 $EnergyNeed = colorNumber(pretty_number(floor($Prod[4] - $ActualNeed)));
                 if ($Element >= 1 && $Element <= 3 or $Element == 5) {
                     $parse['energy'] = "&nbsp;<font color=#FF0000>" . $EnergyNeed . "</font>";
                     $BuildLevel = 0;
                 } elseif ($Element == 4 || $Element == 12) {
                     $parse['energy'] = "&nbsp;<font color=#00FF00>+" . $EnergyNeed . "</font>";
                     $BuildLevel = 0;
                 }
                 $parse['n'] = $ElementName;
                 $parse['descriptions'] = $lang['res']['descriptions'][$Element];
                 $ElementBuildTime = GetBuildingTime($CurrentUser, $CurrentPlanet, $Element);
                 $parse['time'] = ShowBuildTime($ElementBuildTime);
                 $parse['price'] = GetElementPrice($CurrentUser, $CurrentPlanet, $Element);
                 $parse['click'] = '';
                 $NextBuildLevel = $CurrentPlanet[$resource[$Element]] + 1;
                 if ($RoomIsOk && $CanBuildElement) {
                     if ($Queue['lenght'] == 0) {
                         if ($NextBuildLevel == 1) {
                             if ($HaveRessources == true) {
                                 $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_build'] . "</font></a>";
                             } else {
                                 $parse['click'] = "<font color=#FF0000>" . $lang['bd_build'] . "</font>";
                             }
                         } else {
                             if ($HaveRessources == true) {
                                 $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font></a>";
                             } else {
                                 $parse['click'] = "<font color=#FF0000>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font>";
                             }
                         }
                     } else {
                         if ($HaveRessources == true) {
                             $parse['click'] = "<a href=\"game.php?page=buildings&cmd=insert&building=" . $Element . "\"><font color=#00FF00>" . $lang['bd_add_to_list'] . "</font></a>";
                         } else {
                             $parse['click'] = "<font color=#FF0000>" . $lang['bd_add_to_list'] . "</font>";
                         }
                     }
                 } elseif ($RoomIsOk && !$CanBuildElement) {
                     if ($NextBuildLevel == 1) {
                         $parse['click'] = "<font color=#FF0000>" . $lang['bd_build'] . "</font>";
                     } else {
                         $parse['click'] = "<font color=#FF0000>" . $lang['bd_build_next_level'] . $NextBuildLevel . "</font>";
                     }
                 } else {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_no_more_fields'] . "</font>";
                 }
                 if ($Element == 31 && $CurrentUser["b_tech_planet"] != 0) {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_working'] . "</font>";
                 }
                 if (($Element == 21 or $Element == 14 or $Element == 15) && $CurrentPlanet["b_hangar"] != 0) {
                     $parse['click'] = "<font color=#FF0000>" . $lang['bd_working'] . "</font>";
                 }
                 $BuildingPage .= parsetemplate(gettemplate('buildings/buildings_builds_row'), $parse);
             }
         }
     }
     if ($Queue['lenght'] > 0) {
         include $xgp_root . 'includes/functions/InsertBuildListScript.' . $phpEx;
         $parse['BuildListScript'] = InsertBuildListScript("buildings");
         $parse['BuildList'] = $Queue['buildlist'];
     } else {
         $parse['BuildListScript'] = "";
         $parse['BuildList'] = "";
     }
     $parse['BuildingsList'] = $BuildingPage;
     display(parsetemplate(gettemplate('buildings/buildings_builds'), $parse));
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:class.ShowBuildingsPage.php

示例15: ShowOverviewPage


//.........这里部分代码省略.........
                    $Coloneshow++;
                    $AllPlanets .= "<th>" . $CurrentUserPlanet['name'] . "<br>";
                    $AllPlanets .= "<a href=\"game.php?page=overview&cp=" . $CurrentUserPlanet['id'] . "&re=0\" title=\"" . $CurrentUserPlanet['name'] . "\"><img src=\"" . $dpath . "planeten/small/s_" . $CurrentUserPlanet['image'] . ".jpg\" height=\"50\" width=\"50\"></a><br>";
                    $AllPlanets .= "<center>";
                    if ($CurrentUserPlanet['b_building'] != 0) {
                        UpdatePlanetBatimentQueueList($CurrentUserPlanet, $CurrentUser);
                        if ($CurrentUserPlanet['b_building'] != 0) {
                            $BuildQueue = $CurrentUserPlanet['b_building_id'];
                            $QueueArray = explode(";", $BuildQueue);
                            $CurrentBuild = explode(",", $QueueArray[0]);
                            $BuildElement = $CurrentBuild[0];
                            $BuildLevel = $CurrentBuild[1];
                            $BuildRestTime = pretty_time($CurrentBuild[3] - time());
                            $AllPlanets .= '' . $lang['tech'][$BuildElement] . ' (' . $BuildLevel . ')';
                            $AllPlanets .= "<br><font color=\"#7f7f7f\">(" . $BuildRestTime . ")</font>";
                        } else {
                            CheckPlanetUsedFields($CurrentUserPlanet);
                            $AllPlanets .= $lang['ov_free'];
                        }
                    } else {
                        $AllPlanets .= $lang['ov_free'];
                    }
                    $AllPlanets .= "</center></th>";
                    if ($Colone <= 1) {
                        $Colone++;
                    } else {
                        $AllPlanets .= "</tr><tr>";
                        $Colone = 1;
                    }
                }
            }
            $AllPlanets .= "</tr>";
            if ($lunarow['id'] != 0 && $lunarow['destruyed'] != 1 && $CurrentPlanet['planet_type'] != 3) {
                if ($CurrentPlanet['planet_type'] == 1 or $lunarow['id'] != 0) {
                    $moon = doquery("SELECT `id`,`name`,`image` FROM {{table}} WHERE `galaxy` = '" . $CurrentPlanet['galaxy'] . "' AND `system` = '" . $CurrentPlanet['system'] . "' AND `planet` = '" . $CurrentPlanet['planet'] . "' AND `planet_type` = '3'", 'planets', true);
                    $parse['moon_img'] = "<a href=\"game.php?page=overview&cp=" . $moon['id'] . "&re=0\" title=\"" . $moon['name'] . "\"><img src=\"" . $dpath . "planeten/" . $moon['image'] . ".jpg\" height=\"50\" width=\"50\"></a>";
                    $parse['moon'] = $moon['name'] . " (" . $lang['fcm_moon'] . ")";
                } else {
                    $parse['moon_img'] = "";
                    $parse['moon'] = "";
                }
            } else {
                $parse['moon_img'] = "";
                $parse['moon'] = "";
            }
            $parse['planet_diameter'] = pretty_number($CurrentPlanet['diameter']);
            $parse['planet_field_current'] = $CurrentPlanet['field_current'];
            $parse['planet_field_max'] = CalculateMaxPlanetFields($CurrentPlanet);
            $parse['planet_temp_min'] = $CurrentPlanet['temp_min'];
            $parse['planet_temp_max'] = $CurrentPlanet['temp_max'];
            $StatRecord = doquery("SELECT `total_rank`,`total_points` FROM `{{table}}` WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $CurrentUser['id'] . "';", 'statpoints', true);
            $parse['user_username'] = $CurrentUser['username'];
            if (count($fpage) > 0) {
                ksort($fpage);
                foreach ($fpage as $time => $content) {
                    $flotten .= $content . "\n";
                }
            }
            if ($CurrentPlanet['b_building'] != 0) {
                include $xgp_root . 'includes/functions/InsertBuildListScript.' . $phpEx;
                UpdatePlanetBatimentQueueList($planetrow, $user);
                if ($CurrentPlanet['b_building'] != 0) {
                    $BuildQueue = explode(";", $CurrentPlanet['b_building_id']);
                    $CurrBuild = explode(",", $BuildQueue[0]);
                    $RestTime = $CurrentPlanet['b_building'] - time();
                    $PlanetID = $CurrentPlanet['id'];
                    $Build = InsertBuildListScript("overview");
                    $Build .= $lang['tech'][$CurrBuild[0]] . ' (' . $CurrBuild[1] . ')';
                    $Build .= "<br /><div id=\"blc\" class=\"z\">" . pretty_time($RestTime) . "</div>";
                    $Build .= "\n<script language=\"JavaScript\">";
                    $Build .= "\n\tpp = \"" . $RestTime . "\";\n";
                    $Build .= "\n\tpk = \"" . 1 . "\";\n";
                    $Build .= "\n\tpm = \"cancel\";\n";
                    $Build .= "\n\tpl = \"" . $PlanetID . "\";\n";
                    $Build .= "\n\tt();\n";
                    $Build .= "\n</script>\n";
                    $parse['building'] = $Build;
                } else {
                    $parse['building'] = $lang['ov_free'];
                }
            } else {
                $parse['building'] = $lang['ov_free'];
            }
            $parse['fleet_list'] = $flotten;
            $parse['Have_new_message'] = $Have_new_message;
            $parse['planet_image'] = $CurrentPlanet['image'];
            $parse['anothers_planets'] = $AllPlanets;
            $parse["dpath"] = $dpath;
            if ($game_config['stat'] == 0) {
                $parse['user_rank'] = pretty_number($StatRecord['total_points']) . " (" . $lang['ov_place'] . " <a href=\"game.php?page=statistics&range=" . $StatRecord['total_rank'] . "\">" . $StatRecord['total_rank'] . "</a> " . $lang['ov_of'] . " " . $game_config['users_amount'] . ")";
            } elseif ($game_config['stat'] == 1 && $CurrentUser['authlevel'] < $game_config['stat_level']) {
                $parse['user_rank'] = pretty_number($StatRecord['total_points']) . " (" . $lang['ov_place'] . " <a href=\"game.php?page=statistics&range=" . $StatRecord['total_rank'] . "\">" . $StatRecord['total_rank'] . "</a> " . $lang['ov_of'] . " " . $game_config['users_amount'] . ")";
            } else {
                $parse['user_rank'] = "-";
            }
            $parse['date_time'] = date("D M j H:i:s", time());
            return display(parsetemplate(gettemplate('overview/overview_body'), $parse));
            break;
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowOverviewPage.php


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