Image vars

6 posts by 2 authors in: Forums > CMS Builder
Last Post: August 22, 2008   (RSS)

By jjem - August 22, 2008

Hi,
I would like the record num and not the upload num, below in the bold php tag. How do I get this done? Have been searching through the posts with no success...

Thanks for your help.

(By the way, Dave, thanks for the help on the contact form issue...)
Jeremy

<?php foreach ($galleryRecords as $record): ?>
<h3><?php echo $record['title'] ?></h3>
<p>
<?php foreach ($record['pictures'] as $upload): ?>

<?php if ($upload['hasThumbnail']): ?>
<a rel="rokbox[650 424](<?php echo $records['num']?>)" href="<?php echo $upload['urlPath'] ?>" title=""><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /></a><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 break; ?>
<?php endforeach ?></p>

Re: [oams] Image vars

By Dave - August 22, 2008

Hi Jeremy,

Try <?php echo $record['num'] ?> (without the s).

Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Image vars

By jjem - August 22, 2008

Hi Dave, it does not work... already tried...
J

Re: [oams] Image vars

By Dave - August 22, 2008

That's very strange. What error is returned?

Try adding this debugging code below the foreach line to see what fields are available in $record:

<?php foreach ($galleryRecords as $record): ?>
<xmp><?php print_r($record); ?></xmp>

And remove it when you're done. Let me know what that shows and what the error was.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Image vars

By jjem - August 22, 2008

Sorry about that, there is no error message and it works.

The fact is my gallery does not work because I have the <?php break; ?> to show only one image per record in the List.

The <a rel="rokbox[650 424] (<?php echo $record['num']?>)" was to group the rest of the pictures of each record (album) into a slideshow (mootools).

[:/]

Re: [oams] Image vars

By Dave - August 22, 2008

Oh ok, so is it working the way you need now? Or do you need any more help with it?
Dave Edis - Senior Developer
interactivetools.com