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

📄 new.asp

📁 商务网站,信息分类,可以搜索加上ACCESS数据库
💻 ASP
字号:
<%Option Explicit%>
<!--#include file="CONFIG.ASP"-->
<!--#include file="adoconn.asp"-->

<%
dim objRS,sql
dim i
dim pagecount,currpage,Spage,Epage,recordcount

currpage = request.querystring("currpage")
if currpage = "" or IsNull(currpage) then currpage = 1
if not IsNumeric(currpage) then currpage = 1
currpage = Cint(currpage)

Set objRS = Server.CreateObject("ADODB.RecordSet")
sql = "select * from new order by thisdate DESC"
objRS.Open sql, objConn, 3, 3

recordcount = objRS.RecordCount
objRS.PageSize = PAGESIZE
pagecount = objRS.PageCount
if currpage < 1 then
    currpage = 1
elseif currpage > pagecount then
    currpage = pagecount
end if

%>

<HTML>
<HEAD>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<title>梦从这里飞翔……</title>
<link href=style2.css rel=stylesheet>
<script language="JavaScript">
<!--
function todel() {
    if(confirm("\n真的要删除所选项吗?\n\n注意!这里仅删除站点在[最新登录]中的显示,并不真正删除该站点。")) {
        form1.submit();
    }
}
function toremknew() {
    if(confirm("\n系统将把最新登录的部分站点自动更新到[最新登录]中。\n\n确定要更新吗?\n")) {
        form2.submit();
    }
}
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }
function CheckAll2(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall2')
       e.checked = form.chkall2.checked;
    }
  }
//-->
</script>
</head>
<body bgcolor="#FFFFFF">
<%
Response.Write("<hr>")
Response.Write("<center><b>[最 新 登 录]</b></center>")
Response.Write("<hr>")

if recordcount > 0 then Response.Write("本栏目共有站点 " & recordcount & " 个<br>" & VbCrlf)
'========================================实现翻页=============================
if pagecount > 1 then
    response.write("<font color=red>" & currpage & "</font>/" & pagecount & " ")
    Spage = currpage mod PARTSIZE
    if currpage > PARTSIZE then
        if Spage = 0 then Spage = PARTSIZE
        Spage = currpage - Spage + 1
    else
        Spage = 1
    end if
    Epage = Spage + PARTSIZE - 1
    if Epage > pagecount then Epage = pagecount
    if currpage > PARTSIZE then
        response.write("<a href=""new.asp?currpage=" & Spage - 1 & """>前" & PARTSIZE & "页</a>" & VbCrlf)
    end if
    for i = Spage to Epage
        if i = currpage then
            response.write("[<font style={font-size:9.5pt;color:red}><b>" & i & "</b></font>]" & VbCrlf)
        else
            response.write("[<a href=""new.asp?currpage=" & i & """>" & i & "</a>]" & VbCrlf)
        end if
    next
    if Epage < pagecount then
        response.write("<a href=""new.asp?currpage=" & Epage + 1 & """>后" & PARTSIZE & "页</a>" & VbCrlf)
    end if
    if Spage <> 1 then response.write("[<a href=""new.asp?currpage=1"">第一页</a>]")
    if Epage <> pagecount then response.write("[<a href=""new.asp?currpage=" & pagecount & """>最末页</a>]" & VbCrlf)
    response.write("<br>")    
end if
'======================================完成处理=================================

Response.Write("<form name=""form2"" action=""mknew.asp"" method=""GET""></form>")

if objRS.EOF then
    Response.Write("<center><font color=red>暂无最新站点</font><br> <br>")
    Response.Write("<input type=""button"" value=""重新自动更新"" onclick=""toremknew()""></center>")
else
    objRS.AbsolutePage = currpage
    Response.Write("<form name=""form1"" action=""delnew.asp"" method=""POST"">" & VbCrlf)
    Response.Write("<input type=""checkbox"" name=""chkall2"" onclick=""CheckAll2(this.form)""><font color=red>选中所有站点</font></span>  ")
    Response.Write("<input type=""button"" value=""删除所选项"" onclick=""todel()"">")
    Response.Write("  ")
    Response.Write("<input type=""button"" value=""重新自动更新"" onclick=""toremknew()"">")
    Response.Write("<ul>" & VbCrlf)
    if recordcount > 0 then objRS.AbsolutePage = currpage
    for i = 1 to PAGESIZE
        if objRS.EOF then exit for
        Response.Write("<LI><input type=""checkbox"" name=""staid"" value=""" & objRS("id") & """> <a href=""" & objRS("url") & """ target=""_blank"">" & objRS("title") & "</a> [" & objRS("lang") & "] <a href=""admclass.asp?sortid=" & objRS("parentid") & """>所在类目</a>" & VbCrlf)
        Response.Write("    <dl>" & VbCrlf)
        Response.Write("        <dd>" & objRS("description") & "<br><font style={font-size:10.5pt;color:#c0c0c0}>——<i> (" & objRS("whopost") & ")" &  objRS("thisdate") & " 点击:" & objRS("visitcount") & "</i></font>" & VbCrlf)
        Response.Write("    </dl>" & VbCrlf)
        Response.Write("</li>" & VbCrlf)
        objRS.MoveNext()
    next
    Response.Write("</ul>" & VbCrlf)
    Response.Write("<input type=""checkbox"" name=""chkall"" onclick=""CheckAll(this.form)""><font color=red>选中所有站点</font>  <input type=""button"" value=""删除所选项"" onclick=""todel()"">  <input type=""button"" value=""重新自动更新"" onclick=""toremknew()""><br>")
end if

if pagecount > 1 then
    Response.Write("<br>")
    response.write("<font color=red>" & currpage & "</font>/" & pagecount & " ")
    if currpage > PARTSIZE then
        response.write("<a href=""new.asp?currpage=" & Spage - 1 & """>前" & PARTSIZE & "页</a>" & VbCrlf)
    end if
    for i = Spage to Epage
        if i = currpage then
            response.write("[<font style={font-size:9.5pt;color:red}><b>" & i & "</b></font>]" & VbCrlf)
        else
            response.write("[<a href=""new.asp?currpage=" & i & """>" & i & "</a>]" & VbCrlf)
        end if
    next
    if Epage < pagecount then
        response.write("<a href=""new.asp?currpage=" & Epage + 1 & """>后" & PARTSIZE & "页</a>" & VbCrlf)
    end if
    if Spage <> 1 then response.write("[<a href=""new.asp?currpage=1"">第一页</a>]")
    if Epage <> pagecount then response.write("[<a href=""new.asp?currpage=" & pagecount & """>最末页</a>]" & VbCrlf)
    response.write("<br>")    
end if

objConn.Close()
Set objRS = nothing
Set objConn = nothing
%> </form> 
<hr size=1>
<center>
<!--#include file="copyright.asp"-->
</body>
</html>

⌨️ 快捷键说明

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