Categories > TinyButStrong general >

page navigation syntax

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: powerpop
Date: 2004-07-27
Time: 02:37

page navigation syntax

i cannot tell from the documentation how to properly navigate a large list of items from my database

i have a set of 200 or more thumbnails - i want to display 15 on a page and then put up a nav bar to let me go to the next set of 15 - i do not know ahead of time how many total thumbnails i have

so what is the proper syntax to MergeBlock to have it show 15 at a time and the syntax for the navigation bar?

and a second question - on this same page i am showing two sets of information - thumbnails and text listings - both will have navigation bars - can i put two on one page?
By: powerpop
Date: 2004-07-27
Time: 02:57

Re: page navigation syntax

just read deeper into the online doc - so i need to do the following in the MergeBlock to then be able to set up the Navigation:

if (isset($_POST['nbr_rec'])) {
  $nbr_rec = $_POST['nbr_rec'] ;
} else {
  $nbr_rec = -1 ;
}
$nbr_rec = $TBS->MergeBlock('blk1',$cnx_id,'select * from t_country',$p_size,$p_num,$nbr_rec);

does that mean that the Navigation POSTS the value nbr_rec to the page?
By: Skrol29
Date: 2004-07-27
Time: 10:19

Re: page navigation syntax

Hi,

MergeBlock() and MergeNavigationbar() are disconnected. So you can marge as many blocks and navigation bars as you want. If you have several navigation bars, just take care that they have different names.

With "by-page" mode, the last argument $RecCount for MergeBlock() enables you to drive the merge about the last record.
* $RecCount = 0 : the real number of records is unknown and TBS reads data as much as necessary to display the page.
* $RecCount = -1 : TBS reads data until the end of the recordset.
* $RecCount >0 : you already know the number of records.

For your problem, you can only use $RecCount = 0 (the default value) and all should run ok.
The snippet given in the manual is for a smart use of couting records : first you use ($RecCount = -1) to count the real number of records, and for next page calls, you use the real number of records.