Re: [Dave] CMS Multiple Images
Hi Dave and thanks again.
Have bee getting errors when I view the data.xml.php page: "Parse error: parse error, unexpected T_ENDIF in /home/content/s/m/o/smoaklandco/html/data.xml.php on line 23"
No photos are showing. Sorry about the amount of detail in this email.
The code on my page, and I have tried it several ways is:
<?php
require_once "/home/content/s/m/o/smoaklandco/html/cmsAdmin/lib/viewer_functions.php";
list($customRecords, $customDetails) = getRecords(array(
'tableName' => 'custom',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$customRecord = $customRecords[0]; // get first record
?>
<?php header('Content-type: application/xml; charset=utf-8'); ?>
<?php foreach ($customRecord['lg_photo'] as $upload): ?>
<image>
<pic><?php echo $upload['urlPath'] ?></pic>
<thumb><?php echo $upload['thumbUrlPath'] ?></thumb>
<title>David Smoak</title>
<desc>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur sit amet urna vel est laoreet interdum. Sed eget arcu. Phasellus ac est vel neque sagittis rutrum. Sed laoreet dolor ac pede. Sed arcu. Aenean tincidunt. Sed convallis, elit eget blandit consequat, ante arcu molestie nulla, vel feugiat nisi enim sit amet tortor. Nulla facilisi. Nullam placerat purus. Cras tincidunt. Vivamus diam est, accumsan vitae, fermentum vel, lacinia non, odio. Pellentesque ipsum leo, molestie nec, gravida vel, convallis nec, nisi. Phasellus vitae massa. Sed nulla nisl, porttitor id, egestas nec, sodales quis, ligula. Duis dapibus, elit nec ultrices malesuada, augue sapien sollicitudin ligula, quis mattis augue velit vel mauris. Aliquam erat volutpat. Cras in mi et orci vulputate venenatis. Suspendisse adipiscing ante.</desc>
</image>
<?php endif ?>
<?php endforeach ?>
I also tried it without the top segment and had it look very similar to yours and got the following errors:
<?php header('Content-type: application/xml; charset=utf-8'); ?>
<?php foreach ($customRecord['lg_photo'] as $upload): ?>
<image>
<pic><?php echo $upload['urlPath'] ?></pic>
<thumb><?php echo $upload['thumbUrlPath'] ?></thumb>
<title>David Smoak</title>
<desc>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur sit amet urna vel est laoreet interdum. Sed eget arcu. Phasellus ac est vel neque sagittis rutrum. Sed laoreet dolor ac pede. Sed arcu. Aenean tincidunt. Sed convallis, elit eget blandit consequat, ante arcu molestie nulla, vel feugiat nisi enim sit amet tortor. Nulla facilisi. Nullam placerat purus. Cras tincidunt. Vivamus diam est, accumsan vitae, fermentum vel, lacinia non, odio. Pellentesque ipsum leo, molestie nec, gravida vel, convallis nec, nisi. Phasellus vitae massa. Sed nulla nisl, porttitor id, egestas nec, sodales quis, ligula. Duis dapibus, elit nec ultrices malesuada, augue sapien sollicitudin ligula, quis mattis augue velit vel mauris. Aliquam erat volutpat. Cras in mi et orci vulputate venenatis. Suspendisse adipiscing ante.</desc>
</image>
<?php endforeach ?>
And got the folowing errors:
Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/m/o/smoaklandco/html/data.xml.php:3) in /home/content/s/m/o/smoaklandco/html/data.xml.php on line 3
Warning: Invalid argument supplied for foreach() in /home/content/s/m/o/smoaklandco/html/data.xml.php on line 5
Then I added back in the "<?php endif ?>" before the "<?php endforeach ?>"
and I get on the data.xml.php page= "Parse error: parse error, unexpected T_ENDIF in /home/content/s/m/o/smoaklandco/html/data.xml.php on line 12
No Photos