當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ajax::validate_lock方法代碼示例

本文整理匯總了PHP中ajax::validate_lock方法的典型用法代碼示例。如果您正苦於以下問題:PHP ajax::validate_lock方法的具體用法?PHP ajax::validate_lock怎麽用?PHP ajax::validate_lock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ajax的用法示例。


在下文中一共展示了ajax::validate_lock方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isset

<?php

/**
 * Legg til ny forumtråd
 * 
 * Inndata:
 * - sid
 * - forum_id
 * - title
 * - text
 * - type [optional, forum mod]
 * - locked [optional, forum mod]
 */
require "../../../app/ajax.php";
ajax::validate_sid();
// kontroller lås
ajax::validate_lock(true);
global $_base, $_game;
// kontroller forumkategori og tilgang
$forum = new \Kofradia\Forum\CategoryAjax(postval("forum_id"));
$forum->require_access();
// forsøk å legg til forumtråden
$type = isset($_POST['type']) && $forum->fmod ? $_POST['type'] : NULL;
$locked = isset($_POST['locked']) && $forum->fmod ? $_POST['locked'] : NULL;
$forum->add_topic(postval("title"), postval("text"), $type, $locked);
開發者ID:Kuzat,項目名稱:kofradia,代碼行數:25,代碼來源:topic_add.php

示例2: array

<?php

require "../../app/ajax.php";
ajax::require_user();
// kontroller lås
ajax::validate_lock();
// hent alle utfordringer
$result = \Kofradia\DB::get()->query("SELECT poker_id, poker_starter_up_id, poker_time_start, poker_starter_cards, poker_cash FROM poker WHERE poker_state = 2 ORDER BY poker_cash");
$i = 0;
$data = array();
$html_to_parse = array();
while ($row = $result->fetch()) {
    $d = array();
    $d['self'] = $row['poker_starter_up_id'] == login::$user->player->id;
    $html_to_parse[$i] = (!$d['self'] ? '<input type="radio" name="id" value="' . $row['poker_id'] . '" />' : '') . '<user id="' . $row['poker_starter_up_id'] . '" />';
    $d['cash'] = game::format_cash($row['poker_cash']);
    $d['reltime'] = poker_round::get_time_text($row['poker_time_start']);
    if (access::has("admin")) {
        $cards = new CardsPoker(explode(",", $row['poker_starter_cards']));
        $d['cards'] = $cards->solve_text($cards->solve());
    }
    $data[$i++] = $d;
}
// parse html
if (count($html_to_parse) > 0) {
    $html_to_parse = parse_html_array($html_to_parse);
    foreach ($html_to_parse as $i => $value) {
        $data[$i]['player'] = $value;
    }
}
ajax::text(js_encode($data), ajax::TYPE_OK);
開發者ID:Kuzat,項目名稱:kofradia,代碼行數:31,代碼來源:poker_challengers.php


注:本文中的ajax::validate_lock方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。