zoukankan      html  css  js  c++  java
  • 根据会员权限显示指定字段教程与源码

    使用说明:

    一、创建目录

    在帝国的插件目录:e/extend/创建yz目录

    二、创建文件

    在我们创建的目录内新建一个文件index.php,文件内容如下

    <?php
    require("../../class/connect.php");
    include("../../class/db_sql.php");
    include("../../data/dbcache/class.php");
    $link=db_connect();
    $empire=new mysqlquery();
    $classid=(int)$_GET['classid'];
    $id=(int)$_GET['id'];
    $muserid=(int)getcvar('mluserid');//用户id
    $musername=RepPostVar(getcvar('mlusername'));//用户名
    $mgroupid=(int)getcvar('mlgroupid');//会员组id
    if($classid && $id && $class_r[$classid][tbname])
    {
    $r=$empire->fetch1("select id,title,tprice,price from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where id='$id' and classid='$classid' limit 1");
    if($r[id] && !$mgroupid==1)
    {
    ?>
    document.write('市场价:<?=$r[tprice]?>');
    <?php
    }
    if($r[id] && $mgroupid==1)
    {
    ?>
    document.write('会员价:<?=$r[price]?>');
    <?php
    }
    }
    db_close();
    $empire=null;
    ?>

    三、模板中使用

    在商城模板中找到价格显示的位置

    用以下代码替换

    <span class="price">
    <script src="[!--news.url--]e/extend/yz/?id=[!--id--]&classid=[!--classid--]"></script>
    </span>
  • 相关阅读:
    第0次作业(第二学期)
    C语言程序设计(基础)最后一次作业-- 总结报告
    第14、15教学周作业
    第七周作业
    第六周作业
    第四周作业
    第四次作业
    2018第三次作业
    2018第二次作业
    2018第三,四作业合集
  • 原文地址:https://www.cnblogs.com/wordgao/p/3849224.html
Copyright © 2011-2022 走看看