Announcement

#1 2015-06-10 01:21:19

fifreb
Member
2015-06-09
8

[Plugin] Preload

Hello fellow Piwigo users,

I'd like to announce my first plugin called Preload.
It preloads the next/previous photos when in the photo view.
http://piwigo.org/ext/extension_view.php?eid=799

I was inspired by the stripped-responsive theme which implements something very similar.
This should work across all themes.

Comments, translations and technical advice are welcome.

Cheers,
Fif.

Last edited by fifreb (2015-06-10 01:24:57)

Offline

 

#2 2015-06-10 09:39:46

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

Re: [Plugin] Preload

Hi :-)

Can you add en_UK directory in plugin ?

Use you SVN or Git for source code ?


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 2015-06-10 17:35:13

fifreb
Member
2015-06-09
8

Re: [Plugin] Preload

ddtddt wrote:

Can you add en_UK directory in plugin ?

Use you SVN or Git for source code ?

Adding the en_UK locale will be easy.
Yes, I'm using SVN, but it's a private  repository.
I may end up putting this on github, if there's interest.

While you're around I have one legal and one technical question:
This code currently has no declared license.  What is the preferred license for Piwigo plugins?
I've noticed that most plugins do not seem to care about licensing issues, so maybe I'm overthinking this.

For the technical issue, I'm not happy with the way the plugin injects the JavaScript and preload list into picture.tpl.  Right now, the plugin uses set_filenames on the template to override the picture template with picture_preload.tpl, which then includes the stock picture.tpl.
This seem not to scale at all.  What about if another plugin wants to add more sections to picture.tpl?
Is there a better way to perform this?

Thanks,
Fif.

Offline

 

#4 2015-06-10 22:38:06

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

Re: [Plugin] Preload

fifreb wrote:

Yes, I'm using SVN, but it's a private  repository.
I may end up putting this on github, if there's interest.

if you use github or piwigo SVN, I can add your plug on on translate tool -> http://piwigo.org/translate

And translator can translate your project ;-)


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 2015-06-11 16:42:21

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: [Plugin] Preload

fifreb wrote:

This code currently has no declared license.  What is the preferred license for Piwigo plugins?
I've noticed that most plugins do not seem to care about licensing issues, so maybe I'm overthinking this.

All plugins pushed to /ext must be compatible with the GPL licence.

fifreb wrote:

For the technical issue, I'm not happy with the way the plugin injects the JavaScript and preload list into picture.tpl.  Right now, the plugin uses set_filenames on the template to override the picture template with picture_preload.tpl, which then includes the stock picture.tpl.
This seem not to scale at all.  What about if another plugin wants to add more sections to picture.tpl?
Is there a better way to perform this?

Check the Skeleton plugin.
You must uses template prefilters to inject needed HTML and JS includes

ps: you should really fix your indentation, here it's a mix of spaces and tabs, choose one ans stick to that (in Piwigo core we use 2 spaces indentation).

Offline

 

#6 2015-06-11 20:05:10

fifreb
Member
2015-06-09
8

Re: [Plugin] Preload

ddtddt wrote:

fifreb wrote:

Yes, I'm using SVN, but it's a private  repository.
I may end up putting this on github, if there's interest.

if you use github or piwigo SVN, I can add your plug on on translate tool -> http://piwigo.org/translate

And translator can translate your project ;-)

Great.  I'll set that up, probably on GitHub.
If I want to get a pwg svn account, what's the process?

mistic100 wrote:

fifreb wrote:

This code currently has no declared license.  What is the preferred license for Piwigo plugins?
I've noticed that most plugins do not seem to care about licensing issues, so maybe I'm overthinking this.

All plugins pushed to /ext must be compatible with the GPL licence.

I'm happy with that.  v3 ok? or v2 only?

mistic100 wrote:

fifreb wrote:

For the technical issue, I'm not happy with the way the plugin injects the JavaScript and preload list into picture.tpl.  Right now, the plugin uses set_filenames on the template to override the picture template with picture_preload.tpl, which then includes the stock picture.tpl.
This seem not to scale at all.  What about if another plugin wants to add more sections to picture.tpl?
Is there a better way to perform this?

Check the Skeleton plugin.
You must uses template prefilters to inject needed HTML and JS includes
ps: you should really fix your indentation, here it's a mix of spaces and tabs, choose one ans stick to that (in Piwigo core we use 2 spaces indentation).

Thanks for the tips.

Offline

 

#7 2015-06-11 20:10:04

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: [Plugin] Preload

Offline

 

#8 2015-06-11 21:37:37

fifreb
Member
2015-06-09
8

Re: [Plugin] Preload

mistic100 wrote:

http://piwigo.org/basics/license

Thank you.  I guess I should have started there.  Shame on me.
So GPLv2 only?  I've just put out a new 0.2 release, but I have it as GPLv3.
I'd be happy to re-release it as GPLv2 if that's an issue.

Offline

 

#9 2015-06-11 21:44:07

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: [Plugin] Preload

Look, not a single plugin I know actually have a license attached, it's not that important as soon as it's OS.
We had only removed a few plugins because they used a proprietary dependency.

Plus I'm not in capacity to tell you what is truly compatible with what. These multiple Open-Source licences are really bothering me, something that should have been simple is now a legislation hell.

(I always publish under MIT myself, and I'll add the license file to all my plugins soon)

Offline

 

#10 2015-06-11 21:46:48

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: [Plugin] Preload

Ok I'll add this : as long as the plugin is not integrated in the core we absolutely do not care what is the license, as soon as it's OS, I should have started here.

Offline

 

#11 2015-06-12 02:06:52

fifreb
Member
2015-06-09
8

Re: [Plugin] Preload

OK.
Now that's resolved, I release 0.2.1 licensed GPLv2 or later, and with a couple more fixes.
All the other issues I was aware of (including the code make-over, identation etc) are resolved.
I'd appreciate some more technical feedback, if you have it.

Cheers.

Offline

 

#12 2015-06-12 09:24:11

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

Re: [Plugin] Preload

In the majority of plugins I work on, I keep the license at the beginning of PHP files:

Code:

// | This program is free software; you can redistribute it and/or modify  |
// | it under the terms of the GNU General Public License as published by  |
// | the Free Software Foundation                                          |
// |                                                                       |
// | This program is distributed in the hope that it will be useful, but   |
// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+

Offline

 

#13 2015-06-14 15:26:03

Manu
Guest

Re: [Plugin] Preload

Hi,

I installed the preload plugin and my site crashed
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/*******/public_html/my/plugins/Preload/main.inc.php on line 200

Please help me restore the site (how to uninstall the plugin? when admin panel is not accessible?)
Thanks
Manu

 

#14 2015-06-14 15:36:26

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: [Plugin] Preload

you must use PHP 5.2 minimum, Piwigo can't run on versions below
see with your host

Offline

 

#15 2015-06-14 15:49:25

Manu
Guest

Re: [Plugin] Preload

Hi again,

I renamed the plugin folder from my file manager, and that allowed me to access piwigo site again. I uninstalled the plugin.

 

Board footer

Powered by FluxBB

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