📄 syscode_photo.asp
字号:
i=i+1
if i mod 5=0 then
response.write "<br>"
end if
loop
end if
end if
rsChild.close
set rsChild=nothing
end sub
'=================================================
'过程名:ShowClassNavigation
'作 用:显示栏目导航
'参 数:无
'=================================================
sub ShowClassNavigation()
dim rsNavigation,sqlNavigation,strNavigation,PrevRootID,i
dim tr_color1
tr_color1="#f3f3f3"
sqlNavigation="select C.ClassID,C.ClassName,C.Depth,L.LayoutFileName,C.RootID,C.LinkUrl,C.Child,C.Readme From PhotoClass C"
sqlNavigation= sqlNavigation & " inner join Layout L on C.LayoutID=L.LayoutID where C.Depth<=1 order by C.RootID,C.OrderID"
Set rsNavigation= Server.CreateObject("ADODB.Recordset")
rsNavigation.open sqlNavigation,conn,1,1
if rsNavigation.bof and rsNavigation.eof then
response.write "没有任何栏目"
else
strNavigation="<table border='0' cellpadding='2' cellspacing='2'><tr bgcolor='"&tr_color1&"'><td valign='top' nowrap>【<a href='" & rsNavigation(3) & "?ClassID=" & rsNavigation(0) & "' title='" & rsNavigation(7) & "'>" & rsNavigation(1) & "</a>】</td><td>"
PrevRootID=rsNavigation(4)
rsNavigation.movenext
i=1
do while not rsNavigation.eof
if PrevRootID=rsNavigation(4) then
if i mod 4=0 then
strNavigation=strNavigation & "<br>"
end if
strNavigation=strNavigation & "<a href='" & rsNavigation(3) & "?ClassID=" & rsNavigation(0) & "' title='" & rsNavigation(7) & "'>" & rsNavigation(1) & "</a> "
i=i+1
else
strNavigation=strNavigation & "</td></tr><tr bgcolor='"&tr_color1&"' ><td valign='top' nowrap>【<a href='" & rsNavigation(3) & "?ClassID=" & rsNavigation(0) & "' title='" & rsNavigation(7) & "'>" & rsNavigation(1) & "</a>】</td><td>"
i=1
end if
PrevRootID=rsNavigation(4)
rsNavigation.movenext
if tr_color1="#ffffff" then
tr_color1="#f3f3f3"
else tr_color1="#ffffff"
end if
loop
strNavigation=strNavigation & "</td></tr></table>"
response.write strNavigation
end if
rsNavigation.close
set rsNavigation=nothing
end sub
'=================================================
'过程名:ShowSiteCount
'作 用:显示站点统计信息
'参 数:无
'=================================================
sub ShowSiteCount()
dim sqlCount,rsCount
Set rsCount= Server.CreateObject("ADODB.Recordset")
sqlCount="select count(PhotoID) from Photo where Deleted=0"
rsCount.open sqlCount,conn,1,1
response.write "产品总数:" & rsCount(0) & "个<br>"
rsCount.close
sqlCount="select sum(Hits) from Photo"
rsCount.open sqlCount,conn,1,1
response.write "产品查看:" & rsCount(0) & "人次<br>"
rsCount.close
set rsCount=nothing
end sub
'=================================================
'过程名:ShowPhoto
'作 用:分页显示产品标题等信息
'参 数:TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowPhoto(TitleLen,strClassID)
if TitleLen<0 or TitleLen>200 then
TitleLen=50
end if
sqlPhoto="select P.PhotoID,P.ClassID,C.ClassName,L.LayoutFileName,P.PhotoName,P.PhotoUrl_Thumb,P.Author,P.AuthorEmail,P.Keyword,P.UpdateTime,P.Editor,P.Hits,P.DayHits,P.WeekHits,P.MonthHits,P.PhotoSize,P.OnTop,P.Elite,P.Passed,P.Stars,P.PhotoLevel,P.PhotoPoint from Photo P"
sqlPhoto=sqlPhoto & " inner join (PhotoClass C inner join Layout L on C.LayoutID=L.LayoutID) on P.ClassID=C.ClassID where P.Deleted=0 and P.Passed=1 "
'if SpecialID>0 then
' sqlPhoto=sqlPhoto & " and P.SpecialID=" & SpecialID
'end if
if instr(strClassID,",")>0 then
sqlPhoto=sqlPhoto & " and P.ClassID in (" & strClassID & ")"
else
sqlPhoto=sqlPhoto & " and P.ClassID=" & Clng(strClassID)
end if
if keyword<>"" then
select case strField
case "PhotoName"
sqlPhoto=sqlPhoto & " and P.PhotoName like '%" & keyword & "%' "
case "PhotoIntro"
sqlPhoto=sqlPhoto & " and P.PhotoIntro like '%" & keyword & "%' "
case "Author"
sqlPhoto=sqlPhoto & " and P.Author like '%" & keyword & "%' "
case "Editor"
sqlPhoto=sqlPhoto & " and P.Editor like '%" & keyword & "%' "
case else
sqlPhoto=sqlPhoto & " and P.PhotoName like '%" & keyword & "%' "
end select
end if
sqlPhoto=sqlPhoto & " order by P.OnTop,P.PhotoID desc"
Set rsPhoto= Server.CreateObject("ADODB.Recordset")
rsPhoto.open sqlPhoto,conn,1,1
if rsPhoto.bof and rsPhoto.eof then
totalput=0
response.Write("<br><li>没有任何产品</li>")
else
totalput=rsPhoto.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
call PhotoContent(TitleLen,True)
else
if (currentPage-1)*MaxPerPage<totalPut then
rsPhoto.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsPhoto.bookmark
call PhotoContent(TitleLen,True)
else
currentPage=1
call PhotoContent(TitleLen,True)
end if
end if
end if
rsPhoto.close
set rsPhoto=nothing
end sub
'=================================================
'过程名:PhotoContent
'作 用:显示产品属性、标题、作者、更新日期、点击数等信息
'参 数:intTitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub PhotoContent(intTitleLen,ShowTitle)
dim i,strTemp,TitleStr
response.write "<table border='0' cellpadding='0' cellspacing='5'><tr>"
if rsPhoto.bof and rsPhoto.eof then
response.write "<td width='135' align='center'>没有产品</td>"
else
i=0
do while not rsPhoto.eof
if i>0 and i mod 4=0 then
response.write "</tr><tr>"
end if
response.Write "<td align='center' width='135'>"
response.write "<table border='0' cellspacing='0' cellpadding='0' align='center'><tr><td>"
response.write "<a href='Photo_Show.asp?PhotoID=" & rsPhoto("Photoid") & "' title='产品名称:" & rsPhoto("PhotoName") & vbcrlf & "产品大小:" & rsPhoto("PhotoSize") & "K" & vbcrlf & "作 者:" & rsPhoto("Author") & vbcrlf & "更新时间:" & rsPhoto("UpdateTime") & vbcrlf & "下载次数:今日:" & rsPhoto("DayHits") & " 本周:" & rsPhoto("WeekHits") & " 本月:" & rsPhoto("MonthHits") & " 总计:" & rsPhoto("Hits") & "' target='_blank'><img border='0' src='" & rsPhoto("PhotoUrl_Thumb") & "'></a>"
response.write "</td><td><img src='images/yy1_02.gif' width='6' height='90'></td></tr>"
response.write "<tr><td colspan='2'><img src='images/yy1_03.gif' width='125' height='7'></td></tr></table>"
if ShowTitle=True then
response.write "<a href='Photo_Show.asp?PhotoID=" & rsPhoto("Photoid") & "' title='产品名称:" & rsPhoto("PhotoName") & vbcrlf & "产品大小:" & rsPhoto("PhotoSize") & "K" & vbcrlf & "作 者:" & rsPhoto("Author") & vbcrlf & "更新时间:" & rsPhoto("UpdateTime") & vbcrlf & "下载次数:今日:" & rsPhoto("DayHits") & " 本周:" & rsPhoto("WeekHits") & " 本月:" & rsPhoto("MonthHits") & " 总计:" & rsPhoto("Hits") & "' target='_blank'>" & gotTopic(rsPhoto("PhotoName"),intTitleLen) & "</a>"
end if
response.write "</td>"
i=i+1
if i>=MaxPerPage then exit do
rsPhoto.movenext
loop
end if
response.write "</tr></table>"
end sub
'=================================================
'过程名:ShowNewPhoto
'作 用:显示最近更新的产品
'参 数:PhotoNum ----最多显示多少个产品
' ShowTitle ----是否显示产品名称,True为显示,False为不显示
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowNewPhoto(PhotoNum,ShowTitle,TitleLen)
dim sqlNew,rsNew,i
if PhotoNum>0 and PhotoNum<=100 then
sqlNew="select top " & PhotoNum
else
sqlNew="select top 10 "
end if
sqlNew=sqlNew & " 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=0 and P.Passed=1 "
sqlNew=sqlNew & " order by P.PhotoID desc"
Set rsNew= Server.CreateObject("ADODB.Recordset")
rsNew.open sqlNew,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=100
response.write "<table border='0' cellpadding='0' cellspacing='5'><tr>"
if rsNew.bof and rsNew.eof then
response.write "<td width='135' align='center'>没有产品</td>"
else
i=0
do while not rsNew.eof
if i>0 and i mod 4=0 then
response.write "</tr><tr>"
end if
response.Write "<td align='center' width='135'>"
response.write "<table border='0' cellspacing='0' cellpadding='0' align='center'><tr><td>"
response.write "<a href='Photo_Show.asp?PhotoID=" & rsNew("Photoid") & "' title='产品名称:" & rsNew("PhotoName") & vbcrlf & "产品大小:" & rsNew("PhotoSize") & "K" & vbcrlf & "作 者:" & rsNew("Author") & vbcrlf & "更新时间:" & rsNew("UpdateTime") & vbcrlf & "下载次数:今日:" & rsNew("DayHits") & " 本周:" & rsNew("WeekHits") & " 本月:" & rsNew("MonthHits") & " 总计:" & rsNew("Hits") & "' target='_blank'><img border='0' src='" & rsNew("PhotoUrl_Thumb") & "'></a>"
response.write "</td><td><img src='images/yy1_02.gif' width='6' height='90'></td></tr>"
response.write "<tr><td colspan='2'><img src='images/yy1_03.gif' width='125' height='7'></td></tr></table>"
if ShowTitle=True then
response.write "<a href='Photo_Show.asp?PhotoID=" & rsNew("Photoid") & "' title='产品名称:" & rsNew("PhotoName") & vbcrlf & "产品大小:" & rsNew("PhotoSize") & "K" & vbcrlf & "作 者:" & rsNew("Author") & vbcrlf & "更新时间:" & rsNew("UpdateTime") & vbcrlf & "下载次数:今日:" & rsNew("DayHits") & " 本周:" & rsNew("WeekHits") & " 本月:" & rsNew("MonthHits") & " 总计:" & rsNew("Hits") & "' target='_blank'>" & gotTopic(rsNew("PhotoName"),TitleLen) & "</a>"
end if
response.write "</td>"
i=i+1
rsNew.movenext
loop
end if
response.write "</tr></table>"
rsNew.close
set rsNew=nothing
end sub
'=================================================
'过程名:ShowTop
'作 用:显示累计下载TOP N,N由参数PhotoNum指定
'参 数:PhotoNum ----最多显示多少个产品
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
sub ShowTop(PhotoNum,TitleLen,strClassID)
dim sqlTop,rsTop
if PhotoNum>0 and PhotoNum<=100 then
sqlTop="select top " & PhotoNum
else
sqlTop="select top 10 "
end if
sqlTop=sqlTop & " P.PhotoID,P.PhotoName,P.PhotoVersion,P.Author,P.Keyword,P.UpdateTime,P.Editor,P.Hits,P.DayHits,P.WeekHits,P.MonthHits,P.PhotoSize,P.PhotoLevel,P.PhotoPoint from Photo S where P.Deleted=0 and P.Passed=1 "
if instr(strClassID,",")>0 then
sqlTop=sqlTop & " and P.ClassID in (" & strClassID & ")"
else
if CLng(strClassID)>0 then
sqlTop=sqlTop & " and P.ClassID=" & strClassID
end if
end if
sqlTop=sqlTop & " order by P.Hits desc,P.PhotoID desc"
Set rsTop= Server.CreateObject("ADODB.Recordset")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -