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


PHP K函数代码示例

本文整理汇总了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');
 }
开发者ID:exakat,项目名称:exakat,代码行数:26,代码来源:_Namespace.14.php

示例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;
 }
开发者ID:sujinw,项目名称:webPHP,代码行数:7,代码来源:AuthorController.class.php

示例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, '参数错误');
     }
 }
开发者ID:jyht,项目名称:v5,代码行数:33,代码来源:FollowControl.class.php

示例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');
 }
开发者ID:suhanyujie,项目名称:spider,代码行数:7,代码来源:FieldController.class.php

示例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();
 }
开发者ID:sujinw,项目名称:webPHP,代码行数:29,代码来源:LoginController.class.php

示例6: __init

 public function __init()
 {
     $this->db = K('Group');
     if (!IS_WEBMASTER) {
         $this->error('没有操作权限');
     }
 }
开发者ID:suhanyujie,项目名称:spider,代码行数:7,代码来源:GroupController.class.php

示例7: __init

 public function __init()
 {
     $this->db = K('Login');
     if (session('user') && ACTION != 'out') {
         go('Index/index');
     }
 }
开发者ID:lililishuang,项目名称:hdcms,代码行数:7,代码来源:LoginController.class.php

示例8: __init

 public function __init()
 {
     $this->db = K('Login');
     if (IS_LOGIN && ACTION != 'out') {
         go('Index/index');
     }
 }
开发者ID:suhanyujie,项目名称:spider,代码行数:7,代码来源:LoginController.class.php

示例9: __init

 public function __init()
 {
     $this->db = K("User");
     if (!$_SESSION['user']['web_master']) {
         $this->error('没有操作权限');
     }
 }
开发者ID:lililishuang,项目名称:hdcms,代码行数:7,代码来源:AdministratorController.class.php

示例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();
 }
开发者ID:sujinw,项目名称:webPHP,代码行数:13,代码来源:IndexController.class.php

示例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__));
     }
 }
开发者ID:a707937337,项目名称:proxy,代码行数:33,代码来源:QqloginControl.class.php

示例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();
     }
 }
开发者ID:jyht,项目名称:v5,代码行数:27,代码来源:AccessControl.class.php

示例13: __construct

 function __construct()
 {
     parent::__construct();
     $this->web_config = K('webConfig');
     $this->point_rule = K('point_rule');
     //积分模型
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:7,代码来源:webConfigControl.php

示例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();
 }
开发者ID:sujinw,项目名称:webPHP,代码行数:25,代码来源:LoginController.class.php

示例15: __init

 public function __init()
 {
     $this->db = K('Access');
     $this->rid = Q('rid', 0, 'intval');
     if (!IS_WEBMASTER) {
         $this->error('没有操作权限');
     }
 }
开发者ID:suhanyujie,项目名称:spider,代码行数:8,代码来源:AccessController.class.php


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