The simpler media website CMS
The second category of plugin is used to provide alternative implementations of Zenphoto core functions. Examples of these plugins are: The spamfilter set and the theme options implementation. ...The implication here is that one can create a plugin to modify the behavior of core ZP functions. But that is not really described in any additional detail. Furthermore, creating a plugin that tries to redefine a ZP core function gives a PHP "can't redeclare function foo()" error.
Comments
I would like to create a plugin that modifies the way an image is displayed withour having to add a line to a given theme.
It seems to me that a flaw in the design of plugins is that theme plugins have to also be added to themes to work. A bit clunky. I mean, you can't just switch on a plugin and it works, you also have to make sure the theme you are using supports the plugin, and add that support as required.
Am I getting this right? Please show there is something I'm missing.
I want to add simple changes to the way an image is displayed wihtout also having to t modify the theme I'm using, so that this modification will "just work" in any theme, if I decide to change themes.
THANKS
There are also `back-end` plugins that you will find in the zp-core/utilities folder. Again, for this type of extension just follow their lead.
Any other kind of extension to the zenphoto core requires that the core itself be modified to recognize and link to the plugin. (This was what was done in all three cases above, each requiring a different core modification.)
Zenphoto is a script based photo album. This means that all themes are essentially pieces of code. You modify them by modifying their code. Adding functions to a theme with a plugin is no different in that senes than adding functions by changing the HTML/PHP code of the theme.
As for the case of change you are considering, there are two approaches you could take. First you could create a replacement set of image handling functions that reside in your plugin and are used in your theme (and any theme which chooses to support it.)
Second, you could propose hooks into the zenphoto image handling functons which would link to the plugin to provide custom processing.
The plugin architecture is relative new in terms of the zenphoto architecture. Most of all of the image handling functions were already in existance in their current form before the possibility of plugins existed.
It certainly would be possible to re-do all these functions into a plugin structure. This was done for the admin-toolbox. Then extensions could be made by creating replacement image handling functions.
But of course, this would be a large and perhaps minimally beneficial task so there is no plan to do so.
I want to create a plugin that lets me do some simple image editing in-browser. For now, only image rotation. Once I get it going, then adding things like sharpening and cropping will be easier.
I want the plugin to work so that, once logged in, the admin sees a row of buttons underneath each image. For now, just "rot left; rot right; rot 180" buttons.
I can see a way to do this using the theme type plugins but then one would also have to add at least one line to each theme that one wants the plugin to work in.
I want it to be as simple as enabling the plugin gets you the image editing buttons.
To do this, I think that modifying a core function's output somwhere is necessary. I'm guessing maybe printDefaultSizedImage() or similar, to just spit out HTML for these buttons as well as the image HTML. Or maybe printAdminToolbox(), and there is some JS or CSS to place the buttons where I want them to go on the page.
Now, when you say, "propose hooks into the zenphoto image handling functons", what do you mean? Add code to the ZP core? Propose them to the core developers to be added? I really don't want to touch core code as I don't think a plugin should ever have to do that. But I'd be happy to make [as helpful as possible] suggestions to the ZP core developers. (Which is who? You? How many of you are there?)
Incidentally, a little background: I have extensive PHP development background and am comfortable with this stuff. I looked at several "photogallery" apps and found ZP to be the best "put together" at least from the user's perspective. I like to support, encourage, and help F/OSS projects, so I will try to be as helpful as possible (time permitting ). I really just wanted an easy way to rotate my images in-browser!
THANKS
THanks! I'll try SVN