Display Random Image from G2 to my website

christiecc

Joined: 2005-11-07
Posts: 2
Posted: Sat, 2006-01-14 18:05

Is there an easy to display a random image from my g2 gallery on my website? Is there a URL that I can just insert? I know the function exists in gallery but does it exist in gallery2. I see a lot of posts about random image but they are mostly about image block which only allows random image to display on the gallery's sidebar, header or footer. I want to display the image on a webpage that is outside of the gallery directory. Any help will be appricaited.

p.s. I don't know anything about PHP, maybe this is why I don't understand a lot of posts about random image in the forum. So when reply, please keep in mind that I don't understand PHP. Thanks.

 
ckdake
ckdake's picture

Joined: 2004-02-18
Posts: 2258
Posted: Sat, 2006-01-14 19:09

something like this should work:

<?php
@readfile('http://example.com/gallery2/main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_show=none&g2_maxSize=110');
?>
 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2006-01-14 20:02

topic moved to an appropriate forum.

 
christiecc

Joined: 2005-11-07
Posts: 2
Posted: Sat, 2006-01-14 20:56

thanks for the reply, but I tried it and it does not work.
I think this is because I don't have ImageBlock installed. I check the blocks dropdown on the theme pages, ImageBlock is not an option. I just upgraded my gallery to 2.0.2 typical version, but still no such option. Do I need the full version in order to have ImageBlock installed. Thanks

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2006-01-14 22:48

get the full package of g2. or download the imageblock module from the download page from codex.gallery2.org