您的位置:首页 > 其它

discuz 插件开发疑难点整理

2018-03-16 15:42 274 查看
1、C::t('#wechat#common_member_wechat')->fetch_by_openid('xxxxxxxxxxxxxxxxxxx');
这句话表示从 source/plugin/wechat/table/common_member_wechat 类中调用fetch_by_openid方法
2、设置or获取cookies
dsetcookie('reg_nickname', '唐风', 7100);
getcookie('reg_nickname');
还有一种加密的,我不知道在哪设置,如果正常get不到,还有一种方法:authcode(getcookie('reg_nickname'), 'DECODE', $_G['config']['security']['authkey']);

3.在使用手机注册了一个用户后,需要执行下面这段代码:C::t('common_member_profile')->update($uid, array('mobile' => $phone));以后就可以直接用手机号登陆了,具体方法为loaducenter();$info = uc_user_login($phone,$passwd);
4. 检查用户登陆,例如错误次数不能超过5次include_once libfile('function/member'); if(!($loginperm = logincheck($_GET['username']))) { showmessage('login_strike'); }密码错误登陆失败记录错误次数if($result['status'] <= 0) { loginfailed($_GET['username']); failedip(); showmessage('login_invalid', '', array('loginperm' => $loginperm - 1)); }5. 自带日期选择框的使用<script src="static/js/calendar.js"></script><input type="text" class="stime" name="time" value="" readonly="readonly" onclick="showcalendar(event, this, 1)">6.模板加载include template('目录/模板名称'); // 普通模板加载include template('插件标识符:模板名称'); // 加载插件模板
7.discuz API 头部写法
<?phpdefine('IN_API', true);define('CURSCRIPT', 'api');define('DISABLEXSSCHECK', true);
require_once '../../../source/class/class_core.php';$discuz = C::app();$discuz->init();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  discuz 插件