📄 photo.asp
字号:
<%@ CODEPAGE=65001 %>
<%
'///////////////////////////////////////////////////////////////////////////////
'// Z-Blog
'// 作 者: 朱煊(zx.asd)
'// 版权所有: RainbowSoft Studio
'// 技术支持: rainbowsoft@163.com
'// 程序名称:
'// 程序版本:
'// 单元名称: default.asp
'// 开始时间: 2004.07.25
'// 最后修改:
'// 备 注: 主页
'///////////////////////////////////////////////////////////////////////////////
%>
<%' Option Explicit %>
<% On Error Resume Next %>
<% Response.Charset="UTF-8" %>
<% Response.Buffer=True %>
<!-- #include file="c_option.asp" -->
<!-- #include file="function/c_function.asp" -->
<!-- #include file="function/c_function_md5.asp" -->
<!-- #include file="function/c_system_lib.asp" -->
<!-- #include file="function/c_system_base.asp" -->
<!-- #include file="function/c_system_event.asp" -->
<!-- #include file="function/c_system_plugin.asp" -->
<!-- #include file="plugin/p_config.asp" -->
<%
If InStr(LCase(Request.ServerVariables("HTTP_ACCEPT")),"text/vnd.wap.wml") > 0 Then Response.Redirect "wap.asp"
'向导部分wizard
If ZC_DATABASE_PATH="data/zblog.mdb" Then Response.Redirect "wizard.asp?verify=" & MD5(ZC_DATABASE_PATH & Replace(LCase(Request.ServerVariables("PATH_TRANSLATED")),"default.asp",""))
Call System_Initialize_WithOutDB()
'plugin node
For Each sAction_Plugin_Default_Begin in Action_Plugin_Default_Begin
If Not IsEmpty(sAction_Plugin_Default_Begin) Then Call Execute(sAction_Plugin_Default_Begin)
Next
dim db,wConn,myconn,rso
db="plugin/windsphoto/data/winds.mdb"
Set wConn = Server.CreateObject("ADODB.Connection")
myconn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
wConn.Open MyConn
Dim ArtList
Set ArtList=New TArticleList
ArtList.LoadCache
ArtList.template="PHOTO"
If ArtList.ExportByCache("","","","","","") Then
ArtList.Build
Dim Html
Html=ArtList.html
Html=Replace(Html,"<#WINDSPHOTOHTML#>",GetPhoto())
Html=Replace(Html,"<#WINDSPHOTO_CATALOG#>",getSort())
Response.Write Html
'response.wrute GetPhoto()
End If
'plugin node
'For Each sAction_Plugin_Default_End in Action_Plugin_Default_End
' If Not IsEmpty(sAction_Plugin_Default_End) Then Call Execute(sAction_Plugin_Default_End)
'Next
'Call System_Terminate_WithOutDB()
%>
<%
Function GetPhoto()
Dim ipagecount
Dim ipagecurrent
Dim strorderBy
Dim irecordsshown
if request.querystring("page")="" then
ipagecurrent=1
else
ipagecurrent=cint(request.querystring("page"))
end If
dim tpid,sql,sql2,sql3
Set rso=Server.CreateObject("ADODB.RecordSet")
if request.querystring("typeid")<>"" then
tpid=cint(request.querystring("typeid"))
sql="select count(*) as C from desktop where hot=0 and typeid="&tpid
sql2 = "select * from zhuanti where pl="&tpid&" order by id desc"
else
sql="select count(*) as C from desktop where hot=0"
sql2 = "select * from zhuanti order by id desc"
end if
rso.open sql,wConn,3,3
sm=rso("c")
rso.close
set rso=nothing
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.pagesize = 18
rs2.cachesize = 18
rs2.open sql2,wConn,1,1
ipagecount = rs2.pagecount
If ipagecurrent > ipagecount Then ipagecurrent = ipagecount
If ipagecurrent < 1 Then ipagecurrent = 1
if ipagecount=0 then
GetPhoto=GetPhoto&"<div class='post'><p align='center' style='font-size:14px;'>没有任何相册专题</p>"
else
rs2.absolutepage = ipagecurrent
irecordsshown = 0
GetPhoto=GetPhoto&"<div class='post'>"
GetPhoto=GetPhoto&"<table width='100%' border='0' cellspacing='0' cellpadding='3' class='x'><tr><td>"
if request.querystring("typeid")<>"" then
sql3 = "select name from type where id="&tpid
Set rs3=Server.CreateObject("ADODB.RecordSet")
rs3.open sql3,wConn,3,3
GetPhoto=GetPhoto&"<font color='blue'>"&rs3("name")&"</font> "
rs3.close
set rs3=nothing
else
GetPhoto=GetPhoto&"所有"
end if
GetPhoto=GetPhoto&"相册情况,截止到 "&now()&" 共有 <b>"&rs2.RecordCount&" </b> 个相册,"&sm&" </b> 张相片。</td></tr></table>"
do while irecordsshown<18 and NOT rs2.EOF
GetPhoto=GetPhoto&"<table width='100%' border='0' cellspacing='0' cellpadding='5'>"
GetPhoto=GetPhoto&"<tr align='center'>"
for i=1 to 3
GetPhoto=GetPhoto&"<td width='30%'>"
if not rs2.eof then
sqlp="select top 1 * from desktop where zhuanti="&rs2("id")&" and hot=0 order by id asc"
Set rsp=Server.CreateObject("ADODB.RecordSet")
rsp.open sqlp,wConn,1,1
if rsp.eof or rsp.bof then
photourl="image/nopic1.jpg"
else
photourl=rsp("surl")
end if
rsp.close
set rsp=nothing
Set rso=Server.CreateObject("ADODB.RecordSet")
sql="select count(*) as C from desktop where zhuanti="&rs2("id")&" and hot=0"
rso.open sql,wConn,3,3
sm=rso("c")
rso.close
set rso=nothing
dim sqlp
Set rsp=Server.CreateObject("ADODB.RecordSet")
sqlp="select pass from zhuanti where id="&rs2("id")&""
rsp.open sqlp,wConn,1,1
p=rsp("pass")
if p<>"" then
photourl="images/nopass.jpg"
end if
rsp.close
set rsp=nothing
GetPhoto=GetPhoto&"<table align=center bgcolor='#b2b2b2' border=0 cellpadding=1 cellspacing=0 class='bk1'><tr><td><table align=center bgcolor='#ffffff' border=0 cellpadding=5 cellspacing=0 class='bk1'><tbody><td><a href='zhuanti.asp?typeid="&rs2("id")&"'><img src='plugin/windsphoto/"&photourl&"' border='0' class='bk'></a></td></tbody></table></tr></td></tbody></table><br><a href='zhuanti.asp?typeid="&rs2("id")&"' target='_blank'>"&rs2("name")&"</a> | "&sm&"张</td></td>"
irecordsshown = irecordsshown +1
rs2.movenext
end if
next
GetPhoto=GetPhoto&"</tr>"
loop
end if
rs2.Close
set rs2=nothing
GetPhoto=GetPhoto&"</table></div>"
GetPhoto=GetPhoto&"<div class='post pagebar'>每页显示18个相册 共有"&ipagecount&"页 当前为第"&ipagecurrent&"页 "
if ipagecurrent=1 then
GetPhoto=GetPhoto&" 首页 "
else
GetPhoto=GetPhoto&" <a href='index.asp?page=1'>首页</a> "
end if
if ipagecurrent=1 then
GetPhoto=GetPhoto&" 上一页 "
else
GetPhoto=GetPhoto&" <a href='index.asp?page="&ipagecurrent-1&"'>上一页</a> "
end if
if ipagecount>ipagecurrent then
GetPhoto=GetPhoto&" <a href='index.asp?page="&ipagecurrent+1&"'>下一页</a> "
else
GetPhoto=GetPhoto&" 下一页 "
end if
if ipagecount>ipagecurrent then
GetPhoto=GetPhoto&" <a href='index.asp?page="&ipagecount&"'>末页</a>"
else
GetPhoto=GetPhoto&" 末页 "
end if
GetPhoto=GetPhoto&"</div>"
end Function
Function getSort()
sql = "SELECT * FROM type ORDER BY id ASC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,wConn,0,1
if rs.eof and rs.bof then
getSort="还没有分类"
else
do while not rs.eof
sql = "SELECT count(*) as C FROM zhuanti where pl="&rs("id")
Set rsss = Server.CreateObject("ADODB.Recordset")
rsss.OPEN sql,wConn,0,1
getSort=getSort&"<li><a href='photo.asp?typeid="&rs("id")&"'>"&rs("name")&"("&rsss("C")&")</a></li>"
rsss.close
Set rsss=Nothing
rs.movenext
loop
end if
rs.close
Set rs=Nothing
end Function
%>
<!-- <%=RunTime()%>ms --><%
set wConn=nothing
'If Err.Number<>0 then
' Call ShowError(0)
'End If
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -