生成静态页??? 急 急
请问有将新闻系统的列表和详细转化为静态页的方法,,,,,,,,,,,急 问题点数:20、回复次数:5Top
1 楼loye(一天的时间)回复于 2006-11-04 13:58:29 得分 0
写个生成静态页面的程序好了,网上这种例子也多的是Top
2 楼apple__()回复于 2006-11-04 15:14:37 得分 0
关注Top
3 楼luxu001207(笨笨)回复于 2006-11-04 15:18:38 得分 0
网上这类代码N多.......Top
4 楼wsyzh()回复于 2006-11-04 15:25:49 得分 0
具体点.找了.没有详细的Top
5 楼hanpoyangtitan(韩波洋)回复于 2006-11-04 15:33:16 得分 0
字符串替换啊,
<!--#include virtual="common/tools/class/template.inc"-->
<%
dim str
template=new TemplateCase
template.openFile("/template/newsList.html") '加载静态模板
str=""
set rs=server.createobject("adodb.recordset")
rs.open "'pageList',"&pagesize&","¤tpage&","'id','status=1 and category="&category&" order by postdate desc'",conn,1,1 '利用存储过程分页
while not rs.eof
'简化了HTML代码
str=str&"<li><div style=""width:100px;float:left;""><a href="""&rs("htmlurl")&""" target="_self">&rs("title")&"</a></div><div style=""width:50px;float:left"">"&rs("postdate")&"</div></li>"&vbcrlf
rs.movenext
wend
rs.close
set rs=conn.execute("select count(id) from t_news where status=1 and category="&category&" order by postdate desc")
dim count '纪录总数
if not rs.eof then
count=rs(0)
end if
str=str&getPageLink(currentPage,url,count)&vbcrlf '统计数据,和分页链接
rs.close
set rs=nothing
template.value=str
template.replaceTemplate("\$news_list\$")
template.saveTemplateAsFile("/news/html/news_list_"¤tpage&".html")
%>Top




