pagination problems...

3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 10, 2012   (RSS)

Re: [shawnpatoka] pagination problems...

Hi,

I think I can see what the problem is. The meta data variable is used to store information for pagination, your example calls the $notParticipating variable and not the $barMetaData variable in your pagination code.

Something like this should work:

// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/nfs/c06/h05/mnt/94791/domains/shawnpatoka.com/html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }


list($participating, $barMetaData) = getRecords(array(
'tableName' => 'participating_bars',
'loadUploads' => true,
'allowSearch' => false,
'where' => "participating_bar = '1'"
));

list($notParticipating, $notbarMetaData) = getRecords(array(
'tableName' => 'participating_bars',
'perPage' => '5',
'loadUploads' => true,
'allowSearch' => false,
'where' => "participating_bar = '0'"
));


And....

<?php if ($notbarMetaData['prevPage']): ?>
<a href="<?php echo $notbarMetaData['prevPageLink'] ?>">&lt;&lt; prev</a>
<?php else: ?>
&lt;&lt; prev
<?php endif ?>

- page <?php echo $notbarMetaData['page'] ?> of <?php echo $notbarMetaData['totalPages'] ?> -

<?php if ($notbarMetaData['nextPage']): ?>
<a href="<?php echo $notbarMetaData['nextPageLink'] ?>">next &gt;&gt;</a>
<?php else: ?>
next &gt;&gt;
<?php endif ?>


Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [shawnpatoka] pagination problems...

Excellent! thank you very much for all of your help