这两个模板是所有模板里最容易的了:list.html,show.html.
list.html关键代码:
- //两种写法
- 1.{php $subcatsubcats = subcat('phpcms','$catid');}//当前栏目子栏目
- {loop $subcats $catid $cat}
- {$cat[catname]}
- {$cat[url]}
- {$cat[title]}
- {/loop}
- 2.{get sql="select * from phpcms_content where catid=$catid and status=99 order by inputtime desc" rows="20" page="$page" catid="$catid"}//这里要注意条数rows要和网站配置里的一样
- {if $r[titleintact]}{$r[titleintact]}{else}{$r[title]}{/if}
- {if $r[copyfrom]}{$r[copyfrom]}{else}{$r[username]}{/if}
- {date('Y-m-d',$r[updatetime])}
- {$r[description]}
- {$pages} //分页
- {/get}
show.html关键代码:
- {$title}
- {$content}
- {$description}
- {date('Y-m-d', $r[inputtime])}
- {$keywords}
- {$titles} //本文导航
- {tag_内容页相关信息}
- {get sql="select * from phpcms_content a, phpcms_content_count c where a.contentid=c.contentid and a.catid=$catid and a.status=99 order by c.hits desc" rows="8"}
- <li><a title="{$r[title]}" href="{$r[url]}" >{str_cut($r[title],28,'')}</a></li>
- {/get}//相关文章
- {get sql="SELECT * FROM `phpcms_content` WHERE contentid<$contentid AND catid=$catid ORDER BY updatetime DESC" rows="1"}
- {php $next=1;} 上一篇:<a href="{$r[url]}" titile="{$r[title]}">{str_cut($r[title],50)}</a>
- {/get}
- {if $next!=1} 上一篇:没有了 {/if}
- {get sql="SELECT * FROM `phpcms_content` WHERE contentid>$contentid AND catid=$catid ORDER BY updatetime DESC" rows="1"}
- {php $front=1;} 下一篇:<a href="{$r[url]}" titile="{$r[title]}">{str_cut($r[title],50)}</a>
- {/get}
- {if $front!=1} 下一篇:没有了 {/if}
基本就上面这些,另外要实现其他功能就要参照系统的了.