文章内容页面加入缩略图_动易Cms教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

做了个案例展示频道。因为要用到缩略图,便做了个小文件。现在提供需要的朋友。

将文件放在文章频道目录下即可。

下载附件

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>
%>

该文章转自[雨哲在线]:http://www.yz81.com/Blog/ShowArticle.asp?ArticleID=1880

查看更多 动易Cms教程  动易Cms模板

来源:模板无忧//所属分类:动易Cms教程/更新时间:2007-10-11
相关动易Cms教程