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
Hi Nomad,
Wait a few days, I'm going to improve that (automatic disable Fotorama on videos).
Cheers,
Offline
That sounds great. Thank you for the fast response!
Cheers.
Offline
Hi - Just wondering if there was any progress on this?
Thank you!
Nomad
Offline
Hi Plg - Giving this post one more nudge - I just can't find any kind of workaround. Thanks!
Offline
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
Offline
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
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');
}
}
Offline
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
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);
}
}
Offline
I thank you, but still it loads Fotorama for all albums :(
Fotorama is very stubborn
I thank you
Nomad
Offline
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
:-)
Offline
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
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