帝国CMS不同会员组查看文章权限判断在静态页面的实现方法
帝国CMS不同会员组查看文章权限判断在静态页面的实现方法<?phprequire("class/connect.php");include("class/db_sql.php");include("class/config/config.php");include("data/dbcache/class.php");$link=db_connect……
帝国CMS不同会员组查看文章权限判断在静态页面的实现方法
<?phprequire("class/connect.php");include("class/db_sql.php");include("class/config/config.php");include("data/dbcache/class.php");$link=db_connect();$empire=new mysqlquery();$classid=intval($_GET['classid']);//当前信息所属栏目ID$id=intval($_GET['id']);//当前信息ID$muserid=(int)getcvar('mluserid');//用户id$musername=RepPostVar(getcvar('mlusername'));//用户名$mgroupid=(int)getcvar('mlgroupid');//会员组idif($classid&&$id&&$class_r[$classid][tbname]&&$muserid){$r=$empire->fetch1("select id,title from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where id='$id' and classid='$classid' limit 1");if($mgroupid==2){//判断会员组id为2?>document.write('标题:<?=$r[title]?>');//这里自行修改提示文字、要展示的内容等<?php}elseif($tmgetgroupid==1) //判断会员组id为1?>document.write('此信息需要VIP权限才可以查看');//这里自行修改提示文字、要展示的内容等<?php}else{?>document.write('登录后才能查看');//这里自行修改提示文字、要展示的内容等<?php}db_close();$empire=null;?>
把以上代码存为show.php文件,把show.php放到e目录里。
内容模板显示调用
<script src="[!--news.url--]e/show.php?classid=[!--classid--]&id=[!--id--]"></script>
上面的sql语句只是查询title,其他字段自行修改
- 上一篇
帝国CMS下载txt文件浏览器带下载进度显示
帝国默认TXT格式的文件是不可以下载,不修改源文件他会直接打开方法TXT弹出下载:测试版本:帝国CMS7.0功能位置:后台->其他管理->下载模型管理->管理地址前缀相关函数:e/class/DownSysFun.php DoTypeForDownurl() , QDownLoa
- 下一篇
帝国CMS中模板通用的栏目别名调用方法
以下代码适合放到封面模板,列表模板和内容页模板<?php$class_sql=$empire->fetch1('select classid,classname,bname from '.$dbtbpre.'enewsclass where classid='.$GLOBALS[navclassid].'');$bname=$class_sql[bname