當前位置: 首頁>>代碼示例>>PHP>>正文


PHP load_function函數代碼示例

本文整理匯總了PHP中load_function函數的典型用法代碼示例。如果您正苦於以下問題:PHP load_function函數的具體用法?PHP load_function怎麽用?PHP load_function使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了load_function函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: menu_setting

 /**
  * 設置菜單
  */
 public function menu_setting()
 {
     $weixin_config = get_config('weixin_config');
     define(AppId, $weixin_config['appid']);
     //定義AppId,需要在微信公眾平台申請自定義菜單後會得到
     define(AppSecret, $weixin_config['secret']);
     //定義AppSecret,需要在微信公眾平台申請自定義菜單後會得到
     load_function('curl');
     if (isset($GLOBALS['submit'])) {
         $menu_setting = trim($GLOBALS['form']['menu_setting']);
         $menu = load_class('menu', 'weixin');
         //引入微信類
         $creatMenu = $menu->creatMenu($menu_setting);
         //創建菜單
         $creatMenu_arr = json_decode($creatMenu, true);
         if ($creatMenu_arr['errcode'] != 0) {
             MSG($creatMenu);
         } else {
             $this->db->update('setting', array('data' => $menu_setting), array('m' => 'weixin', 'keyid' => 'configs'));
             MSG('創建成功,菜單將在24小時後生效,您可以取消關注,再關注看到最新菜單');
         }
     } else {
         $r = $this->db->get_one('setting', array('m' => 'weixin', 'keyid' => 'configs'));
         $menu_setting = $r['data'];
         include $this->template('menu_setting');
     }
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:30,代碼來源:set.php

示例2: edit

 /**
  * 修改公告
  */
 public function edit()
 {
     $id = intval($GLOBALS['id']);
     if (isset($GLOBALS['submit'])) {
         $formdata = $GLOBALS['form'];
         $formdata['title'] = remove_xss($formdata['title']);
         $formdata['note'] = remove_xss($formdata['note']);
         $formdata['addtime'] = SYS_TIME;
         $formdata['endtime'] = strtotime($GLOBALS['endtime']);
         $formdata['publisher'] = get_cookie('username');
         $formdata['css'] = 'color:#' . remove_xss(ltrim($GLOBALS['title_css'], '#') . ';' . $GLOBALS['font_weight']);
         $linkageid = $this->db->update('affiche', $formdata, array('id' => $id));
         MSG(L('operation success'), '?m=affiche&f=index&v=listing' . $this->su());
     } else {
         $show_formjs = 1;
         $form = load_class('form');
         load_function('admin');
         $endtime = SYS_TIME + 86400 * 30;
         $endtime = date('Y-m-d');
         $r = $this->db->get_one('affiche', array('id' => $id));
         $styles = style($r['css']);
         //color:#ff0000;font-weight:bold
         $font_weight = $styles['font-weight'];
         $color = $styles['color'];
         include $this->template('edit');
     }
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:30,代碼來源:index.php

示例3: __construct

 function __construct()
 {
     $this->member = load_class('member', 'member');
     load_function('common', 'member');
     $this->member_setting = get_cache('setting', 'member');
     parent::__construct();
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:7,代碼來源:member.php

示例4: __construct

 public function __construct()
 {
     load_function('preg_check');
     load_function('common', 'member');
     $this->db = load_class('db');
     $this->setting = get_cache('setting', 'member');
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:7,代碼來源:member.class.php

示例5: show

 public function show()
 {
     load_function('common', 'member');
     $siteconfigs = $this->siteconfigs;
     $id = isset($GLOBALS['id']) ? intval($GLOBALS['id']) : MSG(L('parameter_error'));
     $categorys = get_cache('category', 'content');
     //查詢數據
     $models = get_cache('model_guestbook', 'model');
     $model_r = $models[15];
     $master_table = $model_r['master_table'];
     $data = $this->db->get_one($master_table, array('id' => $id));
     require get_cache_path('content_format', 'model');
     $form_format = new form_format($model_r['modelid']);
     $data = $form_format->execute($data);
     foreach ($data as $_key => $_value) {
         ${$_key} = $_value['data'];
     }
     $_template = TPLID . ':show';
     $styles = explode(':', $_template);
     $project_css = isset($styles[0]) ? $styles[0] : 'default';
     $_template = isset($styles[1]) ? $styles[1] : 'show';
     $seo_title = $title . '_' . $siteconfigs['sitename'];
     $seo_keywords = !empty($keywords) ? implode(',', $keywords) : '';
     $seo_description = $remark;
     $this->db->update($master_table, "`hits`=(`hits`+1)", array('id' => $id));
     include T('guestbook', 'show');
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:27,代碼來源:index.php

示例6: setmonth

 /**
  * 獲取可預約的時間
  */
 public function setmonth()
 {
     load_function('global', 'order');
     $d = $GLOBALS['d'];
     $dar = explode('-', $d);
     $month = $dar[1];
     $year = $dar[0];
     echo build_calendar($month, $year, '');
 }
開發者ID:haizhilin2013,項目名稱:wuzhicms,代碼行數:12,代碼來源:json.php

示例7: create_cookie

 private function create_cookie($info, $cookietime = 0)
 {
     set_cookie('auth', encode($info['uid'] . "\t" . $info['password'] . "\t" . $cookietime, substr(md5(_KEY), 8, 8)), $cookietime);
     set_cookie('_uid', $info['uid'], $cookietime);
     set_cookie('_username', $info['username'], $cookietime);
     set_cookie('_groupid', $info['groupid'], $cookietime);
     load_function('string');
     setcookie(COOKIE_PRE . 'truename', escape($info['username']), $cookietime, COOKIE_PATH, COOKIE_DOMAIN, 0);
     setcookie(COOKIE_PRE . 'modelid', $info['modelid'], $cookietime, COOKIE_PATH, COOKIE_DOMAIN, 0);
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:10,代碼來源:card.php

示例8: updatepw

 public function updatepw($get, $post)
 {
     //	如果沒有傳遞新的密碼直接返回成功
     if (empty($get['password'])) {
         return API_RETURN_SUCCEED;
     }
     load_function('preg_check');
     $factor = random_string('diy', 6);
     if ($this->member->db->update('member', array('factor' => $factor, 'password' => md5(md5($get['password']) . $factor)), 'username="' . $get['username'] . '"')) {
         return API_RETURN_SUCCEED;
     } else {
         return API_RETURN_FAILED;
     }
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:14,代碼來源:uc.php

示例9: add

 /**
  * 後台充值
  */
 public function add()
 {
     $config = $this->db->get_one('payment', array('id' => 2));
     if ($config['status'] != 1) {
         MSG('不支持後台充值,開啟方式:充值配置中開啟後台充值功能');
     }
     if (isset($GLOBALS['submit'])) {
         load_function('common', 'pay');
         $formdata = array();
         $formdata['username'] = remove_xss($GLOBALS['username']);
         $mr = $this->db->get_one('member', array('username' => $formdata['username']));
         if (!$mr) {
             MSG('用戶不存在');
         }
         $formdata['uid'] = $mr['uid'];
         $plus_minus = intval($GLOBALS['plus_minus']);
         $money = $formdata['money'] = sprintf("%.2f", substr(sprintf("%.3f", $GLOBALS['money']), 0, -2));
         $formdata['order_no'] = create_order_no();
         $formdata['note'] = remove_xss($GLOBALS['note']);
         $formdata['plus_minus'] = $plus_minus;
         $formdata['adminuid'] = $_SESSION['uid'];
         $formdata['addtime'] = SYS_TIME;
         $formdata['paytime'] = SYS_TIME;
         $formdata['endtime'] = SYS_TIME;
         $formdata['quantity'] = 1;
         $formdata['status'] = 1;
         $formdata['payment'] = 1;
         $username = get_cookie('username');
         if ($plus_minus == 1) {
             $plus_minus_type = '充值';
             $formdata['payname'] = $username . '為用戶' . $plus_minus_type;
             $linkageid = $this->db->insert('pay', $formdata);
             $this->db->update('member', "`money`=(`money`+{$money})", array('uid' => $mr['uid']));
         } else {
             $plus_minus_type = '扣款';
             $formdata['payname'] = $username . '為用戶' . $plus_minus_type;
             $linkageid = $this->db->insert('pay', $formdata);
             $this->db->update('member', "`money`=(`money`-{$money})", array('uid' => $mr['uid']));
         }
         MSG(L('operation success'));
     } else {
         $show_formjs = 1;
         $form = load_class('form');
         $options = $this->db->get_list('kind', array('keyid' => 'link'));
         $options = key_value($options, 'kid', 'name');
         include $this->template('add');
     }
 }
開發者ID:haizhilin2013,項目名稱:wuzhicms,代碼行數:51,代碼來源:index.php

示例10: show

 public function show()
 {
     $keyid = $GLOBALS['keyid'];
     if (!preg_match('/^([a-z]{1,}[a-z0-9]+)/', $keyid)) {
         MSG('keyid參數錯誤');
     }
     load_function('common', 'member');
     //$dianping_array = array(1=>'很差',2=>'差',3=>'一般',4=>'好',5=>'很好');
     $page = isset($GLOBALS['page']) ? intval($GLOBALS['page']) : 1;
     $page = max($page, 1);
     if (!preg_match('/([a-z0-9_\\-])/', $GLOBALS['template'])) {
         exit('模板錯誤');
     }
     $template = $GLOBALS['template'];
     include T('dianping', $template);
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:16,代碼來源:dianping.php

示例11: __construct

 public function __construct($info = array())
 {
     if (!is_array($info) || empty($info)) {
         $info = get_cache('setting', 'member');
     }
     $this->secret = $info['sina_secret'];
     $this->appkey = $info['sina_key'];
     $this->token = $info['token'];
     $this->code = $info['code'];
     $this->error = 0;
     $this->extend = array();
     load_function('common', 'member');
     if (empty($this->token)) {
         $this->get_token($this->code);
     }
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:16,代碼來源:sinaAuth.class.php

示例12: package_jeu

function package_jeu($titre)
{
    global $phpbb_root_path, $phpEx, $areabb;
    // On est développeur et on veut le package de son mod
    load_function('lib.files');
    $package = new files();
    $name = 'AreaBB-jeux_' . $titre . '.pkg.gz';
    // on crée le package serialize
    $res = $package->makePackage($name, CHEMIN_JEU . $titre, CHEMIN_JEU, 1);
    // on l'enregistre dans un fichier
    if (($fp = fopen($phpbb_root_path . $areabb['chemin_pkg_jeux'] . $name, 'w')) !== false) {
        fwrite($fp, $res, strlen($res));
        fclose($fp);
    }
    return true;
}
開發者ID:Nekrofage,項目名稱:FJR,代碼行數:16,代碼來源:dl.php

示例13: login

 /**
  * 用戶登錄
  * @param	string	$username
  * @param	string	$password
  * @param	array	$user
  * @return	string	$synlogin
  */
 public function login($username, $password, &$user = array())
 {
     list($ucuid, $uc_username, $uc_password, $email) = $this->uc_call("uc_user_login", array($username, $password));
     //	導入用戶到UC數據庫
     if ($ucuid == '-1' && is_array($user) && $user) {
         //	生成臨時密碼用於比對密碼是否正確
         $password_t = md5(md5($password) . $user['factor']);
         if ($user['password'] == $password_t) {
             $ucuid = $this->uc_call("uc_user_register", array($user['username'], $password, $user['email']));
             if ($ucuid <= 0) {
                 MSG(L('user_not_exist'));
             }
         }
         //	再一次調取UC的信息
         list($ucuid, $uc_username, $uc_password, $email) = $this->uc_call("uc_user_login", array($username, $password));
     }
     if ($ucuid == '-1') {
         MSG(L('user_not_exist'));
     }
     if ($ucuid == '-2') {
         MSG(L('password_error'), HTTP_REFERER);
     }
     $synlogin = $this->uc_call('uc_user_synlogin', array($ucuid));
     //	同步數據到WZ
     if (!is_array($user) || empty($user)) {
         $user = $this->db->get_one('member', '`username` = "' . $username . '"', '*');
         if (empty($user)) {
             load_function('preg_check');
             if (strtolower(UC_DBCHARSET) != strtolower(CHARSET)) {
                 $username = iconv(UC_DBCHARSET, CHARSET . '//IGNORE', $username);
             }
             $user['username'] = $username;
             $user['email'] = $email;
             $user['factor'] = random_string('diy', 6);
             $user['password'] = md5(md5($password) . $user['factor']);
             $user['ucuid'] = $ucuid;
             $user['modelid'] = '';
             $user['uid'] = $this->db->insert('member', $user, true);
         }
     }
     if ($user['ucuid'] != $ucuid) {
         $this->db->update('member', 'ucuid=' . $ucuid, 'uid=' . $user['uid']);
     }
     return $synlogin;
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:52,代碼來源:ucenter.class.php

示例14: create

 /**
  * 生成邀請碼
  */
 public function create()
 {
     if (empty($this->setting['invite'])) {
         exit($GLOBALS['callback'] . '({error:1, msg:"係統關閉了邀請注冊"})');
     }
     $count = $this->db->fetch_array($this->db->query('SELECT COUNT(`isbuy` = 1 or null) as buy, COUNT(`isbuy` = 0 or null) as free FROM `wz_member_invite` WHERE uid=' . $this->memberinfo['uid'] . ' AND createtime >' . strtotime(date('Y-m-d'))));
     $isbuy = 0;
     if ($count['free'] >= $this->setting['invitenum'][$this->memberinfo['groupid']]['free']) {
         if ($count['buy'] >= $this->setting['invitenum'][$this->memberinfo['groupid']]['buy']) {
             exit($GLOBALS['callback'] . '({error:1, msg:"您今日的名額已用完"})');
         }
         //	這裏得調用支付接口 暫時空著
         $isbuy = 1;
     }
     load_function('preg_check');
     $invite = random_string('diy', 8, '23456789abcdefghjkmnpqrstuvwxyz');
     $this->db->insert('member_invite', array('uid' => $this->memberinfo['uid'], 'isbuy' => $isbuy, 'invite' => $invite, 'createtime' => SYS_TIME));
     exit($GLOBALS['callback'] . '({error:0, msg:"' . $invite . '"})');
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:22,代碼來源:invite.php

示例15: reply

 /**
  * 回複
  */
 public function reply()
 {
     $id = $GLOBALS['id'];
     $reply_user = get_cookie('wz_name');
     if (isset($GLOBALS['submit'])) {
         $status = 9;
         if (!empty($GLOBALS['reply_user'])) {
             $reply_user = remove_xss($GLOBALS['reply_user']);
         }
         $this->db->update('guestbook', array('status' => $status, 'reply' => $GLOBALS['reply'], 'replytime' => SYS_TIME, 'reply_user' => $reply_user), array('id' => $id));
         $r = $this->db->get_one('guestbook', array('id' => $id));
         $mr = $this->db->get_one('member', array('username' => $r['publisher']));
         //郵箱有驗證狀態時發送郵件通知
         if ($mr['ischeck_email']) {
             load_function('preg_check');
             $config = get_cache('sendmail');
             $password = decode($config['password']);
             //load_function('sendmail');
             $subject = '有人回複了您的提問,請登錄查詢';
             $message = "提問內容:" . $r['title'] . "<br>詳細回複請登錄:<br><a href='" . WEBURL . "index.php?m=guestbook&f=myissue&v=listing' target='_blank'>" . WEBURL . 'index.php?m=guestbook&f=myissue&v=listing</a> 查看';
             $mail = load_class('sendmail');
             $mail->setServer($config['smtp_server'], $config['smtp_user'], $password);
             //設置smtp服務器,普通連接方式
             $mail->setFrom($config['send_email']);
             //設置發件人
             $mail->setReceiver($mr['email']);
             //設置收件人,多個收件人,調用多次
             $mail->setMail($subject, $message);
             //設置郵件主題、內容
             $mail->sendMail();
             //發送
         }
         MSG(L('operation success'), $GLOBALS['forward']);
     } else {
         load_class('form');
         $r = $this->db->get_one('guestbook', array('id' => $id));
         $model_r = $this->db->get_one('model', array('m' => 'guestbook'));
         require get_cache_path('guestbook_form', 'model');
         $form_build = new form_build($model_r['modelid']);
         $formdata = $form_build->execute($r);
         include $this->template('reply');
     }
 }
開發者ID:another3000,項目名稱:wuzhicms,代碼行數:46,代碼來源:index.php


注:本文中的load_function函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。