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


PHP SetSelectedPlanet函数代码示例

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


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

示例1: stristr

        include $xnova_root_path . 'rak.' . $phpEx;
        if (defined('IN_ADMIN')) {
            $UserSkin = $user['dpath'];
            $local = stristr($UserSkin, "http:");
            if ($local === false) {
                if (!$user['dpath']) {
                    $dpath = "../" . DEFAULT_SKINPATH;
                } else {
                    $dpath = "../" . $user["dpath"];
                }
            } else {
                $dpath = $UserSkin;
            }
        } else {
            $dpath = !$user["dpath"] ? DEFAULT_SKINPATH : $user["dpath"];
        }
        SetSelectedPlanet($user);
        $planetrow = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $user['current_planet'] . "';", 'planets', true);
        $galaxyrow = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '" . $planetrow['id'] . "';", 'galaxy', true);
        CheckPlanetUsedFields($planetrow);
        date_default_timezone_set($user['timezone']);
    } else {
        $dpath = "../" . DEFAULT_SKINPATH;
    }
    includeLang("lang_info", ".cfg");
    includeLang("system");
    includeLang('tech');
} else {
    includeLang("lang_info", ".cfg");
    $dpath = "../" . DEFAULT_SKINPATH;
}
开发者ID:GaryHuang-CL,项目名称:y1910061,代码行数:31,代码来源:common.php

示例2: ShowFleetACSPage

function ShowFleetACSPage($CurrentUser, $CurrentPlanet)
{
    global $resource, $pricelist, $reslist, $phpEx, $lang;
    $parse = $lang;
    $fleetid = $_POST['fleetid'];
    if (!is_numeric($fleetid) || empty($fleetid)) {
        exit(header("Location: game." . $phpEx . "?page=fleet"));
    }
    if (isset($_POST['add_member_to_aks']) && !empty($_POST['add_member_to_aks'])) {
        $added_user_id_mr = 0;
        $member_qry_mr = doquery("SELECT `id` FROM {{table}} WHERE `username` ='" . $_POST['addtogroup'] . "' ;", 'users');
        while ($row = mysql_fetch_array($member_qry_mr)) {
            $added_user_id_mr .= $row['id'];
        }
        if ($added_user_id_mr > 0) {
            $new_eingeladen_mr = $_POST['aks_invited_mr'] . ',' . $added_user_id_mr;
            doquery("UPDATE {{table}} SET `eingeladen` = '" . $new_eingeladen_mr . "' ;", 'aks');
            $add_user_message_mr = "<font color=\"lime\">" . $lang['fl_player'] . " " . $_POST['addtogroup'] . " " . $lang['fl_Add_to_attack'];
        } else {
            $add_user_message_mr = "<font color=\"red\">" . $lang['fl_player'] . " " . $_POST['addtogroup'] . " " . $lang['fl_dont_exist'] . "";
        }
        $invite_message = $lang['fl_player'] . $CurrentUser['username'] . $lang['fl_acs_invitation_message'];
        SendSimpleMessage($added_user_id_mr, $CurrentUser['id'], time(), 1, $CurrentUser['username'], $lang['fl_acs_invitation_title'], $invite_message);
    }
    $query = doquery("SELECT * FROM {{table}} WHERE fleet_id = '" . $fleetid . "'", 'fleets');
    if (mysql_num_rows($query) != 1) {
        exit(header("Location: game." . $phpEx . "?page=fleet"));
    }
    $daten = mysql_fetch_array($query);
    if ($daten['fleet_start_time'] <= time() || $daten['fleet_end_time'] < time() || $daten['fleet_mess'] == 1) {
        exit(header("Location: game." . $phpEx . "?page=fleet"));
    }
    if (!isset($_POST['send'])) {
        SetSelectedPlanet($CurrentUser);
        $galaxyrow = doquery("SELECT * FROM {{table}} WHERE `id_planet` = '" . $CurrentPlanet['id'] . "';", 'galaxy', true);
        $maxfleet = doquery("SELECT COUNT(fleet_owner) as ilosc FROM {{table}} WHERE fleet_owner='{$CurrentUser['id']}'", 'fleets', true);
        $maxfleet_count = $maxfleet["ilosc"];
        $fleet = doquery("SELECT * FROM {{table}} WHERE fleet_id = '" . $fleetid . "'", 'fleets', true);
        if (empty($fleet['fleet_group'])) {
            $rand = mt_rand(100000, 999999999);
            $aks_code_mr = "AG" . $rand;
            $aks_invited_mr = $CurrentUser['id'];
            doquery("INSERT INTO {{table}} SET\r\n\t\t\t`name` = '" . $aks_code_mr . "',\r\n\t\t\t`teilnehmer` = '" . $CurrentUser['id'] . "',\r\n\t\t\t`flotten` = '" . $fleetid . "',\r\n\t\t\t`ankunft` = '" . $fleet['fleet_start_time'] . "',\r\n\t\t\t`galaxy` = '" . $fleet['fleet_end_galaxy'] . "',\r\n\t\t\t`system` = '" . $fleet['fleet_end_system'] . "',\r\n\t\t\t`planet` = '" . $fleet['fleet_end_planet'] . "',\r\n\t\t\t`planet_type` = '" . $fleet['fleet_end_type'] . "',\r\n\t\t\t`eingeladen` = '" . $aks_invited_mr . "'\r\n\t\t\t", 'aks');
            $aks = doquery("SELECT * FROM {{table}} WHERE\r\n\t\t\t`name` = '" . $aks_code_mr . "' AND\r\n\t\t\t`teilnehmer` = '" . $CurrentUser['id'] . "' AND\r\n\t\t\t`flotten` = '" . $fleetid . "' AND\r\n\t\t\t`ankunft` = '" . $fleet['fleet_start_time'] . "' AND\r\n\t\t\t`galaxy` = '" . $fleet['fleet_end_galaxy'] . "' AND\r\n\t\t\t`system` = '" . $fleet['fleet_end_system'] . "' AND\r\n\t\t\t`planet` = '" . $fleet['fleet_end_planet'] . "' AND\r\n\t\t\t`eingeladen` = '" . $CurrentUser['id'] . "'\r\n\t\t\t", 'aks', true);
            $aks_madnessred = doquery("SELECT * FROM {{table}} WHERE\r\n\t\t\t`name` = '" . $aks_code_mr . "' AND\r\n\t\t\t`teilnehmer` = '" . $CurrentUser['id'] . "' AND\r\n\t\t\t`flotten` = '" . $fleetid . "' AND\r\n\t\t\t`ankunft` = '" . $fleet['fleet_start_time'] . "' AND\r\n\t\t\t`galaxy` = '" . $fleet['fleet_end_galaxy'] . "' AND\r\n\t\t\t`system` = '" . $fleet['fleet_end_system'] . "' AND\r\n\t\t\t`planet` = '" . $fleet['fleet_end_planet'] . "' AND\r\n\t\t\t`eingeladen` = '" . $CurrentUser['id'] . "'\r\n\t\t\t", 'aks');
            doquery("UPDATE {{table}} SET\r\n\t\t\tfleet_group = '" . $aks['id'] . "'\r\n\t\t\tWHERE\r\n\t\t\tfleet_id = '" . $fleetid . "'", 'fleets');
        } else {
            $aks = doquery("SELECT * FROM {{table}} WHERE id = '" . $fleet['fleet_group'] . "'", 'aks');
            $aks_madnessred = doquery("SELECT * FROM {{table}} WHERE id = '" . $fleet['fleet_group'] . "'", 'aks');
            if (mysql_num_rows($aks) != 1) {
                exit(header("Location: game." . $phpEx . "?page=fleet"));
            }
            $aks = mysql_num_rows($aks);
        }
        $missiontype = array(1 => $lang['type_mission'][1], 2 => $lang['type_mission'][2], 3 => $lang['type_mission'][3], 4 => $lang['type_mission'][4], 5 => $lang['type_mission'][5], 6 => $lang['type_mission'][6], 7 => $lang['type_mission'][7], 8 => $lang['type_mission'][8], 9 => $lang['type_mission'][9], 15 => $lang['type_mission'][15], 16 => $lang['type_mission'][16], 17 => $lang['type_mission'][17]);
        $speed = array(10 => 100, 9 => 90, 8 => 80, 7 => 70, 6 => 60, 5 => 50, 4 => 40, 3 => 30, 2 => 20, 1 => 10);
        $galaxy = intval($_GET['galaxy']);
        $system = intval($_GET['system']);
        $planet = intval($_GET['planet']);
        $planettype = intval($_GET['planettype']);
        $target_mission = intval($_GET['target_mission']);
        if (!$galaxy) {
            $galaxy = $CurrentPlanet['galaxy'];
        }
        if (!$system) {
            $system = $CurrentPlanet['system'];
        }
        if (!$planet) {
            $planet = $CurrentPlanet['planet'];
        }
        if (!$planettype) {
            $planettype = $CurrentPlanet['planet_type'];
        }
        $ile = '' . (1 + $CurrentUser[$resource[108]]) + $CurrentUser['rpg_commandant'] * COMMANDANT . '';
        $parse['ile'] = $ile;
        $fq = doquery("SELECT * FROM {{table}} WHERE fleet_owner='{$CurrentUser['id']}' AND fleet_mission <> 10", "fleets");
        $i = 0;
        while ($f = mysql_fetch_array($fq)) {
            $i++;
            $page .= "<tr height=20><th>{$i}</th><th>";
            $page .= "<a title=\"\">{$missiontype[$f[fleet_mission]]}</a>";
            if ($f['fleet_start_time'] + 1 == $f['fleet_end_time']) {
                $page .= " <a title=\"" . $lang['fl_returning'] . "\">" . $lang['fl_r'] . "</a>";
            }
            $page .= "</th><th><a title=\"";
            $fleet = explode(";", $f['fleet_array']);
            $e = 0;
            foreach ($fleet as $a => $b) {
                if ($b != '') {
                    $e++;
                    $a = explode(",", $b);
                    $page .= "{$lang['tech'][$a[0]]}: {$a[1]}\n";
                    if ($e > 1) {
                        $page .= "\t";
                    }
                }
            }
            $page .= "\">" . pretty_number($f[fleet_amount]) . "</a></th>";
            $page .= "<th>[{$f[fleet_start_galaxy]}:{$f[fleet_start_system]}:{$f[fleet_start_planet]}]</th>";
            $page .= "<th>" . gmdate("d. M Y H:i:s", $f['fleet_start_time']) . "</th>";
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowFleetACSPage.php

示例3: unset

 *
 * @version 1.1 Security checks by Gorlum for http://supernova.ws
 */
require_once 'includes/init.php';
global $debug, $sn_mvc, $template_result, $user;
// Напоминание для Администрации, что игра отключена
if ($template_result[F_GAME_DISABLE]) {
    // $disable_reason = sys_bbcodeParse($config->game_disable_reason); // Должна быть инициализирована выше по коду - в init.php
    echo '<div class="global_admin_warning">', $template_result[F_GAME_DISABLE_REASON], '</div>';
}
unset($disable_reason);
if (defined('IN_ADMIN') && IN_ADMIN === true) {
    lng_include('admin');
} elseif ($sys_user_logged_in) {
    sys_user_vacation($user);
    $planet_id = SetSelectedPlanet($user);
    // TODO НЕ НУЖНО АЛЬЯНС КАЖДЫЙ РАЗ ОБНОВЛЯТЬ!!!
    if ($user['ally_id']) {
        sn_db_transaction_start();
        sn_ali_fill_user_ally($user);
        if (!$user['ally']['player']['id']) {
            sn_sys_logout(false, true);
            $debug->error("User ID {$user['id']} has ally ID {$user['ally_id']} but no ally info", 'User record error', 502);
        }
        // TODO UNCOMMENT
        que_process($user['ally']['player']);
        db_user_set_by_id($user['ally']['player']['id'], '`onlinetime` = ' . SN_TIME_NOW);
        sn_db_transaction_commit();
    }
    // TODO - в режиме эмуляции, на самом деле!
    sn_db_transaction_start();
开发者ID:hayalolsam,项目名称:SuperNova,代码行数:31,代码来源:common.php

示例4: ShowFleetSacPage

function ShowFleetSacPage($CurrentUser, $CurrentPlanet)
{
    global $resource, $pricelist, $reslist, $phpEx, $lang, $db, $displays, $users;
    //$parse		= $lang;
    $displays->assignContent('fleet/fleetACS_table');
    //, $parse)
    $fleetid = $_POST['fleetid'];
    //Comprobación de si es o no un número el id de la flota.
    if (!is_numeric($fleetid) || empty($fleetid)) {
        exit(header("Location: game." . $phpEx . "?page=fleet"));
    }
    //Si no está vacío el campo "invitar usuario" procedemos
    if (isset($_POST['invited'])) {
        $added_user_id_mr = count($_POST['invited']);
        //Si las id de los usuarios añadidos es mayor que 0 (es decir, si se ha invitado a alguien)
        if ($added_user_id_mr > 0) {
            $aks = $db->query("SELECT invited FROM {{table}} WHERE\r\n\t\t\t`fleet_id` = '" . $fleetid . "'", 'sac', true);
            $array = explode(",", $aks["invited"]);
            //Declaramos el nuevo grupo de ataque con el invitador, y los invitados
            $new_eingeladen_mr = "";
            foreach ($_POST['invited'] as $id) {
                if (!in_array($id, $array)) {
                    $not_yet_invited[] = $id;
                }
                $new_eingeladen_mr .= $id . ",";
            }
            $new_eingeladen_mr = substr_replace($new_eingeladen_mr, '', -1);
            //Actualizamos la base de datos poniendo en el campo `ìnvited` el grupo invitado
            $db->query("UPDATE {{table}} SET `invited` = '" . $new_eingeladen_mr . "' WHERE fleet_id={$fleetid} ;", 'sac');
        }
        /*else{
                                $db->query("UPDATE {{table}} SET `invited` = '' WHERE fleet_id={$fleetid} ;",'sac');
        		}*/
        //Mandamos el mensaje al usuario/s invitado/s para que puedan proceder a mandar flota
        $invite_message = $lang['fl_player'] . $CurrentUser['username'] . $lang['fl_acs_invitation_message'];
        foreach ($_POST['invited'] as $id) {
            if (is_array($not_yet_invited)) {
                if (in_array($id, $not_yet_invited)) {
                    $users->SendSimpleMessage($id, $CurrentUser['id'], time(), 1, $CurrentUser['username'], $lang['fl_acs_invitation_title'], $invite_message);
                }
            }
        }
        exit;
    } elseif (isset($_POST['invited']) && empty($_POST['invited'])) {
        $db->query("UPDATE {{table}} SET `invited` = '' WHERE fleet_id={$fleetid} ;", 'sac');
        exit;
    }
    if (isset($_POST["sac_name"])) {
        /*$aks = $db->query(
        		"SELECT name FROM {{table}} WHERE
        		`fleet_id` = '" . $fleetid . "'", 'sac', true);
                     if($aks["name"]!=$_POST["sac_name"]){
                           $db->query("UPDATE {{table}} SET `name` = '{$_POST["sac_name"]}' WHERE fleet_id={$fleetid} ;",'sac');
                     }*/
        echo "cambiado";
        exit;
    }
    //Imprimimos el id de la flota
    //echo $fleetid;
    //Seleccionamos la flota con el id anterior de la tabla de flotas
    $query = $db->query("SELECT * FROM {{table}} WHERE fleet_id = '" . $fleetid . "'", 'fleets');
    //Si no hay ninguna fila en la tabla de datos que corresponda con esa id nos devuelve a la página de flotas inicial
    if (mysql_num_rows($query) != 1) {
        exit(header("Location: game." . $phpEx . "?page=fleet"));
    }
    //Recogemos todos los datos obtenidos con $query en un array llamado $daten
    $daten = mysql_fetch_array($query);
    //Si la hora de salida de la flota es menor que la hora actual o que la hora final es menor que la hora actual
    //O si la flota está volviendo nos devuelve a la página inicial de flotas.
    if ($daten['fleet_start_time'] < time() || $daten['fleet_end_time'] < time() || $daten['fleet_mess'] == 1) {
        exit(header("Location: game." . $phpEx . "?page=fleet"));
    }
    //Si no se ha enviado la flota
    if (!isset($_POST['send'])) {
        //Seleccionamos el planeta del usuario actual
        SetSelectedPlanet($CurrentUser);
        //Realizamos querys para recoger todos los datos del planeta actual
        //Y para saber el numero de flotas enviadas
        $galaxyrow = $db->query("SELECT * FROM {{table}} WHERE `id_planet` = '" . $CurrentPlanet['id'] . "';", 'galaxy', true);
        $maxfleet = $db->query("SELECT COUNT(fleet_owner) as ilosc FROM {{table}} WHERE fleet_owner='{$CurrentUser['id']}'", 'fleets', true);
        $maxfleet_count = $maxfleet["ilosc"];
        //Seleccionamos todos los datos de la flota (tabla 'fleets') en un array $fleet.
        $fleet = $db->query("SELECT * FROM {{table}} WHERE fleet_id = '" . $fleetid . "'", 'fleets', true);
        //Si la flota no pertenece a ningun grupo
        if (empty($fleet['fleet_group'])) {
            //Se establece el nombre del SAC mediante un número aleatorio detrás de las letras "SVN"
            $rand = mt_rand(100000, 999999999);
            $aks_code_mr = "SVN" . $rand;
            //Definimos "$aks_invited_mr" como el usuario que ha invitado al resto
            $aks_invited_mr = $CurrentUser['id'] . ',' . $added_user_id_mr;
            //Introducimos todos los datos del SAC en la tabla correspondiente
            $db->query("INSERT INTO {{table}} SET\r\n\t\t\t`name` = '" . $aks_code_mr . "',\r\n\t\t\t`origen_id` = '" . $CurrentUser['id'] . "',\r\n\t\t\t`fleet_id` = '" . $fleetid . "',\r\n\t\t\t`time` = '" . $fleet['fleet_start_time'] . "',\r\n\t\t\t`galaxy` = '" . $fleet['fleet_end_galaxy'] . "',\r\n\t\t\t`system` = '" . $fleet['fleet_end_system'] . "',\r\n\t\t\t`planet` = '" . $fleet['fleet_end_planet'] . "',\r\n\t\t\t`type` = '" . $fleet['fleet_end_type'] . "',\r\n\t\t\t`accept` = '" . $aks_invited_mr . "'\r\n\t\t\t", 'sac');
            //Seleccionamos todos los datos en un array $aks
            $aks = $db->query("SELECT * FROM {{table}} WHERE\r\n\t\t\t`name` = '" . $aks_code_mr . "' AND\r\n\t\t\t`origen_id` = '" . $CurrentUser['id'] . "' AND\r\n\t\t\t`fleet_id` = '" . $fleetid . "' AND\r\n\t\t\t`time` = '" . $fleet['fleet_start_time'] . "' AND\r\n\t\t\t`galaxy` = '" . $fleet['fleet_end_galaxy'] . "' AND\r\n\t\t\t`system` = '" . $fleet['fleet_end_system'] . "' AND\r\n\t\t\t`planet` = '" . $fleet['fleet_end_planet'] . "'\r\n\t\t\t", 'sac', true);
            //print_r($aks);
            $aks_madnessred = $db->query("SELECT * FROM {{table}} WHERE\r\n\t\t\t`name` = '" . $aks_code_mr . "' AND\r\n\t\t\t`origen_id` = '" . $CurrentUser['id'] . "' AND\r\n\t\t\t`fleet_id` = '" . $fleetid . "' AND\r\n\t\t\t`time` = '" . $fleet['fleet_start_time'] . "' AND\r\n\t\t\t`galaxy` = '" . $fleet['fleet_end_galaxy'] . "' AND\r\n\t\t\t`system` = '" . $fleet['fleet_end_system'] . "' AND\r\n\t\t\t`planet` = '" . $fleet['fleet_end_planet'] . "'\r\n\t\t\t", 'sac');
            //Actualizamos la tabla fleets con el id del grupo de la flota
            $db->query("UPDATE {{table}} SET\r\n\t\t\tfleet_group = '" . $aks['id'] . "',\r\n                        fleet_mission = '2'   \r\n\t\t\tWHERE\r\n\t\t\tfleet_id = '" . $fleetid . "'", 'fleets');
        } else {
            //Seleccionamos los datos del sac que corresponden con la id del grupo de la flota.
//.........这里部分代码省略.........
开发者ID:sonicmaster,项目名称:RPG,代码行数:101,代码来源:ShowFleetSacPage.php


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