📄 classphoto.asp
字号:
PhotoID = EL_Common.ELRequest("PhotoID", 2)
Call EL_Common.InitCommand(PhotoCmd, "EL_SP_GetPhotoInfo")
With PhotoCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@PhotoID", 3, 1, 4, PhotoID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
Set rsPhoto = .Execute()
End With
rsPhoto.Close()
If PhotoCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.InfoError", "指定{$ItemName}不存在"), "{$ItemName}", EL_Channel.ItemName))
Set rsPhoto = Nothing
Set PhotoCmd = Nothing
Exit Sub
End If
rsPhoto.Open()
ClassID = rsPhoto("ClassID")
PhotoName = rsPhoto("PhotoName")
Keywords = rsPhoto("Keywords")
Author = rsPhoto("Author")
Copyfrom = rsPhoto("Copyfrom")
Content = rsPhoto("Content")
Uploadfiles = rsPhoto("Uploadfiles")
Hits = rsPhoto("Hits")
UpdateTime = rsPhoto("UpdateTime")
Inputer = rsPhoto("Inputer")
Editor = rsPhoto("Editor")
SkinID = rsPhoto("SkinID")
TemplateID = rsPhoto("TemplateID")
HTML = EL_Common.Template(ChannelID, 3, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(PhotoName, SiteTitle, EL_Common.TitleDivide))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, ClassID, SkinID))
StrPath = EL_Common.Lang("BaseConfig.Path", " >> ")
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/Index.asp'>"& EL_Channel.ChannelName &"</a>"& EL_Common.GetParentPath(ChannelID, EL_Channel.ChannelDir, ClassID) & StrPath & EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.Content", "{$ItemName}内容"), "{$ItemName}", EL_Channel.ItemName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
'自定义字段标签
Dim FieldCmd, rsField, FieldCount
Call EL_Common.InitCommonCmd(FieldCmd, rsField, "EL_Field", "FieldName", "ChannelID="& ChannelID)
rsField.Close()
FieldCount = FieldCmd(0)
If FieldCount = 0 Then
Set rsField = Nothing
Set FieldCmd = Nothing
Else
rsField.Open()
For i = 1 To FieldCount
HTML = EL_Common.RegExpStaticLabel(HTML, "{$"& rsField(0) &"}", rsPhoto(rsField(0).value))
If i<FieldCount Then rsField.MoveNext
Next
rsField.Close()
Set rsField = Nothing
Set FieldCmd = Nothing
End If
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PhotoID}", PhotoID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PhotoName}", PhotoName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Author}", Author)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Copyfrom}", Copyfrom)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$UpdateTime}", FormatDateTime(UpdateTime, 2))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Inputer}", Inputer)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Editor}", Editor)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Hits}", Hits)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$KeywordList}", EL_Common.KeywordList(Keywords, EL_Channel.ChannelDir))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Content}", Content)
Dim arr, Pics
arr = Split(Uploadfiles, "|")
Pics = ""
For i = 0 To Ubound(arr)
Pics = EL_Common.Join2String(Pics, InstallDir & EL_Channel.ChannelDir &"/"& EL_Channel.UploadDir &"/"& arr(i), "|")
Next
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Pics}", Pics)
HTML = Label_PhotoURL(HTML, InstallDir & EL_Channel.ChannelDir &"/"& EL_Channel.UploadDir &"/"& arr(0))
HTML = Label_PicItemList(HTML, arr)
Dim NearPhoto, NoNearInfo
NoNearInfo = EL_Common.Lang("BaseConfig.NoNearInfo", "没有了")
NearPhoto = EL_Common.ShowNearInfo("EL_Photo", "PhotoID", "PhotoName", "ChannelID="& ChannelID &" And Passed="& EL_True &" And Deleted="& EL_False &" And ClassID="& ClassID, "UpdateTime", PhotoID)
NearPhoto = Split(NearPhoto, VBCRLF)
Dim PrevInfo, NextInfo
PrevInfo = EL_Common.RegExpStaticLabel(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.PrevInfo", "上一{$ItemUnit}{$ItemName}:"), "{$ItemUnit}", EL_Channel.ItemUnit), "{$ItemName}", EL_Channel.ItemName)
NextInfo = EL_Common.RegExpStaticLabel(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.PrevInfo", "下一{$ItemUnit}{$ItemName}:"), "{$ItemUnit}", EL_Channel.ItemUnit), "{$ItemName}", EL_Channel.ItemName)
If NearPhoto(0) = "" OR ISNULL(NearPhoto(0)) Then
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PrevPhoto}", PrevInfo & NoNearInfo)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PrevPhotoURL}", "")
Else
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PrevPhoto}", PrevInfo &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/ShowPhoto.asp?PhotoID="& NearPhoto(0) &"'>"& EL_Common.HTMLEncode(NearPhoto(1)) &"</a>")
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PrevPhotoURL}", InstallDir & EL_Channel.ChannelDir &"/ShowPhoto.asp?PhotoID="& NearPhoto(0))
End If
If NearPhoto(2) = "" OR ISNULL(NearPhoto(2)) Then
HTML = EL_Common.RegExpStaticLabel(HTML, "{$NextPhoto}", NextInfo & NoNearInfo)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$NextPhotoURL}", "")
Else
HTML = EL_Common.RegExpStaticLabel(HTML, "{$NextPhoto}", NextInfo & "<a href='"& InstallDir & EL_Channel.ChannelDir &"/ShowPhoto.asp?PhotoID="& NearPhoto(2) &"'>"& EL_Common.HTMLEncode(NearPhoto(3)) &"</a>")
HTML = EL_Common.RegExpStaticLabel(HTML, "{$NextPhotoURL}", InstallDir & EL_Channel.ChannelDir &"/ShowPhoto.asp?PhotoID="& NearPhoto(2))
End If
Dim PhotoAction
PhotoAction = EL_Common.Lang("Photo.PhotoAction", "")
If PhotoAction<>"" Then
PhotoAction = EL_Common.ReplaceText(PhotoAction, "\{\$SendCommentURL\}", InstallDir & EL_Channel.ChannelDir &"/Comment.asp?InfoID="& PhotoID &"#Add")
PhotoAction = EL_Common.ReplaceText(PhotoAction, "\{\$ShowCommentURL\}", InstallDir & EL_Channel.ChannelDir &"/Comment.asp?InfoID="& PhotoID)
PhotoAction = EL_Common.ReplaceText(PhotoAction, "\{\$AddFavoriteURL\}", InstallDir & "User/User_Favorite.asp?ChannelID="& ChannelID &"&InfoID="& PhotoID &"&Action=Add")
PhotoAction = EL_Common.ReplaceText(PhotoAction, "\{\$SendToFriendURL\}", InstallDir & EL_Channel.ChannelDir &"/SendToFriend.asp?InfoID="& PhotoID )
End If
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PhotoAction}", PhotoAction)
HTML = Label_CorrelationPhoto(HTML, PhotoID)
HTML = Label_ShowComment(HTML, PhotoID)
HTML = Label_GetPhotoList(HTML)
rsPhoto.Close()
Set rsPhoto = Nothing
Set PhotoCmd = Nothing
Call EL_Common.UpdateHits(ChannelID, PhotoID)
Response.Write HTML
End Sub
Private Function Label_PicItemList(ByVal HTML, ByVal ArrPhoto)
Dim Match, Matches, ReturnString, Parameters, Temp
CommonRegExp.Pattern = "<!--\{\$PicItemList\(([ 0-9]+),([ 0-9]+),([ 0-9]+)\)\}-->"
Set Matches = CommonRegExp.Execute(HTML)
ReturnString = HTML
Temp = ""
For Each Match in Matches
Parameters = EL_Common.GetLabelParameters(Match.Value, "PicItemList")
Temp = PicItemList(Parameters(0), Parameters(1), Parameters(2), ArrPhoto)
ReturnString = Replace(ReturnString, Match.Value, Temp)
Next
CommonRegExp.Pattern = "\{\$PicItemList\(([ 0-9]+),([ 0-9]+),([ 0-9]+)\)\}"
Set Matches = CommonRegExp.Execute(ReturnString)
For Each Match in Matches
Parameters = EL_Common.GetLabelParameters(Match.Value, "PicItemList")
Temp = PicItemList(Parameters(0), Parameters(1), Parameters(2), ArrPhoto)
ReturnString = Replace(ReturnString, Match.Value, Temp)
Next
Set Matches = Nothing
Label_PicItemList = ReturnString
End Function
Private Function PicItemList(ByVal ColNum, ByVal PhotoWidth, ByVal PhotoHeight, ByVal ArrPhoto)
Dim i, ReturnString, l
l = UBound(ArrPhoto)
ReturnString = "<table border='0' cellspacing='0' cellpadding='0' class='piclist'><tr>"
For i = 0 To l
ReturnString = ReturnString &"<td class='piclisttd'><a href=""javascript:ShowPic('"& InstallDir & EL_Channel.ChannelDir &"/"& EL_Channel.UploadDir &"/"& ArrPhoto(i) &"')"">"
ReturnString = ReturnString &"<img class='piclisti' src='"& InstallDir & EL_Channel.ChannelDir &"/"& EL_Channel.UploadDir &"/"& ArrPhoto(i) &"' width='"& PhotoWidth &"' height='"& PhotoHeight &"' border='0'>"
ReturnString = ReturnString &"</a>"
If ((i+1) Mod ColNum) = 0 And i<l Then
ReturnString = ReturnString &"</tr><tr>"
End If
Next
ReturnString = ReturnString &"</tr></table>"
PicItemList = ReturnString
End Function
Private Function Label_PhotoURL(ByVal HTML, ByVal URL)
Dim Match, Matches, ReturnString, Parameters
CommonRegExp.Pattern = "<!--\{\$PhotoURL\(([ 0-9]+),([ 0-9]+)\)\}-->"
Set Matches = CommonRegExp.Execute(HTML)
ReturnString = HTML
For Each Match in Matches
Parameters = EL_Common.GetLabelParameters(Match.Value, "PhotoURL")
If Parameters(0) <> "" And Parameters(1) <> "" Then
ReturnString = Replace(ReturnString, Match.Value, "<a href='"& URL &"' target='_blank'><img id=""imgview"" src="""& URL &""" width='"& Parameters(0) &"' height='"& Parameters(1) &"' border=""0""></a>")
End If
Next
CommonRegExp.Pattern = "\{\$PhotoURL\(([ 0-9]+),([ 0-9]+)\)\}"
Set Matches = CommonRegExp.Execute(ReturnString)
For Each Match in Matches
Parameters = EL_Common.GetLabelParameters(Match.Value, "PhotoURL")
If Parameters(0) <> "" And Parameters(1) <> "" Then
ReturnString = Replace(ReturnString, Match.Value, "<a href='#imgview'><img id=""imgview"" src="""& URL &""" width='"& Parameters(0) &"' height='"& Parameters(1) &"' border=""0"" onclick=""window.open(this.src)""></a>")
End If
Next
Set Matches = Nothing
Label_PhotoURL = ReturnString
End Function
Public Sub ShowClass()
Dim ClassCmd, rsClass, ClassType, ItemCount
Dim PageTitle, ClassName, ArrChildID, SkinID, TemplateID, StrPath
ClassID = EL_Common.ELRequest("ClassID", 2)
Call EL_Common.InitCommand(ClassCmd, "EL_SP_GetClassInfo")
With ClassCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@ClassID", 3, 1, 4, ClassID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
.Parameters.Append .CreateParameter("@ClassName", 200, 2, 50)
.Parameters.Append .CreateParameter("@SkinID", 3, 2, 4)
.Parameters.Append .CreateParameter("@TemplateID", 3, 2, 4)
.Parameters.Append .CreateParameter("@ClassType", 3, 2, 4)
.Parameters.Append .CreateParameter("@ItemCount", 3, 2, 4)
.Execute()
End With
Select Case ClassCmd(0)
Case 40: EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ChannelError", "频道参数错误")) : Set ClassCmd = Nothing : Exit Sub
Case 0, 41: EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.ClassError", "指定{$ClassItemName}不存在"), "{$ClassItemName}", EL_Channel.ClassItemName)) : Set ClassCmd = Nothing : Exit Sub
End Select
If ClassCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.ClassError", "指定{$ClassItemName}不存在"), "{$ClassItemName}", EL_Channel.ClassItemName))
Set ClassCmd = Nothing
Exit Sub
End If
ClassName = ClassCmd(3)
SkinID = ClassCmd(4)
TemplateID = ClassCmd(5)
ClassType = ClassCmd(6)
ItemCount = ClassCmd(7)
Set ClassCmd = Nothing
Dim ArrTemplate
HTML = EL_Common.Template(ChannelID, 2, TemplateID)
ArrTemplate = EL_Common.ELSplit(HTML, "{$$$Template$$$}")
If ClassType = 1 Then
HTML = ArrTemplate(1) '小类模板
Else '大类模板
If ShowClassType = 1 Then
HTML = ArrTemplate(1)
Else
HTML = ArrTemplate(0)
End If
End If
HTML = EL_Common.ReplaceCommonLabels(HTML)
PageTitle = EL_Common.Join2String(ClassName, EL_Channel.ChannelName,EL_Common.TitleDivide)
PageTitle = EL_Common.Join2String(PageTitle, SiteTitle, EL_Common.TitleDivide)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", PageTitle)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, ClassID, SkinID))
StrPath = EL_Common.Lang("BaseConfig.Path", " >>")
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/Index.asp'>"& EL_Channel.ChannelName &"</a>"& EL_Common.GetParentPath(ChannelID, EL_Channel.ChannelDir, ClassID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -