• phpcms 调用


    头部

    <meta name="keywords" content="{$SEO['keyword']}" />
    <meta name="description" content="{$SEO['description']}" />
    <title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title>
    
    {template "content","header"}   头部
    {template "content","footer"}    底部
    当前页标题      {$CATEGORYS[$catid][catname]} 
    
    当前也链接      {$CATEGORYS[$catid][url]}  

    当前栏目描述 {$CATEGORYS[$catid][description]}
    当前栏目图片 {$CATEGORYS[
    $catid]['image']} 
    碎片  {pc:block pos="index"}{/pc}
    分页 {$pages}
    {if $pages} {$pages} {/if}

    时间 {$date('Y/m/d',$r['inputtime'])}

    标题 {str_cut($r['title'],36)}
    详情           {str_cut($r[description],500)} 
    
    面包屑导航      首页 > {catpos($catid)} 正文
    
    <p>当前位置 : <a href="/">首页</a> &gt; <a href="{$CATEGORYS[$CAT[parentid]][url]}">{$CATEGORYS[$CAT[parentid]][catname]}</a> &gt; <a href="{$CAT[url]}">{$CAT[catname]}</a></p>

        {pc:content action="lists" catid="11" num="6" order="id DESC LIMIT 5,6--" moreinfo="1" page="$page"}

       第6条开始调,调6条

    导航

    <li class="{if !$catid}nav_ac{/if}"><a href="/">网站首页</a></li>
    <li class="{if $top_parentid == $v[catid]||$catid==$v[catid]||$parentid==$v[catid]}nav_ac{/if}"></li>
    
    <ul>
      {pc:content action="category" catid="0" num="8" siteid="$siteid" order="listorder ASC"}   <li class="{if !$catid}nav_ac{/if}"><a href="/">网站首页</a>   </li>   {loop $data $k $v}   <li class="{if $top_parentid == $v[catid]||$catid==$v[catid]||$parentid==$v[catid]}nav_ac{/if}"><a href="{$v[url]}">{$v[catname]}</a>   </li>   {/loop}   {/pc} </ul>
              <ul>
                <li><a href="/" title="">首页</a></li>
                {pc:content action="category" catid="0" num="8" siteid="$siteid" order="listorder ASC"}
                {loop $data $k $v}
                    <li><a href="{$v[url]}">{$v[catname]}</a>
                    <div class="cell">
                      <ul>
                        {pc:content action="category" catid="$k" num="8" siteid="$siteid" order="listorder ASC"}
                        {loop $data $r}
                       <li><a href="{$r[url]}">{$r[catname]}</a></li>
                        {/loop}
                        {/pc}
                      </ul>
                    </div>
                </li>
                {/loop}
                {/pc}
              </ul>

     调标题

    {pc:content action="category" catid="$top_parentid" num="5" order="listorder ASC"}
    {loop $data $cat}
    <p><a href="{$cat['url']}">{$cat['catname']}</a></p>
    {/loop}
    {/pc}

    {if $cat[catid]==$catid} class="active"{/if}

    调内容

    <ul>
      {pc:content action="lists" catid="$catid" num="8" order="id DESC" moreinfo="1" page="$page"}
      {loop $data $r}
      <li><a href="{$r[url]}">
        <div class="anli_img">
          <img src="{thumb($r['thumb'],293,197)}" alt="{$r['title']}">
        </div>
        <div class="anli_txt">
          <h3>{$r['title']}</h3>
        </div>
      </a></li>
    {/loop}
    {/pc}
    </ul>

     推荐位

    {pc:content  action="position"  posid="2"  order="id DESC"  num="5"}
    {loop $data $r}
      <li><a href="{$r[url]}">
        <div class="anli_img">
          <img src="{thumb($r['thumb'],293,197)}" alt="{$r['title']}">
        </div>
        <div class="anli_txt">
          <h3>{$r['title']}</h3>
        </div>
      </a></li>
    {/loop}

    {/pc}

     调单页内容

    {pc:get sql="SELECT * FROM phpcms_page where catid=16"}
    {loop $data $val}
    {$val[content]}
    {/loop}
    {/pc}
    
    限制字数  {str_cut(strip_tags($val[content]),400,"")}...

    调用点击量

    需要在show.html 模板中首先加载jquery.min.j

    <span>点击:<span id="hits"></span></span>
    <script language="JavaScript" src="{APP_PATH}api.php?op=count&id={$id}&modelid={$modelid}"></script> 

    调用关键字

    <div class="next">关键字:
       {loop $keywords $keyword}
         <a href="{APP_PATH}index.php?m=content&c=tag&catid={$catid}&a=lists&tag={urlencode($keyword)}" target="_blank"> {$keyword}</a> 
      {/loop}
    </div>
  • 相关阅读:
    Android进阶篇判断3G/WIFI/WAP
    Android基础篇配置查看Android系统源码
    Android进阶篇Http协议
    Android进阶篇流量统计
    Android进阶篇自定义Menu(设置Menu的背景及文字属性)
    Android进阶篇Gson解析Json数据
    Android进阶篇PopupWindow的使用
    Android数据篇SAX解析XML
    Android进价篇重力感应
    Android进阶篇ListView和Button共存
  • 原文地址:https://www.cnblogs.com/xaun/p/11460178.html
Copyright © 2020-2023  润新知