zoukankan      html  css  js  c++  java
  • phpcms企业站的一些知识

    头header.html

    尾footer.html

    主页用index.html

    列表页用list.html

    单网页用page.html

    内容页用show.html

    {template "content","header"} 引入头
    {template "content","footer"} 引入尾

    {IMG_PATH}image引入图片的路径(没有/)
    {JS_PATH}js引入JS的路径(没有/)
    {CSS_PATH}css引入CSS的路径(没有/)

    {pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}
    {loop $data $r}

    {/loop}
    {/pc}

    <-- PC标签 -->
    pc:content 代表调用content内容模块

    action="category" category(栏目) 调用category栏目

    action="lisis" lisis(内容数据列表) 调用列表

    catid="0" 找父级栏目 所有一级栏目的父级栏目是0

    num="25" 最多取多少条

    siteid="$siteid" 站点的id 只有一个站点就是siteid="$siteid"

    order="listorder ASC" 根据排序排序 ASC升序


    <-- LOOP标签 -->
    外层的PC就像写了一个SQL语句,然后用LOOP遍历

    $data 相当于二维数组

    $r $data取出的每一项交给$r

    {siteurl($siteid)} 取站点路径id地址


    导航栏的做法:
    首页:
    {if $top_parentid==0 && $catid==""}
    <div class="nei select"><a href="{siteurl($siteid)}">网站首页</a></div>
    {else}
    <div class="nei"><a href="{siteurl($siteid)}">网站首页</a></div>
    {/if}

    用if判断 $top_parentid 的上级代号,点击选中变色,不选中不变色
    除首页外的其它导航:
    {pc:content action="category" catid="0" num="7" siteid="$siteid" order="listorder ASC"}
    {loop $data $r}

    {if $catid==$r[catid] || $top_parentid==$r[catid]}
    <div class="gang"></div>
    <div class="wai">
    <div class="nei select"><a href="{$r[url]}">{$r[catname]}</a></div>
    </div>
    {else}
    <div class="gang"></div>
    <div class="wai">
    <div class="nei"><a href="{$r[url]}">{$r[catname]}</a></div>
    </div>
    {/if}

    {/loop}
    {/pc}

    内容:

    {pc:content action="lists" catid="21" order="id DESC" num="3" moreinfo="1"}
    <ul>
    {loop $data $val}
    <li><img src="{$val[thumb]}" /></li>
    {/loop}
    </ul>
    {/pc}

    {if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}
    {/if}{$SEO['site_title']}
    替换网页的标题

    <meta name="keywords" content="{$SEO['keywords']}"> 网站关键字
    <meta name="description" content="{$SEO['description']}"> 网站描述


    提取某一项的前多少个字符,后面的用...代替
    {str_cut($val[title],48,"…")}


    取消来源后边的 “|0”
    {php list($copyfrom) = explode('|',$val[copyfrom])}
    {$copyfrom}


    加分页 page="$page"
    {date('Y-m-d H:i:s',$val[inputtime])}
    输出:{$pages}

    CMSV9帮助中心   http://v9.help.phpcms.cn/

  • 相关阅读:
    深入admin之chang_list
    List<T>列表通用过滤模块设计
    Mysql行转换为列
    Linux中cp直接覆盖不提示的方法
    hibernate Restrictions 用法
    java.lang.OutOfMemoryError: PermGen space
    ruby+gem常用命令
    Linux查看CPU和内存使用情况
    在Ubuntu 9.04下配置Apache和ModPython
    有关查询和执行计划的DMV 从而明确那些SQL要优化
  • 原文地址:https://www.cnblogs.com/gaobint/p/6760221.html
Copyright © 2011-2022 走看看