Contents |
Display a random image on a external page
This tiny module just provides a small interface to be able to fetch a small block of HTML containing a random image. This forum thread may have more information: http://gallery.menalto.com/node/93574
The source files can be found here:
http://code.nkinka.de/gitweb?p=randimg.git;a=summary
The download link in the top right of this page will give you a tar-gzipped snapshot of the most current version, or click on the "snapshot" link next to the commit you want at the URL above. Alternatively, you can use git to clone it:
$ git clone git://code.nkinka.de/randimg.git
Save the folder to the modules directory on the server. Activate the module: Login -> Admin -> Modules. Check the box next to the module. Click update at the bottom of the page.
Paste the following code into any webpage (where PHP is available, of course):
<?php
$imglink = file_get_contents("http://EXAMPLE.COM/gallery3/index.php/randimg", "r");
echo "$imglink";
?>
Don't forget to edit the URL for the proper location/domain.