Displaying Random Image from G2 using PHP

| | Comments (0)

There are only a couple of lines of code I've put in my main page's PHP to support a random image from G2's photo gallery:

<link rel="stylesheet" href=http://WEBSITE/gallery2/main.php?g2_controller=imageblock.ExternalCSS>
<?php
@readfile('http://WEBSITE/gallery2/main.php?
g2_view=imageblock.External&g2_blocks=randomImage&
g2_show=date|views');
?>

Of course, the link part goes in your <head> section and the readfile part goes in your <body> section somewhere...

Setting the stylesheet allows you to control the view from within G2's Image Block admin page.  Click on the Image Block link from G2's site admistration and it will give you an exact link to put into your own website based on your own G2 installation settings.  You can modify several parameters within the link as described on the admin page.

Leave a comment

Verification (needed to reduce spam):

Amazon Lists

About this Entry

This page contains a single entry by Shawn published on July 9, 2007 9:12 AM.

Another Gameplay Video, Lavaflow was the previous entry in this blog.

Who's that good-lookin' red head that's been around lately? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.