當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。