b2 plugin support

On the b2 forums there are plenty of hacks and enhancements to b2. While there are guidelines to writing hacks they’re informal, and many hacks rely on changing existing code.
I’m using the Smarty plugins support to provide a consistent and documented way of writing plugins.
I created a simple “googleit” function already. It’s integrated into the post.tpl template of this blog and provides the “Search” link you see below.
Using Smarty plugins is easy. You create your function, call it a predictable name (smarty_function_name() where name is “googleit” for example), put it into a file and drop that file into the plugins directory.

The usual advantage of using Smarty caching applies here too. Once it’s cached the plugin isn’t loaded again until it’s called so you can drop as many plugins as you like into the plugin directory without suffering any speed loss!

One thought on “b2 plugin support

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close