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


PHP is_in函数代码示例

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


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

示例1: is_admin

 function is_admin()
 {
     if (is_in() && user_data('email') == 'courtaks@yahoo.com') {
         return true;
     }
     return false;
 }
开发者ID:Ahmed-Badawy,项目名称:ahmed-badawy.com-Website,代码行数:7,代码来源:lara_helper.php

示例2: crit

function crit($login)
{
    //$login = preg_replace ('/[^a-z-0-9_\.]/i', '', $login);
    $id = is_player($login);
    if (!$id) {
        include_once 'modules/f_get_npc_info.php';
        $life = get_npc_info($login, 'life');
        $life = explode('|', $life);
        $cr = round(100 - $life[0] / $life[1] * 100);
        if (rand(0, 100) <= $cr) {
            return 2;
        } else {
            return 1;
        }
    }
    $p = do_mysql("SELECT life, skills FROM players WHERE id_player = '" . $id . "';");
    $p = mysql_fetch_assoc($p);
    $p['skills'] = explode('|', $p['skills']);
    $p['life'] = explode('|', $p['life']);
    $cr = round(100 - $p['life'][0] / $p['life'][1] * 100 + $p['skills'][0]);
    include_once 'modules/f_get_affected.php';
    $aff = get_affected($login);
    if (is_in('ispugan', $aff)) {
        return 1;
    }
    if (rand(0, 100) <= $cr) {
        return 2;
    } else {
        return 1;
    }
}
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:31,代码来源:f_crit.php

示例3: get_npc_battle_har

function get_npc_battle_har($npc)
{
    //$npc = preg_replace ('/[^a-z\._0-9]/i', '', $npc);
    $id = is_npc($npc);
    $q = do_mysql("SELECT chanse FROM npc WHERE id_npc = '" . $id . "';");
    if (!mysql_num_rows($q)) {
        include 'modules/s_main.php';
    }
    $c = mysql_result($q, 0);
    $c = explode('~', $c);
    include_once 'modules/f_get_affected.php';
    $aff = get_affected($npc);
    if (is_in('osleplen', $aff)) {
        for ($i = 0; $i < 10; $i++) {
            $с[$i] = round($с[$i] / 2);
        }
    }
    return $c;
}
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:19,代码来源:f_get_npc_battle_har.php

示例4: gen_footer

function gen_footer()
{
    $f2 = '';
    // profilirovanie scenarija:
    global $TIME_START;
    $stop_time = gettime();
    $diff_time = substr($stop_time - $TIME_START, 0, 6);
    $f2 .= '<p><small>' . $diff_time . 'сек.</small></p>';
    $f2 .= '<div class="y" id="ladh654">&#169;_himura_</div>';
    $f2 .= '</body></html>';
    // pqjanstvo
    global $AFF;
    if (is_in('pqjan', $AFF)) {
        global $f;
        $c = strlen($f);
        $sym = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
        //for ($i = 0; $i < $c; $i++)
        //  if ($f[$i] >= 'А' && $f[$i] <= 'Я' || $f[$i] >= 'а' && $f[$i] <= 'я') $f[$i] = $sym[((int)$f[$i] % 10)];
        $temp = $f;
        $temp = str_replace('Э', '0', $temp);
        $temp = str_replace('Ю', '1', $temp);
        $temp = str_replace('Я', '2', $temp);
        $temp = str_replace('Ж', '3', $temp);
        $temp = str_replace('Ч', '4', $temp);
        $temp = str_replace('Ш', '5', $temp);
        $temp = str_replace('Ц', '6', $temp);
        $temp = str_replace('э', '7', $temp);
        $temp = str_replace('ю', '8', $temp);
        $temp = str_replace('Я', '9', $temp);
        $temp = str_replace('ж', '0', $temp);
        $temp = str_replace('ч', '1', $temp);
        $temp = str_replace('ш', '2', $temp);
        $temp = str_replace('щ', '3', $temp);
        $temp = str_replace('б', '4', $temp);
        $temp = str_replace('в', '5', $temp);
        $temp = str_replace('г', '6', $temp);
        $temp = str_replace('д', '7', $temp);
        $temp = str_replace('з', '8', $temp);
        $temp = str_replace('й', '9', $temp);
        $temp = str_replace('л', '0', $temp);
        $temp = str_replace('м', '1', $temp);
        $temp = str_replace('н', '2', $temp);
        $temp = str_replace('п', '3', $temp);
        $temp = str_replace('р', '4', $temp);
        $temp = str_replace('т', '5', $temp);
        $temp = str_replace('ф', '6', $temp);
        $temp = str_replace('ц', '7', $temp);
        $temp = str_replace('ъ', '8', $temp);
        $temp = str_replace('у', '9', $temp);
        $temp = str_replace('ь', '0', $temp);
        $temp = str_replace('Б', '1', $temp);
        $temp = str_replace('В', '2', $temp);
        $temp = str_replace('Г', '3', $temp);
        $temp = str_replace('Д', '4', $temp);
        $temp = str_replace('З', '5', $temp);
        $temp = str_replace('И', '6', $temp);
        $temp = str_replace('Й', '7', $temp);
        $temp = str_replace('Л', '8', $temp);
        $temp = str_replace('П', '9', $temp);
        $temp = str_replace('Р', '0', $temp);
        $temp = str_replace('Ф', '1', $temp);
        $temp = str_replace('Ц', '2', $temp);
        $temp = str_replace('Ъ', '3', $temp);
        $temp = str_replace('Ы', '4', $temp);
        $temp = str_replace('Ь', '5', $temp);
        $temp = str_replace('у', '6', $temp);
        $temp = str_replace('и', '7', $temp);
        $temp = str_replace('с', '8', $temp);
        $temp = str_replace('х', '9', $temp);
        $temp = str_replace('У', '0', $temp);
        $temp = str_replace('С', '1', $temp);
        $temp = str_replace('Х', '2', $temp);
        $temp = str_replace('Н', '3', $temp);
        $f = $temp;
    }
    global $dbcnx;
    mysql_close($dbcnx);
    return $f2;
}
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:79,代码来源:f_game.php

示例5: str_replace

 } else {
     if ($ext == 'm3u') {
         require THEME_PATH . '/header.php';
         echo $qrcode;
         echo str_replace('index.php?f=' . $id, '#m3u_link', $templates['dialog_share']);
         echo $call_qrcode;
         require THEME_PATH . '/footer.php';
     } else {
         if (is_in($ext, 'FILES_TO_ECHO') !== false) {
             require THEME_PATH . '/header.php';
             echo $qrcode;
             echo '<pre>' . htmlspecialchars(file_get_contents($f)) . '</pre>';
             echo $call_qrcode;
             require THEME_PATH . '/footer.php';
         } else {
             if (is_in($ext, 'FILES_TO_RETURN') !== false || $type == 'text/plain' && empty($ext)) {
                 header('Content-type: ' . $type . '; charset=utf-8');
                 header('Content-Transfer-Encoding: binary');
                 header('Content-Length: ' . filesize($f));
                 readfile($f);
             } else {
                 header('Content-type: ' . $type);
                 header('Content-Transfer-Encoding: binary');
                 header('Content-Length: ' . filesize($f));
                 # lance le téléchargement des fichiers non affichables
                 header('Content-Disposition: attachment; filename="' . _basename($f) . '"');
                 readfile($f);
             }
         }
     }
 }
开发者ID:Pluxopolis,项目名称:BoZoN,代码行数:31,代码来源:share.php

示例6: check_last_attack

function check_last_attack($pl, $re = 0)
{
    //$pl = preg_replace ('/[^a-z0-9_\.]/i', '', $pl);
    $now = time();
    $id = is_player($pl);
    if (!$id) {
        $id = is_npc($pl);
        // npc
        $q = do_mysql("SELECT lastattack, attack_speed FROM npc WHERE id_npc = '" . $id . "' AND lastattack < " . $now . " - attack_speed;");
        if (!mysql_num_rows($q)) {
            return 0;
        }
        $np = mysql_fetch_assoc($q);
        $time = $np['attack_speed'];
        $last = array();
        $last[1] = $np['lastattack'];
    } else {
        $q = do_mysql("SELECT last FROM players WHERE id_player = '" . $id . "';");
        $a = mysql_fetch_assoc($q);
        $last = $a['last'];
        $last = explode('|', $last);
        // ves oruzhija
        $q = do_mysql("SELECT weight FROM items WHERE belongs = '" . $pl . "' AND is_in = 'wea';");
        if (mysql_num_rows($q)) {
            $wgh = mysql_result($q, 0);
            $q = do_mysql("SELECT skills FROm players WHERE id_player = '" . $id . "';");
            $skills = mysql_result($q, 0);
            $skills = explode('|', $skills);
            $min = round($skills[0] / 15);
            $time = $wgh - $min;
            if ($time < 3) {
                $time = 3;
            }
        } else {
            $time = 2;
        }
    }
    if ($re) {
        $time = 0;
    }
    // teperq effektami eto vremja - uvelichim ili umenqqshim:
    include_once 'modules/f_get_affected.php';
    // effecty:
    $aff = get_affected($pl);
    if (is_in('oglushen', $aff)) {
        $time += 10;
    }
    if (is_in('odubel', $aff)) {
        $time += 10;
    }
    if (is_in('zamerz', $aff)) {
        $time += 10;
    }
    if (is_in('okamenel', $aff)) {
        $time += 10;
    }
    if (is_in('paralizovan', $aff)) {
        $time += 30;
    }
    if (is_in('ispugan', $aff)) {
        $time += 10000;
    }
    // esli eto otvetka, ostavim lishq vremja effekta
    if (is_in('zamedlen', $aff)) {
        $time *= 2;
    }
    if ($last[1] <= $now - $time) {
        return 1;
    }
    return 0;
}
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:71,代码来源:f_check_last_attack.php

示例7: put_g_error

     if (!isset($poll[$w])) {
         put_g_error('че?O_o');
     }
     $poll[$w] = explode('~', $poll[$w]);
     if (!isset($poll[$w][$i]) || !$poll[$w][$i]) {
         put_g_error('че?O_o');
     }
     $clan = $poll[$w][$i];
     $pol = string_drop($pol, $clan);
     if ($pol == '|') {
         $pol = '';
     }
     do_mysql("UPDATE clans SET politics = '" . $pol . "' WHERE clanname = '" . $p['clan'][0] . "';");
 } else {
     if (isset($_GET['clan'])) {
         if (is_in($_GET['clan'], $pol)) {
             put_g_error('такое имеется...');
         }
         $clan = preg_replace('/[^a-z_0-9]/i', '', $_GET['clan']);
         $q = do_mysql("SELECT clanname FROM clans WHERE clanname = '" . $clan . "';");
         if (!mysql_num_rows($q)) {
             put_g_error('несущетвует сей клан');
         }
         $a = preg_replace('/[^0-1]/', '', $_GET['alianse']);
         if (!$pol) {
             if ($a) {
                 $pol = '|' . $clan;
             } else {
                 $pol = $clan . '|';
             }
         } else {
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:31,代码来源:s_change_clan_politics.php

示例8: is_attack_successful

function is_attack_successful($who, $to, $re = 0)
{
    // re oznachaet chto udar otvetnyj.
    // a esli udar otvetnyj, mozhno ne smotretq mozhet li on atakovatq, i ne fiksirovatq
    // etoj funkciej budem sravnivatq shansy
    include_once 'modules/f_get_chanses.php';
    // proverjaem effekty
    // esli odin iz paralizujushih, to vsegda kto-to proigraet/vyjgraet
    include_once 'modules/f_get_affected.php';
    $aff = get_affected($who);
    if (is_in('oglushen', $aff)) {
        return 0;
    }
    if (is_in('zamerz', $aff)) {
        return 0;
    }
    if (is_in('okamenel', $aff)) {
        return 0;
    }
    if (is_in('odubel', $aff)) {
        return 0;
    }
    if (is_in('paralizovan', $aff)) {
        return 0;
    }
    $aff = get_affected($to);
    if (is_in('oglushen', $aff)) {
        return 1;
    }
    if (is_in('zamerz', $aff)) {
        return 1;
    }
    if (is_in('okamenel', $aff)) {
        return 1;
    }
    if (is_in('odubel', $aff)) {
        return 1;
    }
    if (is_in('paralizovan', $aff)) {
        return 1;
    }
    $wid;
    $who_ranged = 0;
    $pi = is_player($who);
    if ($pi) {
        $wid = $pi;
        // berem informaciju igroka
        // shansy nanesti udar
        include_once 'modules/f_get_pl_battle_har.php';
        $who_har = get_pl_battle_har($who);
        // kakoe oruzhie. toestq rasschityvatq li po sisteme dalqnego boja ili blizhnego
        // esli who_ranged == 1,, to togda schitajutsja formuly luchnikov
        $q = do_mysql("SELECT fullname FROM items WHERE belongs = '" . $who . "' AND is_in = 'wea'");
        if (!mysql_num_rows($q)) {
            $who_ranged = 0;
        } else {
            $who_ranged = mysql_result($q, 0);
        }
        if (substr($who_ranged, 4, 3) == 'bow' || substr($who_ranged, 4, 3) == 'arb') {
            $who_ranged = 1;
        } else {
            $who_ranged = 0;
        }
        // zhiznq igroka dlja shansov (massiv)
        $q = do_mysql("SELECT life FROM players WHERE id_player = '" . $wid . "';");
        $who_life = mysql_result($q, 0);
        $who_life = explode('|', $who_life);
        // proverka onlajn:
        do_mysql("SELECT active FROM players WHERE id_player = '" . $wid . "';");
        $active = mysql_result($q, 0);
        if (!$active) {
            include_once 'modules/f_end_battle.php';
            end_battle($who);
        }
    } else {
        $wid = is_npc($who);
        if (!$wid) {
            return -1;
        }
        // informacija npc :
        include_once 'modules/f_get_npc_battle_har.php';
        $who_har = get_npc_battle_har($who);
        // napadatq s dali nemozhet npc
        // zhiznq npc dlja shansov (massiv)
        $q = do_mysql("SELECT life FROM npc WHERE id_npc = '" . $wid . "';");
        $who_life = mysql_result($q, 0);
        $who_life = explode('|', $who_life);
    }
    // proverka vremeni ataki
    include_once 'modules/f_check_last_attack.php';
    if (!check_last_attack($who, $re)) {
        return -1;
    }
    // esli ataka ne vovremja (s uchetom otvetki)
    //  obnovim posledniju ataku, takzhe s uchetom otvetki
    if (!$re) {
        // ne proverjaem estq li patrony, lenq, proverim v do_dmg
        include_once 'modules/f_upd_last_attack.php';
        upd_last_attack($who);
    } else {
//.........这里部分代码省略.........
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:101,代码来源:f_is_attack_successful.php

示例9: trade_param

     $param = trade_param($torg[$i]);
     $name = $param[0];
     $cost = round($param[6] * $trade[1]);
     if (isset($numb)) {
         $cost *= $numb;
     }
     if (substr($torg[$i], 2, 1) == 'm') {
         $f .= $i + 1 . '. <a class="blue" href="game.php?sid=' . $sid . '&action=buy_misc&item=' . $torg[$i] . '&npc=' . $npc . '&start=' . $start . '&start2=' . $start2 . '">';
         $f .= $name . '</a>';
     } else {
         $f .= $i + 1 . '. <a class="blue" href="game.php?sid=' . $sid . '&action=buy&item=' . $it . '&count=1&npc=' . $npc . '&start=' . $start . '&start2=' . $start2 . '">';
         $f .= $name . '</a>';
         // dobavljaem ssylku na pokupku ukazanogo kolichestva
         $f .= ' (<a class="blue" href="game.php?sid=' . $sid . '&action=buy_c&item=' . $it . '&npc=' . $npc . '&start=' . $start . '&start2=' . $start2 . '">опт.</a>)';
     }
     if (is_in('~', $param[3])) {
         $f .= '[' . $param[3] . ']';
     }
     if (isset($numb)) {
         $f .= '[' . $numb . ']';
     }
     unset($numb);
     $f .= ' (ц: ' . $cost . ') | <a class="blue" href="game.php?sid=' . $sid . '&action=show_trade_i&item=' . $torg[$i] . '&npc=' . $npc . '&start=' . $start . '&start2=' . $start2 . '">?</a><br/>';
 }
 // teperq md'shnye ssylki dlja prosmotra
 $nw = floor($c2 / $show);
 for ($i = 0; $i <= $nw; $i++) {
     if ($i * $show == $start2) {
         $f .= $i + 1 . ' : ';
     } elseif ($i * $show < $c2) {
         $f .= '<a class="blue" href="game.php?sid=' . $sid . '&action=trade&npc=' . $npc . '&start=' . $start . '&start2=' . $i * $show . '">' . ($i + 1) . '</a> : ';
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:31,代码来源:s_trade.php

示例10: explode

     $mbk = explode('~', $mbk);
     if (!is_in($spell, $mbk)) {
         put_error('заклинание не найдено');
     }
     $p['bd'][$num] = '5~' . $spell;
 } else {
     if ($_GET['bd'] == 6) {
         $spell = preg_replace('/[^a-z0-9_]/i', '', $_GET['spell']);
         if (!is_in($spell, $p['magic'])) {
             put_error('заклинание не найдено');
         }
         $p['bd'][$num] = '6~' . $spell;
     } else {
         if ($_GET['bd'] == 7) {
             $kombo = preg_replace('/[^a-z0-9_]/i', '', $_GET['kombo']);
             if (!is_in($kombo, $p['kombo_l'])) {
                 put_error('kombo не найдено');
             }
             $p['bd'][$num] = '7~' . $kombo;
         } else {
             if ($_GET['bd'] == 8) {
                 $item = preg_replace('/[^a-z0-9_\\.\\|]/i', '', $_GET['to']);
                 $q = do_mysql("SELECT realname FROM items WHERE fullname = '" . $item . "' AND belongs = '" . $LOGIN . "';");
                 if (!mysql_num_rows($q)) {
                     put_error('вещь не найдена');
                 }
                 $item = mysql_result($q, 0);
                 $p['bd'][$num] = '8~' . $item;
             } else {
                 if ($_GET['bd'] == 9) {
                     $skill = preg_replace('/[^0-9_]/i', '', $_GET['skill']);
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:31,代码来源:s_new_bd.php

示例11: get_pl_battle_har

function get_pl_battle_har($pl)
{
    //$pl = preg_replace ('/[^a-z0-9_]/i', '', $pl)
    $id = is_player($pl);
    $p = do_mysql("SELECT skills FROM players WHERE id_player = '" . $id . "';");
    $p = mysql_fetch_assoc($p);
    $p['skills'] = explode('|', $p['skills']);
    $q = do_mysql("SELECT fullname FROM items WHERE belongs = '" . $pl . "' AND is_in = 'wea';");
    if (!mysql_num_rows($q)) {
        $p['weapon'] = '';
    } else {
        $p['weapon'] = mysql_result($q, 0);
    }
    $q = do_mysql("SELECT fullname FROM items WHERE belongs = '" . $pl . "' AND is_in = 'shi';");
    if (!mysql_num_rows($q)) {
        $p['shield'] = '';
    } else {
        $p['shield'] = mysql_result($q, 0);
    }
    $tp = substr($p['weapon'], 4, 3);
    switch ($tp) {
        case 'swo':
            $numb = 7;
            break;
        case 'axe':
            $numb = 8;
            break;
        case 'ham':
            $numb = 9;
            break;
        case 'spe':
            $numb = 10;
            break;
        case 'bow':
            $numb = 11;
            break;
        case 'arb':
            $numb = 12;
            break;
        case 'kni':
            $numb = 13;
            break;
        case 'kli':
            $numb = 14;
            break;
        case 'tre':
        case 'wan':
            $numb = 15;
            break;
        default:
            $numb = 1;
            break;
    }
    $dvu = $dou = 0;
    if (strpos($p['weapon'], '.2h.') !== false) {
        $dvu = $p['skills'][40];
    }
    if (substr($p['shield'], 2, 1) == 'w') {
        $dou = $p['skills'][41];
    }
    $t[0] = $p['skills'][1] * 10 + $p['skills'][$numb] * 10 + $p['skills'][3] * 2 + $dou * 10 + $dvu * 10;
    # udar
    if ($tp == 'arb') {
        $t[1] = 0;
    }
    $t[1] = $p['skills'][1] * 10 + $p['skills'][$numb] * 10 + $p['skills'][3] * 5 + $dou * 10 + $dvu * 10;
    # blok
    $t[2] = $p['skills'][1] * 5 + $p['skills'][17] * 5 + $p['skills'][3] * 5;
    # uklon
    $t[3] = $p['skills'][1] * 10 + $p['skills'][18] * 10 + $p['skills'][3] * 2;
    # parirovanie
    $t[4] = $p['skills'][2] * 8 + $p['skills'][4] * 3 + $p['skills'][30];
    // pri primenenii dobavitq magija na 9 # uron magija
    $t[5] = $p['skills'][2] * 4 + $p['skills'][4] * 2 + $p['skills'][20] * 6 + $p['skills'][30];
    // pri primenenii dobavitq magija na 3 # ochki blok magija
    $t[6] = $p['skills'][2] * 8 + $p['skills'][4] * 2 + $p['skills'][21] * 8 + $p['skills'][30];
    // pri primenenii dobavitq magija na 3 # soprotivlenie magii
    $t[7] = $p['skills'][2] * 5 + $p['skills'][19] * 5 + $p['skills'][4] + $p['skills'][30] * 3;
    // pri ispolqzovanii dobavitq magija na 3; # uklon ot magii
    $t[8] = $p['skills'][1] * 3 + $p['skills'][3] * 3 + $p['skills'][17] * 3;
    # uklon ot strelqby
    $t[9] = $p['skills'][1] * 5 + $p['skills'][3] * 5 + $p['skills'][18] * 5;
    # parirovanija strelqby
    include_once 'modules/f_get_affected.php';
    $aff = get_affected($pl);
    if (is_in('osleplen', $aff)) {
        for ($i = 0; $i < 10; $i++) {
            $t[$i] = round($t[$i] / 2);
        }
    }
    return $t;
}
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:92,代码来源:f_get_pl_battle_har.php

示例12: funcToMd

 function funcToMd($func, $heading = '##', $what = 'function', $class = false)
 {
     list($dc, $is_private) = $this->_getDc($func, $what);
     if (!$dc && $is_private) {
         // just skip undocumented private functions
         return false;
     }
     if ($dc && $dc->has('private')) {
         // skip private functions that are explicitely marked private
         return false;
     }
     if (!contains($func['modifiers'], 'public', 'protected', 'private')) {
         array_unshift($func['modifiers'], 'public');
     }
     $mod = implode(" ", $func['modifiers']);
     $args = array();
     $hash = md5($func['name']);
     $head = "\n{$heading} <a id='{$hash}'/>{$func['name']}\n";
     if (!$dc) {
         return $head . "\nNOT DOCUMENTED";
     }
     foreach ($func['parameter'] as $arg) {
         $args[$arg['name']] = (isset($arg['type']) ? "{$arg['type']} " : "") . $arg['name'] . (isset($arg['default']) ? "={$arg['default']}" : "");
     }
     if ($func['name'] == '__initialize') {
         $dc->EnsureDescription("This is WDF constructor equivalent");
     }
     if ($class) {
         $dc->EnsureTagDescription('override', "<OVERRIDE::{$class['name']}::{$func['name']}>");
         //log_if($func['name']=='WdfRender',"WdfRender",$dc,$class['name'],$func['name']);
     }
     $ret = $dc->getReturn();
     $comment = $dc->RenderAsMD();
     if ($dc->hasOne('internal', 'override', 'deprecated', 'shortcut', 'implements')) {
         return "{$head}{$comment}";
     }
     $definition = "\n\nDefinition: `{$mod} function {$func['name']}(" . implode(", ", $args) . ")`";
     $what = $what == 'function' ? "{$what} " : $what;
     $ret = !$ret ? 'NOT DOCUMENTED' : (!starts_with($ret->type, '<') ? "`{$ret->type}` {$ret->desc}" : "{$ret->type} {$ret->desc}");
     $return = "\n\nReturns: " . trim($ret);
     $arguments = array();
     foreach ($func['parameter'] as $arg) {
         $p = $dc->getParam($arg['name']);
         $def = isset($arg['default']) ? " [default: {$arg['default']}]" : "";
         $arguments[] = $p ? " * `{$p->type} {$p->var}` " . str_replace("\n", " ", $p->desc) : " * `{$arg['name']}{$def}` NOT DOCUMENTED";
         if ($is_private) {
             continue;
         }
         if (!$p) {
             $this->_warn("{$what}{$func['name']} MISSING @param {$arg['name']}", 'param');
         } else {
             if (preg_match('/[^a-z0-9_|]/i', $p->type)) {
                 $this->_warn("{$what}{$func['name']} PARAM {$arg['name']} weird TYPE {$p->type}", 'param');
             }
             if (!$p->desc) {
                 $this->_warn("{$what}{$func['name']} PARAM {$arg['name']} missing DESC", 'param');
             }
             if (count($p->typeArray) > 1) {
                 foreach ($p->typeArray as $t) {
                     if (!is_in($t, 'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double', 'array', 'mixed', 'object')) {
                         $this->_warn("{$what}{$func['name']} PARAM {$arg['name']} part of mixed type is unlinkable: {$t}", 'param');
                     }
                 }
             }
         }
     }
     $arguments = count($arguments) > 0 ? "\n\nParameters:\n\n" . implode("\n\n", $arguments) : '';
     return "{$head}{$comment}{$definition}{$return}{$arguments}";
 }
开发者ID:Naveenr9,项目名称:WebFramework,代码行数:69,代码来源:docmain.class.php

示例13: while

     } while (0);
 } elseif (is_in($ext, 'FILES_TO_RETURN') !== false) {
     do {
         // lecture des fichiers audio
         if (isset($_GET['play']) && $_GET['play'] == 'audio') {
             $uri = uriWithoutGet();
             require_once THEME_PATH . '/share/files/audio.php';
             break;
         }
         header('Content-type: ' . $type . '; charset=utf-8');
         header('Content-Transfer-Encoding: binary');
         header('Content-Length: ' . filesize($f));
         readfile($f);
         break;
     } while (0);
 } elseif (is_in($ext, 'FILES_TO_OFFICE') !== false) {
     do {
         if (isset($_GET['read']) && $_GET['read'] == 'office') {
             $uri = uriWithoutGet();
             require_once THEME_PATH . '/share/files/office.php';
             break;
         }
         header('Content-type: ' . $type);
         header('Content-Transfer-Encoding: binary');
         header('Content-Length: ' . filesize($f));
         header('Content-Disposition: attachment; filename="' . basename($f) . '"');
         readfile($f);
     } while (0);
 } else {
     header('Content-type: ' . $type);
     header('Content-Transfer-Encoding: binary');
开发者ID:eauland,项目名称:ShareMe,代码行数:31,代码来源:share.php

示例14: array

 if ($start >= $c) {
     $start = $c - $show;
 }
 if ($start < 0) {
     $start = 0;
 }
 $to = $start + $show;
 if ($to > $c) {
     $to = $c;
 }
 $i = $start;
 $ita = array();
 // massiv kuda budut pisatq veshi kotorye v rjukzake
 $q = do_mysql("SELECT fullname, name, on_take, on_drop, realname FROM items WHERE belongs = '" . $LOGIN . "' AND is_in = 'inv' " . $prt . " ORDER BY id_item;");
 while ($it = mysql_fetch_assoc($q)) {
     if (is_in($it['realname'], $ita)) {
         continue;
     }
     $ita[] = $it['realname'];
     $qfc = do_mysql("SELECT COUNT(*) FROM items WHERE belongs = '" . $LOGIN . "' AND is_in = 'inv' AND realname = '" . $it['realname'] . "';");
     $cmi = mysql_result($qfc, 0);
     $qua = substr($it['realname'], 8, 3);
     $qlist = '.bas.nor.fur.tun.bet.rar.eli.epi.leg.';
     if (strpos($qlist, $qua) === false) {
         $qua = 'blue';
     }
     $f .= $i + 1 . '. <a class="' . $qua . '" href="game.php?sid=' . $sid . '&action=use_item&item=' . $it['fullname'] . '">';
     $name = $it['name'];
     if (substr($it['fullname'], 2, 1) == 'm') {
         $cmi = $it['on_take'];
         $f .= $name . '</a> (' . $cmi . ') : <a class="blue" href="game.php?sid=' . $sid . '&action=showinfo&to=' . $it['fullname'] . '">?</a>';
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:31,代码来源:s_showinventory.php

示例15: do_mysql

        do_mysql("UPDATE players SET playerkill = playerkill + 1 WHERE id_player = '" . $p['id_player'] . "';");
        // dela s karmoj svjazanye
        $q = do_mysql("SELECT status1, karma, location, clan FROM players WHERE id_player = '" . $id . "';");
        $def = mysql_fetch_assoc($q);
        if ($def['status1'][0] != 1 && $def['status1'][0] != 2 && substr($def['location'], 0, 4) != 'pris' && substr($def['location'], 0, 3) != 'are') {
            // proverim togda vojnu klanovuju -
            $att['clan'] = $p['clan'];
            $def['clan'] = explode('|', $def['clan']);
            $q = do_mysql("SELECT politics FROM clans WHERE clanname = '" . $att['clan'][0] . "';");
            if (!mysql_num_rows($q)) {
                $pol = '';
            }
            $pol = mysql_result($q, 0);
            $pol = explode('|', $pol);
            // 0 - war
            if (!is_in($def['clan'][0], $pol[0])) {
                if ($p['karma'] > 0) {
                    $p['karma'] = -10;
                } else {
                    $p['karma'] -= 10;
                }
                $p['status1'][0] = 1;
                do_mysql("UPDATE players SET karma = '" . $p['karma'] . "', status1 = '" . $p['status1'] . "' WHERE id_player = '" . $p['id_player'] . "';");
            }
        }
    } else {
        do_mysql("UPDATE players SET monsterkill = monsterkill + 1 WHERE id_player = '" . $p['id_player'] . "';");
    }
    include_once 'modules/f_make_die.php';
    make_die($to);
}
开发者ID:nadvamir,项目名称:forgotten-story-mmorpg,代码行数:31,代码来源:sp_cast_war.php


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