📄 p_show.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<%
'=========================================================
' File: p_show.asp
' Date: 2006-04-06
' Script Written by Leibo
'=========================================================
' Copyright (C) 2002,2008 Mathren.com. All rights reserved.
' Web: http://www.hrbyydz.com
' Email: qa_90@hotmail.com
'=========================================================
stats="浏览照片"
dim picid,classname,id,viewid
dim currentPage,totalrec,Pcount,page_count,endpage
dim abgcolor
dim Photonum,filename,filesize,picset,classid,addtime,postuser,postuserid,picinfo,hits
if Cint(GroupSetting(18))=1 then
Errmsg=Errmsg+"<br>"+"<li>您没有查看班级相册中的照片的权限,请<a href=login.asp>登陆</a>或者同管理员联系。"
founderr=true
end if
if request("id")="" then
Errmsg=Errmsg+"<br>"+"<li>请选定相应的照片。"
founderr=true
elseif not isInteger(request("id")) then
Errmsg=Errmsg+"<br>"+"<li>非法的照片参数。"
founderr=true
else
viewid=request("id")
end if
if founderr then
call head()
call head_var("错误信息",Request.ServerVariables("HTTP_REFERER"))
call txl_error()
else
conn.execute("update imgdata set hits=hits+1 where picid="&viewid)
sql="select filename,filesize,picset,classid,addtime,postuser,postuserid,picinfo,hits from imgdata where picid="&viewid
set rs=conn.execute(sql)
if not(rs.bof and rs.eof) then
if rs(2)=2 then
ErrMsg=ErrMsg+"<br>"+"<li>该照片已经被管理员删除!</li>"
founderr=true
elseif rs(2)=1 and guest=true then
ErrMsg=ErrMsg+"<br>"+"<li>你没有浏览该照片的权限!</li>"
founderr=true
end if
filename=rs(0)
filesize=rs(1)
classid=rs(3)
addtime=rs(4)
postuser=rs(5)
postuserid=rs(6)
picinfo=rs(7)
hits=rs(8)
else
ErrMsg=ErrMsg+"<br>"+"<li>您指定的照片不存在</li>"
founderr=true
end if
set rs=nothing
call head()
call head_var("班级相册","p_index.asp")
if founderr then
call txl_error()
else
if request("action")="add" then
call save()
else
call main()
end if
if founderr then call txl_error()
end if
end if
call foot()
sub main()
abgcolor="tablebody2"
%>
<table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">
<tr>
<td width=450 bgcolor=<%=txl_body(10)%> valign=top><br>
<table cellpadding=0 cellspacing=0 style="BORDER: <%=txl_body(21)%> 4px solid" align=center width=400>
<tr>
<td align=center><a href=<%=txl_info(12)&filename%> target=_blank><img src=<%=txl_info(12)&filename%> border=0 width=400></a></td>
</tr>
</table><br>
</td>
<td width=* bgcolor=<%=txl_body(10)%> valign=top><br>
<table cellpadding=0 cellspacing=0 border=0 width=100% align=center>
<tr>
<td valign=top><img src=images/p01.gif></td>
</tr>
<tr>
<td>
<table cellpadding=0 cellspacing=0 border=0 width=100%>
<tr>
<td height=25>上 传 人: <%=postuser%></td>
</tr>
<tr>
<td height=25>上传时间: <%=addtime%></td>
</tr>
<tr>
<td height=25>点击次数: <%=hits%> 次</td>
</tr>
<tr>
<td height=25>照片简介: <%=picinfo%></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign=top height=25><img src=images/p02.gif></td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from imgsay where picid="&viewid
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.write"<tr><td align=center height=25 class=tablebody2>还没有人评论!</td></tr>"
end if
do while not rs.eof
%>
<tr>
<td height=25 class=tablebody2> <img src=images/dot04.gif> <font color=<%=txl_body(20)%>><%=rs("postuser")%></font> 于 <font color=<%=txl_body(20)%>><%=rs("addtime")%></font> 留言</td>
</tr>
<tr>
<td height=25 class=tablebody1><%=rs("content")%></td>
</tr>
<%
rs.movenext
loop
rs.close
%>
<tr>
<td valign=top height=25><img src=images/p03.gif></td>
</tr>
<tr>
<td>
<TABLE width=100% cellSpacing=0 cellPadding=3 align=center>
<form action="p_show.asp?action=add&id=<%=viewid%>" method="post">
<input type="hidden" name=picid value="<%=viewid%>">
<tr>
<td align=center><TEXTAREA style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 9pt; OVERFLOW: auto; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; BACKGROUND-COLOR: white" name=content rows=4 cols=60></TEXTAREA> </td>
</tr>
<tr>
<td align=center><input type="submit" class=input1 value="发表"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
sub save()
dim picid,content
picid=trim(request.form("picid"))
Content=Checkstr(request.form("Content"))
if Content="" then
FoundErr=True
ErrMsg=ErrMsg+"<Br>"+"<li>发表的评论不应为空。"
elseif Len(Content)>50 then
FoundErr=True
ErrMsg=ErrMsg+"<Br>"+"<li>发表评论的字数不能超过50"
end if
if founderr=true then
call error(errmsg)
exit sub
else
set rs=server.createobject("adodb.recordset")
sql="Select * from imgsay where (sayid is null)"
rs.open sql,conn,1,3
rs.addnew
rs("postuser")=membername
rs("picid")=picid
rs("content")=content
rs("addtime")=now()
rs.update
rs.close
set rs=nothing
Response.Redirect "p_show.asp?id="&viewid
end if
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -