帝国CMS判断会员是否登录及登录后才能看到内容的方法

<?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[&#39;classid&#39;]); $id=intval($_GET[&#39;id&#39;]); $muserid=(int)getcvar(&#39;mluserid&#39;);//用户id $musername=RepPostVar(getcvar(&#39;mlusername&#39;));//用户名 $mgroupid=(int)getcvar(&#39;mlgroupid&#39;);//会员组id if($classid&&$id&&$class_r[$classid][tbname]&&$muserid) { $r=$empire->fetch1("select id,phone from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where id=&#39;$id&#39; and  classid=&#39;$classid&#39; limit 1"); if($r[id]) { ?> document.write(&#39;<li title="<?=$r[phone]?>">手机:<?=$r[phone]?></li>&#39;); <?php } } else { ?> document.write(&#39;<li class="businessCard-embed-content-nologin"><span>手机:</span> <span class="businessCard-embed-content-nologinIcon"></span><a id="businessCard-embed-login" href="#"> 登录后可见</a></li>&#39;); <?php } db_close(); $empire=null; ?>

 

wx.jpg ywfw.jpg
热门