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

📄 shjianews.asp

📁 商业网站开发有源代码可以运行
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<html>
<head>
<title><%=webname%>--商家新闻</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="mt_style.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535} 
body{font-size:9pt;line-height:120%} 
a:link          { color: #000000; text-decoration: none }
a:visited       { color: #000000; text-decoration: none }
a:active        { color: #000000; text-decoration: none }
a:hover         { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onMouseOver="window.status='【<%=webname%>】<%=weburl%> 如果您喜欢本站,别忘了把本站介绍给您的好友哦!:)';return false">
<%dim id
id=request.QueryString("id")
set rs_shjia=server.CreateObject("adodb.recordset")
strshjia="select * from shjia where shjiaid="&id
rs_shjia.open strshjia,conn,1,1
%>
<!--#include file="webtop.asp"-->
<table width="760" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="EDECEC">
  <tr> 
    <td width="180" valign="top" bordercolor="#FFFFFF" bgcolor="#FFFFFF"> 
      <!--#include file="gouwucheinfo.asp"-->
      <!--#include file="searchinfo.asp"-->
      <!--#include file="fenleiinfo.asp"-->
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td background="images/bj_x.gif" height="1"></td>
        </tr>		       
      </table>      
    </td>
    <td width="1" valign="top" background="images/bj_x.gif"></td>
	<td width="579" valign="top" bordercolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td valign="top" bgcolor="#FFFFFF" bordercolor="#FFFFFF"> 
            <div align="center">              
              <table width="100%" border="0" cellspacing="0" cellpadding="4" align="center">
                <tr> 
                  <td><!--#include file="user/contentinfo.asp"--></td>
                </tr>                
              </table>
            </div>
		 </td>
          <td width="1" valign="top" background="images/bj_x.gif"></td>
          <td valign="top" bordercolor="#FFFFFF" bgcolor="#FFFFFF" width="35%"> 
            <!--#include file="user/lxshjia.asp"-->
          </td>
        </tr>
        <tr> 
<%
set rs_news=server.CreateObject("adodb.recordset")
strnews="select * from news where shjiaid="&id
rs_news.open strnews,conn,1,1
if rs_news.recordcount=0 then 
%>
		<td height="1" valign="top" colspan="3" background="images/bj_x.gif"></td>
        </tr>
        <tr> 
          <td colspan="3"> 
            <%
		else
	  		rs_news.PageSize =20 '每页记录条数
			iCount=rs_news.RecordCount '记录总数
			iPageSize=rs_news.PageSize
    		maxpage=rs_news.PageCount 
    		page=request("page")
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs_news.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	%>
            <table width=100% border=0 align=center cellpadding=0 cellspacing=0>
              <tr> 
                <td background="images/bj_x.gif" height="1" colspan="2"></td>
              </tr>
              <tr> 
                <td height="22" bgcolor="#FFE9A4" colspan="2"> 
                  <table cellspacing=0 cellpadding=0 width=170 height="20">
                    <tr> 
                      <td width=5>&nbsp;</td>
                      <td> 
                        <div align="center"></div>
                         &nbsp;商家新闻</td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr> 
                <td background="images/bj_x.gif" height="1" colspan="2"></td>
              </tr>
              <%  		
  	    do while not rs_news.eof
  %>
              <tr> 
                <td background="images/bj_x.gif" height="1" colspan="2"></td>
              </tr>
              <tr> 
                <td height=23 width="69%">&nbsp;&nbsp;<img src="images/0.gif" width="12" height="11">&nbsp; 
                  <% if len(replace(trim(rs_news("title")),"<br>",""))>30 then
response.write "<a href=""javascript:;"" onClick=""javascript:window.open('user/news_shjia.asp?id="&rs_news("newsid")&"','news','width=432,height=288,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"" title="&year(rs_news("addtime"))&"年"&month(rs_news("addtime"))&"月"&day(rs_news("addtime"))&"日发布>"&left(trim(rs_news("title")),30)&".."&"</a><br>"
			else
response.write "<a href=""javascript:;"" onClick=""javascript:window.open('user/news_shjia.asp?id="&rs_news("newsid")&"','news','width=432,height=288,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"" title="&year(rs_news("addtime"))&"年"&month(rs_news("addtime"))&"月"&day(rs_news("addtime"))&"日发布>"&trim(rs_news("title"))&"</a><br>"
			end if%>
                </td>
                <td height=23 width="31%">&nbsp;发表于<%=year(rs_news("addtime"))&"年."&month(rs_news("addtime"))&"月."&day(rs_news("addtime"))&"日."%></td>
              </tr>
              <%rs_news.movenext
  	loop
	rs_news.close
	set rs_news=nothing%>
              <tr> 
                <td background="images/bj_x.gif" height="1" colspan="2"></td>
              </tr>
            </table>
            <%
		call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
		end if
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

    query = Split(Request.ServerVariables("QUERY_STRING"), "&")
    For Each x In query
        a = Split(x, "=")
        If StrComp(a(0), "page", vbTextCompare) <> 0 Then
            temp = temp & a(0) & "=" & a(1) & "&"
        End If
    Next

    Response.Write("<table " & Table_style & ">" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=right>" & vbCrLf )
    Response.Write(font_style & vbCrLf )    
        
    if page<=1 then
        Response.Write ("首页 " & vbCrLf)        
        Response.Write ("上页 " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上页</A> " & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("下页 " & vbCrLf)
        Response.Write ("尾页 " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)            
    end if

    Response.Write(" 页次:" & page & "/" & pageCount & "页" &  vbCrLf)
    Response.Write(" 共有" & iCount & "条新闻" &  vbCrLf)
    Response.Write(" 转到" & "<INPUT TYEP=TEXT NAME=page SIZE=1 Maxlength=5 VALUE=" & page & ">" & "页"  & vbCrLf & "<INPUT type=submit style=""font-size: 9pt"" value=GO class=b2>")
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub
%>        </td>
        </tr>
      </table>
	</td>    
  </tr>
</table>
<!--#include file="service1.asp"-->
<!--#include file="copyright.asp"-->
<div  id=floater 
            style="Z-INDEX: 20; WIDTH: 130px; POSITION: absolute; TOP: 342px; overflow: visible;; left: 2px"> 
</div>
<script language=javascript src="floater.js"></script>
</body>
</html>

⌨️ 快捷键说明

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