国产探花免费观看_亚洲丰满少妇自慰呻吟_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%》



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 诸暨市| 富源县| 江陵县| 鄢陵县| 迁安市| 平利县| 孝义市| 临漳县| 射阳县| 安溪县| 天长市| 乌鲁木齐市| 宁夏| 灌南县| 中宁县| 镇雄县| 乌拉特中旗| 祁连县| 库伦旗| 嵊泗县| 龙游县| 赤城县| 昌吉市| 天全县| 南昌市| 黄冈市| 喀喇沁旗| 南岸区| 邛崃市| 东乌| 新闻| 保亭| 北碚区| 呼伦贝尔市| 余干县| 肃南| 札达县| 自贡市| 叶城县| 宣汉县| 长阳|