CREATING A DETAILS PAGE TO DISPLAY A SINGLE IMAGE FROM THE MULTI IMAGE UPLOAD AND USING INFO FIELDS - Aug 3rd, 2010


The standard code block still goes at the top of the page:



<?php

require_once "/path_to_your/cmsAdmin/lib/viewer_functions.php";
list(
$photographyRecords, $photographyMetaData) = getRecords(array(
'Table name' => 'photography',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$photographyRecord = @$photographyRecords[0]; // get first record?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>



Then for example, if you want the 5th image (counting starts with “0") in the series that was the size specified in
thumbnail 2 to be displayed on the page you would call it with:



<img src="<?PHP echo $photographyRecord['images'][4]['thumbUrlPath2']?>" border="0" width="<?PHP echo
$upload['thumbWidth2'] ?>" height="<?PHP echo $upload['thumbHeight2']?>" style="margin-bottom: 5px" />



And if you wanted to use the info fields associated with that specific image you would call them with (substituting the
info number for “X”):



<?PHP echo $photographyRecord['images'][4]['infoX']?>



If you want to test for an image first you can use the code:



<?PHP if ($photographyRecord['images'][4]): ?>
...
<?PHP endif ?>



Pretty simple when you know how isn’t it.



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service