Building a plugin best practices Building a plugin best practices
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Building a plugin best practices

Started by donnoman, November 29, 2005, 09:11:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

donnoman


  • Create a short name for your plugin
  • Prepend functions and variables that exist outside of functions with that shortname.
    This prevents name collisions amongst other plugins. ie two plugins naming  functions 'displayimage'; The second function to use the same name will cause an abort as PHP is unable to declare the second 'displayimage' function.
  • Keep files lowercase
  • Use Coppermine $CONFIG variables where applicable.
    Your plugin might work on YOUR system if you hardcode the fullpath, but it may not work on everybody elses system.

Feel free to add on lessons learned creating plugins to this thread, I'll move the good ones up to the bulleted list.

Paver

Has anyone started on official plugin documentation yet?  If not or even if so, I'd like to help out.  How would I go about creating or adding such documentation?  Should I post here?

Joachim Müller

yes, please post it - would be very welcome.

Sami

waiting for official plugin documentatin  ::)
please paver post it!
‍I don't answer to PM with support question
Please post your issue to related board

Paver

#4
Quote from: bmossavari on June 07, 2006, 08:33:32 PM
waiting for official plugin documentatin  ::)

You and me both.   :P

A large chunk of it is written.  But it's still not fleshed out (sections here & there are blank).  I have been working fairly non-stop on another Coppermine project, and I do realize this is hanging over my head.  I chip away at it when I can, but I need to find a block of time to hammer out the last sections.

With my previous accuracy in giving an expected date, I must not give another projected date.

I really, really want to get this done, so that's my incentive - to hand it off and let others read & hopefully learn & maybe even contribute with more examples or sample code to add.

All I can say is: soon . . .  :-\

Sami

Thank you Pavar, we all see that you work hard on some vulnerability issue and some other CPG project , take your time , as joachim said we are human  ;)
‍I don't answer to PM with support question
Please post your issue to related board

Dr Preacox

That would be a very handy doc, as I also am trying with difficulty to create my plugin
My Mods:
Making Memberlist Public - VIEW
Different Way of Displaying Categories - VIEW
Coming Soon - Automated Sub Domains -MOD

etienne_sf

Quote from: Paver on January 05, 2006, 04:20:51 PM
Has anyone started on official plugin documentation yet?  If not or even if so, I'd like to help out.  How would I go about creating or adding such documentation?  Should I post here?

Did you had time to work on this one ?

  I'm building a plugin (jupload, an upload mod). Several users had problems using it, because they used functions I didn't know or check.


A idea, to build this doc, is to create a wiki. Every one could give the information he has.

It would be really nice to build a documentation this way! Would it be possible to create one on the coppermine web site ?


Etienne

Joachim Müller

Creating a wiki has been discussed many times over, and several efforts have been started (in vain alas) to build one. Should be discussed in another thread imo.

Hot Rides

Quote from: Paver on June 07, 2006, 10:22:44 PM
...
A large chunk of it is written. 

...

All I can say is: soon . . .  :-\