news.asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:2k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <table width="189" border="0" cellpadding="0" cellspacing="0">
  2.   <tr>
  3.     <td><img src="skin/skin<%=skinid%>/newtop.gif" width="189" height="40" border="0" usemap="#Map" /></td>
  4.   </tr>
  5.   <tr>
  6.     <td background="skin/skin<%=skinid%>/newbg.gif"  >
  7.       <table  width="98%" height="22" border="0" align="center" cellpadding="0" cellspacing="0">
  8.         <tr>
  9.           <%dim i
  10.   i=0
  11.   set rs=server.CreateObject("adodb.recordset")
  12.   rs.open "select top 6 newsname,adddate,newsid from news order by newsname desc",conn,1,1
  13.   if rs.eof and rs.bof then
  14.   response.write "目前还没有商城新闻"
  15.   else
  16.   do while not rs.eof
  17.   i=i+1%>
  18.           <td width="10%"  valign="middle">
  19.           <div align="center"><img src="skin/skin<%=skinid%>/blit_01.gif" height="3" width="2" /></div></td>
  20.           <td width="90%"height="18" valign="middle"><span class="noti_text">
  21.             <a href="trends.asp?id=<%=rs("newsid")%>"><%=InterceptString(rs("newsname"),25)%></a>
  22.           </span></td>
  23.         </tr>
  24.         <%rs.movenext
  25.   loop
  26.   end if
  27.   rs.close
  28.   set rs=nothing%>
  29.       </table></td>
  30.   </tr>
  31.   <tr>
  32.     <td ><img src="skin/skin<%=skinid%>/newbot.gif" width="189" height="14" /></td>
  33.   </tr>
  34. </table>
  35. <map name="Map" id="Map">
  36.   <area shape="rect" coords="40,10,138,34" href="trend.asp" />
  37.   <area shape="rect" coords="144,6,181,23" href="trend.asp">
  38. </map>
  39.   <%
  40. function InterceptString(txt,length) 
  41. txt=trim(txt) 
  42. x = len(txt) 
  43. y = 0 
  44. if x >= 1 then 
  45. for ii = 1 to x 
  46. if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then 
  47. y = y + 2 
  48. else 
  49. y = y + 1 
  50. end if 
  51. if y >= length then 
  52. txt = left(trim(txt),ii) 
  53. exit for 
  54. end if 
  55. next 
  56. InterceptString = txt 
  57. else 
  58. InterceptString = "" 
  59. end if 
  60. End Function 
  61. %>