Tutorials to .com

Tutorials to .com » Asp » Skills » Build your web site news release system of the three auto -

Build your web site news release system of the three auto -

Print View , by: iSee ,Total views: 9 ,Word Count: 1672 ,Date: Tue, 25 Aug 2009 Time: 4:00 AM

(C) the code into your page news the best news release, of course, tailor-made for the site itself, so be consistent with the home-style, but this way, press release system has a lack of a common nature, and not be transferred to the value of to other sites to use, gains will lose, on this basis, the key is to find a parallel point. To test an integrated filter, the best approach is to separate the page, so you can not affect the appearance of web pages, but also achieve good results in the use of news website we can put a statement in this script to invoke News Code "script language =" JavaScript "
src = "HTTP / / xxx.com.cn / special / Linux / lnews / autoup.asp" "
You can go here to see results now please take a look at autoup.asp code.
"% @ 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 "in Guangzhou market," / b "" / td "" / tr ""

do while 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" / b "" / td "" / tr ""

do while not rs.eof

'The market situation

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" / b "" / td "" / tr ""

do while 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
count = count +1



end if
rs.movenext
loop
disp = disp & "" tr "" td width = 100% align = right "【More News ...】" / td "" / tr ""
dispmess = dispmess & disp



dispmess = dispmess & "" / table ""

dispmess = "document.write ( '" & dispmess &"')"


% "
"% = Dispmess%"

By customizing the code, you can create a consistent display format for the page you requested.
Add, delete, display all talk is over, the last one, is to press the details of the show.
When the user clicks on news headlines, open disp.asp file while using the GET parameters passed in this way to the past, we look at the contents of documents disp.asp

"% @ Language =" vbscript "%"
"!--# Include Virtual = "/ news / data / data.inc" - "
"%
Set rs = Server.CreateObject ( "ADODB.Recordset")
sql = "select * from data where Cstr (news_id )='"& Cstr (request.querystring (" news_id "))&"'"
rs.open sql, conn, 3,2
% "
"Html"

"Head"
"Meta http-equiv =" Content-Type "content =" text / html; charset = gb2312 ""
"Title" "/ title"
"/ Head"

"Body topmargin =" 8 "leftmargin =" 8 ""
"Div align =" center "" "center"

"Table border =" 0 "width =" 600 "cellpadding =" 0 "cellspacing =" 0 ""
"Tr"
"Td width =" 100 %"""/ td "
"/ Tr"
"Tr"
"Td width =" 100% "bgcolor =" # E6E6E6 "" "table border =" 0 "width =" 100% "cellpadding =" 0 ""
"Tr"
"Td width =" 100% "bgcolor =" # D2E8FF "" "p align =" center "" "b" "% = rs (" news_title ")%""/ b "" / td "
"/ Tr"
"Tr"
"Td width =" 100% "bgcolor =" # FBFDFF "" "table border =" 0 "width =" 100% "cellpadding =" 0 ""
"Tr"
"Td width =" 100% "" "p align =" right "" (update: "% = rs (" news_year ")%"-"%= rs ( "news_month ")%"-"%= rs (" news_day ")%" "% = rs (" news_time ")%") "/ td"
"/ Tr"
"Tr"
"Td width =" 100% "" "p align =" center "" "%
if rs ( "news_pic ")"""" then
% "" Img src =""%= rs ( "news_pic ")%""""%
end if
% "" / Td "
"/ Tr"
"Tr"
"Td width =" 100% "" "div align =" center "" "center" "table border =" 0 "width =" 90% "cellpadding =" 0 ""
"Tr"
"Td width =" 100 %"""%= rs ( "news_comment")% "
"/ Td"
"/ Tr"
"/ Table"
"/ Center" "/ div" "/ td"
"/ Tr"
"/ Table"
"/ Td"
"/ Tr"
"Tr"
"Td width =" 100% "bgcolor =" # D2E8FF "" "p align =" center "" "a href =" javascript: window.close () "" Close Window "/ td"
"/ Tr"
"/ Table"
"/ Td"
"/ Tr"
"Tr"
"Td width =" 100 %"""/ td "
"/ Tr"
"Tr"
"Td width =" 100 %"""/ td "
"/ Tr"
"/ Table"
"/ Center" "/ div" "/ a"
"/ Body"
"/ Html"

At this point, press release system has been able to put into use, give it a try, is not very convenient, very easy to add the daily news content. The next section. We will join the News Publishing System (title / text) search function, making it even more perfect


ASP skills Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.