which bit of recordset code to show a pic?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 25, 2008   (RSS)

By jimbly2 - April 25, 2008

Hi,

I am creating a 'dynamic' page which has an image which can be selected from a library of images along with text and heading, but I can't get the image to show? There seems a lot of code to do with the image in the 'Page viewer' page.

This is the code I've been trying to display the image:

<div id="apDiv3"><img src=" <?php if ($record): ?>
<?php foreach (getUploads($options['tableName'], 'picture', $record['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" /><br/>

<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" /><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

<?php endif ?>
<?php endforeach ?>
<?php endif ?>" /></div>

Clearly it doesn't work, but I don't really understand what it all does. The image shows up fine in the 'page viewer' page. Where am I going wrong?



thanks

Jim

Re: [jimbly2] which bit of recordset code to show a pic?

By jimbly2 - April 25, 2008

Fixed it :-) I'm gonna have to stop doing this!