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


PHP myquery函数代码示例

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


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

示例1: start_chaos

function start_chaos($tur)
{
    global $char;
    //все места заняты - начинаем бой
    //создаем бой
    $combat_type = 11;
    $uid = create_combat($combat_type, $char['map_name'], $char['map_xpos'], $char['map_ypos'], $tur['format']);
    //закидываем туда игроков рандомно
    $sel_users = myquery("SELECT game_users_active_host.host_more,game_users_active.host,game_turnir_users.side,view_active_users.*,game_users_data.sex FROM game_turnir_users,view_active_users,game_users_data,game_users_active,game_users_active_host WHERE game_users_data.user_id=game_turnir_users.user_id AND game_turnir_users.user_id=view_active_users.user_id AND game_turnir_users.turnir_id=" . $tur['id'] . " AND game_users_active.user_id=view_active_users.user_id AND game_users_active_host.user_id=view_active_users.user_id ORDER BY RAND()");
    $user_side = 2;
    while ($us = mysql_fetch_array($sel_users)) {
        $user_side = 3 - $user_side;
        $hod = 1;
        $join = 0;
        $svit = 0;
        $k_komu = 0;
        $k_exp = 1;
        $k_gp = 0;
        $skill = 0;
        $func = 5;
        $delay = 44;
        $no_rejoin = 1;
        combat_insert($us, 0, $uid, $combat_type, $user_side, $hod, $join, $svit, $k_komu, $k_exp, $k_gp, $skill, $func, $delay, $no_rejoin);
        $pismo = iconv("Windows-1251", "UTF-8//IGNORE", "<span style=\"font-style:italic;font-size:12px;color:gold;\">Начинается турнирный хаотичный бой</span>");
        myquery("INSERT INTO game_log (`message`,`date`,`fromm`,`too`,ptype) VALUES ('" . mysql_real_escape_string($pismo) . "'," . time() . ",-1," . $us['user_id'] . ",1)");
    }
    myquery("DELETE game_turnir,game_turnir_users FROM game_turnir,game_turnir_users WHERE (game_turnir.id=" . $tur['id'] . ") AND (game_turnir.id=game_turnir_users.turnir_id) ");
    setLocation("http://" . domain_name . "/combat.php");
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:29,代码来源:turnir.inc.php

示例2: create_response

function create_response($item_id)
{
    $sel_res = myquery("SELECT id,name FROM craft_resource WHERE name LIKE ('%морий%') ORDER BY BINARY name");
    $response = "\n\t<table>\n\t<tr><td>Ресурс</td><td>Количество</td><td>&nbsp;</td><td>&nbsp;<td></tr>\n\t<tr>\n\t<td><select id=\"res_id\">";
    while ($res = mysql_fetch_array($sel_res)) {
        $response .= "<option value=" . $res['id'] . ">(" . $res['id'] . ") " . $res['name'] . "</option>";
    }
    $response .= "</td>\n\t<td><input id=\"new_col\" size=5 value=0></td>\n\t<td><input type=\"button\" value=\"Сохранить\" onClick=\"save_res('new');\"></td>\n\t<td>&nbsp;</tr>";
    if ($item_id > 0) {
        $sel = myquery("SELECT * FROM dungeon_quests_res WHERE quest_id={$item_id} ORDER BY id");
        while ($schema = mysql_fetch_array($sel)) {
            $response .= "<tr>\n\t\t\t<td><select id=\"res_id_" . $schema['id'] . "\">";
            $sel_res = myquery("SELECT id,name FROM craft_resource ORDER BY BINARY name");
            while ($res = mysql_fetch_array($sel_res)) {
                $response .= "<option value=" . $res['id'] . "";
                if ($res['id'] == $schema['res_id']) {
                    $response .= " selected";
                }
                $response .= ">" . $res['name'] . "</option>";
            }
            $response .= "</td>\n\t\t\t<td><input id=\"col_" . $schema['id'] . "\" size=5 value=\"" . $schema['col'] . "\"></td>\n\t\t\t<td><input type=\"button\" value=\"Сохранить\" onClick=\"save_res('" . $schema['id'] . "');\"></td>\n\t\t\t<td><input type=\"button\" value=\"Удалить\" onClick=\"delete_res('" . $schema['id'] . "');\"></td>";
        }
    }
    $response .= "</table>";
    return $response;
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:26,代码来源:quest_moria.php

示例3: move

 function move($pos)
 {
     global $x;
     global $y;
     global $s;
     global $v;
     global $char;
     global $mov;
     $result = myquery("SELECT {$pos}, type, subtype FROM game_map WHERE xpos='{$x}' AND name='" . $char['map_name'] . "' AND ypos='{$y}' limit 1");
     if (!mysql_num_rows($result)) {
         echo '<img src="http://' . img_domain . '/nav/x.gif" width="32" height="32" border="0"><br>';
     } else {
         $map_adj = mysql_fetch_array($result);
         $tile_image = 'http://' . img_domain . '/map/' . $map_adj['type'] . $map_adj['subtype'] . '.jpg';
         if ($map_adj['' . $pos . ''] == '6' or $char['clevel'] < $map_adj['' . $pos . ''] and $map_adj['' . $pos . ''] != 'N') {
             echo '<img src="' . $tile_image . '" width="32" height="32" border="0" alt="';
             if ($map_adj['' . $pos . ''] == '6') {
                 echo 'Нельзя пройти';
             }
             if ($char['clevel'] < $map_adj['' . $pos . ''] and $map_adj['' . $pos . ''] != '6' and $map_adj['' . $pos . ''] != 'N') {
                 echo 'Требуется ' . $map_adj['' . $p . ''] . ' уровень';
             }
             echo '"><br>';
         } else {
             echo '<a href="move.php?move=' . $v . '"><img src="' . $tile_image . '" width="32" height="32" border="0" alt="(' . $x . ', ' . $y . ')"></a><br>';
         }
     }
 }
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:28,代码来源:template_nav1.inc.php

示例4: add_resource

function add_resource($id_resource)
{
    global $user_id, $char, $_SESSION;
    if ($id_resource > 0) {
        $res = mysql_fetch_array(myquery("SELECT * FROM craft_resource WHERE id={$id_resource}"));
        $Res = new Res($res);
        $check = $Res->add_user(0, $user_id);
        if ($check == 1) {
            setCraftTimes($user_id, 6, 1, 1);
            echo 'Ты добыл: ' . $res['name'];
            myquery("insert into craft_stat (build_id, gp, res_id, dob, vip, dat, user, type) values (0, 0, {$id_resource}, 0, 1, " . time() . ", {$user_id}, 'z')");
            if (isset($_SESSION['cur_get_mining'])) {
                $dob = explode('###', $_SESSION['cur_get_mining']);
                $find = 0;
                for ($i = 0; $i < sizeof($dob); $i++) {
                    $cur_dob = explode("&&&", $dob[$i]);
                    if ($cur_dob[0] == $res['name']) {
                        $find = 1;
                        $col = (int) $cur_dob[1] + 1;
                        $dob[$i] = $res['name'] . '&&&' . $col;
                    }
                }
                if ($find == 0) {
                    $dob[] = $res['name'] . '&&&1';
                }
                $_SESSION['cur_get_mining'] = implode("###", $dob);
            } else {
                $str = $res['name'] . '&&&1';
                $_SESSION['cur_get_mining'] = $str;
            }
        } else {
            echo 'У Вас недостаточно свободного места в инвентаре!';
        }
    }
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:35,代码来源:mining.inc.php

示例5: getSuggestions

function getSuggestions($keyword)
{
    DbConnect();
    $patterns = array('/\\s+/', '/"+/', '/%+/');
    $replace = array('');
    $keyword = preg_replace($patterns, $replace, $keyword);
    if ($keyword != '' and preg_match('/^[ _a-zà-ÿA-ZÀ-ß0-9]*$/i', $keyword)) {
        $keyword = mysql_escape_string($keyword);
        $query = "SELECT name FROM game_items_factsheet WHERE name LIKE '" . $keyword . "%' ORDER BY BINARY name";
    } else {
        $query = "SELECT name FROM game_items_factsheet WHERE name=''";
    }
    $result = myquery($query);
    $output = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
    $output .= '<response>';
    if ($result != false) {
        if (mysql_num_rows($result)) {
            while ($row = mysql_fetch_array($result)) {
                $output .= '<name>' . iconv("Windows-1251", "UTF-8//IGNORE", $row['name']) . '</name>';
            }
        }
    }
    $output .= '</response>';
    mysql_close();
    return $output;
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:26,代码来源:suggest_items.php

示例6: izvjestaj_prijemni_top10posto

function izvjestaj_prijemni_top10posto()
{
    ?>
<p>Univerzitet u Sarajevu<br />
Elektrotehnički fakultet Sarajevo</p>

<h3>Najboljih 10% kandidata na prijemnom ispitu po srednjoj školi</h3>
<?php 
    $pt = intval($_REQUEST['termin']);
    $skole = array();
    $q10 = myquery("select count(*) from prijemni_prijava where prijemni_termin={$pt}");
    $desetposto = intval(mysql_result($q10, 0, 0) / 10);
    $q10 = myquery("select pp.rezultat, o.ime, o.prezime, uus.srednja_skola from prijemni_prijava as pp, osoba as o, uspjeh_u_srednjoj as uus where pp.prijemni_termin={$pt} and pp.osoba=o.id and uus.osoba=o.id order by pp.rezultat desc limit {$desetposto}");
    while ($r10 = mysql_fetch_row($q10)) {
        if (!$skole[$r10[3]]) {
            $skole[$r10[3]] = array();
        }
        array_push($skole[$r10[3]], "{$r10['1']} {$r10['2']} ({$r10['0']} bodova)");
    }
    foreach ($skole as $idskole => $skola) {
        $q20 = myquery("select naziv from srednja_skola where id={$idskole}");
        print "<p><b>" . mysql_result($q20, 0, 0) . "</b><br>\n<ul>\n";
        foreach ($skola as $kandidat) {
            print "<li>{$kandidat}</li>\n";
        }
        print "</ul></p>\n";
    }
}
开发者ID:msehalic,项目名称:zamger,代码行数:28,代码来源:prijemni_top10posto.php

示例7: syncTeams

	function syncTeams(){
		$sql="SELECT a.event_id, a.team_id, b.tathva_id, GROUP_CONCAT( a.teammember_id
				SEPARATOR  ',' ) 
				FROM team AS a, participating AS b
				WHERE a.team_id = b.team_id
				GROUP BY a.team_id";
		$res=myquery($sql);
		while($row=mysql_fetch_array($res)){
			//echo $row[0]." | ".$row[1]." | ".$row[2]." | ".$team[1]."<br />";
			$team = explode(",",$row[3]);
			array_splice($team,array_search($row[2],$team),1);
			$sql = "Insert into registration(rg_eventid,
											rg_teamid,
											rg_captainid,
											rg_part1,
											rg_part2,
											rg_part3,
											rg_part4,
											rg_part5,
											rg_part6)
									values('".pg_escape_string(strtoupper($row[0]))."',
											'".pg_escape_string(strtoupper($row[1]))."',
											'".pg_escape_string(strtoupper($row[2]))."',
											'".pg_escape_string(strtoupper($team[0]))."',
											'".pg_escape_string(strtoupper($team[1]))."',
											'".pg_escape_string(strtoupper($team[2]))."',
											'".pg_escape_string(strtoupper($team[3]))."',
											'".pg_escape_string(strtoupper($team[4]))."',
											'".pg_escape_string(strtoupper($team[5]))."');<br />";
			echo $sql;
		}
	}
开发者ID:nitcalicut,项目名称:Sockmonkey,代码行数:32,代码来源:sync.php

示例8: addm

function addm($char, $mes, $priv)
{
    setlocale(LC_ALL, "ru_RU.CP1251");
    if (!isset($char['sex']) || $char['sex'] == "male") {
        $mes = preg_replace("/\\{([\\d\\w\\s]*?)\\|([\\d\\w\\s]*?)\\}/i", "\\1", $mes);
    } else {
        $mes = preg_replace("/\\{([\\d\\w\\s]*?)\\|([\\d\\w\\s]*?)\\}/i", "\\2", $mes);
    }
    $mes = '<span style="color:#FF2828;font-size:12px;">' . iconv("Windows-1251", "UTF-8//IGNORE", $mes) . '</style>';
    $message = $mes;
    $message = mysql_real_escape_string($message);
    $sel = myquery("SELECT `count` FROM `game_bot_chat_resp` WHERE `id` = '" . $char['name'] . "';");
    $n = mysql_fetch_array($sel);
    if ($n['count'] <= 4) {
        myquery("INSERT INTO `game_bot_chat_resp` (`id`,`count`) VALUES ('" . $char['name'] . "','1') ON DUPLICATE KEY UPDATE `count` = `count` + 1;");
        $update_chat = myquery("insert into game_log (town,fromm,too,message,date,ptype) values (0,'-1','" . $char['user_id'] . "','" . $message . "','" . time() . "'," . $priv . ")");
    } else {
        $sel = myquery("SELECT `text` FROM `game_bot_chat_annoy` ORDER BY RAND() ASC LIMIT 1");
        $mes = mysql_fetch_array($sel);
        if (!isset($char['sex']) || $char['sex'] == "male") {
            $mes = preg_replace("/\\{([\\d\\w\\s]*?)\\|([\\d\\w\\s]*?)\\}/i", "\\1", $mes);
        } else {
            $mes = preg_replace("/\\{([\\d\\w\\s]*?)\\|([\\d\\w\\s]*?)\\}/i", "\\2", $mes);
        }
        $message = mysql_real_escape_string('<span style="color:#FF2828;font-size:12px;">' . iconv("Windows-1251", "UTF-8//IGNORE", $mes['text']) . '</style>');
        $update_chat = myquery("insert into game_log (town,fromm,too,message,date,ptype) values (0,'-1','" . $char['user_id'] . "','" . $message . "','" . time() . "'," . $priv . ")");
    }
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:28,代码来源:index.php

示例9: student_moodle

function student_moodle()
{
    global $conf_moodle, $conf_moodle_url;
    if (!$conf_moodle) {
        biguglyerror("Moodle integracija nije uključena.");
        print "Kontaktirajte vašeg administratora.";
        return;
    }
    $predmet = intval($_REQUEST['predmet']);
    $ag = intval($_REQUEST['ag']);
    $tip = $_REQUEST['tip'];
    $q = myquery("select moodle_id from moodle_predmet_id where predmet={$predmet} and akademska_godina={$ag}");
    if (mysql_num_rows($q) < 1) {
        zamgerlog("ne postoji moodle ID za predmet pp{$predmet}, ag{$ag}", 3);
        zamgerlog2("ne postoji moodle ID za predmet", $predmet, $ag);
        niceerror("Pogrešan predmet/akademska_godina ili za ovaj predmet nije definisan moodle ID.");
        return;
    }
    $moodle_id = mysql_result($q, 0, 0);
    if ($tip == "forum") {
        header("Location: {$conf_moodle_url}" . "mod/forum/index.php?id={$moodle_id}");
    } else {
        header("Location: {$conf_moodle_url}" . "course/view.php?id={$moodle_id}");
    }
}
开发者ID:msehalic,项目名称:zamger,代码行数:25,代码来源:moodle.php

示例10: PrintFavNpc

    function PrintFavNpc()
    {
        global $char;
        //Избранные боты
        $npc_online = time();
        $sel = myquery("SELECT\n\tgame_npc_template.npc_name AS npc_name,\n\tgame_npc.EXP AS npc_exp,\n\tgame_maps.name AS npc_map_name,\n\tgame_npc.map_name AS npc_map,\n\tgame_npc.xpos AS npc_xpos,\n\tgame_npc.ypos AS npc_ypos,\n\tgame_npc.xpos_view AS npc_xpos_view,\n\tgame_npc.ypos_view AS npc_ypos_view\n\tFROM game_users_npc, game_npc, game_maps, game_npc_template\n\tWHERE game_npc.npc_id=game_npc_template.npc_id AND game_users_npc.user_id = " . $char['user_id'] . " AND game_npc.view=1 AND game_npc.map_name IN (700,5,18) \n\t  AND game_npc.id = game_users_npc.npc_id AND game_maps.id=game_npc.map_name AND game_npc.time_kill+game_npc_template.respawn<" . $npc_online . " \n\tORDER BY  (CASE WHEN game_npc.map_name = " . $char['map_name'] . " THEN 0 ELSE 1 END), game_users_npc.npc_order");
        if ($sel != false and mysql_num_rows($sel) > 0) {
            echo '<table width="100%" border=0>';
            while ($row = mysql_fetch_array($sel)) {
                echo '<tr>
			<td>' . substr($row["npc_name"], 0, 9) . '</td>
			<td>' . substr($row["npc_map_name"], 0, 4) . '</td>
			<td><nobr>';
                if ($row["npc_exp"] <= 200) {
                    echo $row["npc_xpos"];
                    echo '</td><td align="right"><font color=#FF7DFF>';
                    echo $row["npc_ypos"];
                } else {
                    echo '' . $row["npc_xpos"] + 1 * $row["npc_xpos_view"] . '&plusmn;2';
                    echo '</td><td align="right"><font color=#FF7DFF>';
                    echo '' . $row["npc_ypos"] + 1 * $row["npc_ypos_view"] . '&plusmn;2';
                }
                echo '</td>';
                if ($_SESSION['user_id'] == 612 or $_SESSION['user_id'] == 28591 or $_SESSION['user_id'] == 36051 or $_SESSION['user_id'] == 1 or domain_name == 'localhost') {
                    echo '<td><a href="?func=main&teleport_map_name=' . $row["npc_map"] . '&teleport_map_xpos=' . $row["npc_xpos"] . '&teleport_map_ypos=' . $row["npc_ypos"] . '"><img src="http://' . img_domain . '/nav/show.gif" border="0"></a></td>';
                }
                echo '</tr>';
            }
            echo '</table>';
        }
    }
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:template_stats.inc.php

示例11: before_print

function before_print()
{
    global $book_id, $user_id, $print_text, $alt_text;
    if (!isset($_GET['page'])) {
        return;
    }
    if ($_GET['page'] == 16) {
        $sel = myquery("SELECT * FROM bookgame_users_flags WHERE bookgame={$book_id} AND user_id={$user_id} AND flag=2");
        if (!mysql_num_rows($sel)) {
            $print_text = 1;
            $alt_text = "Неимоверной силой воли ты отправляешь Пожирателей Душ туда, откуда они были призваны. Аргалакс в бешенстве и кричит:\n\t\t\t«Теперь я вызышаю Костяного Занбара и Балтуса Страшного!!!»\n\t\t\tОни материализуются и ты смог бы противиться их заклинаниям, только если бы у тебя есть были Щит Древней Тьмы и Щит Огня. Но их у тебя не оказалось, и ты бесславно погиб на поле боя!";
        }
    }
    if ($_GET['page'] == 17) {
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=2");
    }
    if ($_GET['page'] == 20) {
        myquery("INSERT INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=3,value=0 ON DUPLICATE KEY UPDATE value=LEAST(4,value*2)");
        myquery("UPDATE bookgame_users SET dex=dex+LEAST(4,dex*2) WHERE bookgame={$book_id} AND user_id={$user_id}");
    }
    if ($_GET['page'] == 21) {
        $check = mysqlresult(myquery("SELECT COUNT(*) FROM bookgame_users_flags WHERE bookgame={$book_id} AND user_id={$user_id} AND (flag=4 OR flag=7)"), 0, 0);
        if ($check != 2) {
            $print_text = 1;
            $alt_text = "«НЕЕЕЕТ!!!» - Аргалакс корчится в конвульсиях и его энергия выходит наружу. Вы впитываете её часть и восстанавливаете 3 выносливости.На этом твое приключение заканчивается";
        }
    }
    if ($_GET['page'] == 22) {
        myquery("INSERT INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=5,value=1 ON DUPLICATE KEY UPDATE value=value+1");
        myquery("UPDATE bookgame_users SET dex=dex+1 WHERE bookgame={$book_id} AND user_id={$user_id}");
    }
    if ($_GET['page'] == 41) {
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=4");
    }
    if ($_GET['page'] == 8) {
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=4");
    }
    if ($_GET['page'] == 19) {
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=6");
    }
    if ($_GET['page'] == 10) {
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=8");
        myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=9");
    }
    if ($_GET['page'] == 44) {
        list($gp) = mysqlresult(myquery("SELECT gp FROM bookgame_users WHERE bookgame={$book_id} AND user_id={$user_id}"), 0, 0);
        if ($gp >= 21) {
            myquery("INSERT IGNORE INTO bookgame_users_flags SET user_id={$user_id},bookgame={$book_id},flag=7");
            myquery("UPDATE bookgame_users SET gp=gp-21 WHERE user_id={$user_id} AND bookgame={$book_id}");
        }
    }
    if ($_GET['page'] == 45) {
        $check = mysqlresult(myquery("SELECT COUNT(*) FROM bookgame_users_flags WHERE bookgame={$book_id} AND user_id={$user_id} AND (flag=8 OR flag=9)"), 0, 0);
        if ($check != 2) {
            $print_text = 1;
            $alt_text = "«ААА!!!,- крик Аргалакса звенит под потолком.- Я вызываю Жаррадана Мара и Шарелу, Ведьму Снега!!» Ты можешь противиться заклинаниям двух колдунов, только если есть Щит Времени и Лёд. Но их у тебя не оказалось, и ты бесславно погиб на поле боя!";
        }
    }
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:59,代码来源:quest_demon.php

示例12: PrintError

function PrintError($param, $it, $encik)
{
    if ($it[$param] != $encik[$param]) {
        list($name) = mysql_fetch_array(myquery("(SELECT name FROM game_users WHERE user_id=" . $it['user_id'] . ") UNION (SELECT name FROM game_users_archive WHERE user_id=" . $it['user_id'] . ")"));
        echo '
		<tr><td>' . $it['type'] . '</td><td>' . $it['ident'] . '</td><td>' . $name . '</td><td>' . $param . '</td><td>' . $encik[$param] . '</td><td>' . $it[$param] . '</td><td>' . ($encik[$param] - $it[$param]) . '</td></tr>';
    }
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:8,代码来源:check_item.php

示例13: common_slika

function common_slika()
{
    global $conf_files_path, $user_nastavnik, $user_studentska, $user_siteadmin, $userid;
    // Poslani parametar
    $osoba = intval($_REQUEST['osoba']);
    $promjena = intval($_REQUEST['promjena']);
    // Studenti mogu vidjeti samo svoju sliku
    if (!$user_nastavnik && !$user_studentska && !$user_siteadmin && $osoba != $userid) {
        niceerror("Možete vidjeti samo svoju sliku");
        zamgerlog("pristupa slici za osobu {$osoba} a student je", 3);
        zamgerlog2("pristupa tudjoj slici a student je", $osoba);
        return;
    }
    if ($promjena == 1) {
        $q = myquery("select slika from promjena_podataka where osoba={$osoba}");
    } else {
        $q = myquery("select slika from osoba where id={$osoba}");
    }
    if (mysql_num_rows($q) < 1) {
        // Ova poruka se neće vidjeti iz <img> taga, ali neko može otvoriti sliku u posebnom prozoru/tabu
        niceerror("Nepostojeća osoba {$osoba}");
        zamgerlog("slika: nepostojeca osoba {$osoba}", 3);
        zamgerlog2("nepostojeca osoba", $osoba);
        return;
    }
    $slika = mysql_result($q, 0, 0);
    if ($slika == "") {
        niceerror("Osoba {$osoba} nema sliku");
        zamgerlog("osoba u{$osoba} nema sliku", 3);
        zamgerlog2("osoba nema sliku", $osoba);
        return;
    }
    $lokacija_slike = "{$conf_files_path}/slike/{$slika}";
    if (!file_exists($lokacija_slike)) {
        niceerror("Slika za osobu {$osoba} je definisana, ali datoteka ne postoji");
        zamgerlog("nema datoteke za sliku osobe u{$osoba}", 3);
        zamgerlog2("nema datoteke za sliku", $osoba);
        return;
    }
    // Odredjujemo mimetype
    $podaci = getimagesize($lokacija_slike);
    $mimetype = image_type_to_mime_type($podaci[2]);
    if ($mimetype == "") {
        niceerror("Nepoznat tip slike za osobu {$osoba}");
        zamgerlog("nepoznat tip slike za osobu u{$osoba}", 3);
        zamgerlog2("nepoznat tip slike", $osoba);
        return;
    }
    header("Content-Type: {$mimetype}");
    $k = readfile($lokacija_slike, false);
    if ($k == false) {
        //print "Otvaranje slike nije uspjelo! Kontaktirajte administratora";
        // Pošto je header već poslan, nema smisla ispisivati grešku
        zamgerlog("citanje fajla za sliku nije uspjelo u{$osoba}", 3);
        zamgerlog2("citanje fajla za sliku nije uspjelo", $osoba);
    }
    exit;
}
开发者ID:msehalic,项目名称:zamger,代码行数:58,代码来源:slika.php

示例14: getHelpTopics

function getHelpTopics($str)
{
    $result = myquery("SELECT COUNT(*) FROM `" . dbprfx . "help` WHERE `typekey` = '" . $str . "'");
    if (mysql_result($result, 0) > 0) {
        $result2 = myquery("SELECT * FROM `" . dbprfx . "help` WHERE `typekey` = '" . $str . "' LIMIT 1");
        $array2 = myarray($result2);
        return $array2['helpdata'];
    }
}
开发者ID:eXcomm,项目名称:Aleph3DSuite,代码行数:9,代码来源:mainLIB.php

示例15: q_journal_moria

function q_journal_moria($user_id, $level, $quest_id)
{
    $check_moria = myquery("SELECT t1.res_num, t2.name FROM dungeon_users_progress as t1 JOIN craft_resource as t2 ON t1.res_id=t2.id WHERE t1.user_id=" . $user_id . " and quest_id=" . $quest_id . " and t1.res_num>0");
    echo '<font color="yellow"><h3><b>Подземелья Мории (' . $level . ' уровень)</h3></b>';
    echo '<br><font color="red"><b>Осталось сдать:</b>';
    while ($res = mysql_fetch_array($check_moria)) {
        echo "<br>" . $res['name'] . ": " . $res['res_num'] . "";
    }
    echo '</font>';
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:10,代码来源:q_journal.php


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