针对有网友说看不见文章内容, 现提示如下: 点击每一个标题行任一地方都会展开和隐藏此文章内容(不要点击标题). 目前展开隐藏功能只支持IE浏览器,虽然可以改成支持FF浏览器,不过现在一直没时间去弄,等有时间再修改了。 |
blog名称:乱闪Blog 日志总数:267 评论数量:1618 留言数量:-26 访问次数:2672279 建立时间:2005年1月1日 |
|

| |
ASP应用模板生成html文件的一种方法
|
这里惊云下载系统里的html文件生成方法,看了一下满有用的,所以发上来<%set rs=server.createobject("adodb.recordset")rs.open ("select info_list from mb"),conn,1,1pencat=rs("info_list")rs.close
tid=request("tid")currentPage=cint(request("page"))MaxPerPage=cint(request("MaxPerPage")) '################ 读取标题 等.. 开始 ################ rs.open "select * from infotype where id="&tid,conn,1,1 if not rs.eof then ts=rs("ts") TN=split(rs("tname"),"|") TI=split(rs("ts"), ",") for i = 0 to ubound(TN)-1 if i=ubound(TN)-2 and ubound(TN)>1 then TTY_id=TI(i) TTY_name=TN(i) end if all_type_top_id=TI(i) all_type_name=TN(i) thistype=thistype & "-> <a href=""../info/"&TI(i)&"_1.htm"">"&TN(i)&"</a>" thistitle=thistitle & " - "&TN(i)&"" next end if rs.close
sql="select * from infotype where ts like '"&ts&"%'"rs.open sql,conn,1,1if not rs.eof thendo while not rs.eof sqqq=sqqq& ""&rs("id")&", "rs.MoveNextloopend ifrs.close
''########读取下级分类rs.open "select * from infotype where tn="&tid&" order by id",conn,1,1if NOT rs.EOF thenTTY="NO"Tname=all_type_namedo while NOT rs.EOFTTNN=split(rs("tname"),"|")(rs("tj")-1) TXlist=TXlist&"<a href=""../info/"&rs("id")&"_1.htm""><font color=""#000000"">"&TTNN&"</font></a><br>"rs.MoveNextloopend ifrs.closeif TTY_id<>"" and TTY<>"NO" thenrs.open "select * from infotype where tn="&TTY_id&" order by id",conn,1,1if NOT rs.EOF thenTname=TTY_namedo while NOT rs.EOFTTNN=split(rs("tname"),"|")(rs("tj")-1) TXlist=TXlist&"<a href=""../info/"&rs("id")&"_1.htm""><font color=""#000000"">"&TTNN&"</font></a><br>"rs.MoveNextloopend ifrs.closeend if''########读取本类top10sql="select * from info where tid in("&sqqq&") order by hits desc"rs.open sql,conn,1,1if rs.eof thenTxtop="·还没有文章"elsedo while not rs.eofh=h+1Txtop=Txtop&"·<a href=""../info/"&rs("id")&".htm"">"&rs("title")&"</a><br>"if h>=10 then exit dors.movenextlooph=0end ifrs.close'读取文章列表 sql="select * from info where tid in("&sqqq&") order by date desc"rs.open sql,conn,1,1if rs.eof then lb=lb&"<tr><td width=""100%"" colspan=""3"">对不起! 暂时没有相关文章 @_@</td></tr>"mpage=1allshu=0elsers.pagesize=MaxPerPage '得到每页数mpage=rs.pagecount '得到总页数rs.move (currentPage-1)*MaxPerPageallshu=rs.recordcounth=0do while not rs.eofh=h+1 lb=lb&"<tr height=""22""><td width=""77%""><img border=""0"" src=""../images/d_2.gif"" width=""11"" height=""11"">[" set rs_type=server.CreateObject("ADODB.RecordSet") rs_type.open "select * from infotype where id="&rs("tid"),conn,1,1 if not rs_type.EOF then TN=split(rs_type("tname"),"|") lb=lb&"<a href="""&rs("tid")&"_1.htm""><font color=""#000000"">"&TN(ubound(TN)-1)&"</font></a></FONT>" end if rs_type.close lb=lb&"] <a href=""../info/"&rs("id")&".htm"">"&rs("title")&"</a></td>" lb=lb&"<td width=""13%"" align=""center"">"&year(rs("date"))&"-"&month(rs("date"))&"-"&day(rs("date"))&"</td>" lb=lb&"<td width=""10%"" align=""center"">"&rs("hits")&"</td></tr>" lb=lb&"<tr><td width=""100%"" height=""1"" bgcolor=""#CCCCCC"" colspan=""3""></td></tr>"if h>=MaxPerPage then exit dors.movenextloopend ifrs.closeset rs=nothingconn.closeset conn=nothing'#########读取页次lb=lb&"<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0""><tr><td width=""15%"" nowrap>页次:<b>"¤tPage&"</b>/<b>"&mpage&"</b> 每页<b>"&MaxPerPage&"</b> 文章数<b>"&allshu&"</b></td><td width=""65%"" nowrap><p align=""center"">"pageno=currentPageif cint(pageno)>1 thenlb=lb&"<a href=../info/"&tid&"_1.htm title=""最前页"">"end iflb=lb&"<font face=""Webdings"">9</font></a> "if cint(pageno)>1 thenlb=lb&"<a href=../info/"&tid&"_"&pageno-1&".htm title=""上一页"">"end iflb=lb&"<font face=""Webdings"">7</font></a>"pp=cint(pageno)-2 if pp<1 then pp=1 end if for pno=pp to mpagep=p+1if pno*1=cint(pageno)*1 thenlb=lb&" <font color=""#FF0000"">["&pno&"]</font>"elselb=lb&" <a href=../info/"&tid&"_"&pno&".htm>["&pno&"]</a>"end if if p>=5 then exit for nextlb=lb&" "if cint(pageno)< mpage thenlb=lb&"<a href=../info/"&tid&"_"&pageno+1&".htm title=""下一页"">"end iflb=lb&"<font face=""Webdings"">8</font></a> "if cint(pageno)< mpage thenlb=lb&"<a href=../info/"&tid&"_"&mpage&".htm title=""最后页"">"end iflb=lb&"<font face=""Webdings"">:</font></a></p></td><td width=""18%"" nowrap><table cellpadding=""0"" cellspacing=""0"">"lb=lb&"<form onsubmit=""window.location=this.KKK2.options[this.KKK2.selectedIndex].value; return false;"">"lb=lb&"<tr><td nowrap>到<select name=""select"" onchange=""javascript :window.location.href=this.options[this.selectedIndex].value"">" for i=1 to mpage selected="" if currentpage=i then selected=" selected" end if lb=lb&"<option value=../info/"&tid&"_"&i&".htm"&selected&">"&i&"</option>" nextlb=lb&"</select>页</td></td></tr></form></table></td></tr></table>" '################ 读取完成 ################ pencat=replace(pencat,"T_TITLE",thistitle)pencat=replace(pencat,"T_NAME",tname)pencat=replace(pencat,"TXlist",txlist)pencat=replace(pencat,"TXtop",Txtop)
pencat=replace(pencat,"T_LB",lb)pencat=replace(pencat,"T_TXT",typetxt)pencat=replace(pencat,"T_TYPE",thistype)Set fso = Server.CreateObject("Scripting.FileSystemObject")Set fout = fso.CreateTextFile(server.mappath("../info/"&tid&"_"¤tPage&".htm"))fout.Write pencatfout.close'************** 生成HTML页 结束 ***************
|
|
回复:ASP应用模板生成html文件的一种方法
|
电脑与网络 3325(游客)发表评论于2005/6/23 11:00:16 |
| |
» 1 »
|