Page 1 of 1

[SOLVED] Random image display

Posted: Wed Nov 18, 2009 12:07 am
by brentnl
Hello,

I'm searching for an option to display lets say 30 logo's in a random order. So every logo has to be displayed only once, but on a different spot each time the page is loaded.

This is ment for a sponsor page for a website for a customer of my. He want's to equals his sponsors by rearranging the logos so none of them is displayed at the same spot.

I've found many random image scripts, but they are about random displaying one photo out of a couple of photo's or it where scripts which displayed several photo's randomly; but some photo's could be the same and others wheren't even showing up.

Re: Random image display

Posted: Wed Nov 18, 2009 9:09 am
by Jos
The Gallery Module should be able to do this.
Put the sponsor images in directory uploads/images/Gallery/sponsors/ and call the images in your page with {Gallery action="showrandom" dir="sponsors" number="999"}

Re: Random image display

Posted: Wed Nov 18, 2009 11:15 am
by brentnl
Is it that easy? Thanks!

Is it also possible to cut out all of the album elements such as 'next image' and kind of stuf, so it looks like a static page with just logo's.

Re: Random image display

Posted: Wed Nov 18, 2009 12:00 pm
by Jos
Yes, it's very easy to create a new module tempate for that. You just cut out the parts you don't need.
Hint: click on the info icon beneath the template code field to see which smarty variables are at your service

Re: Random image display

Posted: Thu Nov 19, 2009 1:08 pm
by brentnl
Jos, If I add the tag you mentioned, I get an error:

Code: Select all

sponsors

Warning: getimagesize(uploads/images/Gallery/Sponsors/AdCar.bmp) [function.getimagesize]: failed to open stream: Bestand of map bestaat niet in /home/id2229/domains/joeymanders.nl/public_html/modules/Gallery/Gallery.module.php on line 636

Warning: Division by zero in /home/id2229/domains/joeymanders.nl/public_html/modules/Gallery/Gallery.module.php on line 637

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/id2229/domains/joeymanders.nl/public_html/modules/Gallery/Gallery.module.php on line 691

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/id2229/domains/joeymanders.nl/public_html/modules/Gallery/Gallery.module.php on line 706

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/id2229/domains/joeymanders.nl/public_html/modules/Gallery/Gallery.module.php on line 721

Warning: chmod() [function.chmod]: Bestand of map bestaat niet in /home/id2229/domains/joeymanders.nl/public_html/modules/Gallery/Gallery.module.php on line 722
If I delete the 'showrandom' part, it works fine...

Re: Random image display

Posted: Thu Nov 19, 2009 1:46 pm
by Jos
ehm... Gallery can't resize bmp images to thumbnails... th resizer only supports the regular jpg, png and gif images

Re: Random image display

Posted: Thu Nov 19, 2009 3:01 pm
by brentnl
Jos wrote: ehm... Gallery can't resize bmp images to thumbnails... th resizer only supports the regular jpg, png and gif images
ah, I get it  :)

After I deleted the bmp the gallery kept complaining about that bmp file (which was already deleted), I had to make a different subfolder to fix this problem. Now it's working fine, thanks  ;D

Re: Random image display

Posted: Thu Nov 19, 2009 3:04 pm
by Jos
brentnl wrote: After I deleted the bmp the gallery kept complaining about that bmp file (which was already deleted), I had to make a different subfolder to fix this problem. Now it's working fine, thanks  ;D
I will look at that to make it more stable. thx