If LCase(Left(ComeUrl, InStrRev(ComeUrl, "/"))) <> LCase(Left(cUrl, InStrRev(cUrl, "/"))) Then Response.redirect "/404.html" '自定义错误提示 Response.End End If End If Dim ArticleID,DefaultPicUrl,sql,rs,UploadDir,UploadFiles ArticleID = Trim(request("ArticleID")) %> <!--#include file="../conn.asp"--> <!--#include file="Channel_Config.asp"--> <% Set rs = Conn.Execute("select UploadDir from PE_Channel where ChannelID=" & ChannelID & "") If rs.BOF And rs.EOF Then Response.Write "找不到数据!请检查配置!" Response.End Else UploadDir = rs("UploadDir") End If Set rs = Nothing sql = "select DefaultPicUrl,UploadFiles from PE_Article where ArticleID=" & ArticleID Set rs = conn.execute(sql) If rs.bof And rs.EOF Then Response.Write "document.write('<img class=pic5 src=../images/nopic.gif title=暂无图片>');" Else Do While Not rs.EOF DefaultPicUrl = rs(0) UploadFiles = rs(1)
If InStr(UploadFiles, replace(DefaultPicUrl,"_S.",".")) <= 0 Then Response.Write "document.write('<IMG class=pic5 src=" & UploadDir & "/" & DefaultPicUrl & " Else Response.Write "document.write('<A href=" & UploadDir & "/" & replace(DefaultPicUrl,"_S.",".") & " target=_blank><IMG class=pic5 src=" & UploadDir & "/" & DefaultPicUrl & " title=点击在新窗口中查看图片></A>');" End if rs.movenext Loop End If rs.Close Set rs = Nothing Call CloseConn ' 文件作用:文章内容页面调用缩略图,并自动检测是否存在缩略图原图,假如存在则加入链接到原图在新窗口中打开。 ' 调用方法:<script src="Yz_Get_DefaultPicUrl.asp?ArticleID={$ArticleID}"></script> %>
|