1. Display the column name and link of the specified catid {$CATEGORYS [25][' CatName '}} {$CATEGORYS [25][' URL ']}
Get parent column ID/get parent column name $CATEGORY [$catid][parentid]} Parent column name: {$CATEGORYS [$CAT [Parentid]][catname]}
Ellipsis that appears after removing the title limit
{Str_cut ($r [title],36, ' ... ')}
Formatted Time 2011-05-06 11:22:33
{Date (' y-m-d h:i:s ', $r [Inputtime])}
{Date (' Y year m D Day ', $r [Inputtime])}
------------------------------------------------------------------------------------------------------
2. Call the Sub-column (in the column homepage template needs to use, the list page can also be used)
{pc:content action= "category" Catid= "$catid" num= "siteid=" $siteid "order=" Listorder ASC "}
{Loop $data $r}
<a href= "{$r [url]}" >{$r [catname]}</a> |
{/loop} {/PC}
------------------------------------------------------------------------------------------------------
3. Get the news under the designated column
(1) The moreinfo= "1" here means that the primary sub-table can be used directly.
{pc:content action= "lists" catid= "$catid" num= "order=" "id DESC" return= "info" moreinfo= "1"}
{Loop $info $r}
Update Date: {date (' Y year m D Day ', $r [UpdateTime])}
{$r [username]}
Source: {$r [CopyFrom]}
CTR {$r [readpoint]}
URL {$r [url]}
Article title {$r [' title ']}
Heading style {Title_style ($v [style])}
{/loop}
{/PC}
<p>=====================</p
(2) SQL Universal statement can be more convenient to invoke the specified content
{pc:get sql= "select * from V9_news as a,v9_news_data as B where a.id=b.id and catid=34 and status=99 order by a.id Desc"}
{Loop $data $v}
<li><a href= "{$v [' url ']}" target= "_blank" ></a ></li>
{/loop}
{/PC}
{pc:get sql= "select * from V9_news where catid=10 and status=99 order by updatetime Desc" num= "5" start= "23"}
{Loop $data $rs}
<a href= "{$rs [' url ']}" title= "{$rs [' title '}" target= "_blank" >{$rs [' title ']}</a>
{/loop}
{/PC}
<p>=====================</p
(3) The article is called from the specified location (position recommended bit use)
The starting position is 5, and 3 is called. Equivalent to the Limit function.
{pc:content action= "position" posid= "order=" Listorder DESC "num=" 3 "start=" 5 "}
{Loop $info $r}
<a href= ' {$r [url]} ' >{str_cut ($r [description],115)} ... </a>
{/loop}
{/PC}
or {pc:content action= "lists" catid= "si" thumb= "" order= "Listorder DESC" start= "3" num= "5"} thumb= "" Not categorized
<p>=====================</p> Cycle List News
<div class= "Content" >
{pc:content action= "position" posid= "9" order= "Listorder DESC" num= "4"}
{Loop $data $r}
<a href= "{$r [url]}" title= "{$r [title]}" >{str_cut ($r [title],36, ')}</a>{date (' y-m-d h:i:s ', $r [ Inputtime])}
<p>{if $n ==1}{/if}{str_cut" ($r [description] ,}<a href= "{$r [url]}" >[reading more]</a></p>
{/loop}
{/PC}
</div>
<p>=====================</p>
(4). have pagination effect
{pc:get sql= "select * from Wecheweyounews where hour= $hour order by id DESC" return= "Data" num= "" Page= "$page"}
<ul >
{Loop $data $r}
<li><span class= "left" >·<a href= "{$r [' url ']}" target= "_blank" >{str_cut ($r [' title '], }</a> (edit: {$r [username]}) </span><span class= "right" >{date ("y-m-d", $r [' Inputtime '])}</ Span></li></li>
<?php
if ($n%5==0 and $n <50) echo "</ul><ul>";
?>
{/loop}
</ul>
</div>
<div id= "pages" class= "text-c" >{$pages}</div>
{/PC}
------------------------------------------------------------------------------------------------------
4. <!--home Focus map It's recommended to switch that thing on the picture.
{pc:content action= "position" posid= "1" order= "Listorder DESC" thumb= "1" num= "5"}
{Loop $data $r}
<a href= "{$r [' url ']}" title= "{str_cut ($r [' title '],30)}" ></a>
{/loop}
{/PC}
5 pagination
Foreground call num= "50" refers to 50 records per page
{pc:get sql= "select * from Wecheweyounews where hour= $hour order by id DESC" return= "Data" num= "" Page= "$page"}
<ul >
{Loop $data $r}
<li><span class= "left" >·<a href= "{$r [' url ']}" target= "_blank" >{str_cut ($r [' title '], }</a> (edit: {$r [username]}) </span><span class= "right" >{date ("y-m-d", $r [' Inputtime '])}</ Span></li></li>
<?php
if ($n%5==0 and $n <50) echo "</ul><ul>";
?>
{/loop}
</ul>
</div>
<div id= "pages" class= "text-c" >{$pages}</div>
{/PC}
Turn from:
Favorite Blog http://blog.sina.com.cn/zhouming133
Phpcms label usage (RPM)