最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

帝國CMS判斷會員是否登錄及登錄后才能看到內(nèi)容的方法

  發(fā)布時間:2014-11-29 16:18:27   作者:佚名   我要評論
這篇文章主要為大家介紹了帝國CMS判斷會員是否登錄及登錄后才能看到內(nèi)容的方法,通過引入一個自定義文件進行數(shù)據(jù)庫的讀取及會員登錄判斷操作,是非常實用的權(quán)限判斷功能,需要的朋友可以參考下

本文實例講述了帝國CMS判斷會員是否登錄及登錄后才能看到內(nèi)容的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:

適用版本6.6

效果是:會員登錄后才能看到手機號碼,未登錄時顯示“登錄后可見”

1、新建show.php文件,放到e目錄里下面;

2、show.php內(nèi)容以下:

復制代碼
代碼如下:
<?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)
{
$r=$empire->fetch1("select id,phone from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where id='$id' and classid='$classid' limit 1");
if($r[id])
{
?>
document.write('<li title="<?=$r[phone]?>">手機:<?=$r[phone]?></li>');
<?php
}
}
else
{
?>
document.write('<li class="businessCard-embed-content-nologin"><span>手機:</span><span class="businessCard-embed-content-nologinIcon"></span><a id="businessCard-embed-login" href="#">登錄后可見</a></li>');
<?php
}
db_close();
$empire=null;
?>

3、內(nèi)容模板顯示調(diào)用:

復制代碼
代碼如下:
<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

希望本文所述對大家的帝國CMS建站有所幫助。

相關(guān)文章

最新評論

姚安县| 井陉县| 颍上县| 武平县| 汉中市| 商丘市| 镇巴县| 大同县| 钦州市| 贡嘎县| 永修县| 德钦县| 乌拉特中旗| 门源| 舟山市| 上犹县| 安福县| 即墨市| 岳阳县| 商南县| 廊坊市| 新乡县| 遂昌县| 乌拉特后旗| 肇源县| 张北县| 丰宁| 霍州市| 武清区| 永德县| 禄丰县| 扬州市| 平谷区| 会理县| 虞城县| 哈巴河县| 太仓市| 奇台县| 黎川县| 天祝| 开平市|