Willkommen auf der privaten Homepage von Johannes Jarolim, Salzburg, Österreich

Welcome to the private homepage of Johannes Jarolim, Salzburg, Austria, Europe.

This is a YAPB post

16. June 2008, 12:24

YAPB Plugins / Hooks

350

The way of the master: Install WordPress, convert it to a photoblog via YAPB and finally pimp it up with some plugins.

Already Available Plugins

XP Uploader

Historically the first available third-party extension to YAPB: Developed by Joost, it allows you to upload images directly over the Windows XP File Explorer.

Download the plugin from
the WordPress Plugin repository

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.

Download the plugin from
the WordPress Plugin repository

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.

Download the plugin from
the WordPress Plugin repository

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 ;-)

Download the plugin from
the WordPress Plugin repository

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:


function my_cool_plugin_initialization($yapb) {
  // hook into WordPress,
  // add some options to YAPB and
  // finally do what you want
}

add_action('yapb_register_plugin', 'my_cool_plugin_initialization');

Have a look at the YAPB Sidebar Widget Plugin for more handy sample code.

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.php
Since: 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

Source: YapbTemplateFunctions.php

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

Source: YapbTemplateFunctions.php

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

Source: YapbTemplateFunctions.php

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.

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 on Monday 16. June 2008 at 12:24.

No tag for this post.

12 Comments »

2008-06-24 21:16:00
Comment by Shae Subscribed to comments via email

This is a “Sidebar Widget”, but the YAPB-ready themes you list don’t have sidebars. What theme will this work with?

Any suggestion(s) would be appreciated, as I tried this about six months ago and could not get it to work with any sidebar theme I chose. I’m not picky on a theme, as long as it has a sidebar and comments, because I can tweak the colors and styles.

Thanks

2008-06-25 07:11:55
Comment by Johannes

Hi Shae -

First of all, you may use YAPB with nearly every theme - Those “ready-to-use-themes” are only very specialiced themes for photography. My homepages theme is a regular type of wordpress theme since i want to write normal articles too. And it uses the YAPB Sidebar Widget. Another possibility would be to use the Widget on another blog to display the images of your photoblog: That may be achieved in conjunction with the YAPB XMLRPC Server Plugin.

But yes: You need a theme with widget-enabled sidebar.

Hope that gave a little overview.

 
 
2008-06-25 13:17:11
Comment by Shae Subscribed to comments via email

I know that “photoblogs” aren’t different from regular blogs. That isn’t the problem.

As I said, the ones I chose did NOT work, and I tried with a half dozen or so. They were Broken. They caused errors.

Can you give a name of a theme that you believe will work, please? Perhaps the one you started with? Or any other?

2008-06-25 15:04:51
Comment by Johannes

Try the WordPress Default theme first. YAPB and YAPB Sidebar Widget work with it. If that doesn’t work for you, there is another problem - not a theme problem.

The feedback i got so far shows me that YAPB works with nearly every WordPress theme out there… Personally, i think you could have a technical problem installing YAPB - Not a “YAPB is correctly installed but the theme doesn’t work” kinda problem.

And PLEASE use the forum for support questions.

Greets from Salzburg,

Johannes

 
 
2008-06-25 21:03:30
Comment by Shae Subscribed to comments via email

Meep meep meep meeep mep meep meep meep meep meeep YAPB meep meep, meep meep meep meep. Meeeep meep meep meep meep meep meep meep meeeep mep mep meep.php meep meep meep meep meep meep meeep meeep meeep mep mep meep meep meep meep meeeep.

True, meep meep meep, meeep mep mep mep mep meep, meeep meeep meep meeep meep meeeep meep mep mep meeeep (Meep meeep mep mep mep) meeep meep meep, Meeep meep meep meep meep meeep meeeeeep meep.

Moved answer to the forum.

2008-06-26 07:07:50
Comment by Johannes

And PLEASE use the forum for support questions.

 
 
2008-08-06 09:17:09
Pingback by WP Plugin Archive » YAPB Sidebar Widget Subscribed to comments via email

[...] Plugin YAPB Sidebar Widget von Johannes Jarolim ist einer Erweiterung des Yet another Photoblog Plugins des selben Autors. Es [...]

 
2008-08-06 09:22:00
Pingback by WP Plugin Archive » YAPB XMLRPC Server Plugin Subscribed to comments via email

[...] YAPB XMLRPC Server Plugin von Johannes Jarolim erlaubt externen Zugriff auf Dein Photoblog. Du definierst einen API Key und [...]

 
2008-08-11 09:28:40
Comment by the.darkman Subscribed to comments via email

Hallo,

ich habe YAPB schon länger benutzt und wollte nun auch den Sidbar Widget benutzen. Installation hat super geklappt, aber in den allgemeinen YAPB Optionen ist nirgens etwas bzgl. des Widgets zu finden. Ich nutze die deutsche Version von Wordpress, neusten Version, und auch YAPB ist aktuell. Woran kann das liegen? YAPB selbst funktioniert sehr gut.

Gruß darkman

 
2008-08-18 16:20:30
Comment by George

Hi John,

I downloaded the 1.9.7 version of the plugin, and it appears fine at the plugins list. However, when I go to the Options, the version there mentioned is 1.8.1, and I can’t find any configuration options there for the yapb widget for the latest/random pictures. Is there anything wrong with the installation files?

kind regards,

George

 
2008-11-04 23:02:41
Comment by Jenna Subscribed to comments via email

Hi There - When I first installed the plugin, my post would show next to the image but now it shows below the image. Is there a way I can ensure that the post shows up beside the image instead of below??

Thanks!

2008-11-05 08:34:57
Comment by Johannes

By default, YAPB images are shown above the content. You may place the images on the left if you change the css in the automatic image insertion tab in the YAPB options. Something like “float:left;” could do the thing, but it could break your layout too - depends on your wordpress theme.

To take control, you could adapt your theme manually with YAPB template tags.

 
 

Respond now

Name (required)
E-mail (required - never shown publicly)
Website
Spam protection: Sum of 3 + 14 ?
Your Comment (smaller size | larger size)