Hello,
My name is Robin and I am using Piwigo for a while now, and I've started developing my own personal plugin but I am no expert at all in PHP & SQL... I managed to get some code working by looking at other plugins and Piwigo documentation, but then I am stuck on the following problem :
in my main.inc.php file, I have the following
handler add_event_handler('loc_begin_picture', 'mplg_picture_handler');
and then I define the associated function :
function mplg_picture_handler()
{
....
}
I want to retrieve in this function the string containing the description of the current picture, which is usually referred to as $COMMENT_IMG, or $picture['current']['comment'] but apparently these variables are not yet defined at this stage, and I don't have any idea how to get it.
Any advice would be welcome ! Sorry if the answer is obvious, once again I am no expert. Thanks
RM
Piwigo version: 2.9
PHP version: 7.0.24
MySQL version: 5.5.57
Piwigo URL: http://photos.daedalum.org
Last edited by Hood_fr (2017-11-05 19:21:06)
Offline
Hello
nice to see someone "having fun" with creating an extension ^^ You remind me my first tries... which are still my way of coding :D
you have the page http://photos.daedalum.org/tools/triggers_list.php where every trigger are registered
i think you need
render_element_content trigger_change string $content, array $current_picture
since it seems to allow you to access to current_picture
Offline
Thank you very much flop25 for your hint, this is exactly what I was looking for ! Now I can retrieve the name and it all works fine. I didn't know about this trigger list by the way thanks for that too !!
Robin
Last edited by Hood_fr (2017-11-06 23:37:04)
Offline
Following this advice to use the render_element_content in my extension, I found out that it interacts badly with the RV Maps & Earth extension which also use the same trigger, although with a EVENT_HANDLER_PRIORITY_NEUTRAL-5 propriety.
I have added a lower priority to my handler (EVENT_HANDLER_PRIORITY_NEUTRAL-10), and now the maps is displaying correctly.
Residual problem is : the central part of the screen is not responsive anymore. Nothing happens when I click on the picture thumbnail, or on the form scrolling lists & buttons below the map. Header and Footer are OK though.
Example : https://photos.daedalum.org/picture.php … 60&map
Any help would be welcome
Thanks in advance
Last edited by Hood_fr (2017-11-28 19:19:59)
Offline
I've just seen that you are French actually. So I recommend you to post in the French forum where more people will be able to answer you with more accuracy
Offline
Thanks, I've posted it here : http://fr.piwigo.org/forum/viewtopic.ph … 82#p222982
Offline