当前位置: 首页>>代码示例>>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;未经允许,请勿转载。