Hi,
I think I can see the problem.
You're calling the variable $gallerytest['num'], but I can't see where that variable is being created, I think you might need to change your code to this:
<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/petersmi/public_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."); }
// load records
list($gallerytestRecords, $gallerytestMetaData) = getRecords(array(
'tableName' => 'gallerytest',
'where' => whereRecordNumberInUrl(33),
'limit' => '1',
));
$gallerytestRecord = @$gallerytestRecords[0]; // get first record
// show error message if no matching record is found
if (!$gallerytestRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}
//Get prev/next links using the blog num
list($prevRecord, $nextRecord, $firstRecord, $lastRecord) = getPrevAndNextRecords(array(
'tableName' => 'gallerytest',
'recordNum' => $gallerytestRecord['num'],
'orderBy' => 'createdDate'
));
?>
So I've changed the code so that it uses the $gallerytestRecord variable. Let me know if you have any questions.
Thanks!
Greg
Greg Thomas
PHP Programmer - interactivetools.com