Page 1 of 1

Gallery 2 sidebar plugin - specific gallery to show?

Posted: Tue Jun 20, 2006 8:06 pm
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

Posted: Tue Jun 20, 2006 11:59 pm
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 :)

Posted: Wed Jun 21, 2006 7:52 am
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.

Posted: Wed Jun 21, 2006 3:53 pm
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