📄 func_photo.asp
字号:
sqlTop="select top " & PhotoNum
else
sqlTop="select top 10 "
end if
sqlTop=sqlTop & " S.PhotoID,S.PhotoName,S.PhotoVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.PhotoSize,S.PhotoLevel,S.PhotoPoint from Photo S where S.Deleted=False and S.Passed=True And datediff('ww',LastHitTime,now())<=0 order by S.WeekHits desc,S.PhotoID desc"
Set rsTop= Server.CreateObject("ADODB.Recordset")
rsTop.open sqlTop,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=100
if rsTop.bof and rsTop.eof then
response.write "<li>今日没有下载</li>"
else
do while not rsTop.eof
response.Write "<li><a href='Photo_Show.asp?PhotoID=" & rsTop("Photoid") & "' title='图片名称:" & rsTop("PhotoName") & vbcrlf & "图片版本:" & rsTop("PhotoVersion") & vbcrlf & "图片大小:" & rsTop("PhotoSize") & "K" & vbcrlf & "作 者:" & rsTop("Author") & vbcrlf & "更新时间:" & rsTop("UpdateTime") & vbcrlf & "下载次数:今日:" & rsTop("DayHits") & " 本周:" & rsTop("WeekHits") & " 本月:" & rsTop("MonthHits") & " 总计:" & rsTop("Hits") & "' target='_blank'>" & gotTopic(rsTop("PhotoName"),TitleLen) & "</li><br>"
rsTop.movenext
loop
end if
rsTop.close
set rsTop=nothing
end sub
'=================================================
'过程名:ShowTopMonth
'作 用:显示本月下载TOP N,N由参数PhotoNum指定
'参 数:PhotoNum ----最多显示多少个图片
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowTopMonth(PhotoNum,TitleLen)
dim sqlTop,rsTop
if PhotoNum>0 and PhotoNum<=100 then
sqlTop="select top " & PhotoNum
else
sqlTop="select top 10 "
end if
sqlTop=sqlTop & " S.PhotoID,S.PhotoName,S.PhotoVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.PhotoSize,S.PhotoLevel,S.PhotoPoint from Photo S where S.Deleted=False and S.Passed=True And datediff('m',LastHitTime,now())<=0 order by S.MonthHits desc,S.PhotoID desc"
Set rsTop= Server.CreateObject("ADODB.Recordset")
rsTop.open sqlTop,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=100
if rsTop.bof and rsTop.eof then
response.write "<li>今日没有下载</li>"
else
do while not rsTop.eof
response.Write "<li><a href='Photo_Show.asp?PhotoID=" & rsTop("Photoid") & "' title='图片名称:" & rsTop("PhotoName") & vbcrlf & "图片版本:" & rsTop("PhotoVersion") & vbcrlf & "图片大小:" & rsTop("PhotoSize") & "K" & vbcrlf & "作 者:" & rsTop("Author") & vbcrlf & "更新时间:" & rsTop("UpdateTime") & vbcrlf & "下载次数:今日:" & rsTop("DayHits") & " 本周:" & rsTop("WeekHits") & " 本月:" & rsTop("MonthHits") & " 总计:" & rsTop("Hits") & "' target='_blank'>" & gotTopic(rsTop("PhotoName") & " " & rsTop("PhotoVersion"),TitleLen) & "</li><br>"
rsTop.movenext
loop
end if
rsTop.close
set rsTop=nothing
end sub
'=================================================
'过程名:ShowHot
'作 用:显示热门下载
'参 数:PhotoNum ----最多显示多少个图片
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowHot(PhotoNum,TitleLen)
dim sqlHot,rsHot
if PhotoNum>0 and PhotoNum<=100 then
sqlHot="select top " & PhotoNum
else
sqlHot="select top 10 "
end if
sqlHot=sqlHot & " P.PhotoID,P.PhotoName,P.PhotoUrl_Thumb,P.Author,P.Keyword,P.UpdateTime,P.Editor,P.Hits,P.DayHits,P.WeekHits,P.MonthHits,P.PhotoSize,P.PhotoLevel,P.PhotoPoint from Photo P where P.Deleted=False and P.Passed=True And P.Hits>=" & HitsOfHot
sqlHot=sqlHot & " order by P.PhotoID desc"
Set rsHot= Server.CreateObject("ADODB.Recordset")
rsHot.open sqlHot,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsHot.bof and rsHot.eof then
response.write "<li>无热门图片</li>"
else
do while not rsHot.eof
response.Write "<li><a href='Photo_Show.asp?PhotoID=" & rsHot("Photoid") & "' title='图片名称:" & rsHot("PhotoName") & vbcrlf & "图片大小:" & rsHot("PhotoSize") & "K" & vbcrlf & "作 者:" & rsHot("Author") & vbcrlf & "更新时间:" & rsHot("UpdateTime") & vbcrlf & "下载次数:" & rsHot("Hits") & "' target='_blank'>" & gotTopic(rsHot("PhotoName"),TitleLen) & "[<font color=red>" & rsHot("hits") & "</font>]</li><br>"
rsHot.movenext
loop
end if
rsHot.close
set rsHot=nothing
end sub
'=================================================
'过程名:ShowElite
'作 用:显示推荐图片
'参 数:PhotoNum ----最多显示多少个图片
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowElite(PhotoNum,TitleLen)
dim sqlElite,rsElite
if PhotoNum>0 and PhotoNum<=100 then
sqlElite="select top " & PhotoNum
else
sqlElite="select top 10 "
end if
sqlElite=sqlElite & " P.PhotoID,P.PhotoName,P.PhotoUrl_Thumb,P.Author,P.Keyword,P.UpdateTime,P.Editor,P.Hits,P.DayHits,P.WeekHits,P.MonthHits,P.PhotoSize,P.PhotoLevel,P.PhotoPoint from Photo P where P.Deleted=False and P.Passed=True And P.Elite=True "
sqlElite=sqlElite & " order by P.PhotoID desc"
Set rsElite= Server.CreateObject("ADODB.Recordset")
rsElite.open sqlElite,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsElite.bof and rsElite.eof then
response.write "<li>无推荐图片</li>"
else
do while not rsElite.eof
response.Write "<li><a href='Photo_Show.asp?PhotoID=" & rsElite("Photoid") & "' title='图片名称:" & rsElite("PhotoName") & vbcrlf & "图片大小:" & rsElite("PhotoSize") & "K" & vbcrlf & "作 者:" & rsElite("Author") & vbcrlf & "更新时间:" & rsElite("UpdateTime") & vbcrlf & "下载次数:" & rsElite("Hits") & "' target='_blank'>" & gotTopic(rsElite("PhotoName"),TitleLen) & "[<font color=red>" & rsElite("hits") & "</font>]</li><br>"
rsElite.movenext
loop
end if
rsElite.close
set rsElite=nothing
end sub
'=================================================
'过程名:ShowCorrelative
'作 用:显示相关图片
'参 数:PhotoNum ----最多显示多少个图片
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowCorrelative(PhotoNum,TitleLen)
dim rsCorrelative,sqlCorrelative
dim strKey,arrKey,i
if PhotoNum>0 and PhotoNum<=100 then
sqlCorrelative="select top " & PhotoNum
else
sqlCorrelative="Select Top 5 "
end if
strKey=mid(rs("Keyword"),2,len(rs("Keyword"))-2)
if instr(strkey,"|")>1 then
arrKey=split(strKey,"|")
strKey="((S.Keyword like '%|" & arrKey(0) & "|%')"
for i=1 to ubound(arrKey)
strKey=strKey & " or (S.Keyword like '%|" & arrKey(i) & "|%')"
next
strKey=strKey & ")"
else
strKey="(S.Keyword like '%|" & strKey & "|%')"
end if
sqlCorrelative=sqlCorrelative & " S.PhotoID,S.PhotoName,S.PhotoVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.PhotoSize,S.PhotoLevel,S.PhotoPoint from Photo S Where S.Deleted=False and S.Passed=True and " & strKey & " and S.PhotoID<>" & PhotoID & " Order by S.PhotoID desc"
Set rsCorrelative= Server.CreateObject("ADODB.Recordset")
rsCorrelative.open sqlCorrelative,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=50
if rsCorrelative.bof and rsCorrelative.Eof then
response.write "没有相关图片"
else
do while not rsCorrelative.eof
response.Write "<li><a href='Photo_Show.asp?PhotoID=" & rsCorrelative("Photoid") & "' title='图片名称:" & rsCorrelative("PhotoName") & vbcrlf & "图片大小:" & rsCorrelative("PhotoSize") & "K" & vbcrlf & "作 者:" & rsCorrelative("Author") & vbcrlf & "更新时间:" & rsCorrelative("UpdateTime") & vbcrlf & "下载次数:" & rsCorrelative("Hits") & "' target='_blank'>" & gotTopic(rsCorrelativ("PhotoName"),TitleLen) & "[<font color=red>" & rsCorrelative("hits") & "</font>]</li><br>"
rsCorrelative.movenext
loop
end if
rsCorrelative.close
set rsCorrelative=nothing
end sub
'=================================================
'过程名:ShowComment
'作 用:显示相关评论
'参 数:CommentNum ----最多显示多少个评论
'=================================================
sub ShowComment(CommentNum)
dim rsComment,sqlComment,rsCommentUser
if CommentNum>0 and CommentNum<=100 then
sqlComment="select top " & CommentNum
else
sqlComment="select top 10 "
end if
sqlComment=sqlComment & " * from PhotoComment where PhotoID=" & PhotoID & " order by CommentID desc"
Set rsComment= Server.CreateObject("ADODB.Recordset")
rsComment.open sqlComment,conn,1,1
if rsComment.bof and rsComment.eof then
response.write " 没有任何评论"
else
response.write "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
do while not rsComment.eof
response.write "<tr><td width='70%'>"
if rsComment("UserType")=1 then
response.write "<li>会员"
set rsCommentUser=Conn_User.execute("select " & db_User_ID & "," & db_User_Name & "," & db_User_Email & "," & db_User_QQ & "," & db_User_Homepage & " from " & db_User_Table & " where " & db_User_Name & "='" & rsComment("UserName") & "'")
if rsCommentUser.bof and rsCommentUser.eof then
response.write rsComment("UserName")
else
response.write "『<a href='UserInfo.asp?UserID=" & rsCommentUser(0) & "' title='姓名:" & rsCommentUser(1) & vbcrlf & "信箱:" & rsCommentUser(2) & vbcrlf & "Oicq:" & rsCommentUser(3) & vbcrlf & "主页:" & rsCommentUser(4)&"'><font color='blue'>" & rsComment("UserName") & "</font></a>』"
end if
else
response.write "<li>游客『<span title='姓名:" & rsComment("UserName") & vbcrlf & "信箱:" & rsComment("Email") & vbcrlf & "Oicq:" & rsComment("Oicq") & vbcrlf & "主页:" & rsComment("Homepage")&"' style='cursor:hand'><font color='blue'>" & rsComment("UserName") & "</font></span>』"
end if
response.write "于" & rsComment("WriteTime") & "发表评论:</li>"
response.write "</td><td align=right>评分:"&rsComment("Score")&"分</td></tr>"
response.write "<tr><td colspan='2'>"
response.write " " & rsComment("Content") & "<br>"
if rsComment("ReplyContent")<>"" then
response.write " <font color='009900'>★</font> 管理员『<font color='blue'>" & rsComment("ReplyName") & "</font>』于 " & rsComment("ReplyTime") & " 回复道: " & rsComment("ReplyContent") & "<br>"
end if
response.write "<br></td></tr>"
rsComment.movenext
loop
response.write "<tr><td colspan='2' align='right'>"
response.write "<a href='Photo_CommentShow.asp?PhotoID=" & PhotoID & "'>查看关于此文章的所有评论</a>"
response.write "</td></tr></table>"
end if
end sub
'=================================================
'过程名:Show_super_Menu
'作 用:显示下拉菜单效果 -来自异域-晓炊改进
'参 数:无
'=================================================
sub Show_super_Menu()
dim sqlRoot,rsRoot,tdstyle,tdmouse,sqlClass,rsClass,k
tdstyle=" style='font-size:9.5pt;background-image: url(images/menu_bg1.gif);background-repeat: no-repeat;background-position: right;letter-spacing: 2px' "
' tdmouse=" onmouseover='this.style.background=""url(images/nopic.jpg)""' onmouseout='this.style.background=""url(images/nologo.jpg)""' "
sqlRoot="select C.ClassID,C.ClassName,C.Depth,L.LayoutFileName,C.NextID,C.LinkUrl,C.Child,C.Readme,c.parentID From PhotoClass C"
sqlRoot= sqlRoot & " inner join Layout L on C.LayoutID=L.LayoutID where C.Depth=0 and C.ShowOnTop=True order by C.RootID"
Set rsRoot= Server.CreateObject("ADODB.Recordset")
rsRoot.open sqlRoot,conn,1,1
response.write "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'>"
' response.write "<a href=index.asp><td width='1%' nowrap" & tdstyle & tdmouse & " style='CURSOR: hand'> 首 页</td><a>"
if not(rsRoot.bof and rsRoot.eof) then
do while not rsRoot.eof
if rsRoot(6)>0 then
response.write "<A href='Photo_class.asp?classID=" & rsRoot(0) & "'><TD style='CURSOR: hand; width:1%; padding:0px,18px,0px,18px;' nowrap" & tdstyle & tdmouse & " id=Menu" & rsRoot(0) & ">" & rsRoot(1) & "</TD></A>" & vbcrlf
else
response.write "<a href='Photo_class.asp?classID=" & rsroot(0) & "'><td style='CURSOR: hand; width:1%; padding:0px,18px,0px,18px;' nowrap" & tdstyle & tdmouse & ">" & rsroot(1) & "</td></a>" & vbcrlf
end if
rsRoot.movenext
loop
end if
rsRoot.close
set rsRoot=nothing
response.write "<td width='99%'></td></tr></table>"
%>
<script language="javascript">
if (mtDropDown.isSupported()) {
var ms = new mtDropDownSet(mtDropDown.direction.down, 0, 0, mtDropDown.reference.bottomLeft);
<%
sqlClass="select C.ClassID,C.ClassName,C.Depth,L.LayoutFileName,C.NextID,C.LinkUrl,C.Child,C.Readme,C.parentID From photoClass C" &_
" inner join Layout L on C.LayoutID=L.LayoutID where C.Depth=0 and C.ShowOnTop=True and C.Child>0 order by C.RootID"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
do while not rsClass.eof
response.write "var Menu" & rsClass(0) & "=ms.addMenu(document.getElementById(""" & "Menu" & rsClass(0) & """));" & vbcrlf
call GetSuperMenu(rsClass(0))
rsClass.movenext
loop
rsClass.close
set rsClass=nothing
%>
mtDropDown.renderAll();
}
</script>
<%
end sub
sub GetSuperMenu(ID) '--被上面的调用,递归...
dim sqlClass,rsClass,k
sqlClass="select C.ClassID,C.ClassName,C.Depth,L.LayoutFileName,C.NextID,C.LinkUrl,C.Child,C.Readme,C.parentID From photoClass C" &_
" inner join Layout L on C.LayoutID=L.LayoutID where C.ParentID=" & ID & " order by C.OrderID asc"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
k=0
do while not rsClass.eof
response.write " Menu" & ID & ".addItem(' " & rsClass(1) & "','photo_class.asp?classID=" & rsClass(0) & "');" & vbcrlf
if rsClass(6)>0 then
response.write "var Menu" & rsClass(0) & " = Menu" & rsClass(8) & ".addMenu(Menu" & rsClass(8) & ".items[" & k & "]);" & vbcrlf
call GetSuperMenu(rsClass(0))
end if
k=k+1
rsClass.movenext
loop
rsClass.close
set rsClass=nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -