Build your Website news automatic release system five (paste)

Source: Internet
Author: User
Tags exit count
(iii) Insert the news code into your page
The best news release, of course, is custom-made for the site itself, so as to be consistent with the homepage style, but this way, the news release system has a lack of versatility, can not be moved to other sites to use, there will be lost, on the basis of the key is to find a parallel point. Comprehensive to test filtration, the best approach is to separate from the page, so you can not affect the appearance of the Web page, but also to achieve a good effect, in the use of news on the page we can put a script like this to invoke the news code
Script language= "JavaScript"
Src= "Http//xxx.com.cn/special/linux/lnews/autoup.asp"
We can see the effect here.
Now let's take a look at the autoup.asp code.
% @language = "VBScript"%
"The!--#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" Guangzhou Market "/" "/td" "/tr"

Do as not rs.eof

' Guangzhou Market

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" "More news ..." "/td" "/tr"
Dispmess=dispmess&disp




Rs.movefirst
Disp= ""
Count=0

disp= "TR" "TD width=100%" "B" market Situation "/" "/td" "/tr"

Do as not rs.eof

' Market winds

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" "More news ..." "/td" "/tr"
Dispmess=dispmess&disp



Rs.movefirst
Disp= ""
Count=0
disp= "TR" "TD width=100%" "B" it News "/" "/td" "/tr"

Do as not rs.eof
' It News
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



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.