Random Image Issue
17 posts by 4 authors in: Forums > CMS Builder
Last Post: January 31, 2011 (RSS)
By KCMedia - January 29, 2011
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Random Image Issue
By Jason - January 31, 2011
Could you attach the latest php files you're working with so I can see your current code?
Thanks
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
By KCMedia - January 31, 2011
here are the 2 files.
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Random Image Issue
By Jason - January 31, 2011
I took a look at your code and didn't see the code I posted in it. Try replacing this:
<?php foreach ($showsRecord['sidebar'] as $upload): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" align="center" />
<?php endforeach ?>
with this:
<?php if($record['sidebar']): ?>
<?php shuffle($record['sidebar']);?>
<?php $image = $record['sidebar'][0];?>
<img src="<?php echo $image['urlPath'] ?>" width="<?php echo $image['width'] ?>" height="<?php echo $image['height'] ?>" align="center" />
<?php endif ?>
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
By KCMedia - January 31, 2011
I did that now there is an error on the page
Notice: Undefined variable: record in /hsphere/local/home/f1077a/packemin.com.au/includes/leftbar.php on line 21
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Random Image Issue
By Jason - January 31, 2011
Sorry, typo,
try this instead:
<?php if($showsRecord['sidebar']): ?>
<?php shuffle($showsRecord['sidebar']);?>
<?php $image = $showsRecord['sidebar'][0];?>
<img src="<?php echo $image['urlPath'] ?>" width="<?php echo $image['width'] ?>" height="<?php echo $image['height'] ?>" align="center" />
<?php endif ?>
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
By KCMedia - January 31, 2011
perfect thank you very much.
Craig
KC Media Solutions
www.kcmedia.biz