Random Image Issue
17 posts by 4 authors in: Forums > CMS Builder
Last Post: January 31, 2011 (RSS)
By KCMedia - January 26, 2011
I am having issues with random images showing up on one section of the website.
I have attached the index page and also the leftbar page that holds the codes but i cant get the images to rotate, there are 4 images in the record but just wont show up will only show the 1st image on page load and will not rotate on repage load.
the website is http://www.packemin.com.au/index.php
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Random Image Issue
If you haven't already, you might try removing some of the
'where' => whereRecordNumberInUrl(1),
Or
'limit' => '1',
in the getrecords code. Sometimes this causes these kinds of problems.
Good luck,
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
Re: [gkornbluth] Random Image Issue
By KCMedia - January 27, 2011
I have tried that but still no good.
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Random Image Issue
By Toledoh - January 27, 2011
see what happens when you close the inline style
overflow:hidden;>
to overflow:hidden;">
Tim (toledoh.com.au)
Re: [kcmedia] Random Image Issue
By Toledoh - January 27, 2011
I think you are going to have to have something like
<?php shuffle($upload); ?>
but it all depends on how you've got it structured.Tim (toledoh.com.au)
Re: [Toledoh] Random Image Issue
By KCMedia - January 27, 2011
thanks for that it sort of fixed but still wont show other images.
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Random Image Issue
By KCMedia - January 27, 2011
so where should i put that then.
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Random Image Issue
By Toledoh - January 27, 2011
Tim (toledoh.com.au)
Re: [Toledoh] Random Image Issue
By KCMedia - January 28, 2011
Craig
KC Media Solutions
www.kcmedia.biz
Re: [kcmedia] Random Image Issue
By Jason - January 28, 2011
There doesn't seem to be any errors in your code. You're actually outputting all of the images in order. Are you just trying to randomize them and then output 1?
If so, try this:
<?php shuffle($showsRecord['sidebar']);?>
<?php $upload = $showRecord['sidebar'][0];?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" align="center" />
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/