zoukankan      html  css  js  c++  java
  • phpcms 制作简单企业站的常用标签

    标题 title 关键字 keywords 描述 description

    来源 copyfrom 允许访问 allow_visitor==1 thumb 缩略图


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

     

    {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地址

    class里面加select 选中变色


    <-- if标签 -->
    if 判断

    例子:
    {if $top_parentid==0}
    <a href="{siteurl($siteid)}">
    <div class="h-item select">首页</div>
    </a>
    {else}
    <a href="{siteurl($siteid)}">
    <div class="h-item">首页</div>
    </a>
    {/if}
    用if判断 $top_parentid 的上级代号,点击选中变色,不选中不变色

    $catid==$r[catid] 判断当前地址栏id是否等于要选中的id

    $top_parentid==$r[catid] 用于二级、三级栏目

    {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']}"> 网站描述


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

    加分页  page="$page"    num设定一页输出几行

    输出:{$pages}

    加时间  {date('Y-m-d H:i:s',$val[inputtime])}

  • 相关阅读:
    Linux下tty/pty/pts/ptmx详解
    ubuntu 12 或更高版本 下安装和配置 xrdp 远程登陆
    ubuntu+apache2+php5+mysql5.0的安装
    Ubuntu SSH 服务安装配置和使用
    ubuntu 12.10 进入命令行界面 (字符界面)
    ubuntu 下使用 cron 和 crontab
    Ubuntu用命令行发邮件mutt,报警发短信通知
    Ubuntu 安装 proftpd,并添加虚拟用户
    绝对有效的 ubuntu 12.xx 下 apache2 + svn 安装和配置方法
    添加android系统通知
  • 原文地址:https://www.cnblogs.com/yyy251/p/6760156.html
Copyright © 2011-2022 走看看