Gallery 2 sidebar plugin - specific gallery to show?

Creating and modifying plugins.
Post Reply
el10t
Regular
Posts: 14
Joined: Tue Jun 20, 2006 8:01 pm

Gallery 2 sidebar plugin - specific gallery to show?

Post by el10t »

Hello all,

I've just installed s9y (very impressive!) and have added the sidebar plugin that shows a random Gallery 2 image. This works great, except that I would like to limit the random images selected to just one specific gallery rather than from the entire set of galleries available. Does anyone know whether this is possible?

Many thanks
Rich
costa
Regular
Posts: 110
Joined: Wed Feb 08, 2006 5:29 pm
Location: Poland
Contact:

Post by costa »

ok, i'm totally not into coding but actually you should be able to do that. open serendipity_plugin_gallery_menalto_random.php file and find this code:

Code: Select all

if ((int)$this->get_config('gversion') === 2) {
  $file = 'main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_itemFrame=none';
}
now you can play a little with this link scheme. add gallery's g2_itemId with id of album you want to show. something like that:

Code: Select all

if ((int)$this->get_config('gversion') === 2) {
  $file = 'main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_itemFrame=none&g2_itemId=id_of_your_album';
}
should work althought it's not tested. so, play with it on your own risk :)
"everything is under control" - kasparov demo
el10t
Regular
Posts: 14
Joined: Tue Jun 20, 2006 8:01 pm

Post by el10t »

Woo! That worked great - thanks very much!


It's be good if a future version of this plugin had the gallery ID configurable in the admin screen.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hey, thanks a lot for this contribution. In fact making this configurable is a very good idea, I just committed this to CVS. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply