Hello All,
I've got something that I'm pretty sure isn't too complicated, but I'm stumped.
My category menu is three levels deep: there is one "overview" section that is at depth "0" The main reserves.php list viewer displays the content of this overview along with links across the top for all records of depth "1". These links take the user to reservesDetail.php and display the information of all the depth "1" records. So far so good.
You can see the above here: http://74.52.72.36/~jocotoco/reserves.php
My problem is that on the reservesDetail.php page I'd like to have links across the top of the page to the associated depth "2" records. That is, it would look like the reserves.php page but with the third level links.
I'm almost there, I think: http://74.52.72.36/~jocotoco/reservesDetail.php?overview-tapichalaca-2
The header at the top of the reservesDetail.php page is as follows:
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/jocotoco/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($reservesRecords, $reservesMetaData) = getRecords(array(
'tableName' => 'reserves',
'where' => whereRecordNumberInUrl(1),
));
$reservesRecord = @$reservesRecords[0]; // get first record
// show error message if no matching record is found
if (!$reservesRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}
?>
The php of the reservesDetail.php page is this:
<div class="content_main">
<h3 style="margin:0px;"><?php echo $reservesRecord['name'] ?></h3>
<div class="navigation_secondary">
<?php foreach ($reservesRecords as $record): ?>
<?php if ($reservesRecord['num'] != $record['num']): ?>
<div style="display:inline; margin-right:5px;"><a href="<?php echo $record['_link'] ?>"><?php echo $record['name'] ?></a></div>
<?php else: ?>
<div style="display:inline; margin-right:5px;"><?php echo $record['name'] ?></div>
<?php endif ?>
<?php endforeach ?>
</div>
<!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
Record Number: <?php echo $reservesRecord['num'] ?><br/>
Parent Category: <?php echo $reservesRecord['parentNum'] ?><br/>
Name: <?php echo $reservesRecord['name'] ?><br/>
Content: <?php echo $reservesRecord['content'] ?><br/>
<!-- _link : <a href="<?php echo $reservesRecord['_link'] ?>"><?php echo $reservesRecord['_link'] ?></a><br/> -->
<!-- STEP 2a: Display Uploads for field 'images' (Paste this anywhere inside STEP2 to display uploads) -->
<?php foreach ($reservesRecord['images'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>
<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
<?php endif ?>
<?php endforeach ?>
<!-- STEP2a: /Display Uploads -->
<hr/>
<?php if (!$reservesRecord): ?>
No record found!<br/><br/>
<?php endif ?>
<!-- /STEP2: Display Records -->
<a href="<?php echo $reservesMetaData['_listPage']; ?>"><< Back to OVERVIEW</a> -
<a href="mailto:?subject=<?php echo urlencode(thisPageUrl()) ?>">Email this Page</a>
</div>
Any help would be greatly appreciated.
Ian