📄 classphoto.asp
字号:
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ClassName}", ClassName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ClassID}", ClassID)
If ClassType = 0 Then
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowChildClass}", GetChildClass())
HTML = Label_CurrentClass(HTML, ClassName, ItemCount)
End If
HTML = Label_ArrClassList(HTML)
HTML = Label_GetPhotoList(HTML)
Response.Write HTML
End Sub
Private Function Label_CorrelationPhoto(ByVal HTML, ByVal InfoID)
Dim Match, Matches, ReturnString, Parameters, Temp
CommonRegExp.Pattern = "<!--\{\$CorrelationPhoto\(([ 0-9]+),([ 0-9]+),([ 0-9]+),([ 0-9]+),([ 0-9]+),([ 0-9]+),([ 0-9]+),[ ]*(True|False)[ ]*\)\}-->"
Set Matches = CommonRegExp.Execute(HTML)
ReturnString = HTML
For Each Match in Matches
Parameters = EL_Common.GetLabelParameters(Match.Value, "CorrelationPhoto")
Temp = CorrelationPhoto(Parameters(0), Parameters(1), Parameters(2), Parameters(3), Parameters(4), Parameters(5), Parameters(6), Parameters(7), InfoID)
ReturnString = Replace(ReturnString, Match.Value, Temp)
Next
CommonRegExp.Pattern = "\{\$CorrelationPhoto\(([ 0-9]+),([ 0-9]+),([ 0-9]+),([ 0-9]+),([ 0-9]+),([ 0-9]+),([ 0-9]+),[ ]*(True|False)[ ]*\)\}"
Set Matches = CommonRegExp.Execute(ReturnString)
For Each Match in Matches
Parameters = EL_Common.GetLabelParameters(Match.Value, "CorrelationPhoto")
Temp = CorrelationPhoto(Parameters(0), Parameters(1), Parameters(2), Parameters(3), Parameters(4), Parameters(5), Parameters(6), Parameters(7), InfoID)
ReturnString = Replace(ReturnString, Match.Value, Temp)
Next
Set Matches = Nothing
Label_CorrelationPhoto = ReturnString
End Function
Private Function CorrelationPhoto(ByVal Num, ByVal PhotoWidth, ByVal PhotoHeight, ByVal TitleLen, ByVal OrderType, ByVal OpenType, ByVal ColNum, ByVal ShowHint, ByVal InfoID)
Dim PhotoCmd, rsPhoto, RowCount, i
Dim StrCorrelation, ReturnString, Order, Group
Num = EL_Common.ELClng(Num)
PhotoWidth = EL_Common.ELClng(PhotoWidth)
PhotoHeight = EL_Common.ELClng(PhotoHeight)
TitleLen = EL_Common.ELClng(TitleLen)
OrderType = EL_Common.ELClng(OrderType)
OpenType = EL_Common.ELClng(OpenType)
ColNum = EL_Common.ELClng(ColNum)
ShowHint = Eval(ShowHint)
If OpenType > 1 Then OpenType = 1
If ColNum < 1 Then ColNum = 1
Order = "OnTop DESC"
Group = "PhotoID,PhotoName,Author,DefaultPictrue,UpdateTime,OnTop"
Select Case OrderType
Case 1: Order = Order &",PhotoID ASC"
Case 2: Order = Order &",PhotoID DESC"
Case 3: Order = Order &",UpdateTime ASC"
Case 4: Order = Order &",UpdateTime DESC"
Case 5: Order = Order &",Hits ASC" : Group = Group &",Hits"
Case 6: Order = Order &",Hits DESC" : Group = Group &",Hits"
Case Else: Order = Order &",PhotoID DESC"
End Select
Call EL_Common.InitCommand(PhotoCmd, "EL_SP_CorrelationInfo")
With PhotoCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@InfoID", 3, 1, 4, InfoID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
.Parameters.Append .CreateParameter("@Table", 200, 1, 100, "EL_Photo")
.Parameters.Append .CreateParameter("@PK", 200, 1, 100, "PhotoID")
.Parameters.Append .CreateParameter("@KeyField", 200, 1, 100, "Keywords")
.Parameters.Append .CreateParameter("@Fields", 200, 1, 500, "PhotoID,PhotoName,Author,DefaultPictrue,UpdateTime")
.Parameters.Append .CreateParameter("@Order", 200, 1, 100, Order)
.Parameters.Append .CreateParameter("@Fliter", 200, 1, 500, "Deleted="& EL_False &" And Passed="& EL_True)
.Parameters.Append .CreateParameter("@Group", 200, 1, 200, Group)
.Parameters.Append .CreateParameter("@Num", 3, 1, 4, Num)
Set rsPhoto = .Execute()
End With
rsPhoto.Close()
RowCount = PhotoCmd(0)
StrCorrelation = EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.Correlation", "没有相关{$ItemName}"), "{$ItemName}", EL_Channel.ItemName)
If RowCount = 0 Then
ReturnString = StrCorrelation
Else
Dim Title_Name, Title_Author, Title_UpdateTime
If ShowHint = True Then
Title_Name = EL_Common.RegExpStaticLabel(EL_Common.Lang("Photo.Name", "{$ItemName}名称:"), "{$ItemName}", EL_Channel.ItemName)
Title_Author = EL_Common.RegExpStaticLabel(EL_Common.Lang("Photo.Author", "作 者:"), "{$ItemName}", EL_Channel.ItemName)
Title_UpdateTime = EL_Common.RegExpStaticLabel(EL_Common.Lang("Photo.UpdateTime", "更新日期:"), "{$ItemName}", EL_Channel.ItemName)
End If
rsPhoto.Open()
ReturnString = "<table border='0' cellpadding='0' cellspacing='0' class='piclist'><tr>"
For i = 1 To RowCount
ReturnString = ReturnString &"<td class='piclisttd'><a href='"& InstallDir & EL_Channel.ChannelDir &"/ShowPhoto.asp?PhotoID="& rsPhoto("PhotoID") &"' "
If ShowHint = True Then
ReturnString = ReturnString &"title='"& Title_Name &":"& EL_Common.HTMLEncode(rsPhoto("PhotoName")) & VBCRLF & Title_Author &":"& rsPhoto("Author") &":"& VBCRLF & Title_UpdateTime & rsPhoto("UpdateTime") &"' "
End If
ReturnString = ReturnString &"class='listA' "& EL_Common.ArrOpenType(OpenType) &">"
ReturnString = ReturnString &"<img class='piclisti' src='"& EL_Common.PictrueURL(rsPhoto("DefaultPictrue"), EL_Channel.FilePath) &"' width='"& PhotoWidth &"' height='"& PhotoHeight &"' border='0'>"
ReturnString = ReturnString &"<br>"& EL_Common.HTMLEncode(EL_Common.GetTopic(rsPhoto("PhotoName"), TitleLen))
ReturnString = ReturnString &"</a></td>"
If (i Mod ColNum) = 0 And i<RowCount Then
ReturnString = ReturnString &"</tr><tr>"
End If
If i<RowCount Then rsPhoto.MoveNext
Next
ReturnString = ReturnString &"</tr></table>"
rsPhoto.Close()
End If
Set rsPhoto = Nothing
Set PhotoCmd = Nothing
CorrelationPhoto = ReturnString
End Function
Private Function Label_CurrentClass(ByVal HTML, ByVal ClassName, ByVal ItemCount)
Dim Match, Matches, ReturnString, Temp
Dim TempString, MatchString
Dim ArrClassCmd, rsArrClass, SQLCondition, RowCount, i
CommonRegExp.Pattern = "\[CurrentClass\][\w\W]*\[\/CurrentClass\]"
Set Matches = CommonRegExp.Execute(HTML)
ReturnString = HTML
EL_Flag = False
For Each Match in Matches
If ItemCount > 0 Then
Temp = Match.Value
Temp = EL_Common.ReplaceText(Temp, "\[CurrentClass\]", "")
Temp = EL_Common.ReplaceText(Temp, "\[\/CurrentClass\]", "")
Temp = EL_Common.ReplaceText(Temp, "Current_ClassID", ClassID)
Temp = EL_Common.RegExpStaticLabel(Temp, "{$Current_ClassName}", ClassName)
Temp = EL_Common.RegExpStaticLabel(Temp, "{$Current_ClassURL}", InstallDir & EL_Channel.ChannelDir &"/ShowClass.asp?ShowType=1&ClassID="& ClassID)
ShowClassType = 1
Temp = Label_GetPhotoList(Temp)
ShowClassType = 0
Else
Temp = ""
End If
ReturnString = Replace(ReturnString, Match.Value, Temp)
Next
Set Matches = Nothing
EL_Flag = True
Label_CurrentClass = ReturnString
End Function
Private Function GetChildClass()
Dim ChildCmd, rsChild, RowCount, i, ReturnString, ClassIcon
ClassIcon = EL_Common.Lang("BaseConfig.ClassIncludeIcon", " ·")
Call EL_Common.InitCommand(ChildCmd, "EL_SP_ClassList")
With ChildCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@ParentID", 3, 1, 4, ClassID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
Set rsChild = .Execute()
End With
rsChild.Close()
RowCount = ChildCmd(0)
rsChild.Open()
ReturnString = ""
For i = 1 To RowCount
ReturnString = ReturnString & ClassIcon &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/ShowClass.asp?ClassID="& rsChild(0) &"'>"& rsChild(1) &"</a><br>"
If i<RowCount Then rsChild.MoveNext
Next
rsChild.Close()
Set rsChild = Nothing
Set ChildCmd = Nothing
GetChildClass = ReturnString
End Function
Private Function Label_ArrClassList(ByVal HTML)
Dim Match, Matches, ReturnString, Cols, Temp
Dim TempString, MatchString
Dim ArrClassCmd, rsArrClass, SQLCondition, RowCount, i
CommonRegExp.Pattern = "\[arrClassList\(([ 0-9]+)\)\][\w\W]*\[\/arrClassList\]"
Set Matches = CommonRegExp.Execute(HTML)
ReturnString = HTML
EL_Flag = False
For Each Match in Matches
MatchString = Match.Value
TempString = LCase(Left(MatchString, InStr(MatchString, "]")))
TempString = Replace(Replace(TempString, "[", ""), "]", "")
TempString = Replace(TempString, " ", "")
TempString = Replace(TempString, "arrclasslist", "")
TempString = Replace(Replace(TempString, "(", ""), ")", "")
Cols = EL_Common.ELClng(TempString)
If Cols < 1 Then Cols = 1
If ClassID = 0 Then
SQLCondition = "ChannelID="& ChannelID &" And ParentID="& ClassID &" And ShowOnIndex="& EL_True &" ORDER BY OrderID"
Else
SQLCondition = "ChannelID="& ChannelID &" And ParentID="& ClassID &" And ShowOnParent="& EL_True &" ORDER BY OrderID"
End If
Call EL_Common.InitCommonCmd(ArrClassCmd, rsArrClass, "EL_Class", "ClassID,ClassName", SQLCondition)
rsArrClass.Close()
RowCount = ArrClassCmd(0)
If RowCount = 0 Then
Temp = ""
Else
MatchString = EL_Common.ReplaceText(MatchString, "\[arrClassList\(([ 0-9]+)\)\]", "")
MatchString = EL_Common.ReplaceText(MatchString, "\[\/arrClassList\]", "")
rsArrClass.Open()
Temp = "<table width=100% border='0' cellpadding='0' cellspacing='0'><tr>"
Dim ItemHTML, ArrClassID
For i = 1 To RowCount
ArrClassID = Replace(EL_Common.GetAllClassID(rsArrClass(0)), ",", "|")
ItemHTML = ""
ItemHTML = EL_Common.RegExpStaticLabel(MatchString, "{$arr_ClassID}", rsArrClass(0).value)
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$arr_ClassName}", rsArrClass(1).value)
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$arr_ClassURL}", InstallDir & EL_Channel.ChannelDir &"/ShowClass.asp?ClassID="& rsArrClass(0).value)
ItemHTML = EL_Common.ReplaceText(ItemHTML, "arr_AllChildID", ArrClassID)
ItemHTML = Label_GetPhotoList(ItemHTML)
Temp = Temp &"<td width='"& 100/Cols &"%' valign='top'>"
Temp = Temp & ItemHTML
Temp = Temp &"</td>"
If (i Mod Cols)=0 And i<RowCount Then
Temp = Temp &"</tr><tr>"
Else
If (i Mod Cols)>0 Then Temp = Temp &"<td> </td>"
End If
If i<RowCount Then rsArrClass.MoveNext
Next
Temp = Temp &"</tr></table>"
rsArrClass.Close()
End if
Set rsArrClass = Nothing
Set ArrClassCmd = Nothing
ReturnString = Replace(ReturnString, Match.Value, Temp)
Next
Set Matches = Nothing
EL_Flag = True
Label_ArrClassList = ReturnString
End Function
Private Function Label_GetPhotoList(ByVal HTML)
Dim Match, Matches, ReturnString, Parameters, Temp
CommonRegExp.Pattern = "<!--\{\$GetPhotoList\(([ 0-9]+|[ ]*ChannelID[ ]*),([ 0-9\|]+|[ ]*ClassID[ ]*),([ 0-9]+),([ 0-9]+),([ 0-9]+),([ 0-9]+),[ ]*(True|False)[ ]*,([ 0-9]+),([ 0-9]+),([ 0-9]+),[ ]*(True|False)[ ]*\)\}-->"
Set Matches = CommonRegExp.Execute(HTML)
ReturnString = HTML
Temp = ""
For Each Match in Matches
Parameters = EL_Common.GetLabelParameters(Match.Value, "GetPhotoList")
Temp = PhotoList(Parameters(0), Parameters(1), Parameters(2), Parameters(3), Parameters(4), Parameters(5), Parameters(6), Parameters(7), Parameters(8), Parameters(9), Parameters(10))
ReturnString = Replace(ReturnString, Match.Value, Temp)
Next
CommonRegExp.Pattern = "\{\$GetPhotoList\(([ 0-9]+|[ ]*ChannelID[ ]*),([ 0-9\|]+|[ ]*ClassID[ ]*),([ 0-9]+),([ 0-9]+),([ 0-9]+),([ 0-9]+),[ ]*(True|False)[ ]*,([ 0-9]+),([ 0-9]+),([ 0-9]+),[ ]*(True|False)[ ]*\)\}"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -