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


PHP doquery函数代码示例

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


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

示例1: ShowLeftMenu

function ShowLeftMenu()
{
    global $xgp_root, $phpEx, $dpath, $game_config, $lang, $planetrow, $user, $lang;
    $parse = $lang;
    $parse['dpath'] = $dpath;
    $parse['avatar'] = $user['avatar'];
    $parse['version'] = VERSION;
    $parse['servername'] = $game_config['game_name'];
    $parse['forum_url'] = $game_config['forum_url'];
    $parse['user_rank'] = $user['total_rank'];
    $parse['opt_avata_data'] = $CurrentUser['avatar'];
    $parse['user_username'] = $user['username'];
    // Mod cuenta mensajes by shoek
    $MenSoporte = doquery("SELECT COUNT(*) as total FROM `{{table}}` WHERE `player_id` = '" . intval($CurrentUser['id']) . "' AND `status` = '2';", 'supp', true);
    if ($MenSoporte['total'] > 0) {
        $parse['NumSoporte'] = "(<a href=\"game.php?page=support\">" . $MenSoporte['total'] . "</a>)";
    }
    // Fin mod cuenta mensajes
    if ($_POST && $mode == "change") {
        // Array ( [db_character]
        $iduser = $user["id"];
        $avatar = $_POST["avatar"];
    }
    if (isset($planetrow['sprungtor']) && $planetrow['sprungtor'] > 0) {
        $parse['portal_link'] = "<tr><td><div align=\"center\"><a href='game.php?page=infos&gid=43' ><font color=\"green\">" . $lang['tech'][43] . "</font></a></div></td></tr>";
    }
    return parsetemplate(gettemplate('left_menu'), $parse);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:28,代码来源:ShowLeftMenu.php

示例2: login

function login()
{
    include 'config.php';
    $link = opendb();
    if (isset($_POST["submit"])) {
        $query = doquery("SELECT * FROM {{table}} WHERE username='" . $_POST["username"] . "' AND password='" . md5($_POST["password"]) . "' LIMIT 1", "users");
        if (mysql_num_rows($query) != 1) {
            die("Invalid username or password. Please go back and try again.");
        }
        $row = mysql_fetch_array($query);
        if (isset($_POST["rememberme"])) {
            $expiretime = time() + 31536000;
            $rememberme = 1;
        } else {
            $expiretime = 0;
            $rememberme = 0;
        }
        $cookie = $row["id"] . " " . $row["username"] . " " . md5($row["password"] . "--" . $dbsettings["secretword"]) . " " . $rememberme;
        setcookie("dkgame", $cookie, $expiretime, "/", "", 0);
        header("Location: index.php");
        die;
    }
    $page = gettemplate("login");
    $title = "Log In";
    display($page, $title, false, false, false, false);
}
开发者ID:arveo,项目名称:NarutoBrowserMmorpg,代码行数:26,代码来源:login.php

示例3: ShowLeftMenu

/**
 * adminmenu.php
 *
 * @version 1.2
 * @copyright 2008 By Chlorel for XNova
 * @copyright 2009 By MadnessRed for XNova Redesigned
 */
function ShowLeftMenu($cpage = 'x')
{
    global $lang;
    $qry = doquery("SELECT COUNT('error_id') as `errors` FROM {{table}}", 'errors', true);
    $errorscount = $qry['errors'];
    $qry = doquery("SELECT `id` FROM {{table}} WHERE `status` = 1 || `status` = 2 ;", 'supp');
    $ticketcount = mysql_num_rows($qry);
    $info = @file(XNOVAUKLINK . "info.php");
    if ($info[0] != VERSION . "\n") {
        $newversion = colourRed("(*)");
    }
    $adminpages = array('overview' => 'Overview ' . $newversion, 'config' => 'Configuration', 'edit' => 'Manage Users', 'errors' => 'Errors (' . $errorscount . ')', 'supp' => 'Tickets (' . $ticketcount . ')');
    getLang('menu');
    $parse = $lang;
    $parse['links'] = '';
    foreach ($adminpages as $get => $title) {
        $parse['links'] .= '
		<li class="menubutton_table">
			<span class="menu_icon">
		  		<img src="' . GAME_SKIN . '/img/navigation/navi_ikon_premium_b.gif" height="29" width="38" />
		  	</span>
			<a class="menubutton" href="./?page=admin&link=' . $get . '" title=\'' . $title . '\' tabindex="1">
				<span class="textlabel">' . $title . '</span>
			</a>
		</li>
		';
    }
    $Menu = parsetemplate(gettemplate('redesigned/adminmenu'), $parse);
    return $Menu;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:37,代码来源:adminmenu.php

示例4: sendnewpassword

function sendnewpassword($email)
{
    $ExistMail = doquery("SELECT `email` FROM {{table}} WHERE `email` = '" . $email . "' LIMIT 1;", 'users', true);
    if (empty($ExistMail['email'])) {
        message('That address is not found !', 'Error');
    } else {
        $Caracters = "aazertyuiopqsdfghjklmwxcvbn���AZERTYUIOPQSDFGHJKLMWXCVBN���1234567890";
        $Count = strlen($Caracters);
        $NewPass = "";
        $Taille = 6;
        srand((double) microtime() * 1000000);
        for ($i = 0; $i < $Taille; $i++) {
            $CaracterBoucle = rand(0, $Count - 1);
            $NewPass = $NewPass . substr($Caracters, $CaracterBoucle, 1);
        }
        $Title = "Rogue Universe : Nytt l�senord";
        $Body = "H�r �r ditt nya l�senord : ";
        $Body .= $NewPass;
        mail($email, $Title, $Body);
        $NewPassSql = md5($NewPass);
        $QryPassChange = "UPDATE game_users SET ";
        $QryPassChange .= "`password` ='" . $NewPassSql . "' ";
        $QryPassChange .= "WHERE `email`='" . $email . "' LIMIT 1;";
        doquery($QryPassChange, 'users');
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:26,代码来源:SendNewPassword.php

示例5: MissionCaseStay

/**
 * This file is part of XNova:Legacies
 *
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 * @see http://www.xnova-ng.org/
 *
 * Copyright (c) 2009-2010, XNova Support Team <http://www.xnova-ng.org>
 * All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *                                --> NOTICE <--
 *  This file is part of the core development branch, changing its contents will
 * make you unable to use the automatic updates manager. Please refer to the
 * documentation for further information about customizing XNova.
 *
 */
function MissionCaseStay($FleetRow)
{
    global $lang, $resource;
    if ($FleetRow['fleet_mess'] == 0) {
        if ($FleetRow['fleet_start_time'] <= time()) {
            $QryGetTargetPlanet = "SELECT * FROM {{table}} ";
            $QryGetTargetPlanet .= "WHERE ";
            $QryGetTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
            $QryGetTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
            $QryGetTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
            $QryGetTargetPlanet .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "';";
            $TargetPlanet = doquery($QryGetTargetPlanet, 'planets', true);
            $TargetUserID = $TargetPlanet['id_owner'];
            $TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
            $TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($FleetRow['fleet_resource_metal']), $lang['Crystal'], pretty_number($FleetRow['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($FleetRow['fleet_resource_deuterium']));
            $TargetMessage = $lang['sys_stay_mess_start'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $FleetRow['fleet_end_galaxy'] . "&system=" . $FleetRow['fleet_end_system'] . "\">";
            $TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_end'] . "<br />" . $TargetAddedGoods;
            SendSimpleMessage($TargetUserID, '', $FleetRow['fleet_start_time'], 5, $lang['sys_mess_qg'], $lang['sys_stay_mess_stay'], $TargetMessage);
            RestoreFleetToPlanet($FleetRow, false);
            doquery("DELETE FROM {{table}} WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';", 'fleets');
        }
    } else {
        if ($FleetRow['fleet_end_time'] <= time()) {
            $TargetAdress = sprintf($lang['sys_adress_planet'], $FleetRow['fleet_start_galaxy'], $FleetRow['fleet_start_system'], $FleetRow['fleet_start_planet']);
            $TargetAddedGoods = sprintf($lang['sys_stay_mess_goods'], $lang['Metal'], pretty_number($FleetRow['fleet_resource_metal']), $lang['Crystal'], pretty_number($FleetRow['fleet_resource_crystal']), $lang['Deuterium'], pretty_number($FleetRow['fleet_resource_deuterium']));
            $TargetMessage = $lang['sys_stay_mess_back'] . "<a href=\"galaxy.php?mode=3&galaxy=" . $FleetRow['fleet_start_galaxy'] . "&system=" . $FleetRow['fleet_start_system'] . "\">";
            $TargetMessage .= $TargetAdress . "</a>" . $lang['sys_stay_mess_bend'] . "<br />" . $TargetAddedGoods;
            SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_end_time'], 5, $lang['sys_mess_qg'], $lang['sys_mess_fleetback'], $TargetMessage);
            RestoreFleetToPlanet($FleetRow, true);
            doquery("DELETE FROM {{table}} WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';", 'fleets');
        }
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:61,代码来源:MissionCaseStay.php

示例6: eco_get_lab_max_effective_level

/**
 * eco_get_build_data.php
 *
 * 1.0 - copyright (c) 2010 by Gorlum for http://supernova.ws
 * @version 1.0
 */
function eco_get_lab_max_effective_level(&$user, $lab_require)
{
    if (!$user['user_as_ally'] && !isset($user['laboratories_active'])) {
        $user['laboratories_active'] = array();
        $query = db_unit_list_laboratories($user['id']);
        while ($row = db_fetch($query)) {
            if (!eco_unit_busy($user, $row, UNIT_TECHNOLOGIES)) {
                $row += array(STRUC_LABORATORY => $level_lab = mrc_get_level($user, $row, STRUC_LABORATORY), STRUC_LABORATORY_NANO => $level_lab_nano = mrc_get_level($user, $row, STRUC_LABORATORY_NANO), 'laboratory_effective_level' => $level_lab * pow(2, $level_lab_nano));
                $user['laboratories_active'][$row['id']] = $row;
            }
        }
        uasort($user['laboratories_active'], 'eco_lab_sort_effectivness');
    }
    if (!isset($user['research_effective_level'][$lab_require])) {
        if ($user['user_as_ally']) {
            $lab_level = doquery("SELECT ally_members AS effective_level FROM {{alliance}} WHERE id = {$user['user_as_ally']} LIMIT 1", true);
        } else {
            $tech_intergalactic = mrc_get_level($user, false, TECH_RESEARCH) + 1;
            $lab_level['effective_level'] = 0;
            foreach ($user['laboratories_active'] as $data) {
                if ($tech_intergalactic <= 0) {
                    break;
                }
                if ($data[STRUC_LABORATORY] >= $lab_require) {
                    $lab_level['effective_level'] += $data['laboratory_effective_level'];
                    $tech_intergalactic--;
                }
            }
        }
        $user['research_effective_level'][$lab_require] = $lab_level['effective_level'] ? $lab_level['effective_level'] : 1;
    }
    return $user['research_effective_level'][$lab_require];
}
开发者ID:hayalolsam,项目名称:SuperNova,代码行数:39,代码来源:eco_get_build_data.php

示例7: flt_get_fleets

function flt_get_fleets($condition, $phalanx = false)
{
    $fleet_db_list = array();
    if (!$condition) {
        $missile_query = $condition = 1;
    } elseif (is_array($condition)) {
        $missile_query = "\n      (fleet_start_galaxy = {$condition['galaxy']} AND fleet_start_system = {$condition['system']} AND fleet_start_planet = {$condition['planet']} AND fleet_start_type = {$condition['planet_type']})\n      OR\n      (fleet_end_galaxy = {$condition['galaxy']} AND fleet_end_system = {$condition['system']} AND fleet_end_planet = {$condition['planet']} AND fleet_end_type = {$condition['planet_type']})";
        $condition = "\n      (fleet_start_galaxy = {$condition['galaxy']} AND fleet_start_system = {$condition['system']} AND fleet_start_planet = {$condition['planet']} AND fleet_start_type = {$condition['planet_type']}" . ($phalanx ? '' : ' AND fleet_mess = 1') . ")\n      OR\n      (fleet_end_galaxy = {$condition['galaxy']} AND fleet_end_system = {$condition['system']} AND fleet_end_planet = {$condition['planet']} AND fleet_end_type = {$condition['planet_type']}" . ($phalanx ? '' : ' AND fleet_mess = 0') . ")";
    } else {
        $missile_query = "`fleet_owner` = '{$condition}' OR `fleet_target_owner` = '{$condition}'";
        $condition = $missile_query;
    }
    $sql_fleets = doquery("SELECT DISTINCT * FROM {{fleets}} WHERE {$condition};");
    while ($fleet = db_fetch($sql_fleets)) {
        $fleet_db_list[] = $fleet;
    }
    // Missile attack
    $sql_fleets = doquery("SELECT * FROM `{{iraks}}` WHERE {$missile_query};");
    while ($irak = db_fetch($sql_fleets)) {
        if ($irak['fleet_end_time'] >= SN_TIME_NOW) {
            $irak['fleet_start_type'] = PT_PLANET;
            $planet_start = db_planet_by_vector($irak, 'fleet_start_', false, 'name');
            $irak['fleet_id'] = -$irak['id'];
            $irak['fleet_mission'] = MT_MISSILE;
            $irak['fleet_array'] = UNIT_DEF_MISSILE_INTERPLANET . ",{$irak['fleet_amount']};";
            $irak['fleet_start_name'] = $planet_start['name'];
        }
        $fleet_db_list[] = $irak;
    }
    return $fleet_db_list;
}
开发者ID:hayalolsam,项目名称:SuperNova,代码行数:31,代码来源:int_fleet_events.php

示例8: chatmap

function chatmap()
{
    global $userrow;
    if (isset($_POST["submit"])) {
        extract($_POST);
        if ($fala == "") {
            header('Location: index.php');
            die;
        }
        $chatquery = doquery("SELECT * FROM {{table}} WHERE latitude='" . $userrow['latitude'] . "' AND longitude='" . $userrow['longitude'] . "' order by id", "chatmap");
        $i = 0;
        while ($chatrow = mysql_fetch_array($chatquery)) {
            $i += 1;
            if ($chatrow['id'] < $menorid || $menorid == "") {
                $menorid = $chatrow['id'];
            }
        }
        if ($i < 10) {
            $chatquery = doquery("INSERT INTO {{table}} (name, fala, latitude, longitude) VALUES ('" . $userrow['charname'] . "','{$fala}', '" . $userrow['latitude'] . "', '" . $userrow['longitude'] . "')", "chatmap");
        } else {
            $chatquery = doquery("DELETE FROM {{table}} WHERE id='" . $menorid . "' LIMIT 1", "chatmap");
            $chatquery = doquery("INSERT INTO {{table}} (name, fala, latitude, longitude) VALUES ('" . $userrow['charname'] . "','{$fala}', '" . $userrow['latitude'] . "', '" . $userrow['longitude'] . "')", "chatmap");
        }
    }
    //fim isset submit.
    header('Location: index.php');
    die;
}
开发者ID:arveo,项目名称:NarutoBrowserMmorpg,代码行数:28,代码来源:chat.php

示例9: sn_tpl_parse_fleet_db

function sn_tpl_parse_fleet_db($fleet, $index, $user_data = false, &$result)
{
    global $lang, $user;
    if (!$user_data) {
        $user_data = $user;
    }
    if ($fleet['fleet_mess'] == 0 && $fleet['fleet_mission'] == MT_AKS) {
        $aks = doquery("SELECT * FROM {{aks}} WHERE id={$fleet['fleet_group']} LIMIT 1;", true);
    }
    $spy_level = $user['id'] == $fleet['fleet_owner'] ? 100 : GetSpyLevel($user);
    $result['fleet'] = isset($result['fleet']) ? $result['fleet'] : array();
    $result['fleet'] = array('NUMBER' => $index, 'ID' => $fleet['fleet_id'], 'OWNER' => $fleet['fleet_owner'], 'TARGET_OWNER' => $fleet['fleet_target_owner'], 'MESSAGE' => $fleet['fleet_mess'], 'MISSION' => $fleet['fleet_mission'], 'MISSION_NAME' => $lang['type_mission'][$fleet['fleet_mission']], 'ACS' => $aks['name'], 'AMOUNT' => $spy_level >= 4 ? pretty_number($fleet['fleet_amount']) . ($fleet['fleet_resource_metal'] + $fleet['fleet_resource_crystal'] + $fleet['fleet_resource_deuterium'] ? '+' : '') : '?', 'METAL' => $spy_level >= 8 ? $fleet['fleet_resource_metal'] : 0, 'CRYSTAL' => $spy_level >= 8 ? $fleet['fleet_resource_crystal'] : 0, 'DEUTERIUM' => $spy_level >= 8 ? $fleet['fleet_resource_deuterium'] : 0, 'START_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$fleet['fleet_start_type']], 'START_COORDS' => "[{$fleet['fleet_start_galaxy']}:{$fleet['fleet_start_system']}:{$fleet['fleet_start_planet']}]", 'START_TIME_TEXT' => date(FMT_DATE_TIME, $fleet['fleet_end_time'] + SN_CLIENT_TIME_DIFF), 'START_LEFT' => floor($fleet['fleet_end_time'] + 1 - SN_TIME_NOW), 'START_URL' => uni_render_coordinates_href($fleet, 'fleet_start_', 3), 'START_NAME' => $fleet['fleet_start_name'], 'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$fleet['fleet_end_type']], 'END_COORDS' => "[{$fleet['fleet_end_galaxy']}:{$fleet['fleet_end_system']}:{$fleet['fleet_end_planet']}]", 'END_TIME_TEXT' => date(FMT_DATE_TIME, $fleet['fleet_start_time'] + SN_CLIENT_TIME_DIFF), 'END_LEFT' => floor($fleet['fleet_start_time'] + 1 - SN_TIME_NOW), 'END_URL' => uni_render_coordinates_href($fleet, 'fleet_end_', 3), 'END_NAME' => $fleet['fleet_end_name'], 'STAY_TIME' => date(FMT_DATE_TIME, $fleet['fleet_end_stay'] + SN_CLIENT_TIME_DIFF), 'STAY_LEFT' => floor($fleet['fleet_end_stay'] + 1 - SN_TIME_NOW), 'OV_LABEL' => $fleet['ov_label'], 'EVENT_TIME_TEXT' => date(FMT_DATE_TIME, $fleet['event_time'] + SN_CLIENT_TIME_DIFF), 'OV_LEFT' => floor($fleet['event_time'] + 1 - SN_TIME_NOW), 'OV_THIS_PLANET' => $fleet['ov_this_planet']);
    $ship_list = explode(';', $fleet['fleet_array']);
    if ($spy_level >= 6) {
        foreach ($ship_list as $ship_record) {
            if ($ship_record) {
                $ship_data = explode(',', $ship_record);
                if ($spy_level >= 10) {
                    $single_ship_data = get_ship_data($ship_data[0], $user_data);
                    $result['ships'][$ship_data[0]] = array('ID' => $ship_data[0], 'NAME' => $lang['tech'][$ship_data[0]], 'AMOUNT' => $ship_data[1], 'AMOUNT_TEXT' => pretty_number($ship_data[1]), 'CONSUMPTION' => $single_ship_data['consumption'], 'SPEED' => $single_ship_data['speed'], 'CAPACITY' => $single_ship_data['capacity']);
                } else {
                    $result['ships'][$ship_data[0]] = array('ID' => $ship_id++, 'NAME' => $lang['tech'][UNIT_SHIPS], 'AMOUNT' => $ship_data[1], 'AMOUNT_TEXT' => pretty_number($ship_data[1]), 'CONSUMPTION' => 0, 'SPEED' => 0, 'CAPACITY' => 0);
                }
            }
        }
    }
    return $result;
}
开发者ID:divyinfo,项目名称:SuperNova,代码行数:28,代码来源:tpl_helpers.php

示例10: MipAttack

function MipAttack($NbreMip, $IDAversaire)
{
    $TechnoArme = doquery("SELECT * FROM {{table}} WHERE `id`='" . $user['id'] . "'", "users");
    $InfoAdversaire = doquery("SELECT * FROM {{table}} WHERE `id`='" . $IDAversaire . "'", "planets", true);
    $PuissanceAttaque = $NbreMip * 12000 * (1.05 * $TechnoArme['military_tech']);
    $TableauDeDefense = array(401 => array('shield' => 20), 402 => array('shield' => 25), 403 => array('shield' => 100), 404 => array('shield' => 200), 405 => array('shield' => 500), 406 => array('shield' => 300), 407 => array('shield' => 2000), 408 => array('shield' => 2000));
    $DefenseAdversaire = array(401 => $InfoAdversaire['misil_launcher'], 402 => $InfoAdversaire['small_laser'], 403 => $InfoAdversaire['big_laser'], 404 => $InfoAdversaire['gauss_canyon'], 405 => $InfoAdversaire['ionic_canyon'], 406 => $InfoAdversaire['buster_canyon'], 407 => $InfoAdversaire['small_protection_shield'], 408 => $InfoAdversaire['big_protection_shield']);
    while ($PuissanceAttaque > 20) {
        $RandomDefense = rand(401, 408);
        $SelectionDefense = $DefenseAdversaire[$RandomDefense];
        if ($SelectionDefense > 0) {
            if ($PuissanceAttaque > $SelectionDefense * $TableauDeDefense[$RandomDefense]) {
                $PuissanceAttaque = $PuissanceAttaque - $SelectionDefense * $TableauDeDefense[$RandomDefense];
                $DefenseAdversaire[$RandomDefense] = $DefenseAdversaire[$RandomDefense] - 1;
            }
        }
    }
    $SqlDefenseur = "UPDATE {{table}} SET ";
    $SqlDefenseur .= "`small_laser`='" . $DefenseAdversaire[402] . "', ";
    $SqlDefenseur .= "`big_laser`='" . $DefenseAdversaire[403] . "', ";
    $SqlDefenseur .= "`gauss_canyon`='" . $DefenseAdversaire[404] . "', ";
    $SqlDefenseur .= "`ionic_canyon`='" . $DefenseAdversaire[405] . "', ";
    $SqlDefenseur .= "`buster_canyon`='" . $DefenseAdversaire[406] . "', ";
    $SqlDefenseur .= "`small_protection_shield`='" . $DefenseAdversaire[407] . "', ";
    $SqlDefenseur .= "`big_protection_shield`='" . $DefenseAdversaire[408] . "' ";
    $SqlDefenseur .= " WHERE `id`='" . $IDAversaire . "'";
    doquery($SqlDefenseur, 'planets');
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:28,代码来源:MipCombatEngine.php

示例11: sn_db_perform

function sn_db_perform($table, $values, $type = 'insert', $options = false)
{
    $mass_perform = false;
    $field_set = '';
    $value_set = '';
    switch ($type) {
        case 'delete':
            $query = 'DELETE FROM';
            break;
        case 'insert':
            $query = 'INSERT INTO';
            if (isset($options['__multi'])) {
                // Here we generate mass-insert set
                break;
            }
        case 'update':
            if (!$query) {
                $query = 'UPDATE';
            }
            foreach ($values as $field => &$value) {
                $value_type = gettype($value);
                if ($value_type == 'string') {
                    $value = "'" . db_escape($value) . "'";
                }
                $value = "`{$field}` = {$value}";
            }
            $field_set = 'SET ' . implode(', ', $values);
            break;
    }
    $query .= " {$table} {$field_set}";
    return doquery($query);
}
开发者ID:divyinfo,项目名称:SuperNova,代码行数:32,代码来源:db.php

示例12: ShowLeftMenu

function ShowLeftMenu($Level, $Template = 'left_menu')
{
    global $lang, $dpath, $game_config;
    includeLang('leftmenu');
    $MenuTPL = gettemplate($Template);
    $InfoTPL = gettemplate('serv_infos');
    $parse = $lang;
    $parse['lm_tx_serv'] = $game_config['resource_multiplier'];
    $parse['lm_tx_game'] = $game_config['game_speed'] / 2500;
    $parse['lm_tx_fleet'] = $game_config['fleet_speed'] / 2500;
    $parse['lm_tx_queue'] = MAX_FLEET_OR_DEFS_PER_ROW;
    $SubFrame = parsetemplate($InfoTPL, $parse);
    $parse['server_info'] = $SubFrame;
    $parse['XNovaRelease'] = VERSION;
    $parse['dpath'] = $dpath;
    $parse['forum_url'] = $game_config['forum_url'];
    $parse['mf'] = "Hauptframe";
    $rank = doquery("SELECT `total_rank` FROM {{table}} WHERE `stat_code` = '1' AND `stat_type` = '1' AND `id_owner` = '" . $user['id'] . "';", 'statpoints', true);
    $parse['user_rank'] = $rank['total_rank'];
    if ($Level > 0) {
        $parse['ADMIN_LINK'] = "\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\"><div><a href=\"admin/leftmenu.php\"><font color=\"lime\">" . $lang['user_level'][$Level] . "</font></a></div></td>\r\n\t\t</tr>";
    } else {
        $parse['ADMIN_LINK'] = "";
    }
    $parse['servername'] = $game_config['game_name'];
    $Menu = parsetemplate($MenuTPL, $parse);
    return $Menu;
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:28,代码来源:leftmenu.php

示例13: sendnewpassword

 function sendnewpassword($mail)
 {
     global $lang;
     $ExistMail = doquery("SELECT `email` FROM {{table}} WHERE `email` = '" . $mail . "' LIMIT 1;", 'users', true);
     if (empty($ExistMail['email'])) {
         message($lang['mail_not_exist'], "index.php?page=lostpassword", 2, false, false);
     } else {
         $Caracters = "aazertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN1234567890";
         $Count = strlen($Caracters);
         $NewPass = "";
         $Taille = 6;
         srand((double) microtime() * 1000000);
         for ($i = 0; $i < $Taille; $i++) {
             $CaracterBoucle = rand(0, $Count - 1);
             $NewPass = $NewPass . substr($Caracters, $CaracterBoucle, 1);
         }
         $Title = $lang['mail_title'];
         $Body = "Hallo ShadoX,\n\n";
         $Body .= "dein Passwort für " . $game_config['game_name'] . " lautet:\n\n";
         $Body .= $NewPass . "\n\n";
         $Body .= "Du kannst dich damit unter " . REGURL . " einloggen.\n\n";
         $Body .= "Wir verschicken Passwörter nur an die von dir im Spiel angegebenen Mailadressen. Solltest du diese Mail nicht angefordert haben kannst du sie also einfach ignorieren.\n\n";
         $Body .= "Wir wünschen dir weiterhin viel Erfolg beim Spielen von " . $game_config['game_name'] . "!\n\n";
         $Body .= "Dein " . $game_config['game_name'] . "-Team\n\n";
         mymail($mail, $Title, $Body, ADMINEMAIL);
         $NewPassSql = md5($NewPass);
         $QryPassChange = "UPDATE {{table}} SET ";
         $QryPassChange .= "`password` ='" . $NewPassSql . "' ";
         $QryPassChange .= "WHERE `email`='" . $mail . "' LIMIT 1;";
         doquery($QryPassChange, 'users');
     }
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:32,代码来源:index.php

示例14: PM

/**
 * PM.php
 *
 * @version 1.1
 * @copyright 2009 by MadnessRed for XNova Redeisgned
 */
function PM($to, $from, $message, $subject = '', $sender = '', $type = 0)
{
    //Add the message to the databas (xnova code) with a bit of security modification
    $QryInsertMessage = "INSERT INTO {{table}} SET ";
    $QryInsertMessage .= "`message_owner` = '" . idstring($to) . "', ";
    $QryInsertMessage .= "`message_sender` = '" . idstring($from) . "', ";
    $QryInsertMessage .= "`message_text` = '" . mysql_real_escape_string(addslashes($message)) . "', ";
    $QryInsertMessage .= "`message_subject` = '" . mysql_escape_string(addslashes($subject)) . "', ";
    $QryInsertMessage .= "`message_from` = '" . mysql_real_escape_string(addslashes($sender)) . "', ";
    $QryInsertMessage .= "`message_type` = '" . idstring($type) . "', ";
    $QryInsertMessage .= "`message_time` = '" . time() . "';";
    doquery($QryInsertMessage, 'messages');
    //Get the target
    $target = doquery("SELECT `id`,`messages` FROM {{table}} WHERE `id` = '" . idstring($to) . "' LIMIT 1 ;", 'users', true);
    //Set messages of this type to +1
    if (strlen($target['messages']) == 0) {
        $target['messages'] = '0,0,0,0,0,0';
    }
    $messages = explode(",", $target['messages'], 6);
    if ($type < 0 || $time > 5) {
        $type = 5;
    }
    $messages[$type] += 1;
    $newmessages = implode(",", $messages);
    //$newmessages = $messages[0].",".$messages[1].",".$messages[2].",".$messages[3].",".$messages[4].",".$messages[5];
    doquery("UPDATE {{table}} SET `messages` = '" . $newmessages . "', `menus_update` = '" . time() . "' WHERE `id` = '" . $target['id'] . "' LIMIT 1 ;", 'users');
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:33,代码来源:PM.php

示例15: ShowTopKB

function ShowTopKB()
{
    global $lang;
    //anzeige der Top 100 Liste
    includeLang('INGAME');
    $parse = $lang;
    $RowsTPL = gettemplate('topkb/topkb_rows');
    $top = doquery("SELECT * FROM {{table}} ORDER BY gesamtunits DESC LIMIT 100;", 'topkb');
    $a = 0;
    while ($data = mysql_fetch_array($top)) {
        $a++;
        $timedeut = date("D d M H:i:s", $data['time']);
        $user1 = doquery("SELECT * FROM {{table}} WHERE username='" . $data[2] . "';", 'users', true);
        if ($data['fleetresult'] == "a" and $user1['hof'] == 1) {
            $bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?mode=" . $data['rid'] . "', '');\"><font color=\"green\">" . $data['angreifer'] . "</font><b> VS </b><font color=\"red\">" . $data['defender'] . "</font></a>";
        } else {
            if ($data['fleetresult'] == "r" and $user1['hof'] == 1) {
                $bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?page=showtopkb&mode=" . $data['rid'] . "', '');\"><font color=\"red\">" . $data['angreifer'] . "</font><b> VS </b><font color=\"green\">" . $data['defender'] . "</font></a>";
            } else {
                if ($data['fleetresult'] == "w" and $user1['hof'] == 1) {
                    $bloc['top_fighters'] = "<a href=\"javascript:f('topkbuser.php?mode=" . $data['rid'] . "', '');\">" . $data['angreifer'] . "<b> VS </b>" . $data['defender'] . "</a>";
                }
            }
        }
        $bloc['top_rank'] = $a;
        $bloc['top_time'] = $timedeut;
        $bloc['top_units'] = pretty_number($data['gesamtunits']);
        $bloc['underrow'] = $lang['grata'] . "test";
        //  date("r", $data['time']);
        $parse['top_list'] .= parsetemplate($RowsTPL, $bloc);
    }
    display(parsetemplate(gettemplate('topkb/topkb'), $parse), false);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:33,代码来源:ShowTopKB.php


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