YAPB-Queue

YAPB-Geotag

YAPB Sidebar Widget

Previously included in the default YAPB installation, the YAPB sidebar widget was outsourced since version 1.9 and has become a plugin of it’s own. Of course, it evolved a little bit and now offers you the following functionality: Either show a list of your prevously posted images or just output some random images. Additionally you now may display a link to your mosiac page below the widget.

YAPB XMLRPC Sidebar Widget

Basically the same as the default YAPB Sidebar Widget, this version may display your images remotely on another blog. All you need is a source-blog running YAPB + the YAPB XMLRPC Server Plugin (As seen below) so you can access those images remotely.

YAPB XMLRPC Server

Originally provided by Mac, the YAPB XMLRPC Server Plugin allows remote access to your photoblog. You define an API key and voila: Your images are accessible via XML RPC. If you don’t know how to do that: Just have a look at the YAPB XMLRPC Sidebar Widget ;-)

Developing your own YAPB Plugin

Ah, finally – The interesting part for us developers ;-) Read this little introduction and have a look at the code of the yapb-sidebar-widget for example, and you should know how to develop YAPB plugins. It’s no rocket science.

Why YAPB Plugins?

First of all: Why splitting YAPB into a main part + plugins? Imho, separating blocks of functionality helps YAPB stay clean, “small” (whatever that means) and helps YAPB keeping focused on its primary target: Extend WordPress to become a Photoblog platform.

Secondly, separate plugins may be developed and evolved separately without any coupling to the main YAPB release cycle. Developers may now create additional features without “asking me for permission” or whatever – just go and do it ;-)

It’s simple

Writing a YAPB-Plugin is basically the same thing as writing a WordPress Plugin – It’s just a matter of view: We develop additional functionality built onto the YAPB foundation:

YAPB basicly offers you the “yapb_register_plugin” action-hook, which gets called right after YAPB initialization. Additionally, your function gets called with the current YAPB Class Instance as parameter: It’s a simple as that:

[code language=”php”]
function my_cool_plugin_initialization($yapb) {
// hook into WordPress,
// add some options to YAPB and
// finally do what you want
}

The ultimate YAPB Hook Reference

YAPB offers some hooks out of the box. If you’re interested in developing your own YAPB Extension you should have a look at this list:

yapb_register_plugin

Source: Yapb.class.phpSince: 1.9

yapb_register_thumbnail gets fired just after the initialization of YAPB itself (last line in the constructor). That means you can execute code right after YAPB was initialized – And you get the YAPB Instance as Parameter. This hook is an action which means that it primarily acts as an event trigger, instead of a content filter.

yapb_get_thumbnail

yapb_get_thumbnail gets fired just before the image tag gets returned from the yapb_get_thumbnail() template function. This hook is a filter which means that information is passed through it, and then used by WordPress.

yapb_get_exif

yapb_get_exif gets fired just before the EXIF tags array gets returned from the yapb_get_exif() template function. This hook is a filter which means that information is passed through it, and then used by WordPress.

yapb_alternative_image_formats

yapb_alternative_image_formats gets fired just before the list of alternative image formats get returned by the according template function. This hook is a filter which means that information is passed through it, and then used by WordPress.

yapb_image_upload

Source: Yapb.class.phpParameters: YapbImage Instance of the current imageSince: 1.9.18

yapb_image_upload gets fired just after you saved a post containing a YAPB image and that image was persisted to database and disc. This hook is an action which means that it primarily acts as an event trigger, instead of a content filter.

damn_i_need_a_new_hook

If you need a hook in YAPB to develop something new: Leave me a note in the forum so we can discuss it. But hey: I’m the last one blocking new features. As long as it’s not disturbing the way YAPB works, i’m with you.

This entry was posted 8 years and 5 months ago on Monday, June 16th, 2008 at 12:24 and is filed under .

Fifty One Replies

I'm trying to get a front end posting photoblog, and I'm pretty dumb. Adding the injected code to the front end form (User Front End -- which seems to trigger the normal post plugins) resulted in the following error:

Fatal error: Call to undefined function wp_handle_upload() in /wp-content/plugins/yet-another-photoblog/lib/Yapb.class.php on line 294

It still created the post, but failed to upload the image or attach the image to the post.

Hi HumanGirl - Have a look into the /wp-includes folder and search for the file including this function: You may have to include this file manually. Be aware: You may rise up security issues by allowing posting and uploading files from the frontend.

Hello
I'm very happy using YAPB fused with ReflectionMod Theme in my photo blog, but i have a little problem issue. I don't know which parameter should i change to get more than 10 thumbnails in archive category (on page - portfolio)... Help :)

first of all, this is an awsome plugin ! thx a lot!! Just a simple question : would there be an option to click on the picture in order to see the next image? (maybe a sort of option or line of code that we could insert in YAPB settings)