本文整理汇总了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);
示例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);