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

📄 myweb_pic.asp

📁 源码源源码 源码 源码码源 码源 码源 码源 码
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="myweb_check.asp"-->
<%
dim ID,Action,userid
action=trim(request("action"))
ID=trim(Request("ID"))
userid=trim(Request("userid"))
set moneyrs=conn.execute("select add_money,lost_money from myweb_const where id=1")
addmoney=moneyrs("add_money")
lostmoney=moneyrs("lost_money")
moneyrs.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">栏目导航:&nbsp; 
		<a href="myweb_pic.asp">管理所有图片</a> <font color="#FF0000">说明</font>:&quot;设为网站图片&quot;则该图片可以在主站上显示,&quot;撤消网站图片&quot;则该图片不显示在主站上</td>
    </tr>
</table>
</div>
<%if request("action")="" then%>
<br>
<table border="0" width="100%"  cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border" height="49">
	<tr class="tdbg" >
		<td height="20" class="topbg" width="3%" align="center">
		<font color="#000000">ID</font></td>
		<td height="20" class="topbg" align="center" width="40%">
		<strong style="font-weight: 400">
	<font color="#000000">图片</font></strong>标题</td>
		<td height="20" class="topbg" align="center" width="12%">
		查看次数</td>
		<td height="20" class="topbg" align="center" width="10%">
		主站是否显示</td>
		<td height="20" class="topbg" align="center" width="33%">
		<font color="#000000"> 
              管 理 操 作</font></td>
	</tr>
<%

If Len(Trim(Request("page")))=0 Then  '返回目标页码的判断
page=1 
Else 
page=CInt(Trim(Request("page"))) 
End If

set rs=Server.CreateObject("ADODB.RecordSet")

	sql="select userid,id,picname,pictimes,index from [myweb_pic] where picnice=true  order by id desc"
	rs.open sql,conn,1,1
	rs.PageSize=20
if not rs.eof then
  rs.AbsolutePage=page
    for k=1 to rs.PageSize 
%>
	<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
		<td width="3%" align="center" ><%=rs("id")%></td>
		<td width="40%" align="center" ><%=rs("picname")%>   </td>
		<td align="center" width="12%" ><%=rs("pictimes")%>   </td>
		<td align="center" width="10%" ><%if rs("index")=true then%><font color=red>是</font><%else%>否<%end if%></td>
		<td align="center" width="33%" >
		<a target="_blank" href="e_showpic.asp?picid=<%=rs("id")%>&userid=<%=rs("userid")%>">查看</a>&nbsp;&nbsp;  <a href="myweb_pic.asp?action=modif&id=<%=rs("id")%>">编辑</a>&nbsp;&nbsp;&nbsp;<a href="myweb_pic.asp?action=del&id=<%=rs("id")%>&userid=<%=rs("userid")%>" <%="onClick='return confirm(""确定要删除此图片吗(不可恢复)?"");'"%>>删除</a>&nbsp;		
		<%if rs("index")=false then%><a href=myweb_pic.asp?action=index&id=<%=rs("id")%>&userid=<%=rs("userid")%>>设为网站图片</a><%end if%><%if rs("index")=true then%><a href=myweb_pic.asp?action=noindex&id=<%=rs("id")%>&userid=<%=rs("userid")%>>撤消网站图片</a><%end if%>
		</td>
	</tr>
	<%
 rs.movenext
    if rs.EOF Then Exit For
    next
  end if
%>	<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
		<td align="center" colspan="5" ><%
  if page <>1 then
     Response.Write "<a href=myweb_pic.asp?page=1>首页</a> "
  end if
  tmppage = page - 1 
  if tmppage <= 0 then 
     tmppage = 1 
  else
     Response.Write"<a href=myweb_pic.asp?page="&tmppage&">上一页</a>"
  end if
  tmppage = page + 1 
  if tmppage >rs.PageCount then 
     tmppage = page
  else
     Response.Write " <a href=myweb_pic.asp?page="&tmppage&">下一页</a> "
  end if 
  if Cstr(page) <> Cstr(rs.PageCount) and Cstr(rs.PageCount) <> 0 then
    Response.Write "<a href=myweb_pic.asp?page="&rs.PageCount&">尾页</a>"
  end if
  if Cstr(rs.PageCount) <> 0 then
  Response.Write "每页显示<font color=red>20</font>个图片信息  第<font color='blue'>" & page & "/"&rs.PageCount&"</font>页"
  end if
  Response.Write "  共有<font color='blue'>"&rs.RecordCount&"</font>个图片信息"
 rs.close
%>   </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=myweb_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=50 size="59" 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="pictimes1" maxlength=50 size="59" value="<%=rs("pictimes")%>"></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=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"))
  pictimes1=trim(request.form("pictimes1"))
  picurl1=trim(request.form("picurl1"))
  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 pictimes1="" 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 id="&id&" "
  rs.open sql,conn,1,3
  rs.update
  rs("picname")=picname1
  rs("picwrite")=picwrite1
  if isnumeric(pictimes1) then
  rs("pictimes")=pictimes1
  end if
  rs("picurl")=picurl1 
  rs("content")=content1 
  rs.update
  response.write"<li><font color=red>系统处理结果如下</font></li><br><li>图片信息修改成功 </li><br> <center><a href=myweb_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 ID=" & CLng(ID)
Conn.Execute sql
conn.execute("update [myweb_user] set count_pic=count_pic-1  where userid="&userID&"")
response.redirect"myweb_pic.asp"
end if
%>
<%if request("action")="index" then
sql="update  [myweb_pic] set index=true  where ID=" & CLng(ID)
Conn.Execute sql
set addrs=server.CreateObject("adodb.recordset")
sql1="select money from [myweb_user]  where userid="&userid&""
addrs.open sql1,conn,1,3
addrs.update
addrs(0)=addrs(0)+addmoney
addrs.update
addrs.close
response.redirect"myweb_pic.asp"
end if
%>
<%if request("action")="noindex" then
sql="update  [myweb_pic] set index=false  where ID=" & CLng(ID)
Conn.Execute sql
set addrs=server.CreateObject("adodb.recordset")
sql1="select money from [myweb_user]  where userid="&userID&""
addrs.open sql1,conn,1,3
addrs.update
addrs(0)=addrs(0)-lostmoney
addrs.update
addrs.close
response.redirect"myweb_pic.asp"
end if
%>

⌨️ 快捷键说明

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