文档库 最新最全的文档下载
当前位置:文档库 › phpcmsv9标签调用大使用

phpcmsv9标签调用大使用


右边加new小图标:{if time()-$r[inputtime]<7*24*3600}{/if}
统计:{tjcode()}
碎片:{pc:block pos="scroll"}{/pc}
头部:

{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}



常用系统常量: {CSS_PATH} {JS_PATH} {IMG_PATH} {APP_PATH}//程序目录

模板包含:{template "content","header"} {template "content","sidebar"} {template "content","footer"}

------常用调用数据-------
{pc:content action="lists" catid="6" num="8" order="id DESC" }
{loop $data $r}

  • ({date('Y/m/d H:m:s',$r[inputtime])}){str_cut($r[title],'28')}

  • {/loop}
    {/pc}

    常用标签:{$r[thumb]}

    推荐位调用:
    {pc:content action="position" posid="1" order="listorder DESC" num="5"}
    {loop $data $r}
  • {$r[title]}

  • {/loop}
    {/pc}

    一级栏目调用:
    {pc:content action="category" catid="0" num="8" siteid="$siteid" order="listorder ASC"}
    {loop $data $r}
  • {$r[catname]}

  • {/loop}
    {/pc}

    当前栏目风格:
    {if $catid==$r[catid]} class="current"{/if}

    在文章前显示文章分类名:
    {pc:content action="lists" catid="2" order="listorder DESC" num="14" }

    {loop $data $n $r}
  • {if $TYPE[$r[typeid]][name]}[ {$TYPE[$r[typeid]][name]}] {/if}{str_cut($r[title],33,'')}

  • {/loop}
    {/pc}

    指定变量循环增长:
    {pc:content...
    {php $num = 0}
    {loop $data $r}
    ...
    {php $num++}
    {/loop}
    {/pc}

    文章从指定位置调用:num="3" start="5"} (可配合pc:get标签使用)

    文章列表页调用关键字,或者首页调用关键字:
    {pc:content action="lists" catid="$catid" num="10" order="id DESC" page="$page"}
    {loop $data $r}
    {$r[title]}
    php $keywords = explode(',',$r[keywords]);}
    文章标签:
    {loop $keywords $keyword}
    {$keyword}
    {/loop}
    {/loop}
    {/pc}

    当列表几行的时候出现一次某些符号:{if $n%2==1}|{/if}


    -------------------列表页调用-------------------------
    当前位置显示:
    当前位置:首页 > {catpos($catid)} 列表

    当前栏目名称:{$catname}
    获取父栏目id/获取父栏目名称:{$CATEGORY[$catid][parentid]} / {$CATEGORYS[$CAT[parentid]][catname]}
    指定ID

    栏目名称:{$CATEGORYS[栏目ID号]['catname']} / {$CATEGORYS[$catid]['catname']}
    其他常用调用:{$r[description]} {$r[image]}

    列表内容显示(带分页):



      {pc:content action="lists" catid="$catid" num="20" order="id DESC" page="$page"}
      {loop $data $r}
    • {date('Y-m-d H:i:s',$r[inputtime])}{$r[title]}

    • {/loop}

    {$pages}

    {/pc}


    显示该栏目下的子栏目:
    {if $top_parentid}
    {pc:content action="category" catid="$top_parentid" num="15" siteid="$siteid" order="listorder ASC"}
    {loop $data $r}
  • {$r[catname]}

  • {/loop}
    {/pc}
    {/if}

    频道页:
    {php $j=1;}
    {loop subcat($catid) $v}
    {php if($v['type']!=0) continue;}
    更多»{$v[catname]}



      {pc:content action="lists" catid="$v[catid]" num="5" order="id DESC"}
      {loop $data $r}
    • {date('Y-m-d',$r[inputtime])}{$r[title]}

    • {/loop}
      {/pc}




    {$j++}
    {/loop}



    ---------------------文章内容页-------------------
    显示内容:
    {$title} {$inputtime} {$content} {$copyfrom} {$thumb} 当前所属栏目:{$CAT[catname]} 当前所属栏目URL:{$CAT[url]}


    父栏目名称与链接:{$CATEGORYS[$CAT[parentid]][catname]} 与 {$CATEGORYS[$CAT[parentid]][url]}

    获取上上级栏目名称与链接:{$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][catname]} 与 {$CATEGORYS[$CATEGORYS[$CAT[parentid]][parentid]][url]}


    组图列表:
    {loop $photos $r}
  • {$r[alt]}

  • {/loop}


    浏览次数:



    显示上一页和下一页:


    上一篇:{$previous_page[title]}

    下一篇:{$next_page[title]}




    文章内容分页:
    {$pages}



    加载评论:
    {if $allow_comment && module_exists('comment')}

    {/if}


    -----------PC:get语句调用数据---------------

    用pc:get时的记录条数时分页显示:
    解决办法一:

    {pc:get sql="SELECT title,url FROM v9_news where catid=9 and status=99 order by updatetime desc" start="0"

    num="4" return="v"}

    解决办法二:

    {pc:get sql="SELECT title,url FROM v9_news where catid=9 and status=99 order by updatetime desc limit 0,4--" return="v"}



    在首页某模型所有栏目最新文章调用带栏目名称
    {pc:get sql="select * from v9_convert_news where status=99 order by id desc" num="11"}
    {loop $data $v}

  • {str_cut($CATEGORYS[$v[catid]][catname],45,'...')}


  • | {str_cut($v[title],90)}

  • {/loop}
    {/pc}

    相关文档
    相关文档 最新文档