首页 > 后端开发 > php教程 > php问题,跪求各位大牛指点迷津

php问题,跪求各位大牛指点迷津

WBOY
发布: 2016-06-20 12:32:22
原创
713 人浏览过

<?phpif(!defined('IN_DISCUZ')) {	exit('Access Denied');}class plugin_qdkzcj {	function global_qdadd(){		global $_G;		$tablepre=$_G['config']['db']['1']['tablepre'];		@extract($_G['cache']['plugin']['qdkzcj']);						$_G['isqd']=$_G['qdday']=0;				$_G['todayq'] = DB::result_first("SELECT `todayq` FROM `{$tablepre}dsu_paulsignset` WHERE `id` ='1' ");				if(!$_G['uid']) return '';				$qiandaodb = DB::fetch_first("SELECT time FROM ".DB::table('dsu_paulsign')." WHERE uid='$_G[uid]'");		$htime = dgmdate($_G['timestamp'], 'H',$var['tos']);		$tdtime=strtotime(date('Y-m-d'));		if($qiandaodb['time']<$tdtime){			$_G['isqd']=0;		}else{			$_G['isqd']=1;		}		$_G['qdday']=DB::result_first("SELECT `lasted` FROM `{$tablepre}dsu_paulsign` WHERE `uid` ='{$_G['uid']}' LIMIT 0 , 1");		$_G['qmday']=DB::result_first("SELECT `mdays` FROM `{$tablepre}dsu_paulsign` WHERE `uid` ='{$_G['uid']}' LIMIT 0 , 1");		$_G['qtime']=DB::result_first("SELECT `time` FROM `{$tablepre}dsu_paulsign` WHERE `uid` ='{$_G['uid']}' LIMIT 0 , 1");				$_G['qqtime']=date('ymd',$_G['qtime'])==date('ymd',$_G['timestamp'])?date('H:i',$_G['qtime']):date('m-d',$_G['qtime']);			}}function qdbyuid($uid){	return DB::result_first("SELECT `lasted` FROM ".DB::table("dsu_paulsign")." WHERE `uid` ='{$uid}' LIMIT 0 , 1");}function qdbyuser($user){	$user=addslashes($user);	$uid=DB::result_first("select uid from ".DB::table("common_member")." where username='$user' limit 1");	return DB::result_first("SELECT `lasted` FROM ".DB::table("dsu_paulsign")." WHERE `uid` ='{$uid}' LIMIT 0 , 1");}?>
登录后复制

这段php代码做成插件启用以后,模板涉及到的变量就有效。把这个php文件直接引用到模板,变量却无效了。跪求大神帮我改一下,让它有效的在模板里引用


回复讨论(解决方案)

搞不懂你在说啥   

来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板