Random Image Issue

17 posts by 4 authors in: Forums > CMS Builder
Last Post: January 31, 2011   (RSS)

By KCMedia - January 26, 2011

Hi

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
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

index_031.php 4K

leftbar.php 2K

Re: [kcmedia] Random Image Issue

Hi Craig,

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
The first CMS Builder reference book is now available on-line!







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

Hi

I have tried that but still no good.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Random Image Issue

By Toledoh - January 27, 2011

line 18 of leftbar.php

see what happens when you close the inline style

overflow:hidden;> to overflow:hidden;">
Cheers,

Tim (toledoh.com.au)

Re: [kcmedia] Random Image Issue

By Toledoh - January 27, 2011

Actually, I think the problem is that you are randomising the "shows", but the uploads within shows aren't being randomised.

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.
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] Random Image Issue

By KCMedia - January 27, 2011

Hi Tim

thanks for that it sort of fixed but still wont show other images.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Random Image Issue

By KCMedia - January 27, 2011

Hi Tim

so where should i put that then.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [Toledoh] Random Image Issue

By KCMedia - January 28, 2011

Hi can anyone from Interactive Tools help with this still cant get it to work.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Random Image Issue

By Jason - January 28, 2011

Hi Craig,

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/