Create a press release system with text +asp (iii) News list display

Source: Internet
Author: User
Show <%
Dim myfso,myread
Set Myfso=createobject ("Scripting.FileSystemObject")
Set Myread=myfso.opentextfile (Server.MapPath ("./new_list.asp"), 1,0)

If Myread.atendofstream Then
Response.Write "No news currently added"
Response.End
Else

Dim Mytext,listarray
Mytext=myread.readall
Listarray=split (mytext, "|") ' ###### #把所有记录分割成一个数组a


Dim Recordcount,pagecount, PageSize, Pagenum
Recordcount=ubound (Listarray) ' ########### #记录条数
pagesize=2
Pagecount=recordcount/pagesize ' ###### #取得页面数
If InStr (1,pagecount, ".") =null or InStr (1,pagecount, ".") =0 Then
Pagenum=pagecount
Else
Pagenum=int (PageCount) +1
End If

Dim topage
Topage=cint (Request.QueryString ("ToPage")) ' ####### #取得要显示的页面
If Topage<=0 Then
Topage=1
End If
If Topage>pagenum Then
Topage=pagenum
End If


Dim i,j,n
B=listarray
For i=0 to Recordcount-1 ' ####### #把每一条记录组成一个数组
J=split (Listarray (i), ",")
If UBound (j) =6 Then
B (i) = "<span style= ' COLOR: #ffbd00; Font-size:7px ' ><li></span><span style= ' font-size:10pt ' ><a href= ' news_view.asp?id= ' & j (0) & "' Target=blank>" & J (1) & "(figure) </a> click:" & J (4) & "Time last Released:" &j (5) & "&LT;/SPAN&G t; "
Else
B (i) = "<span style= ' COLOR: #ffbd00; Font-size:7px ' ><li></span><span style= ' font-size:10pt ' ><a href= ' news_view.asp?id= ' & j (0) & "' Target=blank>" & J (1) & "</a> click:" & J (4) & "Time last Released:" &j (5) & "</span>"
End If
Next

' ####### #把记录反排序存储在新的数组实现按时间反排序
Dim c (100)
N=0
For I=recordcount to 0 step-1
C (n) =b (i)
N=n+1
Next


Dim CurrentRecord
currentrecord=pagesize* (topage-1) +1 ' ######## #显示每一页
For K=1 to PageSize
If Len (c (currentrecord)) =0 Then
Exit For
End If
Response.Write C (CurrentRecord) & "<br>"
Currentrecord=currentrecord+1
Next
Response.Write "<body bgcolor= #EDF0F5 topmargin=10 marginheight=5 leftmargin=4"
For M=1 to Pagenum
Response.Write "<span style=font-size:10pt><a href=news_list.asp?topage=" &m& ">" &m& " </a></span> "
Next

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.