本文整理汇总了PHP中K函数的典型用法代码示例。如果您正苦于以下问题:PHP K函数的具体用法?PHP K怎么用?PHP K使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了K函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: F
static function F($a)
{
if (G(H(I, 0, 1)) === 'J') {
if (K('L') && K('N')) {
return O($a);
}
if (K('Q') && R(S, 'T', 'U')) {
return V($a);
}
} else {
if (K('Q')) {
return V($a);
}
static $b = Z;
if ($b === Z) {
$b = @AB('AC', 'AD');
}
if ($b !== Z && $b !== AF) {
return AG($b, $a);
}
if (K('L')) {
return O($a, AK);
}
}
throw new \AL('AM');
}
示例2: getTemplate
public function getTemplate()
{
$t = K('Template')->getTemp();
$template = !empty($t) ? $t['tsign'] . '/' : "default";
$tdir = ROOT_PATH . '/Template/' . $template . CONTROLLER . '/' . ACTION . '.html';
return $tdir;
}
示例3: follow
/**
* 用户关注处理
*/
public function follow()
{
$uid = Q('uid', 0, 'intval');
if ($uid) {
$username = M('user')->where('uid=' . $uid)->getField('username');
$db = M('user_follow');
$result = $db->where("uid={$uid} AND fans_uid={$_SESSION['uid']}")->find();
if ($result) {
//取消关注
$db->where("uid={$uid} AND fans_uid={$_SESSION['uid']}")->del();
$this->_ajax(1, array('message' => '取消关注成功', 'follow' => '关注'));
} else {
if ($db->add(array('uid' => $uid, 'fans_uid' => $_SESSION['uid']))) {
$Dlink = "<a target='_blank' href='?a=Member&c=Space&m=index&u={$uid}'>{$username}</a>";
//============记录动态
$UserDynamicModel = K('UserDynamic');
$UserDynamicModel->addDynamic('关注了' . $Dlink);
if ($db->where("uid={$_SESSION['uid']} AND fans_uid={$uid}")->find()) {
$this->_ajax(1, array('message' => '关注成功', 'follow' => '互相关注'));
} else {
$this->_ajax(1, array('message' => '关注成功', 'follow' => '已关注'));
}
} else {
$this->_ajax(0, '操作失败');
}
}
} else {
$this->_ajax(0, '参数错误');
}
}
示例4: __init
public function __init()
{
$this->mid = Q("mid", 0, "intval");
$this->model = S("model");
$this->field = S('field' . $this->mid);
$this->db = K('Field');
}
示例5: index
public function index()
{
if (IS_POST) {
//处理后台登录
$gzdata = array('username' => $_POST['username'], 'password' => md5($_POST['password']));
// p($gzdata);die;
$code = K('User')->adminCheck($gzdata);
switch ($code) {
case 1:
$msg = "管理员账户不存在,请检查填写是否正确!";
$url = __APP__ . '?m=admin&c=login';
$this->error($msg, $url);
break;
case 2:
Rbac::login($gzdata['username'], $gzdata['password']);
// p($_SESSION);die;
$msg = "验证成功,即将进入后台!!";
$url = __APP__ . '?m=admin&c=index';
$this->success($msg, $url);
break;
case 3:
$msg = "密码错误,请重新检验你的管理账户密码!!";
$url = __APP__ . '?m=admin&c=login';
$this->error($msg, $url);
break;
}
}
$this->display();
}
示例6: __init
public function __init()
{
$this->db = K('Group');
if (!IS_WEBMASTER) {
$this->error('没有操作权限');
}
}
示例7: __init
public function __init()
{
$this->db = K('Login');
if (session('user') && ACTION != 'out') {
go('Index/index');
}
}
示例8: __init
public function __init()
{
$this->db = K('Login');
if (IS_LOGIN && ACTION != 'out') {
go('Index/index');
}
}
示例9: __init
public function __init()
{
$this->db = K("User");
if (!$_SESSION['user']['web_master']) {
$this->error('没有操作权限');
}
}
示例10: welcome
/**
* [welcome 后台欢迎界面]
* @Author Rukic
* @DateTime 2015-11-25T20:57:53+0800
* @return [type] [description]
*/
public function welcome()
{
$data = K('AdminUser')->get_admin($_SESSION['uid']);
$welcome = array('OS' => get_os(), 'browser' => browser_info(), 'PHPV' => phpversion(), 'MYPHPV' => MYPHP_VERSION, 'admin_user' => $_SESSION['uname'], 'id' => $_SESSION['uid'], 'login_time' => $data['admin_logintime'], 'login_ip' => ntoip($data['admin_loginip']));
$this->assign('w', $welcome);
$this->display();
}
示例11: callback
/**
* 返回登录
*/
public function callback()
{
require_once COMMON_LIB_PATH . "QqConnect/API/qqConnectAPI.php";
$qc = new QC();
$callback = $qc->qq_callback();
$openid = $qc->get_openid();
$user = K("user")->field("uid,username,password,qqau,userlock,uuid,usergroup")->where(array("qqau" => $openid))->find();
session("qqau", $openid);
if (empty($user["qqau"])) {
//首次登录或没有绑定账号
$qc = new QC($callback, $openid);
$arr = $qc->get_user_info();
session("UserInfo", $arr["nickname"]);
go("Passport/Qqlogin/index");
} elseif ($user["qqau"] == $openid) {
//数据库比对正确
if ($user["userlock"] == 1) {
$this->error("您已经被锁定,请联系管理员!");
}
//$this->eve_exp($user["uid"]);
$loginData = array("logintime" => time(), "loginip" => ip::getClientIp(), "qqau" => $openid);
M("user")->where(array("uid" => $user["uid"]))->save($loginData);
// p($_POST);
session("username", $user["username"]);
session("uid", $user["uid"]);
session("uuid", $user["uuid"]);
session("usergroup", $user["usergroup"]);
$this->success("登录成功!正在跳转...", U(__WEB__));
}
}
示例12: edit
public function edit()
{
$Model = K('Access');
if (IS_POST) {
$rid = Q("post.rid");
$Model->where(array("rid" => $rid))->del();
if (!empty($_POST['nid'])) {
foreach ($_POST['nid'] as $v) {
$Model->add(array("rid" => $rid, "nid" => $v));
}
}
$this->success('修改成功');
} else {
$rid = Q("rid", 0, 'intval');
$sql = "SELECT n.nid,n.title,n.pid,n.type,a.rid as access_rid FROM hd_node AS n LEFT JOIN \n \t\t\t(SELECT * FROM (SELECT * FROM hd_access WHERE rid={$rid}) AS aa)AS a\n \t\tON n.nid = a.nid ORDER BY list_order ASC";
$result = $Model->query($sql);
foreach ($result as $n => $r) {
//有权限或不需要验证的节点
$checked = $r['access_rid'] || $r['type'] == 2 ? " checked=''" : '';
$disabled = $r['type'] == 2 ? 'disabled=""' : '';
$result[$n]['checkbox'] = "<label><input type='checkbox' name='nid[]' value='{$r['nid']}' {$checked} {$disabled}/> {$r['title']}</label>";
}
$this->access = Data::channelLevel($result, 0, '-', 'nid');
$this->rid = $rid;
$this->display();
}
}
示例13: __construct
function __construct()
{
parent::__construct();
$this->web_config = K('webConfig');
$this->point_rule = K('point_rule');
//积分模型
}
示例14: login
public function login()
{
if (IS_POST) {
$data = $_POST;
if ($info = K('User')->validate($data['username'], $data['password'])) {
$_SESSION['gz_username'] = $info['username'];
$_SESSION['gz_userid'] = $info['id'];
$login = M('userLogin');
if ($login->where("uid='" . $info['id'] . "'")->one()) {
$login->where("uid='" . $info['id'] . "'")->update(array('login_time' => time(), 'login_ip' => ipton(ip_get_client())));
} else {
$login->add(array('uid' => $info['id'], 'login_time' => time(), 'login_ip' => ipton(ip_get_client())));
}
$this->success('登录成功,正在跳转至首页...', U('Index/index/index'));
if ($data['remanber']) {
cookie('gezi_username', $info['username']);
cookie('gezi_userid', $info['id']);
}
} else {
$this->error('登录失败,请检查用户名和密码', U('Index/Login/login'));
}
return;
}
$this->v();
}
示例15: __init
public function __init()
{
$this->db = K('Access');
$this->rid = Q('rid', 0, 'intval');
if (!IS_WEBMASTER) {
$this->error('没有操作权限');
}
}