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

📄 sub.asp

📁 一套企业全站
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<style>
.productBorder {
	border: 2px double #CCCCCC;
}
</style>













<%'===========================首页显示新闻-阮丁远修改版=============================
'----------------------------------
' num  首页新闻 条数
' more  显示更多 还是 分页函数  true 表示分页函数
' fileName  分页连接地址
'
' morefile  更多的连接地址
'
'--------------------------------------

sub showNewsruan(num)%>

 
			
              <%
	
	dim ni

newsSql="select * from j_news where delflag=false and (class=1 or class=2 or class=0) order by newid desc"
	maxperpage=num
			  set newsRs=server.CreateObject("adodb.recordset")
			  newsRs.open newsSql,conn,1,1
			  if not newsRs.eof then
	
		for ni=1 to MaxPerpage
		if newsRs.eof then exit for
			  %>




 <tr>
            <td width="200" height="24" align="center">



<a href="newsView.asp?id=<%=newsRs("id")%>" title="<%=newsRs("title")%>"><%=gottopic(newsRs("title"),28)%></a>





</td>
 </tr>



	  
			  <%
			  newsRs.movenext
			  next
			  else
			  %>
			  <tr><td align="center"><font color="#FF0000"><strong>资料正在整理中……</strong></font></td></tr>
			  <%end if
			  newsRs.close
			  set newsRs=nothing
			  %>

<%end sub%>

































<%'===========================显示新闻=============================
'----------------------------------
' num  新闻 条数
' more  显示更多 还是 分页函数  true 表示分页函数
' fileName  分页连接地址
' newsSql   SQL 语句
' morefile  更多的连接地址
' charNum   标题长度
'--------------------------------------

sub showNews(num,more,fileName,newsSql,moreFile,charnum)%>

 
			<table width="95%" height="98%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#dfdcd5">
              <%
	
	CurrentPage=replacebadchar(request("page"))
	if CurrentPage="" then
	CurrentPage=1
	else if not IsNumeric(CurrentPage) then
	CurrentPage=1
	else if int(CurrentPage)<=0 then
	CurrentPage=1
	else
 	CurrentPage=replaceBadchar(request("page"))
 	end if
	end if
	end if
	strFileName=""&fileName&""
	maxperpage=num
			  set newsRs=server.CreateObject("adodb.recordset")
			  newsRs.open newsSql,conn,1,1
			  if not newsRs.eof then
	newsRs.pagesize=MaxPerpage
	totalnumber=newsRs.recordcount
	if totalnumber mod maxperpage=0 then
   MaxPage= totalnumber \ MaxPerpage
  	else
   MaxPage= totalnumber \ MaxPerpage+1
  	end if
	if int(CurrentPage)>int(MaxPage) then
	CurrentPage=MaxPage
	else
	CurrentPage=CurrentPage
	end if
	newsRs.absolutepage=CurrentPage
		for ni=1 to MaxPerpage
		if newsRs.eof then exit for
			  %>
			  <tr valign="bottom" bgcolor="#FFFFFF">
                <td height="27" align="left" valign="middle" <%if ni mod 2=0 then response.Write("background=images/hang_bg.jpg") end if%> ><img src="images/news_piont.jpg" width="16" height="10">&nbsp;&nbsp;<a href="newsView.asp?id=<%=newsRs("id")%>" title="<%=newsRs("title")%>"><%=gottopic(newsRs("title"),charnum)%></a></td>
              </tr>
			  <%
			  newsRs.movenext
			  next
			  else
			  %>
			  <tr><td align="center"><font color="#FF0000"><strong>资料正在整理中……</strong></font></td></tr>
			  <%end if
			  newsRs.close
			  set newsRs=nothing
			  %>
</table>
<%end sub%>


<%'===========================显示更多新闻=============================
'----------------------------------
' num  新闻 条数
' more  显示更多 还是 分页函数  true 表示分页函数
' fileName  分页连接地址
' newsSql   SQL 语句
' morefile  更多的连接地址
' unit    分页显示的 计数单位
' charNum  标题长度
'--------------------------------------

sub showNewsMore(num,more,fileName,newsSql,moreFile,unit,charNum)%>

 
			<table width="95%" height="98%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#dfdcd5">
              <%
	
	CurrentPage=replacebadchar(request("page"))
	if CurrentPage="" then
	CurrentPage=1
	else if not IsNumeric(CurrentPage) then
	CurrentPage=1
	else if int(CurrentPage)<=0 then
	CurrentPage=1
	else
 	CurrentPage=replaceBadchar(request("page"))
 	end if
	end if
	end if
	strFileName=""&fileName&""
	maxperpage=num
			  set newsRs=server.CreateObject("adodb.recordset")
			  newsRs.open newsSql,conn,1,1
			  if not newsRs.eof then
	newsRs.pagesize=MaxPerpage
	totalnumber=newsRs.recordcount
	if totalnumber mod maxperpage=0 then
   MaxPage= totalnumber \ MaxPerpage
  	else
   MaxPage= totalnumber \ MaxPerpage+1
  	end if
	if int(CurrentPage)>int(MaxPage) then
	CurrentPage=MaxPage
	else
	CurrentPage=CurrentPage
	end if
	newsRs.absolutepage=CurrentPage
		for ni=1 to MaxPerpage
		if newsRs.eof then exit for
			  %>
			  <tr valign="bottom" bgcolor="#FFFFFF">
                <td width="60" height="27" align="right" valign="middle" <%if ni mod 2=0 then response.Write("background=images/hang_bg.jpg") end if%>><img src="images/news_piont.jpg" width="16" height="10"></td>
                <td width="290" align="left" valign="middle" <%if ni mod 2=0 then response.Write("background=images/hang_bg.jpg") end if%> >&nbsp;&nbsp;<a href="newsView.asp?id=<%=newsRs("id")%>" title="<%=newsRs("title")%>"><%=gottopic(newsRs("title"),charNum)%></a></td>
                <td width="90" align="center" valign="middle" <%if ni mod 2=0 then response.Write("background=images/hang_bg.jpg") end if%> ><%=nogottopic(newsRs("adder"),8)%></td>
                <td width="83" align="center" valign="middle" <%if ni mod 2=0 then response.Write("background=images/hang_bg.jpg") end if%> ><%=DateValue(newsRs("time"))%></td>
                <td align="center" valign="middle" bgcolor="#FFFFFF" <%if ni mod 2=0 then response.Write("background=images/hang_bg.jpg") end if%> ><font color="#3C7582"><strong><%=newsRs("hits")%></strong></font></td>
			  </tr>
			  <%
			  newsRs.movenext
			  next
			  else
			  %>
			  <tr><td colspan="5" align="center"><font color="#FF0000"><strong>资料正在整理中……</strong></font></td></tr>
			  <%end if
			  newsRs.close
			  set newsRs=nothing
			  %>
			        <tr>
        <td  colspan="5" align="center" height="27" bgcolor="#FFFFFF"><%if more then call showpage(strFileName,totalnumber,MaxPerPage,true,true,unit,CurrentPage) end if%></td>
      </tr>
	   <tr>
        <td  colspan="5" align="center" bgcolor="#FFFFFF"></td>
      </tr>
</table>
<%end sub%>
<%
'*****************************************
'显示产品函数
'row  ---- 行数
'col  ---- 列数
'pNum ---- 分页数
'more ---- 显示 更多 还是 分页,TRUE 表示分页
'fileName --- 连接地址
'pSql  -----  SQL 语句
'*****************************************
sub showProduct(row,col,pnum,more,fileName,pSql)%>
<table width="0%" height="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
      <% 
	CurrentPage=replacebadchar(request("page"))
	if CurrentPage="" then
	CurrentPage=1
	else if not IsNumeric(CurrentPage) then
	CurrentPage=1
	else if int(CurrentPage)<=0 then
	CurrentPage=1
	else
 	CurrentPage=replaceBadchar(request("page"))
 	end if
	end if
	end if
	strFileName=""&fileName&""
	maxperpage=pnum
	set productRs=server.CreateObject("adodb.recordset")

	productRs.open pSql,conn,1,1
	if not productRs.eof then
	productRs.pagesize=MaxPerpage
	totalnumber=productRs.recordcount
	if totalnumber mod maxperpage=0 then
  	MaxPage= totalnumber \ MaxPerpage
  	else
  	MaxPage= totalnumber \ MaxPerpage+1
  	end if
	if int(CurrentPage)>int(MaxPage) then
	CurrentPage=MaxPage
	else
	CurrentPage=CurrentPage
	end if
	productRs.absolutepage=CurrentPage
	for ni=1 to row
	if productRs.eof then exit for
	%>
      <tr align="center">
        <%for bj=1 to col
  if productRs.eof then exit for
 rs2=conn.execute("select * from j_productsmallclass where delflag=false and id="&productrs("smallclass")&"")
  %>
        <td width="0%" height="30" align="left"><table  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="135"height="160" align="center" valign="middle"><a href="productView.asp?id=<%=productRs("id")%>"><img src="upimg/<%=productRs("smallpic")%>"  width=100 height=100 border="0"  title="编号&nbsp;:<%=productRs("ProductStuff")%>&#13规格&nbsp;<%=productRs("ProductArea")%>&#13包装&nbsp;<%=productRs("ProductColor")%>&#13类别&nbsp;<%=rs2("classname")%>"></a></td>
              <td width="165" align="left" valign="middle">编号&nbsp;:<a href="productView.asp?id=<%=productRs("id")%>" title="<%=productRs("ProductStuff")%>"><font color="#37C0C7"><%=gottopic(productRs("ProductStuff"),20)%></font></a><br>规格&nbsp;:<font color="#37C0C7">见详细信息</font><br>包装&nbsp;:<font color="#37C0C7">见详细信息</font><br>类别&nbsp;:<font color="#37C0C7"><%=rs2("classname")%></font><br><a href="productView.asp?id=<%=productRs("id")%>">详细信息</a></td>
            </tr>
            <tr>
              <td height="1" colspan="2" align="center" valign="middle"><img src="images/product_xuxian.gif"></td>
            </tr>
        </table></td>
        <%
	productRs.movenext
	next
	%>
      </tr>
      <%next
  else
  %>
      <tr>
        <td height="30" colspan="4" align="center"><font color="#FF0000"><strong>未找到……</strong></font></td>
      </tr>
      <%end if
	productRs.close
	set productRs=nothing
	%>
      <tr>
        <td  colspan="4" align="center"><%if more then call showpage(strFileName,totalnumber,MaxPerPage,true,true,"个",CurrentPage) end if%></td>
      </tr>
</table>
	<%end sub%>
	
	<%
	'====================================友情连接=============================
	' Fnum  友情连接的个数
	'=========================================================================
	sub friendSite(Fnum)%>
	<MARQUEE onMouseOver="this.stop()" onMouseOut="this.start()" direction="up" SCROLLAMOUNT=10 SCROLLDELAY=200 width="176" align="center" height="250">
            <table width="95%" height="95%" border="0" align="center" cellpadding="0" cellspacing="0">
             <%
			 set Frs=server.CreateObject("adodb.recordset")
			 Fsql="select * from J_FriendSite order by newid desc"
			 Frs.open Fsql,conn,1,1
			 if not Frs.eof or Frs.bof then
			 for i=1 to Fnum
			 if Frs.eof then exit for
			 %>

              <tr> 
                <td align="center" height="40"><a href="<%=Frs("http")%>"><img src="<%=Frs("logo")%>" width="88" height="31" border="0" alt="<%=Frs("name")%>"></a></td>
              </tr>
              <%
			  Frs.movenext
			  next
			  end if
			  %>
            </table>
</MARQUEE>
<%
Frs.close
set Frs=nothing

⌨️ 快捷键说明

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