myweb_article1.asp
来自「源码源源码 源码 源码码源 码源 码源 码源 码」· ASP 代码 · 共 237 行
ASP
237 行
<!--#include file="conn.asp"-->
<!--#include file="myweb_check.asp"-->
<%
dim ID,Action
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">栏目导航:
<a href="myweb_article.asp">管理所有文章</a> <font color="#FF0000">说明</font>:"设为网站文章"则该文章可以在主站上显示,"撤消网站文章"则该文章不显示在主站上</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="35%">
<strong style="font-weight: 400">
<font color="#000000">文 章</font></strong> 标 题</td>
<td height="20" class="topbg" align="center" width="17%">
发 布 日 期</td>
<td height="20" class="topbg" align="center" width="14%">
主站是否显示</td>
<td height="20" class="topbg" align="center" width="31%">
<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,articlename,articledate,articenice,index,otherid from [other] where articenice=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="35%" align="center" ><%=rs("articlename")%> </td>
<td align="center" width="17%" ><%=rs("articledate")%> </td>
<td align="center" width="14%" ><%if rs("index")=true then%><font color=red>是</font><%else%>否<%end if%> </td>
<td align="center" width="31%" >
<a target="_blank" href="e_showotherarticle.asp?userid=<%=rs("userid")%>&id=<%=rs("id")%>&otherid=<%=rs("otherid")%>">查看</a>
<%if rs("index")=false then%><a href=myweb_article1.asp?action=index&id=<%=rs("id")%>&userid=<%=rs("userid")%>>设为网站文章</a><%end if%><%if rs("index")=true then%><a href=myweb_article1.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_article1.asp?page=1>首页</a> "
end if
tmppage = page - 1
if tmppage <= 0 then
tmppage = 1
else
Response.Write"<a href=myweb_article1.asp?page="&tmppage&">上一页</a>"
end if
tmppage = page + 1
if tmppage >rs.PageCount then
tmppage = page
else
Response.Write " <a href=myweb_article1.asp?page="&tmppage&">下一页</a> "
end if
if Cstr(page) <> Cstr(rs.PageCount) and Cstr(rs.PageCount) <> 0 then
Response.Write "<a href=myweb_article1.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,articlename,articlewrite,articletimes,articenice,classid,content from myweb_article where id="&id&"")%>
<form action=myweb_article.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="3">
<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%" colspan="2" >
<input type="text" name="articlename1" maxlength=50 size="59" value="<%=rs("articlename")%>"></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
文章发布:</td>
<td width="76%" colspan="2" >
<input type="text" name="articlewrite1" maxlength=50 size="59" value="<%=rs("articlewrite")%>">
</td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
查看次数:</td>
<td width="76%" colspan="2" >
<input type="text" name="articletimes1" maxlength=50 size="59" value="<%=rs("articletimes")%>"></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F6FcF9'">
<td width="23%" align="left" >
文章分类:</td>
<td width="14%" ><select size="1" name="classid1">
<option selected value="<%=rs("classid")%>">默认</option>
<%set rs1=conn.execute("select * from myweb_articleclass where userid=0 order by id desc")
do while not rs1.eof
%>
<option value="<%=rs1("id")%>"><%=rs1("classname")%></option>
<%rs1.movenext
loop
rs1.close%>
</select>
</td>
<td width="62%" >是否推荐:
<input type="radio" value="true" name="articenice1" <% if rs("articenice")=true then response.write"checked" end if %>> 是
<input type="radio" name="articenice1" value="false" <% if rs("articenice")=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%" colspan="2" >
<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="3" >
<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 articlename1,articlewrite1,articletimes1,articenice1,classid1,content1,erroredit
articlename1=trim(request.form("articlename1"))
articlewrite1=trim(request.form("articlewrite1"))
articletimes1=trim(request.form("articletimes1"))
classid1=trim(request.form("classid1"))
articenice1=trim(request.form("articenice1"))
content1=trim(request.form("content1"))
if articlename1="" then
erroredit=erroredit+"<br><li>文章标题不能为空</li>"
end if
if articlewrite1="" then
erroredit=erroredit+"<br><li>文章作者不能为空</li>"
end if
if articletimes1="" then
erroredit=erroredit+"<br><li>文章查看次数不能为空</li>"
end if
if classid1="" then
erroradd=erroradd+"<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,articlename,articlewrite,articletimes,classid,articenice,content from myweb_article where id="&id&" "
rs.open sql,conn,1,3
rs.update
rs("articlename")=articlename1
rs("articlewrite")=articlewrite1
if isnumeric(articletimes1) then
rs("articletimes")=articletimes1
end if
rs("articenice")=articenice1
rs("classid")=classid1
rs("content")=content1
rs.update
response.write"<li><font color=red>系统处理结果如下</font></li><br><li>文章信息修改成功 </li><br> <center><a href=myweb_article.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_article] where ID=" & CLng(ID)
Conn.Execute sql
conn.execute("update [myweb_user] set count_article=count_article-1 where userid="&userID&"")
response.redirect"myweb_article.asp"
end if
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?