• 常用帝国cms标签收录


    帝国网站管理系统V6.6版-数据字典 :  http://www.phome.net/doc/manual/extend/html/dbdoc/index.html

    帝国模板网:http://www.daixiao360.cn/

    http://www.yangqq.com/jstt/bj/2014-10-18/731.html   帝国cms常用标签调用方法总结

    帝国CMS没通用的调用网站栏目名称的标签,[!-有-pagetitle--]是调用当前页面的名称

    如果想在列表页或者内容页调用网站的名称可以使用: <?=$public_r[sitename]?>

    判断会员是否登录
    <?php
    if(!$_COOKIE[ecmsmlusername]){
    $srr="登录可见";
    }else{
    $srr="[!--lbsly--]";
    }
    ?>


    [!--news.url--]skin/default/


    [e:loop={"select classid,classname,bname from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}]<title><?=$bqr[bname]?></title>[/e:loop]

    [e:loop={"select * from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}]<title><?=$bqr[bname]?></title>[/e:loop]

     

     

    <?php
    $fcr=explode('|',$class_r[$GLOBALS[navclassid]][featherclass]);
    $topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的顶级栏目ID
    $rs=$empire->fetch1("select * from phome_enewsclass where classid=$topbclassid");
    ?>

    _<?=$rs['bname']?>_<?=$public_r[sitename]?> 顶级栏目名称+网站标题

    <?=$class_r[$GLOBALS[navclassid]][bname]?> 得到当前栏目的名称

    <title>[!--pagetitle--] </title>  或   <title><?=$class_r[$GLOBALS[navclassid]][bname]?></title>
    <meta name="keywords" content="[!--pagekey--]" />
    <meta name="description" content="[!--pagedes--]" />

     

    isgood=1 一级推荐

    firsttitle=1 一级头条

    [e:loop={10,3,0,0}] 10当前栏目,3显示条数,

    [e:loop={4,1000,0,1,'leib="楼市快讯"','id DESC'}] 1有图片的显示。

    [e:loop={"select * from phome_ecms_xtgg where firsttitle=1 order by id DESC limit 20",6,24,0}]

    <?=$bqno?> [!--no.num--] 循环序号

    <?=$bqsr['titleurl']?> <?=$bqr[title]?> <?=esub($bqr[title],8)?>

    [/e:loop]


    <?=DoWapRepNewstext($r[newstext])?>


    时间调用标签:<?=date("Y-m-d",$bqr['newstime'])?>


    列表页

    您当前的位置:[!--newsnav--]

    [!--no.num--]

    [!--show.listpage--]

     

    内容页

    [!--info.next--]下一篇 [!--info.pre--]上一篇

    万能标签用[!--onclick--] 灵动标签用<?=$bqr[onclick]?> 点击量

    $titleurl=sys_ReturnBqTitleLink($navinfor); 获得当前页面的网址

    $url = "http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF']; 获得当前页面的网址

     

    sql语句

    <?php
    //报名人数
    $num=$empire->gettotal("select count(*) as total from phome_enewsfeedback where kft='".$navinfor[title]."'");
    ?>

    帝国CMS经常用到的调用sql语句:

    请注意,如果是帝国7.0版本的,需要将checked=1去掉

      1,根据最新文章 select * from [!db.pre!]ecms_news where checked=1 order by newstime desc limit 10
      2,根据推荐文章 select * from [!db.pre!]ecms_news where checked=1 and isgood=1 order by newstime desc limit 10
      3,根据热门文章 select * from [!db.pre!]ecms_news where checked=1 order by onclick desc limit 10
      4,根据头条新闻 select * from [!db.pre!]ecms_news where checked=1 and firsttitle=1 order by newstime desc limit 10
      5,根据评论排行 select * from [!db.pre!]ecms_news where checked=1 order by plnum desc limit 10
      6,根据digg排行 select * from [!db.pre!]ecms_news where checked=1 order by diggtop desc limit 10
      7,根据投票排行 select * from [!db.pre!]ecms_news where checked=1 order by votenum desc limit 10
      8,根据下载排行 select * from [!db.pre!]ecms_news where checked=1 order by totaldown desc limit 10
      9,根据评分排行 select * from [!db.pre!]ecms_news where checked=1 order by infopfen desc limit 10

     

    小技巧收录:

    php三元条件运算符:

    <?=$bqr['ftitle']?$bqr['ftitle']:$bqr['title']?>

     

    灵动或者php查询调用编辑器内容的时候要加stripslashes删除反斜杠比如:

     

    <?=stripslashes($r['newstext'])?>

     

    内容页当前信息ID:

     

    $navinfor['id']

     

    列表内容模板信息ID:

     

    $r['id']

     

    当前栏目名:

     

    $class_r[$GLOBALS['navclassid']]['classname'];

     

    当前栏目父栏目:

     

    $class_r[$GLOBALS['navclassid']]['bclassid'];

     

    当前栏目别名:

     

    $class_r[$GLOBALS['navclassid']]['bname'];

     

    当前栏目子栏目:

     

    $class_r[$GLOBALS['navclassid']]['sonclass'];

     

    当前栏目子判断是否为终级栏目:

     

    $class_r[$GLOBALS['navclassid']]['islast'];

     

    当前栏目是否有已审核信息:

     

    $GLOBALS['num']==0为没有信息

     

    帝国cms中引入php路径写法(例子是文件在根目录)

     

    <?php include(ECMS_PATH."./bottom.php");?>

     

    排除置顶、头条、推荐等,sql附加条件:

     

    'istop=0 and isgood=0 and firsttitle=0'

     

    上上级栏目id:

     

    <?php

    $bclassid=$class_r[$GLOBALS[navclassid]][bclassid];

    $bbclassid=$class_r[$bclassid][bclassid];

    echo $bbclassid;

    ?>

     

    $bbclassid就是上上级父栏目id

     

    投稿、登陆、反馈、留言等之后跳转指定页面:

     

    <input type=hidden name=ecmsfrom value="返回页面地址">

     

    统计信息被收藏数: 

    <?

    $favas=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsfava where id='$navinfor[id]' and classid='$GLOBALS[navclassid]'");

    ?>

     

     

    <?=$favas?>就是这条信息的收藏数

     

    列表、结合项判断当前没有信息给出提示:

     

    <?

    if($GLOBALS['num']=='0'){

    ?>

    <p>对不起,暂时没有任何信息!</p>

    <?

    }else{

    ?>

    [!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--]

    <?

    }

    ?>

     

     

     

    动态使用:

    网站名称:<?=$public_r['sitename']?>

    网站地址:<?=$public_r['newsurl']?>

     

    帝国自身的时间转换函数:

     

    <?=format_datetime($bqr[newstime],'Y-m-d')?>

     

     

    此函数自带判断,比较不错,推荐。

     

    判断内容是否有图片,没有图片则显示文中广告 有图片则不显示:

     

    <?php

    $string=$navinfor['newstext'];//内容字段

    $some="<img ";

    $num=explode($some,$string);

    if(count($num)>1){//判断内容中是否有图片

    ?>

    [!--newstext--]

    <?

    }else{

    ?>

    <div id="ad">我是广告</div>

    [!--newstext--]

    <?

    }

    ?>

    截取加过滤标签:

    <?=esub(htmlspecialchars(strip_tags($navinfor[newstext])),160)?>

    内容页或灵动标签支持标题属性

    内容页:

    <?=DoTitleFont($navinfor[titlefont],$navinfor[title])?>

     

    灵动标签:

     

    <?=DoTitleFont($bqr[titlefont],$bqr[title])?>

     

    标题截取字数+标题属性:

    <?=DoTitleFont($bqr[titlefont],esub($bqr[title],32,'...'))?>

  • 相关阅读:
    /bin,/sbin,/usr/sbin,/usr/bin 目录
    centos开放端口8080
    centos 创建用户组及用户
    oracle内存优化
    ORACLE概要文件
    【刷题】洛谷 P3834 【模板】可持久化线段树 1(主席树)
    【总结】莫比乌斯反演
    【刷题】洛谷 P3768 简单的数学题
    【刷题】BZOJ 4816 [Sdoi2017]数字表格
    【刷题】BZOJ 2693 jzptab
  • 原文地址:https://www.cnblogs.com/xiaomifeng/p/4549675.html
Copyright © 2020-2023  润新知