<% '获得图片 '判断文件存在 set fs=createobject("scripting.filesystemobject") set rs=server.createobject("adodb.recordset") strPath = Server.MapPath(".") picpath="nrpic" filepath=strpath &"\"& picpath &"\" 'response.write filepath function getpic(pp) if pp<>"" or pp<>null then getpic=filepath & pp if not fs.fileexists (getpic) then picstr="图片不存在,请检查图像文件" getpic= "" else getpic=pp picstr="图片" end if else picstr="无图片" getpic="" end if end function dim fname() '分解图片 Sub vodname(fstr) f1 = InStr(1, fstr, ",") if f1=0 then picnum=1 redim fname(picnum) fname(0)=fstr exit sub end if Do While f1 <> 0 picnum = picnum + 1 ReDim Preserve fname(picnum) fname(picnum - 1) = Left(fstr, f1 - 1) fstr = Right(fstr, Len(fstr) - f1) f1 = InStr(1, fstr, ",") If f1 = 0 Then picnum = picnum + 1 ReDim Preserve fname(picnum) fname(picnum - 1) = fstr Exit Do End If Loop End Sub strpicbt="" sql="select id,logotxt,nrpic from dzzhishi where logo=1" rs.open sql,conn,0,2 if rs.eof and rs.bof then '无图片新闻 ' else picid=rs("id") picbt=rs("logotxt") strpicbt="" nrpic=rs("nrpic") call vodname(nrpic) picfile=getpic(fname(0)) picfile="nrpic/"&picfile strimage=strpicbt+"" strpicbt=strpicbt+picbt & "" end if rs.close %>
<%call wdim2()%>
<% 'set rs=server.createobject("adodb.recordset") sql="select * from dzleibie where leibie=4 and jibie=1" rs.open sql,conn,0,2 if not rs.eof or rs.bof then i=0 do while not rs.eof i=i+1 name=rs("lbname") js=rs("jieshao") strname=""& name &"" %> <% rs.movenext loop end if rs.close %>
<%=strname%>     <%=js%>
<% set rszs=server.createobject("adodb.recordset") sqlzs="select top 4 name,id,yd,shijian,nrpic from dzzhishi where lbname like '%"& name &"%' order by shijian desc" rszs.open sqlzs,conn,0,2 strzs=" " datenow=now if not rszs.eof or rszs.bof then do while not rszs.eof zsname=rszs("name") id=rszs("id") zssj=rszs("shijian") zssj=FormatDateTime(zssj,2) havepic=rszs("nrpic") dayinterval=datediff("d",zssj,datenow) if dayinterval>5 then newstr="" else newstr="new" end if pstr="" zssj="" if ( havepic<>null or havepic<>"") then pstr="" strzs=" "& zsname &" "& pstr &zssj&" "& newstr &"" %> <% rszs.movenext loop else %> <% end if rszs.close %>
·<%=strzs%>
<%=strzs%>


<%=strimage%>
<%=strpicbt%>
 
<% sql="select top 10 id,yd,name from dzzhishi order by yd desc" rs.open sql,conn,0,2 if rs.eof and rs.bof then else inum=0 do while not rs.eof inum=inum+1 id=rs("id") yd=rs("yd") name=rs("name") strzs=" "& name &" ("&yd&")" %> <% rs.movenext loop end if rs.close %>
阅读排行榜
<%=inum%> <%=strzs%>
<% rs.close sql="select top 12 id,dzztname,dzzjyear from dzzj order by shijian desc" rs.open sql,conn,0,2 if rs.eof and rs.bof then else do while not rs.eof id=rs("id") zjname=rs("dzztname") zjyear=rs("dzzjyear") strzj="-- "& zjname &"" if zjyear<>year0 then %> <%end if%> <% year0=zjyear rs.movenext loop end if rs.close %>
<%=zjyear%>年
<%=strzj%>
 
 

 
<% set rszs=nothing set rs=nothing conn.close set conn=nothing %>