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!

Seperating my forum script into pages...

Status
Not open for further replies.

M4TT5T3R

Programmer
Apr 19, 2001
11
US
'Lo there...

I'm coding my forum script at but i'm stuck...

I'm trying to make it show the 100 most recent posts, and anything after that, on different pages... each 100 posts long... an example is at at the bottom of the top frame...

I have no idea how to even start doing this, can anyone help?

Thanks
 
Hi!

Well, I have done this many times - breaking a single page to the pages with sepcial number of records and paging through pages. When you have already a single page with all records displayed, than add a session variable that will hold the current page. In the asp code if this session variable is empty or 1 and there are more than 100 items in recordset, I display the link like <A href=...ASP?page=2 title = 'Next 100 records'>&gt;&gt</A>. If page is 2 or more, I display link to previous page also. In ASP I process Request.QueryString(&quot;page&quot;) and update page properly. When displaying records, I just skip all records that are not in the current page (in the loop I just go to next iteration).
You can also add an '1 2 3 4 5 ...' links to go to appropriate page by a single click. Each will have the sample link but the 'page' parameter will be different.

Hope this helps.


Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top