The simpler media website CMS
while ($file = readdir ($verz)) {
if(substr($file,-4,4) === ".php")
{
require_once("customfunctions/".$file);
}
}
closedir($verz);
`
All custom functions would then be avaiable to all themes.
Does anyone finds this useful? Then I could try making a little backend page for uploading, deleting and displaying installed custom functions files. Of course a very basic plugin system but maybe a good idea?
Comments
What I had always envisioned was a plugins tab in the admin. Inside of this tab would be a list of all the files listed within the plugin folder, each of which can be activated and deactivated. Much like how wordpress works. A new table 'plugins' would be created with fields like 'filename', 'plugin_name', 'active'
The active field could be bit/logical, and set to True when the plugin is set to active in the admin tab.
What you wrote above could be improvised to grab the list of plugins in the plugin directory and also be edited to run the includes if active=true for each plugin.
What we need to decide is what core function zenphoto will support going forward, and then what functions can be moved to plugins, which will allow the user to choose the functionality they want. Things like RSS, EXIF, Basic Comments and Comment SPAM moderation should be core code stuff.
Something else I think is important to add to the ZP Core is password protection on a album by album basis and for the entire gallery.
Everything around these basics functions may be a plugin (video, rss, comments, language), but the themes can be seen as a plugin too !
Even the security can be a plugin... but it would be hard to create.
If we are looking at zenphoto to be something similar that people are familiar with already (wordpress), the themes and plugins should be separate administrative functions. That way you can use x plugin with y theme. That way if something goes awry with the plugin functionality, your themes aren't affected by it (and vice versa).
What access an api should provide ?
In others terms, we must define what a plugin can do ... and what it can't do.
List albums, list galleries, list photos (or items), modify them ?
We should write everything clearly on the wiki !
The plugins should definitely be theme agnostic and for the most part require only one line or no lines to implement. printRSS() or printComments() and something like ZenVideo would require no changes to themes, but like I said above would require overwriting functions that are built into the core.
Redoing the admin seems like the #1 priority here. After the bones are laid out, all the functionality that albums have can be implemented into subalbums, something that is badly needed. As I see it, the plugin functionality should then follow, IMO. You guys are basically the developers now, I'm just thinking out loud!