Announcement

  •  » Requests
  •  » Disable plugin for specific album

#1 2015-11-22 15:11:40

Nomad
Member
2015-11-22
10

Disable plugin for specific album

Greetings,

Thanks for a really terrific tool! I wonder if it's possible to disable a plugin for a specific album?

The reason is: I'm using Fotorama and GThumb+ and they work great together for stills, but when I have an album containing only Embedded Videos, the still frames of the videos play in a slideshow. The only way to get to see the video itself is to click on the 'info' icon at bottom right, but even then, with the slideshow running automatically, that's very difficult and it's not intuitive for a visitor.

Basically I need to say something like: 'if album number = 123, then ignore the Fotorama plugin'

Much appreciate any ideas. Thank you!


Piwigo version: 2.7.4
PHP version:
MySQL version:
Piwigo URL: http://

Offline

 

#2 2015-11-22 16:03:27

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13786

Re: Disable plugin for specific album

Hi Nomad,

Wait a few days, I'm going to improve that (automatic disable Fotorama on videos).

Cheers,

Offline

 

#3 2015-11-22 17:53:00

Nomad
Member
2015-11-22
10

Re: Disable plugin for specific album

That sounds great. Thank you for the fast response!
Cheers.

Offline

 

#4 2016-01-12 12:17:08

Nomad
Member
2015-11-22
10

Re: Disable plugin for specific album

Hi - Just wondering if there was any progress on this?
Thank you!
Nomad

Offline

 

#5 2016-04-08 21:55:57

Nomad
Member
2015-11-22
10

Re: Disable plugin for specific album

Hi Plg - Giving this post one more nudge - I just can't find any kind of workaround. Thanks!

Offline

 

#6 2016-04-09 06:04:40

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: Disable plugin for specific album

Hi :-)

you can test in personal plugin

add_event_handler('loc_begin_index', 'GThumbs_exception', EVENT_HANDLER_PRIORITY_NEUTRAL+10);

    function GThumbs_exception()
    {
      global $page;

      $exceptions = array(123, 16);

      if (isset($page['category']['id']) and in_array($page['category']['id'], $exceptions))
      {
remove_event_handler('loc_end_index_thumbnails', 'process_GThumb', 50, 2);
remove_event_handler('loc_begin_index', 'GThumb_init', 60);
remove_event_handler('loc_end_index', 'GThumb_remove_thumb_size');
remove_event_handler('get_admin_plugin_menu_links', 'GThumb_admin_menu');
      }
    }

GThumbs is disable for album 123 and 16


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#7 2016-04-09 06:38:56

Nomad
Member
2015-11-22
10

Re: Disable plugin for specific album

Thank you ddtddt ;) !

This was successful in turning off GThumb for a specific album, but it looks like it's Fotorama which takes over from there. When I click a the thumbnail of any video in that album, it still tries to play all the video thumbnails as a slideshow, rather than skipping that and just showing the specific video.

Is there a way to configure this personal plugin to shut off Fotorama for a specific album?

Many thanks for your help!

Nomad

Offline

 

#8 2016-04-09 06:48:18

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: Disable plugin for specific album

Hi :)

I don't test

add_event_handler('loc_begin_index', 'fotorama_exception', EVENT_HANDLER_PRIORITY_NEUTRAL+10);

    function fotorama_exception()
    {
      global $page;

      $exceptions = array(123, 16);

      if (isset($page['category']['id']) and in_array($page['category']['id'], $exceptions))
      {
remove_event_handler('render_element_content', 'Fotorama_element_content');
remove_event_handler('loc_end_picture', 'Fotorama_end_picture');
remove_event_handler('init', 'Fotorama_init');

      }
    }


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#9 2016-04-09 07:14:16

Nomad
Member
2015-11-22
10

Re: Disable plugin for specific album

Hmm. I thank you again - I just tried your fotorama exception and unfortunately it didn't work :(
I even deactivated all plugins other than Localfiles Editor, Personal Plugin and Fotorama to test with just those plugins, and it still did not interrupt fotorama :o

Any ideas?
I thank you.
Nomad

Offline

 

#10 2016-04-09 09:30:18

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: Disable plugin for specific album

Hi :)

I don't test

add_event_handler('loc_begin_index', 'fotorama_exception', EVENT_HANDLER_PRIORITY_NEUTRAL+10);

    function fotorama_exception()
    {
      global $page;

      $exceptions = array(123, 16);

      if (isset($page['category']['id']) and in_array($page['category']['id'], $exceptions))
      {
remove_event_handler('render_element_content', 'Fotorama_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
remove_event_handler('loc_end_picture', 'Fotorama_end_picture', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
remove_event_handler('init', 'Fotorama_init', EVENT_HANDLER_PRIORITY_NEUTRAL+10);

      }
    }


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#11 2016-04-09 09:41:32

Nomad
Member
2015-11-22
10

Re: Disable plugin for specific album

I thank you, but still it loads Fotorama for all albums :(
Fotorama is very stubborn
I thank you
Nomad

Offline

 

#12 2016-04-09 22:08:04

Nomad
Member
2015-11-22
10

Re: Disable plugin for specific album

Hi - I tried everything I could thing of using the code you kindly sent, but still no luck.
I have a feeling it could maybe have something to do with this 'if'?:

add_event_handler('init', 'Fotorama_init');
if (defined('IN_ADMIN'))

or, perhaps it has something to do with the 'replace_page' option/function in Fotorama? That seems to be high-level command of some kind, and I need it activated for all the other albums.

I tried to add lines to what your sent me... there are probably mistakes but I'm trying - thank you for your help!:

______________________________________

add_event_handler('loc_begin_index', 'fotorama_exception', EVENT_HANDLER_PRIORITY_NEUTRAL+10);

    function fotorama_exception()
    {
      global $page;

      $exceptions = array(31);

      if (isset($page['category']['id']) and in_array(!$page['category']['id'], $exceptions))
      {
remove_event_handler('render_element_content', 'Fotorama_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
remove_event_handler('loc_end_picture', 'Fotorama_end_picture', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
remove_event_handler('loc_begin_picture', 'Fotorama_begin_picture', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
remove_event_handler('replace_picture', 'Fotorama_is_replace_picture', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
remove_event_handler('replace_picture_only_users', 'Fotorama_is_replace_picture_only_users', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
remove_event_handler('init', 'Fotorama_init', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
remove_event_handler('loc_end_page_header', 'Fotorama_end_page_header', EVENT_HANDLER_PRIORITY_NEUTRAL+10);     
remove_event_handler('get_admin_plugin_menu_links', 'Fotorama_admin_menu', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
      }
    }

Offline

 

#13 2016-04-10 06:18:07

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: Disable plugin for specific album

:-)


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#14 2016-04-10 20:12:50

Nomad
Member
2015-11-22
10

Re: Disable plugin for specific album

Hi - I'm still trying. Is there a way to trigger 'slidestop' if the array is a certain value?
It seems as though fotorama would then go straight to the video rather than trying to launch the slideshow.
Appreciate any help you can offer.
Thank you
Nomad

Offline

 

#15 2016-04-13 19:26:55

Nomad
Member
2015-11-22
10

Re: Disable plugin for specific album

As an alternative workaround - I've found that the Lightbox plugin plays videos. Would it be possible to tell Lightbox to only function for a specific album? The other albums would still use Fotorama.

Thank you

Nomad.

Offline

 
  •  » Requests
  •  » Disable plugin for specific album

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact