帝国CMS教程判断会员是否登录 登录后才能看见内容版本

版本6.6
 
效果是:会员登录后才能看到手机号码,未登录时显示“登录后可见”
 
1、新建show.php文件,放到e目录里下面;
 
2、show.php内容以下:
 
<?php
require("class/connect.php");
include("class/db_sql.php");
include("class/config.php");
include("data/dbcache/class.php");
$link=db_connect();
$empire=new mysqlquery();
$classid=intval($_GET['classid']);
$id=intval($_GET['id']);
$muserid=(int)getcvar('mluserid');//用户id
$musername=RepPostVar(getcvar('mlusername'));//用户名
$mgroupid=(int)getcvar('mlgroupid');//会员组id
if($classid&&$id&&$class_r[$classid][tbname]&&$muserid)
?>
3、内容模板显示调用:
 
<script src="[!--news.url--]e/show.php?classid=[!--classid--]&id=[!--id--]"></script>
 
4、上面的sql语句只是查询phone,其他字段自行修改(注:phone有两处地方的,如果修改要同时进行)
 
5、若是多字段,请参考:http://bbs.phome.net/showthread-13-89138-6.html

dawei

【声明】:毕节站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。