首页调用栏目
复制代码 代码示例:
{pc:content action="category" siteid="$siteid" num="15" order="listorder"}
{loop $data $r}
<li><a title="" href="{$r}">{$r[catname]}</a></li>
{/loop}
{/pc}
调用二级栏目
复制代码 代码示例:
{pc:content action="category" catid="7" num="20" order="listorder"}
{loop $data $r}
<a href="{$r[url]}" target="_blank" title="{$r[title]}">{$r[catname]}</a>
{/loop}
{/pc}
判断当前栏目是否存在子栏目
复制代码 代码示例:
{if $v[child]==1}
XXX
{else}
XXX
{/if}
调用文章列表
复制代码 代码示例:
{pc:content action="lists" catid="25" num="8" order="id desc"}
{loop $data $r}
<li><a href="{$r[url]}" target="_blank" title="{$r[title]}">{$r[title]}</a></li>
{/loop}
{/pc}
带缩略图:
复制代码 代码示例:
{pc:content action="lists" catid="20" order="id desc" num="6"}
{loop $data $r}
<div class="tuphp">
<h4><a href="{$r[url]}" target="_blank" title="{$r[title]}">
<img src="{thumb($r['thumb'],111,139)}" alt="{$r[title]}" width="" height="" border="0"></a></h4>
<p><a href="{$r[url]}" target="_blank" title="{$r[title]}">{$r[title]}</a></p>
</div>
{/loop}
{/pc}
调用推荐位
复制代码 代码示例:
{pc:content action="position" posid="2" order="listorder" num="1"}
{loop $data $r}
<div class="abti"><a href="{$r[url]}" target="_blank" title="{$r[title]}">{$r[title]}</a></div>
<div class="aboutcon"> <img src="statics/dimages/2010111758232601.jpg">{str_cut($r[description],106)}
<div style="clear:both;"></div>
</div>
<div class="abobtn"><a href="{$r[url]}" target="_blank" title=""><img src="statics/dimages/abobtn.jpg"></a></div>
{/loop}
{/pc}
sql方法调用
复制代码 代码示例:
{pc:get sql="SELECT * FROM v9_news WHERE catid <= 50 and catid >= 1 order by id DESC" return="data" num="6" start="0" }
{loop $data $r}
<li><a href="{$r[url]}" target="_blank" class="lef" title="{$r[title]}">{str_cut($r[title],35,'')}</a><span>[{date('Y-m-d',$r[inputtime])}]</span></li>
{/loop}
{/pc}
调用相关文章
复制代码 代码示例:
{pc:content action="relation" relation="$relation" catid="2" num="5" keywords="$rs[keywords]"}
{loop $data $r}
{$r[title]}
{/loop}
{/pc}
内容页相关文章的点击量
复制代码 代码示例:
{pc:content action="lists" catid="$catid" num="10" order="id DESC" page="$page"}
{loop $data $r}
<p>
<li><a href="{$r[url]}" target="_blank"><img src="/NanJing454/statics/nimages/next1.png" /> {str_cut($r[title], 57)}</a>{php $h_md=pc_base::load_model('hits_model');$get_db=$h_md->get_one(array('hitsid'=>"c-".$modelid."-".$r[id]));$views=$get_db[views];}
点击量:{$views} </li>
</p>
{/loop}
{/pc}
全站最新文章
复制代码 代码示例:
{pc:content action="newcontent" order="8" num="7"}
{loop $data $r}
<li>[{$CATEGORYS[$r[catid]][catname]}]<a href="{$r['url']}">{str_cut($r['title'],28)}</a></li>
{/loop}
{/pc}
合作机构:
复制代码 代码示例:
{pc:link action="type_list" linktype="1" siteid="$siteid" typeid="53" num="16" order="listorder DESC"}
{loop $data $r}
<img src="{$r['logo']}" border="0" />
{/loop}
{/pc}
友情链接:
复制代码 代码示例:
{pc:link action="type_list" siteid="$siteid" typeid="53" order="listorder DESC" num="60" return="dat"}
{loop $dat $v}
<a href="{$v[url]}" target="_blank" title="{$v[name]}">{$v[name]}</a>
{/loop}
{/pc}
{date('Y-m-d',$r[inputtime])}
{str_cut($r[title],30,'')}
列表页调父栏目子栏目
复制代码 代码示例:
{php $arrchildid = $CATEGORYS[$CAT[parentid]][catid]}
{pc … catid="$arrchildid"}
内页时间:
复制代码 代码示例:
{date('Y-m-d',strtotime($inputtime))}