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

📄 admindiary_body.asp

📁 不错的asp论坛,大家可以看看啊和呵呵.
💻 ASP
字号:
<%sub admindiary_body()
dim totaldiary,adperpage,Currentpage,totalpages,i
adperpage=15
sql="select * from diary order by d_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<HTML><HEAD><TITLE>.</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK 
href="inc/djcss" type=text/css rel=StyleSheet>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
</HEAD>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) background=inc/dj_bg.gif>
      <table align="center" width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#C0C0C0" style="border-collapse: collapse">
        <tr> 
          <td colspan="3" bgcolor="#E8E8E8">公告管理</td>
        </tr>
        <tr align="center" bgcolor="#E8E8E8"> 
          <td class="chinese" width="10%" bgcolor="#F5F5F5">编号</td>
          <td class="chinese" width="70%" bgcolor="#F5F5F5">内容</td>
          <td class="chinese" width="20%" bgcolor="#F5F5F5">操作</td>
        </tr>
        <%if not rs.eof then
rs.Movefirst
rs.pagesize=adperpage
if trim(request("page"))<>"" then
    currentpage=clng(request("page"))
	if currentpage>rs.pagecount then
	   currentpage=rs.pagecount
	end if
else
    currentpage=1
end if
    totaldiary=rs.recordcount
	if currentpage<>1 then
	   if(currentpage-1)*adperpage<totaldiary then
	      rs.move(currentpage-1)*adperpage
		  dim bookmark
		  bookmark=rs.bookmark
	   end if
	end if
	if (totaldiary mod adperpage)=0 then
	   totalpages=totaldiary\adperpage
	else
	   totalpages=totaldiary\adperpage+1
	end if
i=0
do while not rs.eof and i<adperpage
%>
        <tr> 
          <td bgcolor="#FFFFFF" class="chinese" align="center"><%=rs("d_id")%> </td>
          <td bgcolor="#FFFFFF" class="chinese"><%=cutstr(formatstr(rs("d_content")),20,false,none)%><span class="date"><%=rs("d_date")%></span> </td>
          
    <td bgcolor="#FFFFFF" class="chinese" align="center"><a href="admin_diary.asp?id=<%=rs("d_id")%>&action=editdiary#editdiary">edit</a> 
      <a href="admin_diary.asp?id=<%=rs("d_id")%>&action=deldiary#deldiary">del</a> 
    </td>
        </tr>
        <%i=i+1
rs.movenext
loop
else
If rs.EOF And rs.BOF Then%>
        <tr> 
          <td bgcolor="#FFFFFF" class="chinese" colspan=3 align="center">当前还没有
          公告!</td>
        </tr>
        <%end if
end if%>
      </table>
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <form name="form2" method="post" action="admin_diary.asp">
          <tr> 
            <td class="chinese" align="right"><%=currentpage%>/<%=totalpages%>页,<%=totaldiary%>条记录/<%=adperpage%>篇每页. 
              <%
i=1
dy10=false
showye=totalpages
if showye>10 then
dy10=true
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
              <%=i%> 
              <%else%>
              <a href="admin_diary.asp?page=<%=i%>"><%=i%></a> 
              <%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
              <a href="admin_diary.asp?page=<%=page%>" title="下一页">>></a>
              <%end if%>
            </td>
          </tr>
        </form>
      </table>
      <br>
      <%if request.querystring("action")="newdiary" then%>
      <table width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#C0C0C0" style="border-collapse: collapse" align="center">
        <form name="form1" method="post" action="<%=MM_editAction%>">
          <tr> 
            <td bgcolor="#E8E8E8">
            <font color="#333333"><a name="newdiary">新的</a></font><a name="newdiary"><font color="#333333">公告</font></a></td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF"> 
              <%call ubbshow()%>  </td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF"> 
              <textarea name="textfield" cols="85" rows="19" class="textarea" wrap="VIRTUAL"></textarea>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#F5F5F5" align="center" height="30"> 
              <input type="submit" name="Submit" value="确定新增" class="button">
              <input type="reset" name="Reset" value="清空重写" class="button">
            </td>
          </tr>
          <input type="hidden" name="action" value="newdiary">
          <input type="hidden" name="MM_insert" value="true">
        </form>
      </table>
      <%end if
if request.querystring("action")="editdiary" then
if request.querystring("id")="" then
  errmsg=errmsg+"<br>"+"<li>请指定操作的对象!"
  call diserror()
  response.end
else
  if not isinteger(request.querystring("id")) then
    errmsg=errmsg+"<br>"+"<li>非法的日记ID参数!"
	call diserror()
	response.end
  end if
end if
sql="select * from diary where d_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
	  %>
      <table width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#C0C0C0" style="border-collapse: collapse" align="center">
        <form name="form1" method="post" action="<%=MM_editAction%>">
          <tr> 
            <td bgcolor="#E8E8E8">
            <font color="#333333"><a name="editdiary">修改</a></font><a name="editdiary"><font color="#333333">公告</font></a></td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF" class="chinese"> 
              <%call ubbshow()%>  </td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF"> 
              <textarea cols="85" rows="19" class="textarea" wrap="VIRTUAL" name="textfield"><%=rs("d_content")%></textarea>
            </td>
          </tr>
          <tr> 
            <td bgcolor="#F5F5F5" align="center" height="30"> 
              <input type="submit" name="Submit" value="确定修改" class="button">
              <input type="reset" name="Reset" value="清空重写" class="button">
            </td>
          </tr>
          <input type="hidden" name="id" value="<%=rs("d_id")%>">
          <input type="hidden" name="action" value="editdiary">
          <input type="hidden" name="MM_insert" value="true">
        </form>
      </table>
      <%end if
if request.querystring("action")="deldiary" then
if request.querystring("id")="" then
  errmsg=errmsg+"<br>"+"<li>请指定操作的对象!"
  call diserror()
  response.end
else
  if not isinteger(request.querystring("id")) then
    errmsg=errmsg+"<br>"+"<li>非法的日记ID参数!"
	call diserror()
	response.end
  end if
end if
sql="select * from diary where d_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
	  %>
      <table width="98%" border="1" cellspacing="0" cellpadding="4" class="chinese" bordercolor="#C0C0C0" style="border-collapse: collapse" align="center">
        <form name="form1" method="post" action="<%=MM_editAction%>">
          <tr> 
            <td bgcolor="#E8E8E8">
            <font color="#333333"><a name="deldiary">删除</a></font><a name="deldiary"><font color="#333333">公告</font></a></td>
          </tr>
          <tr> 
            <td bgcolor="#FFFFFF"><%=ubb2html(formatStr(autourl(rs("d_content"))), true, true)%>
			<div align="right"><br>
        第<span class="newshead"><%=rs("d_id")%></span>篇,发表于-<span class="newshead"><%=rs("d_date")%></span></div></td>
          </tr>
          <tr> 
            <td bgcolor="#F5F5F5" align="center" height="30"> 
              <input type="submit" name="Submit" value="确定删除" class="button">
              [<a href="admin_diary.asp">返回</a>] </td>
          </tr>
          <input type="hidden" name="id" value="<%=rs("d_id")%>">
          <input type="hidden" name="action" value="deldiary">
          <input type="hidden" name="MM_insert" value="true">
        </form>
      </table>
<%end if%>
      <br>
    </td>
  </tr>
</table>
<%
rs.close
set rs=nothing
end sub%>

⌨️ 快捷键说明

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