本文整理汇总了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');
}
}
示例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');
}
}
示例3: __construct
function __construct()
{
$this->member = load_class('member', 'member');
load_function('common', 'member');
$this->member_setting = get_cache('setting', 'member');
parent::__construct();
}
示例4: __construct
public function __construct()
{
load_function('preg_check');
load_function('common', 'member');
$this->db = load_class('db');
$this->setting = get_cache('setting', 'member');
}
示例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');
}
示例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, '');
}
示例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);
}
示例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;
}
}
示例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');
}
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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 . '"})');
}
示例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');
}
}