sql函数实现的,其实很简单,但很多新手对sql并不了解,包括本人,也不是很了解,不过会者不难难者不会,我就说下我的网站的sql列表是如何实现的吧。
===================
查询语句
===================
select ID,Title,Author,Origin,Adddate,Intro from KS_Article where tid in({$CurrClassChildID}) and deltf=0 and verific=1 order by id desc
===================
循环体
===================
[loop=10]
< ul class="list_wk">
< li class="list_title">< h4>< a href="{$Field(ID,GetInfoUrl,1,1)}" title="{$Field(Title,Text,0,...,0,)}">{$Field(Title,Text,60,,0,)}< /a>< /h4>< /li>
< li class="list_info">{$Field(Intro,Text,200,...,0,)}< span>< a href="{$Field(ID,GetInfoUrl,1,1)}">[详细内容]< /a>< /span>< /li>
< li class="list_date">作者:< span>{$Field(Author,Text,0,...,0,)}< /span> 来源:< span>{$Field(Origin,Text,0,...,0,)}< /span> & nbsp; & nbsp; 添加日期:< span>{$Field(Adddate,Date,[YYYY-MM-DD])}< /span>< /li>
< /ul>
[/loop]
注意,中间的<后面我加了空格,请自行去掉!
===================
样式
===================
.list_wk { margin-bottom:20px;}
.list_title{ height:26px;}
.list_title a:link,.list_title a:visited,.list_title a:active{color:#1F597E; font-size:16px; font-weight:bold;}
.list_title a:hover{color:#f60; font-size:16px; font-weight:bold;}
.list_info { text-indent:2em; line-height:22px; color:#454; height:44px;}
.list_info span { display:block; float:right; margin-top:-18px;}
.list_date { height:24px; padding:0 0 0 24px; color:#455; border-bottom:1px dashed #666;}
.list_date span { color:#355;}
===================
另外附赠一个css样式吧,用于文章内容页面的样式,大家看看我写的,琢磨一下你自己该怎么写
===================
/* 布局 - 文章阅读页面 */
#article_title,#article_title h2{ font-size:18px; text-align:center; color:#f50; font-weight:bold; height:30px;}
#article_date{ height:24px; line-height:24px;text-align:center; border-top:1px dashed #99BBDD; color:#000;}
#article_info{ text-indent:2em; line-height:20px; padding:5px; border:1px dashed #99BBDD; background:#F5FAFF; color:#000}
#article_nr { font-size:14px; line-height:200%; color:#566;text-indent:2em; width:655px; overflow:hidden;}
#article_nr p { padding:5px 0;}
#article_nr img {width: expression(this.width > 600 ? 600: true); max-width: 600px; padding:4px; border:1px solid #4594A5;}
#article_nr a:link,#article_nr a:visited,#article_nr a:active{color:#f60; font-size:14px;}
#article_nr a:hover{color:#50AC23;font-size:14px;}
#article_nr h1,#article_nr h2,#article_nr h3,#article_nr h4,#article_nr h5 { color:red; padding:5px 0;}
#article_google { float:left; width:340px; height:260px;}
#article_foot { text-align:center;}
#article_next{ line-height:24px;color:#000;}
#article_link{border:1px solid #225D98; padding:1px;}
#article_link_title{ background:#8AB8E6; height:24px; font-size:14px; color:#000; line-height:24px; padding:0 0 0 15px; font-weight:bold;}
#article_link_list{overflow:hidden !important; padding:5px; color:#f60; width:640px;}
#article_link_list li{ float:left; width:210px; height:20px; line-height:20px;}
#article_link_list li span { float:right; margin:-20px 10px 0 0;}