Topic: Public-side Plugin Hooks?
Hi Rickard, everyone,
I was wondering if it might be possible to include a few hooks into some of the display code. I'm not thinking of a whole plugin system like WP, simply some opportunities to augment various functions and arrays.
For example, I have a hack for linking to an on-site wiki, and I'd like to add one where users can indicate their L/L by putting [location]43.485731,-80.551908[/location] into their signature and have the parser hide that in regular display.
But I'm just leery of having to re-do these and other mods on every upgrade. In the example of bbcode parsing, couldn't there be code such as this in parser.php: (functions do_bbcode() and do_smilies(), respectively)
if (function_exists('punbb_mod_smilies')) punbb_mod_smilies($smiley_text, $smiley_img);
if (function_exists('punbb_mod_bbcode_regex')) punbb_mod_bbcode_regex($pattern, $replace);
Another example is the profiles. I've written a Mediawiki plugin that lets my users share logins between Pun and MW, and it would be cool to show MW-related data on their forum profiles. In that case, it would be down around lines 950-1000 in profile.php; add a few hooks similar to those above that would allow the output of an arbitrary function.
All we'd have to do is place/link those functions in the config.php file, and it's a way to perform slight modifications without bringing down the system on an upgrade.
I hope you'll consider this as a possibility. It's fairly unobtrusive, yet gives a lot of power to people who wish to *slightly* extend their PunBB.
Either way, thanks for a great (simple!) piece of software. Reading the Pun source is a breeze compared to dissecting the mess that is phpBB.
Mike