zoukankan      html  css  js  c++  java
  • beescms文章列表页函数学习

    //函数:get_tpl_list_nav($tpl_id='',$is_content=0)

    //功能:根据模板ID或当前栏目ID获得子栏目列表页

    {assign source=get_tpl_list_nav('3',1) name=tree/}
    {if $tree}
    <div class="box left_width">
    <div class="left_title"><h2>产品导航</h2></div>
    <div class="box_in">
    <div id="category_tree">
    {loop source=$tree item=$nav}
    <dl>
    <dt><span class="c_icon"></span><a class="{print $nav['class']/}" href="{print $nav['url']/}" {print $nav['target']/} title="{print $nav['cate_name']/}">{print $nav['cate_name']/}({print $nav['content_num']/})</a></dt>

    <dd style="display: none;" id="nav_16">
    <ul>
    {loop source=$nav['child']}
    <li><a class="{print $v['class']/}" href="{print $v['url']/}">{print $v['cate_name']/}({print $v['content_num']/})</a></li>
    {/loop}
    </ul>
    </dd>
    </dl>
    {/loop}
    </div><!--分页导航-->

    </div>
    </div><!--容器结束-->
    {/if}

    //函数:get_else_content($cate_id='',$limit='0,5',$order_type='id',$filter='',$pic='no',$order='desc',$lang='',$like=0)

    //功能:获得其它内容【列表页和内容页自动获取】

    {assign source=get_else_content($cate_id='',$limit='0,5',$order_type='hits',$filter='',$pic='no',$order='desc',$lang='') name=hot_arc/}
    {if $hot_arc}
    <div class="box">
    <div class="left_title"><h2>热门内容</h2></div>
    <div class="box_in">
    <div class="news_list">
    <ul>
    {loop source=$hot_arc}
    <li><a title="{print $v['title']/}" href="{print $v['url']/}" {print $v['target']/} {if $v['style']}style="{print $v['style']/}"{/if}>{print cn_substr($v['title'],40)/}</a>{print date('m-d',$v['updatetime'])/}</li>
    {/loop}
    </ul>
    </div>
    </div>
    </div>

    /*
    * 获得片段内容,通过标识获取
    */
    function get_block_content($block=''){
    if(empty($block)){return;}
    $sql="select content from ".DB_PRE."block where tag = '".$block."' and lang='".$GLOBALS['lang']."'";
    $rel = $GLOBALS['mysql']->fetch_asc($sql);
    return $rel[0]['content'];
    }

    //函数:list_article()

    //功能:获得列表页内容列表【只能在列表页使用】

    {loop source=list_article()}
    <li><span class="time">{print date('Y-m-d H:m:s',$v['updatetime'])/}</span><a href="{print $v['url']/}" {print $v['target']/} style="{print $v['style']/}">{print $v['title']/}</a></li>
    {/loop}

  • 相关阅读:
    linux,windows kettle安装方法
    等待事件分类
    分析函数详细例子
    v$session中不同连接方式module,program的区别
    charles Glist发布设置
    charles 发布Glist
    charles 工具菜单总结
    charles 高级批量请求
    charles 批量重复请求/重复发包工具
    charles 重写工具/rewrite Srttings
  • 原文地址:https://www.cnblogs.com/runong/p/3529475.html
Copyright © 2011-2022 走看看