<%
'set rs_1 = server.CreateObject ("adodb.recordset")
set rs_2 = server.CreateObject ("adodb.recordset")
sql_2 = "select * from board order by boardid desc"
rs_2.Open sql_2,conn,1,1
do while not rs_2.Eof
n=1
set rs_1 = server.CreateObject ("adodb.recordset")
Set fso= Server.CreateObject("Scripting.FileSystemObject")
set fd=fso.createtextfile(server.MapPath("..\js\board"&rs_2("boardid")&".js"),true)
str="document.write('"
sql_1 = "select top "&rs("boardnum")&" id,boardid,title,ifimg,fpath,fname,ifshow,addtime from article where boardid="&rs_2("boardid")&" and ifshow=1 order by id desc"
rs_1.Open sql_1,conn,1,1
if rs_1.eof then
str=str & "')"
response.write "<tr bgcolor=#eeeeee><td align=right width='30%' >"&rs_2("boardname")&"</td><td><font color=red>暂时还没有文章!</font></td></tr>"
else
do while not rs_1.EOF
temptime =month(rs_1("addtime")) & "月" & day(rs_1("addtime")) & "日"
call titlen(boardlen)
if rs("boardtime")=1 then
str = str & ""&rs("boardsign")&"<a href=./"& rs_1("fpath")& "/"& rs_1("fname")& " target=_blank title="&rs_1("title")&">"& tlen& "</a><font color=666666>("& temptime & ")</font><br>"
else
str = str & ""&rs("boardsign")&"<a href=./"& rs_1("fpath")& "/"& rs_1("fname")& " target=_blank title="&rs_1("title")&">"& tlen& "</a><br>"
end if
rs_1.movenext
n=n+1
loop
str=str & "')"
response.write "<tr bgcolor=#eeeeee><td align=right width='30%'>"&rs_2("boardname")&"</td><td><font color=blue>完成更新</font></td></tr>"
end if
rs_1.close
set rs_1=nothing
fd.write str
fd.close
rs_2.MoveNext
Loop
rs_2.Close
set rs1=nothing
set rs2=nothing
%>
这一段输出到js,然后主页调用。
想加个如果("ifimg")=1(就是说这条新闻里如果有图片)
那么标题末尾显示一张图片,提示这条新闻内容中有图片。<img src=../image/tu.gif>
就是这个样子。 |