[SOLVED] Random image display

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
brentnl
Power Poster
Power Poster
Posts: 493
Joined: Mon May 11, 2009 4:35 pm

[SOLVED] Random image display

Post 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.
Last edited by brentnl on Thu Nov 19, 2009 4:57 pm, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Random image display

Post 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"}
brentnl
Power Poster
Power Poster
Posts: 493
Joined: Mon May 11, 2009 4:35 pm

Re: Random image display

Post 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.
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Random image display

Post 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
brentnl
Power Poster
Power Poster
Posts: 493
Joined: Mon May 11, 2009 4:35 pm

Re: Random image display

Post 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...
Last edited by brentnl on Thu Nov 19, 2009 1:10 pm, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Random image display

Post by Jos »

ehm... Gallery can't resize bmp images to thumbnails... th resizer only supports the regular jpg, png and gif images
brentnl
Power Poster
Power Poster
Posts: 493
Joined: Mon May 11, 2009 4:35 pm

Re: Random image display

Post 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
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Random image display

Post 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
Post Reply

Return to “Layout and Design (CSS & HTML)”