国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

構建你的網站新聞自動發布系統之五

2019-11-18 22:19:53
字體:
來源:轉載
供稿:網友
(三)把新聞代碼插入你的頁面   
  最好的新聞發布,當然是為網站本身定做的,那樣才能與主頁風格一致,但如此
一來,新聞發布系統有缺乏了通用性了,不能移值到別的網站上使用,有得必有失,
在這個基礎上關鍵是找一個平行點。綜合來考濾,最好的做法是與頁面分離,那樣就
可以不影響網頁的外觀,而也能達到很好的效果,在使用新聞的網頁上我們可以通過
放置一條這樣的script語句來調用新聞代碼   
  《script language="javaScript"   
src="http//xxx.com.cn/special/linux/lnews/autoup.asp"》   
  大家可以到這里看看效果   
  現在請大家看看autoup.asp的代碼。   
《% @language="vbscript" %》   
《!--#include Virtual="/news/data/data.inc"--》   
《%   
Set rs = Server.CreateObject("ADODB.Recordset")   
sql="select * from data Order by news_id Desc"   
rs.open sql,conn,3,2   
if rs.bof then   
response.end   
end if     
dispmess="《table border=0 width=100% cellpadding=0》"   
  
rs.movefirst   
disp=""   
count=0   
  
disp="《tr》《td width=100% 》《b》廣州市場《/b》《/td》《/tr》"   
  
do while not rs.eof   
  
'廣州市場   
  
if Cint(rs("news_class"))=3 then   
  
disp=disp&"《tr》《td width=100% 》《a
href=http://www.aaaaa.com.cn/news/read.asp?news_id="&rs("news_id")&"
target=_blank》>>"&rs("news_title")&"《/a》(《font size=1》"&rs
("news_year")&"-"&rs("news_month")&"-"&rs("news_day")&" "&rs
("news_time")&"《/font》)《/td》《/tr》"   
if count》=10 then 'clng(application("disp_1"))-1 then   
exit do   
end if   
count=count+1   
end if   
rs.movenext   
  
loop   
disp=disp&"《tr》《td width=100% align=right》【更多新聞...】      
《/td》《/tr》"   
dispmess=dispmess&disp     
rs.movefirst   
disp=""   
count=0   
  
disp="《tr》《td width=100% 》《b》市場風云《/b》《/td》《/tr》"   
  
do while not rs.eof   
  
'市場風云   
  
if Cint(rs("news_class"))=1 then   
  
disp=disp&"《tr》《td width=100% 》《a
href=http://www.aaaaa.com.cn/news/read.asp?news_id="&rs("news_id")&"
target=_blank》>>"&rs("news_title")&"《/a》(《font size=1》"&rs
("news_year")&"-"&rs("news_month")&"-"&rs("news_day")&" "&rs
("news_time")&"《/font》)《/td》《/tr》"   
if count》=10 then 'clng(application("disp_2"))-1 then   
exit do   
end if   
count=count+1   
end if   
rs.movenext   
  
loop   
disp=disp&"《tr》《td width=100% align=right》【更多新聞...】      
《/td》《/tr》"   
dispmess=dispmess&disp   
rs.movefirst   
disp=""   
count=0   
disp="《tr》《td width=100% 》《b》IT新聞《/b》《/td》《/tr》"   
  
do while not rs.eof   
'IT新聞   
if Cint(rs("news_class"))=2 then   
  
disp=disp&"《tr》《td width=100% 》《a
href=http://www.aaaaa.com.cn/news/read.asp?news_id="&rs("news_id")&"
target=_blank》>>"&rs("news_title")&"《/a》(《font size=1》"&rs
("news_year")&"-"&rs("news_month")&"-"&rs("news_day")&" "&rs
("news_time")&"《/font》)《/td》《/tr》"   
if count》=50 then 'clng(application("disp_3"))-1 then   
exit do   
end if   
count=count+1     
  
end if   
rs.movenext   
loop   
disp=disp&"《tr》《td width=100% align=right》【更多新聞...】      
《/td》《/tr》"   
dispmess=dispmess&disp   
    
dispmess=dispmess&"《/table》"   
  
dispmess="document.write('"&dispmess&"')"     
%》   
《%=dispmess%》



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 洪雅县| 云梦县| 孝感市| 全椒县| 简阳市| 湟中县| 社旗县| 沅江市| 繁峙县| 横峰县| 全州县| 无为县| 苍南县| 焉耆| 康定县| 新源县| 奉贤区| 吴江市| 临邑县| 多伦县| 巧家县| 崇明县| 涡阳县| 米易县| 三门县| 渝中区| 普宁市| 华容县| 邵阳县| 江西省| 佳木斯市| 西平县| 沂源县| 平顺县| 柯坪县| 清水河县| 罗山县| 张掖市| 阜宁县| 阳春市| 剑阁县|