Hello,
at the moment I'm trying to create my first own plugin for Piwigo and I was already quite successful with the addition of image information on the image page as well as on the corresponding admin page.
But now I would like to provide additional information to category pages. As on the image page I tried to add additional fields to the admin page with the help of the copyright example. But for the planned functionality I need the category ID. Unfortunately I didn't find out which variable it contains or if it is passed at all (but I think it is).
Can anyone give me a hint about this? Are there more helpful documentations than the tutorials for copyrights anywhere?
I'd appreciate any help and say thank you in advance!
Harry
Piwigo 2.9.4
Linux
PHP: 7.2.10-0ubuntu0.18.04.1 (Info anzeigen) [2018-10-06 11:12:51]
MySQL: 5.5.5-10.1.34-MariaDB-0ubuntu0.18.04.1 [2018-10-06 11:12:51]
ImageMagick 6.9.7-4
Offline
Hi :-)
global $page; if (!empty($page['category']['id'])) { $category_id = $page['category']['id']; // ****** your code ******** }
Offline
Thanks a lot. That's what I needed I guess. I'l try it next days.
Offline
Hi again!
I only thought, that this would solve my problem but it didn't. However, after some experiments I found out that the category id can be found in $page['cat_id'].
Could you please help in another point: What are the numbers in the event handler definition for? I have the feeling ;-) they could possibly cause another problem I have hat the moment.
add_event_handler('loc_begin_admin', 'PMV_set_prefilter_cat_modify', 50); add_event_handler('loc_begin_admin_page', 'PMV_cat_modify_submit', 45);
Sorry for the maybe silly questions but I'm no programmer but I have a bit more than base knowledge in PHP programming and I'm still learning ;-) .
Thanks
Harry
Offline
Hi :-)
It's order execute
if you,ve
add_event_handler('loc_begin_admin_page', 'PMV_cat_modify_submit', 45);
add_event_handler('loc_begin_admin_page', 'PMV_cat_modify_submit2', 46);
add_event_handler('loc_begin_admin_page', 'PMV_cat_modify_submit3', 47);
piwigo executed PMV_cat_modify_submit after PMV_cat_modify_submit2 after PMV_cat_modify_submit3
Offline