Howto: Gallery2 pics in sidebar

Posted on Friday, Jan 27, 2006 at 12:00 AM in ,

It is actually a bit of a story, and it began with upgrading my installation of gallery from version 1 to version 2. Gone in version 2, at the time, was syndication via rss of pictures. That's originally how I had the pictures published to the right side of my blog. There's an RSS plugin for Gallery2, which I did get to install, but it didn't completely work since it sends the images as enclosures, not just links to the image.

That led me to find other ways to get pictures from Gallery onto a remote site. Here a discussion form thread on calling random image code, but its by fetching html. The types of images to show are in a the pipe-delimted list can be "randomImage;" or "recentImage"e;. IF you list multiple then it'll get, for example: 3 random pictures as below:

  @readfile('http://www.los-merida.com/gallery/main.php?g2_view=imageblock.External&g2_blocks=randomImage|randomImage|randomImage&g2_show=none');

You'll want to cache the output so that the pictures rotate every couple hours, not with every hit to page you have them on. I have some sample PHP code for caching here.

Comments

says

Posted Wednesday, Dec 31, 1969 at 07:00 PM

Post your comment

Required but will not be shown
URL for your own blog or site - begin with http or https.
Most HTML is allowed.
The values you submit will be saved to a cookie to automatically fill in this form.
 Yes, save it.

Meta

Links Out

Links In

View blog reactions

Technorati Tags

Feed

License

Subscribe via Email

Enter your email address:

Delivered by FeedBurner