Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page number list nees <br>!

Status
Not open for further replies.

mattys

Programmer
May 1, 2001
35
GB
Hi

Does anyone knbow how to deal with page numbers lists that could go on forever and have your page scroll sidewyas!!?

I have a database of users and a certain amount of users are displayed per page, the rest of the users can be accessed by htting page number links at the bottom. However, the database is filling up now and the list size means I have to scroll sideways and it's just plain messy!

Is there any javascript code that will add a <br> tag after, say, a certain number of page numbers?

Help appreciated.

Matt
 
I would say YES. Almost certainly, at least PROBABLY.

Post some of the code you're using and I'm sure someone will chime in with a suggestion on how to edit it.

--Dave
 
Hi

This is the ASP code that goes in the body:

Code:
<%'Pages Navigation...
if rs.PageCount > 1 then ' If pagecount>1
Response.Write("<p align=center class=MsgText>Pages:")

if page > 1 then ' Prev Button
 Response.Write("&nbsp;<a href=users.asp?page=" & page-1 & "&sort=" & sort & " title='Prev Page'>&lt;&lt;Prev</a>")
end if
for i=1 to rs.PageCount ' Page List
if i=page then 
 Response.Write("&nbsp;" & i)
else Response.Write("&nbsp;<a href=users.asp?page=" & i & "&sort=" & sort & ">" & i & "</a>")
end if 
next

if page < rs.PageCount then ' Next Button
 Response.Write("&nbsp;<a href=users.asp?page=" & page+1 & "&sort=" & sort & " title='Next Page'>Next&gt;&gt;</a>")
end if
 Response.Write("</p>")
else Response.Write("<br>") ' rs.pagecount<=1
end if 'rs.PageCount>1

rs.Close 'Close Prev RS

Dim t1,t2,t3,t4 'Users Statistics
Set rs=Conn.Execute("SELECT COUNT(*) FROM jsUsers")
t1=rs(0)
rs.Close: set Rs=Nothing

Set rs=Conn.Execute("SELECT count(*) FROM jsUsers WHERE enabled<200")
t2=rs(0)
rs.Close: Set rs=Nothing

if dbUseMSSQL then 'SQL Server:
Set rs=Conn.Execute("SELECT count(*) FROM jsUserDetails WHERE DATEDIFF([d],sincedate,GETDATE())<14")
t3=rs(0) 'New for last 14 days
rs.Close: Set rs=Nothing
Set rs=Conn.Execute("SELECT count(*) as Total FROM jsUserDetails WHERE DATEDIFF([d],sincedate,GETDATE())>14")
t4=rs(0) 'Never Logged for last 14 days
'rs.close: set rs=Nothing
else
Set rs=Conn.Execute("SELECT count(*) FROM jsUserDetails WHERE DATEDIFF('d',sincedate,Now())<14")
t3=rs(0) 'New for last 14 days
rs.Close: Set rs=Nothing
Set rs=Conn.Execute("SELECT count(*) as Total FROM jsUserDetails WHERE DateDiff('d',lastlogged,Now())>14")
t4=rs(0) 'Never Logged for last 14 days
'rs.close: set rs=Nothing
end if
closeDB()

Response.Write("<b><br>USERS: Total: " & t1 & ", Trial: " & t2 & ", Permanent: " & t1-t2 & _
".<br>New Users for last 14 days: " & t3 & _
".<br>Never Logged Users for last 14 days: " & t4 & ".</b>")
end select 'End of command selection

private function isValidMail(str) 'Function Test email address format.
dim i,i2,l
isValidMail=0
l=len(str)
if l=0 then exit function
if str=Null then exit function
i=InStr(str,"@")
if i=0 then exit function
i2=InStr(i+1,str,".")
if i2=0 or i2<i or i=1 or i2>=l or l-i2<2 or i2-i<2 then exit function
'DBG: Response.Write("<br>isValidMail: len=" & l & " i=" & i & " i2=" & i2 )
isValidMail=1
end function %>

Would this, perhaps, be better posted on the ASP forum?

Matt
 
Maybe yes/maybe no. It would be helpful to also post the clean HTML that this ASP produces.

--Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top