This is something I'm going to need to do eventually, and I thought I'd get your input. We need to brainstorm and think of all the plugin hooks you could ever want in Zenphoto!
For those of you who don't know, a plugin hook is a function that always runs when some specific action happens in zenphoto, for example, there might be a hook called `p_on_submit_comment` (or something) that runs every time a comment is submitted, allowing a plugin author to, oh, I don't know, say, filter for spam (Yay! wooo! <small>hooray!</small>) or `p_on_load_image`, allowing you to do cool things to your images during processing. The possibilities are endless :-)
Other ideas off the top of my head:
- Page load (album page, image page, any page, etc)
- Image load (specific to thumbnails, all images, etc.)
- Submit comment
- ?
I'm not being very thorough, so go ahead and give me obvious ones too. Ready.... go!
Comments
On image upload for preprocessing images(landscape, portrait, added meta data...)
On image process for manipulating the output of the image processor
That is all I can come up with right now...
On Thumbnail Generation (for some kind of run-time photo manipulation)
On Picture Generation (for embedding watermarks or so)
I guess these are similar to Chilifrei64's second suggestion.
Try to think of more general-use hooks that you might need.
It's probably easy to add new ones once everything's all set up though, I just want to provide the best set possible when it's launched.
On_LogOut
On_Sort
- On Garbage Collection
- On upload
- On detection (album/image)
- On download full-sized image?
- On update (fieldname)
- On delete (object)
- On theme change
- On plugin activation/deactivation
Once the hooks are defined, I just might consider developing the plugin. I know a couple of PHP libraries exist for EXIF manipulation. Pear has some for various image manipulations. I'll look thru them and see what I can find.
Lee Eschen
I already have a non-plugin version of the watermarking functionality working. This will at least tide you over until Tristan gets the plugin hooks done. Let me know and I'll be glad to show you how I did it.
You can see it in action either at:
http://www.photosbydaisy.com/zenphoto/The+Bush+Family/3a.jpg (that's me and my family BTW)
or
http://www.thinkdreams.com/zenphoto/karson/IMG_4000.JPG
Both of which should display the watermark in the lower right corner. The image is just a transparent 24-bit .png file you can make yourself with photoshop, and it just takes a few tweaks to the i.php and zp-config.php to make it work.
(This might give you a jump to your plugin as well once the hooks are in place).
This would make it much easier to have a super-admin that has full editing and moderation of albums and comments, and then regular access so that users can add/edit their own albums, but not others' albums or any comments. (and then integrate the whole thing with Wordpress' roles/capabilities system)
Remove_User()
On_User_Added()
On_User_Removed()
I'm sorry, thinkdreams, for not responding to this earlier. I got busy with stuff and just never got a "round tuit." Now that the holidays are almost over, maybe I can get back to the good stuff.
<br>
I thank you for the links for examples of your working watermarking. I would very definitely be interested in seeing just how you accomplished the task. Might you be able to email me the code (I presume it's PHP4/5).
<br>
And aside to trisweb: when can we expect the hooks to be 1: defined and 2: implemented? And what can we, the members here, do to help?
Anticipating the very best ZenPhoto ever,
Lee Eschen
Lee
Hooks to check permissions for the different users.
when loading, something like the AJAX stuff, show a small GIF when images are still loading... don't know if this is related but anyway,
excellent work! love zenphoto!
i hope i am right here in this topic now
i have a real request, real because it would be cool (well cooler as cool)
i start in a few days my photoshop battle net. and i thought it would be really cool to get the ability with zen to have a "mural" category for those mural photoshop battles.
kinda 6-14 pictures side by side in one length .
like:
http://www.kranestyle.com/stuff/battles/shadowtouch/
(sorry for the frame demo krane)
so zen would be then the ultimate choice for photoshop battle forums.
so you say (in this constellation) that i need to install 2 zen's right?
Event Hooks:
on_login, on_newuser, on_logout for user based plugins
on_comment, on_comment_edit, on_comment_delete for comment based plugins.
on_main, on_gallery, on_image for the three most used page types.
on_submit, on_edit, on_upload, on_delete, on_fulldownload for image uploading and editing, would make writing plugins which deal with each process much much easier.
Variables and Globals:
zpdb to be the main database class or whatever to enable plugins to utilise the database functions that zp uses.
gallery_title, image_title self explanatory
It would be nice to add search, tagging and rss support soon. Also to be able to select your own thumbnail sizes within the admin panel without having to edit files, as well as an on the fly image processing script so that a plugin which requires a different thumb size, etc can call it/the function.
I could go on but I should have been in bed 4 and a half hours ago!