📄 photo_show.asp
字号:
<!--#include file=INC/skin.asp-->
<%
dim const_txl_HomeUrl,errstr,i,page
errstr=""
const_txl_HomeUrl=""
OpenDatabase
txl_SiteHead const_txlname&"-手机相册"
call online
call main
CloseDatabase
web_end
sub main
If const_photo_login_limit=1 Then '手机相册登录查看限制
If session("username")="" Then
errstr="<li>当前Wap影音状态已经设置为<font color=red>手机相册只有登录之后才能看到</font>!</li>"
errstr=errstr&"<li>你现在还没有登录或者会话超时,点<a href='user_login.asp'>这里登录</a>!</li>"
errstr=errstr&"<li>如果还有疑问请与管理员联系!</li>"
Call printerror("浏览手机相册出错!",errstr,779)
Exit Sub
End If
ElseIf const_photo_login_limit=2 Then
If session("username")="" Then
errstr="<li>当前Wap影音状态已经设置为<font color=red>手机相册只有影音成员和嘉宾有查看权限</font>!</li>"
errstr=errstr&"<li>你现在还没有登录或者会话超时,点<a href='user_login.asp'>这里登录</a>!</li>"
errstr=errstr&"<li>如果还有疑问请与管理员联系!</li>"
Call printerror("查看手机相册出错!",errstr,779)
Exit Sub
End If
If not (session("usertype")=3 or session("usertype")=4) Then
errstr="<li>当前Wap影音状态已经设置为<font color=red>手机相册只有影音成员和嘉宾有查看权限</font>!</li>"
errstr=errstr&"<li>你目前的身份没有该权限!</li>"
errstr=errstr&"<li>如果还有疑问请与管理员联系!</li>"
Call printerror("查看手机相册出错!",errstr,779)
Exit Sub
End If
End If
If Request.QueryString("action")="del" Then
Call del
ElseIf Request.QueryString("action")="Isok" Then
Call Isok
Else
Call showphoto
End If
end sub%>
<%Sub showphoto
Dim rs,sql,ss
set rs=Server.CreateObject("Adodb.Recordset")
if Request.QueryString("action")=1 and Session("adminname")<>"" then
sql="select photo.*,ec.studentid,sname from photo,ec where Isok=0 and ec.studentid=photo.username order by LastUpdateTime desc,picid desc"
else
sql="select photo.*,ec.studentid,sname from photo,ec where Isok=1 and ec.studentid=photo.username order by LastUpdateTime desc,picid desc"
end if
rs.open sql,conn,1
dim RecordCount2,LinkFile,displaypagenum,PageSize2,k,PageCount2
page=Request.QueryString("page")
if page="" or (not isnumeric(page)) Then
page=1
end if
page=Cint(page)
RecordCount2=rs.recordcount
LinkFile="?"
displaypagenum=15
pagesize2=15
rs.pagesize=PageSize2
PageCount2=rs.pagecount
If not rs.eof then
rs.absolutepage=page
end if
i=0
%>
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {color: #0000FF}
-->
</style>
<table width="779" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td background="" style="padding:5px;vertical-align:top; ">
<table width="100%" border="0" cellpadding="0" cellspacing="8">
<tr>
<td class="rig1"><b>网站导航:</b><a href="<%=const_homepageurl%>">首页</a>
>> <a href="<%=const_txl_HomeUrl&const_txlurl%>"><%=const_txlname%></a>
>> <a href="photo_show.asp">手机相册</a>
</td></tr>
</table>
<table width="100%" bgcolor="#FFFFFF" border="0" cellspacing="8" cellpadding="0" style="margin-bottom:5px;border:#666666 1px solid;">
<tr><td style="line-height:1.8;">
·<b>请注意:</b> 上传的照片<span class="style1">只可以向管理员申请删除</span>。<br>
·<b>我要上传照片</b> <a href="#pub">点击此处上传照片</a> <%if Session("adminname")<>""then%><a href="?action=1&Isok=0">未批准的文件</a><%end if%>
</td>
</tr>
<tr>
<td class="rig1"><%=ShowPage(PageCount2,RecordCount2,page,PageSize2,LinkFile,displaypagenum) %>
</td>
</tr>
</table>
<%
dim trflag,trflag2,clos
clos=5 '每行4列
k=0
ss=RecordCount2
if ss>0 then
Response.Write"<table width=""769"" align=""center"" border=""1"" cellspacing=""0"" cellpadding=""1"" bordercolor=""#666666"" bgcolor=""#FFFFFF"" style=""border-collapse:collapse;text-align:center;line-height:1.5;font-family:Verdana;"">"
while k<ss and i<pagesize2 and not rs.eof
i=i+1
trflag=false
trflag2=false
if k mod 5=0 then trflag=true
if trflag then Response.Write("<tr>")
Response.Write("<td width=149>")
%>
<table width="149" border="0" cellpadding="0" cellspacing="0" style="font-family:Verdana, Arial, Helvetica, sans-serif;">
<tr>
<td height="91" style="padding:8px;" align="center"> <a href="photo_view.asp?picid=<%=rs("picid")%>">
<%If Lcase(rs("PhotoFormat"))=".swf" Then
Response.Write "<embed width='120' height='160' src='"&const_txl_HomeUrl&const_photoup_path&rs("pic")&"' align='center'>"
Else%>
<img src="<%=const_txl_HomeUrl&const_photoup_path&rs("pic")%>" alt="<%=rs("LastUpdateInfo")%>" width="100" height="120" border="0" style="border:#cccccc 1px solid;">
<%End IF%>
</a> </td>
</tr>
<tr>
<td align="center" style="padding:5px;"><b><a href="photo_view.asp?picid=<%=rs("picid")%>" title="<%=rs("LastUpdateInfo")%>"><%=rs("subject")%></a></b><span class="small"> (<%= rs("liuyanshu")&"/"&rs("dianji")%>) </span>
</td>
</tr>
<tr>
<td align="center" style="padding-bottom:8px;"><%=rs("sname")%>
<%if Session("adminname")<>""then%>
[<a href="?action=del&picid=<%=rs("picid")%>" title="删除照片,管理员和上传者有权限" onclick="return confirm('这个操作将删除这个照片以及下面相关的回复留言\n 你确定吗?');">删除</a>
<%if rs("Isok")=0 then%>
<a href="?action=Isok&ok=1&id=<%=rs("picid")%>">显示</a>
<%else%>
<a href="?action=Isok&ok=0&id=<%=rs("picid")%>">隐藏</a>
<%end if%>]
<%end if%>
</td>
</tr>
<!-- <%=rs("PhotoSize")&"KB"%><br> -->
</table>
<%
Response.Write("</td>")
rs.movenext
k=k+1
if k mod clos=0 then trflag2=true
if trflag2 then Response.Write("</tr>")
wend
if ss mod clos<>0 then
for k=1 to (clos-ss mod clos)
Response.Write("<td> </td>")
next
Response.Write("</tr>")
end if
Response.Write("</table>")
end if
rs.close
set rs=nothing
%>
<table width="100%" border="0" cellspacing="0" cellpadding="8" style="margin-top:5px;margin-bottom:5px;">
<tr>
<td class="rig1"><%=ShowPage(PageCount2,RecordCount2,page,PageSize2,LinkFile,displaypagenum) %></td>
</tr>
</table>
<script>
submitflag=false
function check_Csk3000_form(Csk3000_frm)
{
//Csk3000编写
if (Csk3000_frm.intro.value==""){
alert("请输入简短的说明!");
Csk3000_frm.intro.focus();
return false
}
if (Csk3000_frm.file.value==""){
alert("请选择图片!");
Csk3000_frm.file.focus();
return false
}
if(!submitflag){
Csk3000_frm.submit();
Csk3000_frm.Submit.disabled=true
submitflag=true
return true
}
else
{
alert("请不要重复提交");
return false;
}
}
</script>
<form action="photo_upload.asp" method="post" enctype="multipart/form-data" name="form1" onsubmit="return check_Csk3000_form(this)">
<table width="100%" border="1" cellspacing="0" cellpadding="1" bordercolor="#666666" style="border-collapse:collapse;font-family:Verdana, Arial, Helvetica, sans-serif;">
<tr>
<td colspan="3" bgcolor="#F1F1F1" class="title">上载照片</td>
</tr>
<tr>
<td width="341" height="25" bgcolor="#F1F1F1" style="font-weight:bold;text-align:center;">注意事项:<img src="images/null.gif" id="preimg" name="preimg" onload="javascript:if(this.width>=200)this.width=200"><a name="pub"></a></td>
<td width="74" bgcolor="#FFFFFF" class="tar">提 供 :</td>
<td width="340" bgcolor="#FFFFFF" class="content"><%=Session("username")%>
</td>
</tr>
<tr>
<td rowspan="4" bgcolor="#Ffffff" style="padding-top:15px;line-height:1.5;padding-right:15px;"><ol>
<li> 请不要在此发布违法的照片。</li>
<li>仅接受<font color="#FF0000"><%=const_PhotoFormat%></font>格式的图片,大小不超过<font color="#FF0000"><%=const_PhotoMaxSize%>K</font>。</li>
</ol></td>
<td bgcolor="#F1F1F1" class="tar" >大 小 :</td>
<td bgcolor="#F1F1F1" class="content"><font color="#FF0000"><<%=const_PhotoMaxSize%>K</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="tar" >格 式 :</td>
<td bgcolor="#FFFFFF" style="padding-left:7px; padding-right:3px;line-height:1.5;"><font color="#FF0000"><%=const_PhotoFormat%></font></td>
</tr>
<tr>
<td bgcolor="#F1F1F1" class="tar">说 明 : </td>
<td bgcolor="#F1F1F1" style="padding-left:7px; padding-right:3px;line-height:1.5;"><input name="intro" type="text" id="intro" size="30" maxlength="50"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="tar">浏 览 : </td>
<td bgcolor="#FFFFFF" style="padding-left:7px; padding-right:3px;line-height:1.5;"><input type="file" name="filexx"></td>
</tr>
<tr align="center">
<td height="30" colspan=3>如果你的图片文件较大或网络速度太慢,上载过程可能要一段时间,请耐心等待!</td>
</tr>
<tr>
<td height="40" colspan="3" bgcolor="#F1F1F1" align=center><input type="submit" name="Submit" value="开始上传"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%
End Sub
Sub del
If session("adminname")<>"" Then
dim limitflag,dealuser,picimgname,username,tmpstr
Dim rs,dellogid,picid,sql
picid=Request.QueryString("picid")
if picid="" or (not isnumeric(picid)) Then
Call printerror("删除相片出错"," <li>参数错误!</li>",779)
Exit Sub
end if
set rs=conn.execute ("select * from photo where picid="&picid)
IF rs.eof then
errstr="<li>不存在标号为"&picid&"的影音相片,该相片可能已经被删除</li>"
errstr=errstr&"<li>请选择<a href='photo_show.asp'手机相册</a>重新进入</li>"
Call printerror("读取相片出错",errstr,779)
exit sub
end if
picimgname=rs("pic")
limitflag=false
If session("adminname")<>"" Then
limitflag=true
dealuser="管理员"
End If
username=Session("username")
If rs("username")=username Then
limitflag=true
dealuser=username
end if
rs.close
set rs=nothing
If not(limitflag) Then
Call printerror ("删除相片出错!","<li>你没有操作该功能的权限!</li>",779)
exit sub
Else
If Request("queren")<>"true" Then
Response.write "<div align=center><br><font color=red>本操作正在删除照片,且不可恢复。你确实要进行该操作吗?<br>请点击下面的“确定”按钮继续执行操作,点击“取消”来撤消本次操作。</font><br><br>"
Response.write "<input type=button value='确定' onclick=""javascript:window.location.href='?action=del&picid="&picid&"&queren=true&url="&Request.ServerVariables("HTTP_REFERER")&"'""> <input type=button value='取消' onclick='javascript:history.back()'><br><br></div>"
Else
conn.Execute ("delete from photoforum where picid="&picid) '删除回复留言
conn.Execute ("delete from photo where picid="&picid) '删除相片
set rs=conn.execute ("select top 1 id from dellog order by id desc")
if rs.eof then
dellogid=1
else
dellogid=rs(0)+1
end if
sql="insert into dellog(id,sname,pic,deltime)values("
sql=sql&dellogid&",'"&dealuser&"','"&picimgname&"','"&now()&"')"
conn.execute (sql) '做删除记录
tmpstr="<li>已经成功删除标号为"&picid&"的照片,照片下面的回复帖也已经删除!</li>"
tmpstr=tmpstr&"<li>回<a href='photo_show.asp'>手机相册</a>!</li>"
tmpstr=tmpstr&"<li>回<a href='"&Request("url")&"'>"&Request("url")&"</a>!</li>"
Call printsuc("删除照片成功!",tmpstr,779)
End IF
End If
else
Call printerror ("删除相片出错!","<li>你没有操作该功能的权限!</li>",779)
end if
end sub
Sub Isok
Dim ID,Rs
ID = Trim(Request("id"))
If ID = "" OR (Not Isnumeric(ID)) Then
Call printerror ("出错","<li>ID传递错误!</li>",779)
Exit Sub
End IF
ID = Clng(ID)
If Session("username") = "" and Session("adminname") = "" Then
Call printerror ("出错","<li>无法鉴别您的身份,如果不是管理员,请先<a href='user_login.asp'>登录</a>!</li>",779)
Exit Sub
End IF
Set Rs = conn.execute("select * from photo where picID = "&ID)
If Rs.Eof Then
Call printerror ("出错","<li>记录不存在!</li>",779)
Rs.Close
Set Rs = Nothing
Exit Sub
End If
If Session("adminname") = "" Then
Call printerror ("出错","<li>你无权删除!</li>",779)
Exit Sub
End IF
Rs.Close
Set Rs = Nothing
conn.execute ("update photo set Isok="&Request("ok")&" where picid="&id)
Response.Redirect "photo_show.asp?action=1&Isok=0"
'Call printsuc("操作成功!","<li>操作成功!</li><li><a href='"&Request.ServerVariables("HTTP_REFERER")&"'>回刚页面</a></li>",779)
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -