⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zhuanti.asp

📁 以朱朱相册为程序原型整合开发winds相册
💻 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" -->

<%

dim typename,classid,classname,pl,hot
if IsNumeric(Request.QueryString("typeid"))=False then
Response.Redirect"info.asp?info=错误的参数"
else
typeid=cint(Request.QueryString("typeid"))
end if
if Request.QueryString("mo") <>"" and IsNumeric(Request.QueryString("mo"))=False then
Response.Redirect"info.asp?info=错误的参数"
else
if Request.QueryString("mo") <>"" then
mo=cint(Request.QueryString("mo"))
end If
end if
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
set temprs=wConn.execute("select name,pl,hot,data,time1,js,music,pass,view from zhuanti where id="&typeid) 
if temprs.eof or temprs.bof then 
Response.Redirect"info.asp?info=该专题不存在"
response.end
end if
if temprs(8)=true and mo=0 then
Response.Redirect"zhuanti.asp?typeid="&typeid&"&mo=1"
end if
typename=temprs(0)
if temprs(1)="" OR IsNULL(temprs(1))=true then
	pl ="0"
	else
	pl=temprs(1)
	end if
hot=temprs(2)
data=temprs(3)
data1=temprs(4)
js=temprs(5)
ms=temprs(6)
p=temprs(7)
set temprs=nothing
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from zhuanti where id="&typeid
Set rs = Server.CreateObject("ADODB.Recordset")
rs.OPEN sql,wConn,1,3
ps=Rs("pass")
if Rs("hot")="" OR IsNULL(Rs("hot"))=true then
	Rs("hot") ="1"
	else
	Rs("hot") = Rs("hot")+1
	end if
rs.update
Rs.close
set Rs = nothing
%>

<%
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 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()
GetPhoto="<div class='post'>"
'判断是否密码
pss=Request.cookies("'"&typeid&"'")
if len(ps)<>0 then
	if pss<>ps then
	GetPhoto=GetPhoto&"<span style='color:#808000;font-size:14px;'>该相册是一个非共享文件夹,请提供查看通行证:</a></span><form name='form' method='post' action='pass.asp?typeid="&typeid&"'><input type='password' name='pase'><input type='submit' name='Submit' value='确定'></form></div>"
	exit function //中止function
	end if
end if
'取得专题信息
sqlo="select id from desktop where zhuanti="&typeid&" order by id asc"
Set rso=Server.CreateObject("ADODB.RecordSet")
rso.open sqlo,wconn,1,1
if rso.eof or rso.bof then 
sm=0
else
sm=rso.RecordCount
end if
rso.close
set rso=Nothing
'统计
GetPhoto=GetPhoto&"<table cellpadding='0' cellspacing='0' width='100%' height='50' align='center'><tr><td>本专题共有"&sm&"张照片</td><td align='right'><a href='zhuanti.asp?typeid="&typeid&"&mo=2'>以缩图形式查看</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href='zhuanti.asp?typeid="&typeid&"&mo=1'>以列表形式查看</a></td></tr></table>"
'日期
GetPhoto=GetPhoto&"<table cellpadding='0' cellspacing='0' width='90%' height='70' align='center'>"
GetPhoto=GetPhoto&"<tr align='left'><td colspan=3 style='BORDER-RIGHT: 1px solid #999; BORDER-TOP: 1px solid #999; BORDER-LEFT: 1px solid #999; BORDER-BOTTOM: 0px solid #999;font-weight:bold;font-size:14px;'>&nbsp;&nbsp;"&typename&"&nbsp;&nbsp;<span style='font-size:12px;'>浏览</span></td></tr>"
GetPhoto=GetPhoto&"<tr align='left'><td style='BORDER-RIGHT: 1px solid #999; BORDER-TOP: 1px solid #999; BORDER-LEFT: 1px solid #999; BORDER-BOTTOM: 1px solid #999' width='43%'>发布日期:"&data1&"(浏览:"&hot&")</td>"
GetPhoto=GetPhoto&"<td style='BORDER-RIGHT: 1px solid #999; BORDER-TOP: 1px solid #999; BORDER-LEFT: 0px solid #999; BORDER-BOTTOM: 1px solid #999' width='32%'>拍摄日期:"&data&"</td>"
GetPhoto=GetPhoto&"<td style='BORDER-RIGHT: 1px solid #999; BORDER-TOP: 1px solid #999; BORDER-LEFT: 0px solid #999; BORDER-BOTTOM: 1px solid #999' width='24%'><font face='webdings'>4</font>"
if p<>"" then
GetPhoto=GetPhoto&"<font color=red>需权限浏览</font>"
else
GetPhoto=GetPhoto&"共享相册"
end If
GetPhoto=GetPhoto&"</td></tr></table>"
'介绍
if js>"" Then
GetPhoto=GetPhoto&"<div align='center' style='margin-top:20px'><table cellSpacing='1' cellPadding='0' align='center' bgColor='#e1e1e1' border='0' width='80%'><tr><td bgColor='#ffffff'><table cellSpacing='1' cellPadding='0' bgColor='#d7d7d7' border='0' width='100%'><tr><td bgColor='#ffffff'><table cellSpacing='1' cellPadding='0' bgColor='#b2b2b2' border='0' width='100%'><tr><td bgColor='#ffffff'><table cellSpacing='0' cellPadding='8' width='100%' border='0'><tr><td>"&js&"</td></tr></table></td></tr></table></td></tr></table></td></tr></table></div>"
End if
'相片
GetPhoto=GetPhoto&"<table width='100%'  border='0' cellspacing='0' cellpadding='8'><tr><td align='center' valign='top'>"
if mo<>1 then
	GetPhoto=GetPhoto&"<table width='100%' border='0' cellspacing='0' cellpadding='5'>"

	Dim ipagecount
	Dim ipagecurrent
	Dim strorderBy
	Dim irecordsshown
	if request.querystring("page")="" then
		ipagecurrent=1
	else
		ipagecurrent=cint(request.querystring("page"))
	end if
	sql = "SELECT surl,ck,name,id FROM desktop where zhuanti="&typeid&" ORDER BY id aSC"
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.pagesize = 30
	rs.cachesize = 30
	rs.open sql,wConn,1,1
	ipagecount = rs.pagecount
	If ipagecurrent > ipagecount Then ipagecurrent = ipagecount
	If ipagecurrent < 1 Then ipagecurrent = 1
	if ipagecount=0 then
		GetPhoto=GetPhoto&"<tr><td align='center'>没有任何文件</tr></td>"
	else
		rs.absolutepage = ipagecurrent
		irecordsshown = 0
		do while irecordsshown<30 and NOT rs.EOF
		GetPhoto=GetPhoto&"<tr align='center'>"
		GetPhoto=GetPhoto&"<td width='25%'>"
		if not rs.eof then
			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='display.asp?id="&rs("id")&"' target='_blank'><img src='plugin/windsphoto/"&rs("surl")&"' border='0' class='bk'></a></td></tbody></table></tr></td></tbody></table><br><a href='display.asp?id="&rs("id")&"' target='_blank'>"&rs("name")&"</a></td></td>"
			irecordsshown = irecordsshown +1
			rs.movenext
		end if

		GetPhoto=GetPhoto&"<td width='25%'>"
		if not rs.eof then
			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='display.asp?id="&rs("id")&"' target='_blank'><img src='plugin/windsphoto/"&rs("surl")&"' border='0' class='bk'></a></td></tbody></table></tr></td></tbody></table><br><a href='display.asp?id="&rs("id")&"' target='_blank'>"&rs("name")&"</a></td></td>"
			irecordsshown = irecordsshown +1
			rs.movenext
		end if

		GetPhoto=GetPhoto&"<td width='25%'>"
		if not rs.eof then
			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='display.asp?id="&rs("id")&"' target='_blank'><img src='plugin/windsphoto/"&rs("surl")&"' border='0' class='bk'></a></td></tbody></table></tr></td></tbody></table><br><a href='display.asp?id="&rs("id")&"' target='_blank'>"&rs("name")&"</a></td></td>"
			irecordsshown = irecordsshown +1
			rs.movenext
		end if

		GetPhoto=GetPhoto&"<td width='25%'>"
		if not rs.eof then
			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='display.asp?id="&rs("id")&"' target='_blank'><img src='plugin/windsphoto/"&rs("surl")&"' border='0' class='bk'></a></td></tbody></table></tr></td></tbody></table><br><a href='display.asp?id="&rs("id")&"' target='_blank'>"&rs("name")&"</a></td></td>"
			irecordsshown = irecordsshown +1
			rs.movenext
		end if

		GetPhoto=GetPhoto&"</tr>"
	loop
	end If
	GetPhoto=GetPhoto&"</table></tr></table></div>"
	if ipagecount >1 then
	GetPhoto=GetPhoto&"<div class='post pagebar'>每页显示30个文件&nbsp;&nbsp;共有"&ipagecount&"页&nbsp;&nbsp;当前为第"&ipagecurrent&"页&nbsp;&nbsp;"
	if ipagecurrent=1 then
	GetPhoto=GetPhoto&"&nbsp;&nbsp;首页&nbsp;&nbsp;"
	else
	GetPhoto=GetPhoto&"&nbsp;&nbsp;<a href='zhuanti.asp?typeid="&typeid&"&mo="&request.querystring("mo")&"&page=1'>首页</a>&nbsp;&nbsp;"
	end if
	if ipagecurrent=1 then
	GetPhoto=GetPhoto&"&nbsp;&nbsp;上一页&nbsp;&nbsp;"
	else
	GetPhoto=GetPhoto&"&nbsp;&nbsp;<a href='zhuanti.asp?typeid="&typeid&"&mo="&request.querystring("mo")&"&page="&ipagecurrent-1&"'>上一页</a>&nbsp;&nbsp;"
	end if
	if ipagecount>ipagecurrent then
	GetPhoto=GetPhoto&"&nbsp;&nbsp;<a href='zhuanti.asp?typeid="&typeid&"&mo="&request.querystring("mo")&"&page="&ipagecurrent+1&"'>下一页</a>&nbsp;&nbsp;"
	else
	GetPhoto=GetPhoto&"&nbsp;&nbsp;下一页&nbsp;&nbsp;"
	end if
	if ipagecount>ipagecurrent then
	GetPhoto=GetPhoto&"&nbsp;&nbsp;<a href='zhuanti.asp?typeid="&typeid&"&mo="&request.querystring("mo")&"&page="&ipagecount&"'>末页</a>"
	else
	GetPhoto=GetPhoto&"&nbsp;&nbsp;末页"
	end if
	GetPhoto=GetPhoto&"</div>"
	rs.Close
	set rs=nothing
	end If

else

GetPhoto=GetPhoto&"<table width='99%' border='0' cellspacing='0' cellpadding='5'>"
sql = "SELECT url,ck,name,id,jj FROM desktop where zhuanti="&typeid&" ORDER BY id aSC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,wConn,1,1
ipagecount = rs.pagecount
If ipagecurrent > ipagecount Then ipagecurrent = ipagecount
If ipagecurrent < 1 Then ipagecurrent = 1
if ipagecount=0 then
GetPhoto=GetPhoto&"<tr align='center'><td>没有任何文件</td></tr>"
else
do while NOT rs.EOF
GetPhoto=GetPhoto&"<tr align='center'><td>"
GetPhoto=GetPhoto&"<table width='20%' border=0 align='center' cellpadding='0' cellspacing='10'><tr><td><table cellspacing=1 cellpadding=0 align=center bgcolor=#e1e1e1 border=0><tbody><tr><td bgcolor=#ffffff><table cellspacing=1 cellpadding=0 bgcolor=#d7d7d7 border=0><tbody><tr><td bgcolor=#ffffff><table cellspacing=1 cellpadding=0 bgcolor=#b2b2b2 border=0><tbody><tr><td bgcolor=#ffffff><table cellspacing=0 cellpadding=8 width='100%' border=0><tbody><tr><td><table cellspacing=0 cellpadding=1 width='100%' border=0><tbody><tr><td align=middle bgcolor=#808080><img alt='"&rs("name")&"' src='plugin/windsphoto/"&rs("url")&"' align=middle border=0 onload='javascript:if(this.width>718)this.width=715'></td></tr></tbody></table></td></tr></tbody></table>"
if rs("jj")>"" Then
GetPhoto=GetPhoto&"<table height=35 cellspacing=0 width='97%' align=center border=0><tbody><tr><td valign='middle'><span style='color:#000'>"&rs("jj")&"</span></td></tr></tbody></table>" 
end if
GetPhoto=GetPhoto&"</td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></table></td></tr>"
rs.movenext
loop
end if 
GetPhoto=GetPhoto&"</table></td></tr></table></div>"
end if 
rs.Close
set rs=nothing
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 --><%
wConn.Close
set wConn=nothing
'If Err.Number<>0 then
'	Call ShowError(0)
'End If
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -