Announcement

#1 2011-01-08 10:20:53

J.Commelin
Member
2011-01-08
36

Writing plugins

Hi,

I'm new to Piwigo and amazed by its flexibility and scalability! Proficiat!
Now, I would really like to write some plugins for it, but I think I will need some help to get started.
I have read the wiki-page on Managing Plugins, and understand the idea about event handlers. But I am missing a list of all possible events and actions. Is such a list available?

J

Offline

 

#2 2011-01-12 20:06:47

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

Re: Writing plugins

Hi :-)

I suggest you watch [extension by Piwigo Team] Event tracer

Then to make a plugin you can regard other plugin [documentation is currently poor :-( ]

What kind of plugin are you planning to create?


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

 

#3 2011-01-14 20:29:30

J.Commelin
Member
2011-01-08
36

Re: Writing plugins

Hi, thanks for your reply!

I will dive into that event tracer, to see how Piwigo's events work.

The plugin I am planning to make deals with user permissions. I am actually working on a Piwigo install (with two other guys) which will contain media of several partners. Each partner will have his own private category, and there will also be several public categories. Allthough we -- as developers -- will have the 'overall administrator' rights, every partner should have a 'local admin' that can create subcategories in his private category. Besides that, he should be able to approve media that users uploaded to his category. For we do not want to have to approve all the stuff of the seperate partners, that they uploaded. Besides that, it would be big-brotherish from our side. But we do not want to give all partners an 'overall administrator' account (because of the obvious reasons).

Another plugin we are thinking about is an extended upload-page, because a lot of media that will be uploaded to our database has lots of weird info attached to it. Think about archive, archivebox, archivenumber, author, copyright, descriptions in 5 languages among others. We have allready designed a database extension, and can obviously create an upload page seperate from Piwigo, but it would be very nice to create one that integrates nicely with Piwigo.

So that are the current plans and ideas. But as you mentioned, the plugin-writing documentation is not very extensive. So I hope that you guys can help us in our bootstraps :) a bit. In return for your help, we can write documentation on the parts that we use, as well as some tutorials for plugin writing. For we do want to contribute to this nice piece of software.

J

Offline

 

#4 2011-01-18 13:24:05

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

Re: Writing plugins

Many good idea :-)

Feel free to ask specific question, we will gladly answer


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

 

#5 2011-02-03 16:26:38

Mattias
Translation Team
The Netherlands
2011-01-31
18

Re: Writing plugins

Hi

Im trying to learn how to write plugins too, but i dont get the event tracer working.
I created a file, called config_local.inc.php in the include folder, with this code:

Code:

<?php
// show_queries : for debug purpose, show queries and execution times
$conf['show_queries'] = true;
?>

but when i navigate around, try to add and delete comments or users, i dont get any message at the footer of the page

am i forgetting anything?

Greetings, Mattias

Offline

 

#6 2011-02-05 22:01:39

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

Re: Writing plugins

Hi Mattias and welcome to Piwigo forums

Mattias wrote:

Im trying to learn how to write plugins too, but i dont get the event tracer working.

[extension by Piwigo Team] Event tracer plugin is not the same as the $conf['show_queries'] parameter. $conf['show_queries'] will show you SQL queries while Event Tracer will show you the call to trigger_events.

If you want to display SQL queries:

1) install/activate [extension by Piwigo Team] LocalFiles Editor from screen [Administration > Plugins > Manage]

2) open [Administration > Plugins > LocalFiles Editor > Local config] and paste the following code:

Code:

<?php
$conf['show_queries'] = true;
?>

Offline

 

#7 2011-02-06 21:08:27

Mattias
Translation Team
The Netherlands
2011-01-31
18

Re: Writing plugins

Hi, and thank you ;)

This text is from the Event Tracer plugin:

The event tracer is a developer tool that logs in the footer of the window all calls to trigger_event method. You can use this plugin to see what events is Piwigo calling. Note that $conf['show_queries'] must be true.

But when I want to browse and try to do some things, to see what events they are actually calling, i dont see anything special in the footer after I, for example, deleted a user
(There is also an option to view all events and actions - this works perfect)

now i installed this localfile editor plugin, iserted the queries=true stuff, and i get to see lots of nice queries and some nice event handlers too - thanks!


(i saw in this part of the documentation things about myrootfolder/include/config_local.inc.php)

Last edited by Mattias (2011-02-14 15:52:02)

Offline

 

#8 2011-02-06 22:17:59

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

Re: Writing plugins

Mattias wrote:

(i saw in this part of the documentation things about myrootfolder/include/config_local.inc.php)

on this page -> This page complies with branch 1.5, not with previous branches.

Since Piwigo 2.1

local config file is local/config/config.inc.php


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

 

Board footer

Powered by FluxBB

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