📄 classphoto.asp
字号:
Set Matches = CommonRegExp.Execute(ReturnString)
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
Set Matches = Nothing
Label_GetPhotoList = ReturnString
End Function
Private Function PhotoList(ByVal iChannelID, ByVal ArrClassID, ByVal PhotoNum, ByVal PhotoWidth, ByVal PhotoHeight, ByVal TitleLen, ByVal IsCommend, ByVal OrderType, ByVal OpenType, ByVal ColNum, ByVal ShowPage)
Dim PhotoCmd, rsPhoto, i, ReturnString
Dim PageSizes, RowCount, TotalRowCount, PageCounts
Dim SQLTables, SQLFields, SQLCondition, SQLOrder, SQL
Dim ChannelCmd, rsChannel, ChannelDir, ChannelModule, ItemName, ItemUnit, Disabled, UploadDir
iChannelID = Eval(iChannelID)
If Instr(ArrClassID, "|")<1 Then
ArrClassID = Eval(ArrClassID)
End If
ArrClassID = CStr(ArrClassID)
If iChannelID <> ChannelID Then
Call EL_Common.InitCommonCmd(ChannelCmd, rsChannel, "EL_Channel", "ChannelDir,ChannelModule,ItemName,ItemUnit,Disabled,UploadDir", "ChannelID="& iChannelID &" AND ChannelType=0")
rsChannel.Close()
If ChannelCmd(0) <> 1 Then
Set rsChannel = Nothing
Set ChannelCmd = Nothing
PhotoList = EL_Common.Lang("BaseConfig.ChannelError", "·频道参数错误")
Exit Function
Else
rsChannel.Open()
ChannelDir = rsChannel(0)
ChannelModule = rsChannel(1)
ItemName = rsChannel(2)
ItemUnit = rsChannel(3)
Disabled = rsChannel(4)
UploadDir = rsChannel(5)
rsChannel.Close()
End If
Set rsChannel = Nothing
Set ChannelCmd = Nothing
Else
ChannelDir = EL_Channel.ChannelDir
ChannelModule = EL_Channel.ChannelModule
ItemName = EL_Channel.ItemName
ItemUnit = EL_Channel.ItemUnit
Disabled = EL_Channel.Disabled
UploadDir = EL_Channel.UploadDir
End If
If ChannelModule <> 6 Then
PhotoList = EL_Common.Lang("BaseConfig.ChannelModuleError", "·频道模块错误")
Exit Function
End If
If Disabled Then
PhotoList = EL_Common.Lang("BaseConfig.Disabled", "·该频道已被禁用")
Exit Function
End If
PhotoNum = EL_Common.ELClng(PhotoNum)
TitleLen = EL_Common.ELClng(TitleLen)
ColNum = EL_Common.ELClng(ColNum)
OrderType = EL_Common.ELClng(OrderType)
OpenType = EL_Common.ELClng(OpenType)
IsCommend = Eval(IsCommend)
ShowPage = Eval(ShowPage)
PhotoWidth = EL_Common.ELClng(PhotoWidth)
PhotoHeight = EL_Common.ELClng(PhotoHeight)
If PhotoWidth <=0 Then PhotoWidth = EL_Common.Lang("Photo.PhotoWidth", 120)
If PhotoHeight <=0 Then PhotoHeight = EL_Common.Lang("Photo.PhotoHeight", 80)
If OpenType > 1 Then OpenType = 1
If ColNum < 1 Then ColNum = 1
SQLTables = "EL_Photo"
SQLFields = "EL_Photo.PhotoID,EL_Photo.PhotoName,EL_Photo.Author,EL_Photo.DefaultPictrue,EL_Photo.UpdateTime"
SQLOrder = "EL_Photo.OnTop DESC"
Select Case OrderType
Case 1: SQLOrder = SQLOrder &",EL_Photo.PhotoID ASC"
Case 2: SQLOrder = SQLOrder &",EL_Photo.PhotoID DESC"
Case 3: SQLOrder = SQLOrder &",EL_Photo.UpdateTime ASC"
Case 4: SQLOrder = SQLOrder &",EL_Photo.UpdateTime DESC"
Case 5: SQLOrder = SQLOrder &",EL_Photo.Hits ASC"
Case 6: SQLOrder = SQLOrder &",EL_Photo.Hits DESC"
Case Else: SQLOrder = SQLOrder &",EL_Photo.PhotoID DESC"
End Select
SQLCondition = " EL_Photo.ChannelID="& ChannelID &" And EL_Photo.Passed="& EL_True &" And EL_Photo.Deleted="& EL_False &" "
If ArrClassID = "" Or ArrClassID = "0" Or Replace(ArrClassID, "|", "") = "" Then
'SQLCondition = SQLCondition &""
Else
If ShowClassType = 1 Then
ArrClassID = ArrClassID
Else
ArrClassID = EL_Common.GetAllClassID(ArrClassID)
End If
SQLCondition = SQLCondition &"AND EL_Photo.ClassID In("& ArrClassID &") "
End If
If IsCommend Then SQLCondition = SQLCondition &" AND EL_Photo.Commended="& EL_True &" "
ReturnString = ""
If EL_Flag = False Then ShowPage = False '防止在特殊标签中设 ShowPage=True
If ShowPage Then
Call EL_Common.InitCommand(PhotoCmd, "EL_SP_SplitPage")
With PhotoCmd
.Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
.Parameters.Append .CreateParameter("@Tables", 200, 1, 100, SQLTables)
.Parameters.Append .CreateParameter("@PrimaryKey", 200, 1, 20, "EL_Photo.PhotoID")
.Parameters.Append .CreateParameter("@Sort", 200, 1, 200, SQLOrder)
.Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
.Parameters.Append .CreateParameter("@PageSize", 3, 1, 4, PageSizes)
.Parameters.Append .CreateParameter("@Fields", 200, 1, 1000, SQLFields)
.Parameters.Append .CreateParameter("@Filter", 200, 1, 1000, SQLCondition)
.Parameters.Append .CreateParameter("@Group", 200, 1, 1, "")
.Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
Set rsPhoto = .Execute()
End With
rsPhoto.Close()
RowCount = PhotoCmd(0)
TotalRowCount = PhotoCmd(9)
PageCounts = PhotoCmd(10)
Else
If PhotoNum < 1 Then PhotoNum = EL_Common.Lang("Photo.TopNum", 5)
Call EL_Common.InitCommonCmd(PhotoCmd, rsPhoto, SQLTables, " TOP "& PhotoNum &" "& SQLFields, SQLCondition &" ORDER BY "& SQLOrder)
rsPhoto.Close()
RowCount = PhotoCmd(0)
End If
If RowCount = 0 Then
Set rsPhoto = Nothing
Set PhotoCmd = Nothing
PhotoList = EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.NoList", "·没有任何{$ItemName}"), "{$ItemName}", ItemName)
Exit Function
Else
Dim Title_Name, Title_Author, Title_UpdateTime
Title_Name = EL_Common.RegExpStaticLabel(EL_Common.Lang("Photo.Name", "{$ItemName}标题"), "{$ItemName}", ItemName)
Title_Author = EL_Common.Lang("Photo.Author", "作 者")
Title_UpdateTime = EL_Common.Lang("Photo.UpdateTime", "更新日期")
rsPhoto.Open()
ReturnString = "<table border='0' cellspacing='0' cellpadding='0' class='piclist'><tr>"
For i = 1 To RowCount
ReturnString = ReturnString &"<td class='piclisttd'><a href='"& InstallDir & ChannelDir &"/ShowPhoto.asp?PhotoID="& rsPhoto("PhotoID") &"' "
ReturnString = ReturnString &"title='"& Title_Name &":"& EL_Common.HTMLEncode(rsPhoto("PhotoName")) & VBCRLF & Title_Author &":"& rsPhoto("Author") & VBCRLF & Title_UpdateTime &":"& rsPhoto("UpdateTime") &"' 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><span class='piclistn'>"& EL_Common.HTMLEncode(EL_Common.GetTopic(rsPhoto("PhotoName"), TitleLen)) &"</span>"
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
If ShowPage Then
Dim PageHTML, PageString
PageHTML = EL_Common.Lang("BaseConfig.ShowPage", "")
PageHTML = EL_Common.ReplaceText(PageHTML, "\{\$PageList\}", EL_Common.ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, EL_Channel.ItemName, EL_Channel.ItemUnit))
ReturnString = ReturnString & PageHTML
End If
PhotoList = ReturnString
End Function
Private Function Label_ShowComment(ByVal HTML, ByVal InfoID)
Dim Match, Matches, ReturnString, Parameters, Temp
CommonRegExp.Pattern = "<!--\{\$ShowComment\(([ 0-9]+),([ 0-9]+),[ ]*(True|False)[ ]*,[ ]*(True|False)[ ]*,([ 0-9]+)\)\}-->"
Set Matches = CommonRegExp.Execute(HTML)
ReturnString = HTML
For Each Match in Matches
Parameters = EL_Common.GetLabelParameters(Match.Value, "ShowComment")
Temp = CommentList(InfoID, Parameters(0), Parameters(1), Parameters(2), Parameters(3), Parameters(4))
ReturnString = Replace(ReturnString, Match.Value, Temp)
Next
CommonRegExp.Pattern = "\{\$ShowComment\(([ 0-9]+),([ 0-9]+),[ ]*(True|False)[ ]*,[ ]*(True|False)[ ]*,([ 0-9]+)\)\}"
Set Matches = CommonRegExp.Execute(ReturnString)
For Each Match in Matches
Parameters = EL_Common.GetLabelParameters(Match.Value, "ShowComment")
Temp = CommentList(InfoID, Parameters(0), Parameters(1), Parameters(2), Parameters(3), Parameters(4))
ReturnString = Replace(ReturnString, Match.Value, Temp)
Next
Set Matches = Nothing
Label_ShowComment = ReturnString
End Function
Private Function CommentList(ByVal InfoID, ByVal Num, ByVal TitleLen, ByVal ShowAuthor, ByVal ShowPoint, ByVal ShowDateType)
Dim CommentCmd, rsComment, RowCount, i, ReturnString
Dim SQLCondition, CommentItemName, CommentItemUnit, PointName
Num = EL_Common.ELClng(Num)
TitleLen = EL_Common.ELClng(TitleLen)
ShowAuthor = Eval(ShowAuthor)
ShowPoint = Eval(ShowPoint)
ShowDateType = EL_Common.ELClng(ShowDateType)
If Num<1 Then Num = EL_Common.Lang("Comment.TopNum", 10)
SQLCondition = "InfoID="& InfoID &" And ChannelID="& ChannelID &" Order By CommentID DESC"
Call EL_Common.InitCommonCmd(CommentCmd, rsComment, "EL_Comment", "TOP "& Num &"UserName,Content,Point,UpdateTime", SQLCondition)
rsComment.Close()
RowCount = CommentCmd(0)
CommentItemName = EL_Common.Lang("Comment.ItemName", "评论")
CommentItemUnit = EL_Common.Lang("Comment.ItemUnit", "条")
PointName = EL_Common.Lang("Comment.Point", "分")
If RowCount = 0 Then
CommentList = EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.NoList", "·没有任何{$ItemName}"), "{$ItemName}", CommentItemName)
Set rsComment = Nothing
Set CommentCmd = Nothing
Exit Function
End If
ReturnString = "<table width='100%' border='0' cellspacing='1' cellpadding='0' class='comment'><tr class='comment_title'>"
If ShowAuthor Then ReturnString = ReturnString &"<td width=70 align=center>"& EL_Common.Lang("Comment.t0", "评论人") &"</td>"
ReturnString = ReturnString &"<td align=center>"& EL_Common.Lang("Comment.t1", "评论内容") &"</td>"
If ShowPoint Then ReturnString = ReturnString &"<td align=center width=50>"& EL_Common.Lang("Comment.t2", "打分") &"</td>"
ReturnString = ReturnString &"<td align=center width=60>"& EL_Common.Lang("Comment.t3", "评论时间") &"</td></tr>"
rsComment.Open()
For i = 1 To RowCount
ReturnString = ReturnString &"<tr class=comment_list>"
If ShowAuthor Then ReturnString = ReturnString &"<td align=center>"& EL_Common.ReplaceKeyLink(EL_Common.ServerHTMLEncode(rsComment(0)), 1) &"</td>"
ReturnString = ReturnString &"<td>"& EL_Common.GetTopic(EL_Common.ReplaceKeyLink(rsComment(1), 1), TitleLen) &"</td>"
If ShowPoint Then ReturnString = ReturnString &"<td align=center>"& EL_Common.ServerHTMLEncode(rsComment(2)) &" "& PointName &"</td>"
Select Case ShowDateType
Case 1: ReturnString = ReturnString &"<td align=center>"& FormatDateTime(rsComment(3), 2) &"</td>"
Case 2: ReturnString = ReturnString &"<td align=center>"& Right("0"& Month(rsComment(3)), 2) &"-"& Right("0"& Day(rsComment(3)), 2) &"</td>"
Case Else: ReturnString = ReturnString &"<td align=center>"& rsComment(3) &"</td>"
End Select
ReturnString = ReturnString &"</tr>"
If i<RowCount Then rsComment.MoveNext
Next
ReturnString = ReturnString &"</table>"
rsComment.Close()
Set rsComment = Nothing
Set CommentCmd = Nothing
CommentList = ReturnString
End Function
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -