📄 user_pic.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="user_check.asp"-->
<!--#include file="inc/function.asp"-->
<%
dim ID,Action
action=trim(request("action"))
ID=trim(Request("ID"))
set rs=conn.execute("select lost_money from myweb_const where id=1")
lost_money=rs(0)
rs.close
%>
<html>
<head>
<title>木叶村免费个人主页http://www.x92.cn</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="木叶村网免费个人主页http://www.x92.cn">
<meta name="description" content="木叶村网免费个人主页http://www.x92.cn">
<link rel="stylesheet" href="admin/Admin_STYLE.CSS">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="bgcolor">
<div align="center">
<table width="100%" border="0" cellpadding="2" cellspacing="1" Class="border">
<tr class="topbg">
<td height="24" align=center class="title"><strong style="font-weight: 400">
<font color="#000000">网 站 图 片 管 理</font></strong></td>
</tr>
<tr class="tdbg">
<td width="787">栏目导航: <a href="user_pic.asp?action=add">添加图片</a> |
<a href="user_pic.asp">管理所有图片</a></td>
</tr>
</table>
</div>
<%if request("action")="" then%>
<table border="0" width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
<tr class="tdbg" >
<td class="title" height="24">
<p align="center"><font color="#000000">所 有 图 片 管 理</font></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td >
<p align="left">
<table border=0 cellspacing=0 cellpadding=3 align=center width="165">
<%
dim rs
dim sql
dim row,msg_per_page,therow,n,i,j,EndPage,currentpage,totalrec,rowcount,isorno
msg_per_page = 20
set rs=server.createobject("adodb.recordset")
sql="select * from myweb_pic where userid="&session("userid")&" order by id DESC"
rs.cursorlocation = 3
rs.pagesize = msg_per_page
rs.open sql,conn,0,1
if err.number<>0 then
response.write "数据库操作失败:" & err.description
err.clear
else
if not (rs.eof and rs.bof) then
totalrec = RS.RecordCount
if rs.recordcount mod msg_per_page = 0 then
n = rs.recordcount\msg_per_page
else
n = rs.recordcount\msg_per_page+1
end if
currentpage = request("page")
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage < 1 then
currentpage = 1
end if
if err.number <> 0 then
err.clear
currentpage = 1
end if
else
currentpage = 1
End if
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then
currentPage=1
end if
rs.absolutepage = currentpage
rowcount = rs.pagesize
while not rs.eof and rowcount>0
if therow mod 5 = 0 then
response.write("<tr>")
end if
%>
<td align=center width=159 height=60>
<table width=144 height=102 cellspacing=1 cellpadding=0 class="border">
<tr class="tdbg" >
<td width="140" align=center class="topbg" height="21"><%=left(rs("picname"),10)%> <tr bgcolor=#ffffff height=40>
<td align=center bgcolor="#DFE2D6" height="56">
<img src="<%=rs("picurl")%>" border=0 alt="<%=rs("picname")%>" width=120 height=120>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td height="17" align=center bgcolor="#DFE2D6" class="topbg">
<a href="user_pic.asp?id=<%=rs("id")%>&action=modif">编辑</a>
<a href="user_pic.asp?id=<%=rs("id")%>&action=del" <%="onclick='return confirm(""是否真的要删除?"");'"%>>删除</a> </table>
<%
therow=therow+1
rowcount=rowcount-1
rs.MoveNext
wend
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
if therow mod 6<>0 then
for i=1 to 6-(therow mod 6)
response.write("<td width=110> ")
next
end if
%>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">
<%call listPages()%>
</td>
</tr>
</table>
<%
sub listPages()
for i=0 to n\msg_per_page-1
for j=1 to msg_per_page
%>
<b> <a href="<%=request.ServerVariables("script_name")%>?page=<%=i*msg_per_page+j %>">[
<% =i*msg_per_page+j %>
]</a></b></font>
<%
next
next
EndPage = n mod msg_per_page
for j=1 to EndPage
%>
<b> <a href="<%=request.ServerVariables("script_name")%>?page=<% =i*msg_per_page+j %>">[
<% =i*msg_per_page+j %>
]</a></b>
<%next%>
<%if not totalrec=0 then%>
当前页:<b><%=currentpage%> <%=msg_per_page%></b>个网站/页 总网站数:<b><%=totalrec%></b>
<%else
response.write("<div align=center>没有图片</div>")
end if%>
<%end sub%> </td>
</tr>
</table>
<%end if%>
<%if request("action")="add" then%>
<form action=user_pic.asp?action=addpic method=post name="postart" onSubmit="submits();">
<table border="0" width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
<tr class="tdbg" >
<td class="topbg" colspan="2">
<p align="center"><font color="#000000">添 加 </font>图 片</td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
图片标题:</td>
<td width="76%" >
<input type="text" name="picname" maxlength=50 size="59"> </td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
图片发布:</td>
<td width="76%" >
<input type="text" name="picwrite" maxlength=10 size="20" value="<%=session("ty_username")%>"></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
图片地址:</td>
<td width="76%" >
<input type="text" name="pic" maxlength=200 size="59"><font color="#FF0000">请正确填写路径否则无法正常显示
</font><IFRAME src="upphoto.asp" frameBorder=0 width="49%" scrolling=no height=26 name="I1" align="left"></IFRAME></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
是否推荐:</td>
<td width="76%" >
<input type="radio" value="true" name="picnice">是
<input type="radio" value="false" name="picnice" checked>
否
(选择是就可以在主站显示,这样就可以增加主页的访问量了。)</td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
图片简介:</td>
<td width="76%" >
<input type=hidden name="content" id='edit' value=""><!--#include file="edit.asp"--></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td colspan="2" >
<p align="center"><input type=submit value="添 加" </td></td>
</tr>
</table>
</form>
<%end if%>
<%if request("action")="addpic" then%>
<br>
<table border="0" width="60%" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border" height="56">
<tr class="tdbg" >
<td height="24" class="title">
<p align="center"><font color="#000000">系 统 信 息 提 示</font></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td >
<%dim picname,picwrite,pictimes,picnice,content,pic,erroradd
picname=trim(request.form("picname"))
picwrite=trim(request.form("picwrite"))
pic=trim(request.form("pic"))
picnice=trim(request.form("picnice"))
content=trim(request.form("content"))
if picname="" then
erroradd=erroradd+"<br><li>图片标题不能为空</li>"
end if
if picwrite="" then
erroradd=erroradd+"<br><li>图片作者不能为空</li>"
end if
if pic="" then
erroradd=erroradd+"<br><li>图片地址不能为空</li>"
end if
if content="" then
erroradd=erroradd+"<br><li>图片内容不能为空</li>"
end if
set rs=conn.execute("select money from myweb_user where userid="&session("userid")&"")
money=rs(0)
if money<lost_money then
erroradd=erroradd+"<br><li>您的帐户余额已经不足,请尽快充值</li>"
end if
if erroradd="" then
set rs=server.CreateObject("adodb.recordset")
sql="select picname,picwrite,pictimes,picurl,picnice,content,userid from myweb_pic "
rs.open sql,conn,1,3
rs.addnew
rs("picname")=HTMLEncode(left(picname,50))
rs("picwrite")=HTMLEncode(left(picwrite,10))
rs("picurl")=pic
rs("picnice")=picnice
rs("content")=content
rs("userid")=session("userid")
rs.update
conn.execute("update [myweb_user] set count_pic=count_pic+1 where userid="&session("userid")&"")
'添加财务信息
conn.execute("Insert into [myweb_money] (userid,content) values ("&session("userid")&",'发布图片,消费货币:<font color=red>"&lost_money&"</font>') ")
set addrs=server.CreateObject("adodb.recordset")
sql1="select money from [myweb_user] where userid="&session("userid")&""
addrs.open sql1,conn,1,3
addrs.update
addrs(0)=addrs(0)-lost_money
addrs.update
addrs.close
response.redirect"user_pic.asp"
rs.close
set rs=nothing
else
response.write"<li><font color=red>系统处理结果如下</font></li>"&erroradd&"<br> <center> <a href=javascript:history.go(-1)><font color=red>返回</font></a></center>"
end if
%>
</td>
</tr>
</table>
<%end if%>
<%if request("action")="modif" then%>
<%set rs=conn.execute("select id,picname,picwrite,pictimes,picurl,picnice,content from myweb_pic where id="&id&"")%>
<form action=user_pic.asp?action=edit&id=<%=rs("id")%> method=post onSubmit="submits();">
<table border="0" width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
<tr class="tdbg" >
<td class="topbg" colspan="2">
<p align="center"><font color="#000000">修 改 图 片 信 息</font></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
图片标题:</td>
<td width="76%" >
<input type="text" name="picname1" maxlength=50 size="59" value="<%=rs("picname")%>"></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
图片发布:</td>
<td width="76%" >
<input type="text" name="picwrite1" maxlength=10 size="20" value="<%=rs("picwrite")%>">
</td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
图片地址:</td>
<td width="76%" >
<input type="text" name="picurl1" maxlength=200 size="59" value="<%=rs("picurl")%>"></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
是否推荐:</td>
<td width="76%" >
<input type="radio" value="true" name="nice1" <%if rs("picnice")=true then response.write"checked" end if%>>是
<input type="radio" value="false" name="nice1" <%if rs("picnice")=false then response.write"checked" end if%> >
否
(选择是就可以在主站显示,这样就可以增加主页的访问量了。)</td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
图片简介:</td>
<td width="76%" >
<input type=hidden name="content1" id='edit' value="<%
response.Write Server.HtmlEncode(rs("content"))
%>"><!--#include file="edit.asp"-->
</td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td colspan="2" >
<p align="center"><input type=submit value="修 改" </td></td>
</tr>
</table>
</form>
<%rs.close%>
<%end if%>
<%if request("action")="edit" then%>
<br>
<table border="0" width="60%" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border" height="56">
<tr class="tdbg" >
<td height="24" class="title">
<p align="center"><font color="#000000">系 统 信 息 提 示</font></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td >
<%dim picname1,picwrite1,pictimes1,nice1,content1,picurl1,erroredit
picname1=trim(request.form("picname1"))
picwrite1=trim(request.form("picwrite1"))
picurl1=trim(request.form("picurl1"))
nice1=trim(request.form("nice1"))
content1=trim(request.form("content1"))
if picname1="" then
erroredit=erroredit+"<br><li>图片标题不能为空</li>"
end if
if picwrite1="" then
erroredit=erroredit+"<br><li>图片作者不能为空</li>"
end if
if picurl1="" then
erroredit=erroredit+"<br><li>图片地址不能为空</li>"
end if
if content1="" then
erroredit=erroredit+"<br><li>图片内容不能为空</li>"
end if
if erroredit="" then
set rs=server.CreateObject("adodb.recordset")
sql="select id,picname,picwrite,pictimes,picurl,picnice,content from myweb_pic where userid="&session("userid")&" and id="&id&" "
rs.open sql,conn,1,3
rs.update
rs("picname")=HTMLEncode(left(picname1,50))
rs("picwrite")=HTMLEncode(left(picwrite1,10))
rs("picurl")=picurl1
rs("picnice")=nice1
rs("content")=content1
rs.update
response.write"<li><font color=red>系统处理结果如下</font></li><br><li>图片信息修改成功 </li><br> <center><a href=user_pic.asp><font color=red>返回</font></a></center>"
rs.close
set rs=nothing
else
response.write"<li><font color=red>系统处理结果如下</font></li>"&erroredit&"<br> <center> <a href=javascript:history.go(-1)><font color=red>返回重写</font></a></center>"
end if
%>
</td>
</tr>
</table>
<%end if%>
<%if request("action")="del" then
sql="delete from [myweb_pic] where userid="&session("userid")&" and ID=" & CLng(ID)
Conn.Execute sql
conn.execute("update [myweb_user] set count_pic=count_pic-1 where userid="&session("userid")&"")
response.redirect"user_pic.asp"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -