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

📄 news.asp

📁 ①后台增加了基本设置功能
💻 ASP
字号:
<!--#include file="Inc/Code.asp" -->
<%
dim i,j
dim ArticleID
dim Title
dim NewsClassName
dim PurviewChecked
dim strAdmin,arrAdmin
PurviewChecked=false

Title=Trim(request("Title"))
ArticleID=Request("ArticleID")
NewsClassName=Trim(request("NewsClassName"))
strFileName="News.asp?NewsClassName=" & NewsClassName

if request("page")<>"" then
    currentPage=cint(request("page"))
else
	currentPage=1
end if

sql="select * from News where ArticleID>0"
if Title<>"" then
	sql=sql & " and title like '%" & Title & "%' "
end if
if NewsClassName<>"" then
	sql=sql & " and NewsClassName='" & NewsClassName & "' "
else
end if
sql=sql & " order by articleid desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%><HTML>
<HEAD>
<TITLE><%Call W_WebSiteName()%>┊<%Call W_WebSiteUrl()%></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="Images/style.css" type=text/css rel=stylesheet>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<TABLE cellSpacing=0 cellPadding=0 width=758 align=center border=0>
  <TBODY>
  <TR>
    <TD rowspan="2"><a href="Index.asp"><img src="Images/Logo.gif" alt="企网互联|域名注册|虚拟主机|全能空间|企业网站建设专家|企业网站智能管理系统官方网站" width="160" height="75" border="0"></a></TD>
    <TD width="598"><TABLE cellSpacing=0 cellPadding=0 align=center bgColor=#ffffff 
border=0>
      <TBODY>
        <TR>
          <TD width=418 height="28">&nbsp;</TD>
          <TD vAlign=bottom width=180 background=Images/index_new2.gif>
            <DIV align=center><IMG height=11 src="Images/home.gif" width=13> 设为首页 | <IMG height=12 
      src="Images/ofldr.gif" width=16> 加入收藏</DIV></TD>
        </TR>
      </TBODY>
    </TABLE></TD>
  </TR>
  <TR>
    <TD><img src="Images/Menu1.gif" width="598" height="47" border="0" usemap="#Map"></TD>
  </TR>
  </TBODY></TABLE>
<table width="758" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="756" height="140" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="758" height="140">
        <param name="movie" value="Images/tt.swf">
        <param name="quality" value="high">
        <embed src="Images/tt.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="758" height="140"></embed>
    </object></td>
  </tr>
  <tr>
    <td><img src="Images/pic03.gif" width="758" height="5"></td>
  </tr>
  <tr>
    <td height="445" valign="top"><table width="758" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="195" height="445" valign="top" background="images/bg06.gif"><table width="195" border="0" cellpadding="0" cellspacing="0" class="c">
              <tr>
                <td width="258"><img src="Images/pic40.gif" width="195" height="44"></td>
              </tr>
              <tr>
                <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="36"><img src="Images/pic42.gif" width="36" height="26"></td>
                      <td width="159" valign="bottom"><font color="#FFFFFF">.</font><strong><font color="#FF0000">新闻资讯</font></strong></td>
                    </tr>
                    <tr>
                      <td colspan="2"><img src="images/pic41.gif" width="195" height="7"></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td><% call News_Type() %></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
          </table></td>
          <td valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="44" valign="middle" background="images/bg05.gif"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="b">
                    <tr>
                      <td class="L15"><a href="Index.asp">首页</a> <span class="en_text">&gt;&gt; </span><a href="News.asp">新闻资讯</a> &gt;&gt; <%call News_ClassName()%></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td height="16" valign="top"><TABLE cellSpacing=1 cellPadding=5 width="100%" border=0>
                  <TBODY>
                    <TR>
                      <TD width="422" 
                  height=25><%
if rs.eof and rs.bof then
	   response.write"暂无此类新闻,相关新闻正在整理中..."
end if
%></TD>
                      <TD width="120"><%
  	if rs.eof and rs.bof then
		response.write "共找到 0 条新闻"
	else
    	totalPut=rs.recordcount
		if currentpage<1 then
       		currentpage=1
    	end if
    	if (currentpage-1)*15>totalput then
	   		if (totalPut mod 15)=0 then
	     		currentpage= totalPut \ 15
		  	else
		      	currentpage= totalPut \ 15 + 1
	   		end if

    	end if
		response.Write "共找到 " & totalPut & " 条新闻"
%>
                      </TD>
                    </TR>
                    <TR>
                      <TD 
                  height=1 colspan="2"><%		
	    if currentPage=1 then
		MaxPerPage=15
        	showContent
        	showpage strFileName,totalput,MaxPerPage,true,false,"条新闻" 
   	 	else
   	     	if (currentPage-1)*15<totalPut then
		MaxPerPage=15
         	   	rs.move  (currentPage-1)*15
         		dim bookmark
           		bookmark=rs.bookmark
            	showContent
            	showpage strFileName,totalput,MaxPerPage,true,false,"条新闻" 
        	else
		MaxPerPage=15
	        	currentPage=1
           		showContent
           		showpage strFileName,totalput,MaxPerPage,true,false,"条新闻"
	    	end if
		end if
	end if
%>
                          <%  
sub showContent
   	dim i
    i=0
%>
                          <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#D3D3D3">
						  <tr bgcolor="#f5f5f5">
                              <td width="7%" height="20" align="center"><strong>序号</strong></td>
                              <td width="63%"><div align="center"><strong>标 题</strong></div></td>
                              <td width="11%"><div align="center"><strong>点 击</strong></div></td>
                              <td><div align="center"><strong>日 期</strong></div></td>
                            </tr>
                            <%do while not rs.eof%>
                            <tr bgcolor="#FFFFFF">
                              <td height="20" bgcolor="#FFFFFF"><div align="center"><%=rs("articleid")%></div></td>
                              <td height="20">&nbsp;<a href="NewsShow.asp?NewsID=<%=rs("articleid")%>"><%=rs("title")%></a></td>
                              <td height="20"><div align="center"><%=rs("Hits")%></div></td>
                              <td width="19%" bgcolor="#FFFFFF"><div align="center"><%= FormatDateTime(rs("UpdateTime"),2) %></div></td>
                            </tr>
                            
                            <%
	i=i+1
	      if i>=15 then exit do
	      rs.movenext
	loop
%>
                          </table>
                      </TD>
                    </TR>
                    <TR>
                      <TD 
                  height=1 colspan="2"><%
   end sub 
%></TD>
                    </TR>
                    <TR>
                      <TD height=10 colspan="3">&nbsp;</TD>
                    </TR>
                  </TBODY>
                </TABLE></td>
              </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>
</table>
<table width="758" height="28" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="34" background="Images/bg07.gif"><table width="72%" border="0" align="right" cellpadding="0" cellspacing="0">
        <tr>
          <td><SPAN class=buttom><%Call W_Copyright()%>&nbsp;&nbsp;<%Call W_Count()%></SPAN></td>
        </tr>
    </table></td>
  </tr>
</table>
<map name="Map">
  <area shape="rect" coords="29,10,103,29" href="About.asp">
  <area shape="rect" coords="126,10,199,29" href="News.asp">
  <area shape="rect" coords="223,10,299,30" href="Product.asp">
  <area shape="rect" coords="319,10,396,30" href="Download.asp">
  <area shape="rect" coords="419,10,493,29" href="Guestbook.asp">
  <area shape="rect" coords="516,10,591,30" href="Contact.asp">
</map>
</BODY></HTML>

⌨️ 快捷键说明

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