腾讯云服务器安全可靠高性能,多种配置供您选择
免费注册 | 会员中心
您当前位置:模板超市 > 建站教程 > 模板使用教程 >

phpcms v9模板制作常用get标签分享

时间:2012-10-29 13:24 来源:模板超市 点击:

1、全站多模型联合调用最新文章
  1. {pc:get

  2. sql="SELECT id,url,title,status,inputtime from v9_news WHERE status=99

  3. UNION SELECT id,url,title,status,inputtime from v9_picture WHERE status=99

  4. UNION SELECT id,url,title,status,inputtime from v9_flashgame WHERE status=99

  5. ORDER BY inputtime DESC" num="10"}

  6. {loop $data $r}

  7. <a href="{$r[url]}" title="{$r[title]}" target="_blank">{$r[title]}</a>

  8. {/loop}

  9. {/pc}

 

2、多个栏目调用 

{pc:get sql="SELECT `n`.`inputtime`,`n`.`url`,`n`.`title`,`c`.`catname`,`c`.`url` as `c_url` FROM `v9_news` as `n` left join `v9_category` as `c` on `n`.`catid` = `c`.`catid` where `c`.`catid` in (18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40) order by `n`.`id` desc" num="10"  return="data"}
{loop $data $key $val}{date('Y-m-d H:i:s',$val[inputtime])}[{$val[catname]}] {$val[title]}

{/loop}
{/pc}


3、热门搜索  (模板超市 www.bbscms.net)

{pc:get sql="select keyword from v9_search_keyword"  orderby="searchnums desc" num="5" cache="3600"}
   {loop $data $r}
<a href="{APP_PATH}index.php?m=search&c=index&a=init&typeid=1&siteid=1&q={$r[keyword]}" target="_blank">{$r[keyword]}</a>


         {/loop}
   {/pc}




4、热门关键词调用
 

{pc:get sql="select keyword from v9_search_keyword"  orderby="searchnums desc" num="5" cache="3600"}
   {loop $data $r}
<a href="{APP_PATH}index.php?m=search&c=index&a=init&typeid=1&siteid=1&q={$r[keyword]}" target="_blank">{$r[keyword]}</a>

         {/loop}

   {/pc}


5、get 分页肯定能用的

  1. {get sql="SELECT contentid,catid,title,style,thumb,keywords,description,userid,updatetime,islink,inputtime,url FROM `content` WHERE status=99 AND `catid` = $catid ORDER BY contentid DESC" rows="8" page="$page"catid="$catid"}
  2. <li><a href="{$r[url]}"><img src="{$r[thumb]}" width="125" height="200" border="0" alt="{$r[title]}" /></a><br /><a href="{$r[url]}" title="{$r[title]}" target="_blank">{str_cut($r[title], 27,'')}</a></li>
  3. {/get}
  4. {$pages}


6、在首页某模型所有栏目最新文章调用带栏目名称

  1. {pc:get sql="select * from v9_convert_news where status=99 order by id desc" num="11"}
  2. {loop $data $v}
  3. <li style="text-align:center;"><a href="{$CATEGORYS[$v[catid]][url]}" style="font-size:12px; color:#F30">{str_cut($CATEGORYS[$v[catid]][catname],45,'...')}</a></li>
  4. <li style="width:280px;">
  5. | <a href="{$v['url']}" title="{$r[title]}" target="_blank">{str_cut($v[title],90)}</a></li>
  6. {/loop}
  7. {/pc}



友荐云推荐

赞助商链接


模板超市提供PHPCMS模板织梦模板网店模板论坛模板博客模板模板定制服务。 SITEMAP 若侵犯了您的版权请联系客服。