Member
Member
bplasma   2008-02-04, 01:10
#1

please forgive me if this question is super noobed out...

i am looking to create a page that displays 6 random images from a specific gallery.

i found the code on the zp.org site used to display a single random image from all galleries and it works well:

$randomImage = getRandomImages();
$randomImageURL = getURL($randomImage);
echo "';

i also found the getRandomImageAlbum function, but am unsure how to use it from a page that is not within an album (i.e. splash page on site).

my questions:

  1. how can i specify a gallery to choose the images from?
  2. do i need to put the above block of code in the page 6 times to achieve this effect?

thanks very much for the help.

JP

Member
Member
sbillard   2008-02-04, 05:02
#2

getRandomImagesAlbum()1 will return a single image from the current album. Call it siz times and display the image each time.

Member
Member
bplasma   2008-02-14, 17:40
#3

Thank you very much for the response. This sounds perfect. One last question, is there a way to specify an album as a variable in the page instead of in the URL?

My intent is to have the front page of my website (i.e. http://domain.com/index.php) display 6 images from a specific gallery. For a reference, I have it running here, using pMachine:

http://joshuapickering.com/

Again, many thanks for your help.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.