Categories > TinyButStrong general >

Last Record, Mergeblock and Navigation Bar

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: SarCaSM
Date: 2005-06-24
Time: 01:55

Last Record, Mergeblock and Navigation Bar

Wondering if anyone can help me out by giving an example of how to use a mergeblock and navigation bar together, but I want to display  one record on a page and the last record first.
By: SarCaSM
Date: 2005-06-24
Time: 04:45

Re: Last Record, Mergeblock and Navigation Bar

Basically asking because I try using a -1 for PageNum in the mergeblock (and essentially the mergenavigation), but it doesn't display anything at all.  My code is as follows.

$query = "SELECT stories.Content, images.Filename FROM stories, images WHERE images.ID = stories.Image ORDER BY Timestamp ASC";
$RecCnt = $tbs->MergeBlock('blk1',$cnx_id,$query,$PageSize,$PageNum,$RecCnt);
$tbs->MergeNavigationBar('nv','',$PageNum,$RecCnt,$PageSize);

and $PageNum is set to -1 if $story is not set.  But when its -1 nothing gets displayed.
By: Skrol29
Date: 2005-06-24
Time: 21:26

Re: Last Record, Mergeblock and Navigation Bar

Hi SarCaSM,

I've tried to reproduce your problem and I've discovered that TBS 2.x has a bug with MergeBlock() : when the argument $PageNum is set to -1, and when the last page to display contains only one record, then MergeBlock() display no record.

I'm working on that bug and will give more information when I've found how to fix it.
By: SarCaSM
Date: 2005-06-24
Time: 23:47

Re: Last Record, Mergeblock and Navigation Bar

Thanks Skrol!  I thought for a while there I was messing up somehow in my code, or that something special had to be done for a mergeblock and mergenavigation being used together.  Definitely, please let me know when you have a fix, it will be incredibly useful to me.
By: Skrol29
Date: 2005-06-25
Time: 00:50

Re: Last Record, Mergeblock and Navigation Bar

The fix is downloadable.
TBS version 2.02.4

Just tell me when your bug is gone, if you can.
By: SarCaSM
Date: 2005-06-25
Time: 03:04

Re: Last Record, Mergeblock and Navigation Bar

Hmmm, ok.  That fixed it, though now I have a problem of my own (I think its my problem and not TBS) with the navigation.  Going to try figuring it out tonight, but I might have to post.

The previous bug is definitely fixed though.  Yay!