Topic: a couple of ideas to punbb 1.3 hooks

Hope this is still on time.

I have no idea how the hook system will work nor if the template engine is going to change radically.

A feature that is widely used in vbulletin is ads after the first post of a topic view.

I think this is cool mod and extremely useful these days when advertise is the only income of millions of sites.

this is just an idea, but i think it could bring a lot of flexibility to punbb and make a lot of things doable just by using a plugin rather than going and hack the code.

There could be a topicview.tpl with placeholders for each message #...

like

<topicmessage1>
<between1-2>
<topicmessage2>
<between2-3>
<topicmessage3>
...

something like that.
Then, if each of them would call a hook it would be possible to put php code in pretty much every spot of the script.

This would be very handy because it would possible to do a lot of stuff without hacking the code, and since punbb1.3 pluggins will store actual php code on the database, then one could play around with a specific message # and keep those changes through an update.

I am not sure i made this very clear... anyway, it's just an ideia. There is many ways to achieve this freedom

Re: a couple of ideas to punbb 1.3 hooks

There's no need to add a template, and it wouldn't even work the way you proposed because the number of posts per page varies depending upon the user.
Instead, there should be (if there isn't already) a hook at the top of the post fetching loop. You can check the post number there and act on it.

And don't worry, it's nowhere near too late to propose hooks smile

3 (edited by pedrotuga 2007-10-27 01:42)

Re: a couple of ideas to punbb 1.3 hooks

Yeah... that's the way to go.
I just dropped the idea in here as quick as it popped in my head. It was way too undercook, it was raw actually.
In my raw idia the placeholders would only be used if the number of topics would 'reach' it. But, i agree, that was acompletely dumass way of implementing this.

Now that i think about it there's absolutely no need for a template, a hook on the top of the post loop would be enough indeed. Another one on the bottom might be handy to.

Damn... cant wait for 1.3... the new plugin system will rock, i will finally hack my forums like hell without worring about updates.


EDIT: as i checked a topic about a keyword insertion i thought about some spots to place hooks.
In between the post form fields. In case sombody wants to ad extra fields. Ok, that's probably thought trhough already.