Topic: Hook requests

Did anyone say hooks? Please post your hook requests in this topic. Please try to be reasonable and to explain why you want a hook in that particular place.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

2 (edited by liquidat0r 2008-01-30 14:44)

Re: Hook requests

Hooks in parser.php (and more hooks in help.php) for adding new BBCode and smilies.

Oh, right. Sorry. Just read this post.

Re: Hook requests

what is hooks ?

MyFootballCafe.com  is Now Online!

Re: Hook requests

SuperMAG wrote:

what is hooks ?

More info about the extension system can be found in our blog or by searching these forums.

Re: Hook requests

One for appending links to $adnav_links would be handy if you're making a really large extension which uses several pages for options/management. (A gallery perhaps, or a death ray. But that wouldn't really need more than a fire button. Anways.)

All my other "hook needs" have been solved by workarounds, by using some hook nearby. (adding content to index.php above the forum listing for example) But I must say that it overall looks awesome. smile

Re: Hook requests

intedinmamma wrote:

One for appending links to $adnav_links would be handy if you're making a really large extension which uses several pages for options/management. (A gallery perhaps, or a death ray. But that wouldn't really need more than a fire button. Anways.)

You can use fn_generate_navlinks_end to add navlinks.

Re: Hook requests

liquidat0r wrote:
intedinmamma wrote:

One for appending links to $adnav_links would be handy if you're making a really large extension which uses several pages for options/management. (A gallery perhaps, or a death ray. But that wouldn't really need more than a fire button. Anways.)

You can use fn_generate_navlinks_end to add navlinks.

Oops, should've mentioned that I meant the navigation for the admin pages. roll

Re: Hook requests

intedinmamma wrote:
liquidat0r wrote:
intedinmamma wrote:

One for appending links to $adnav_links would be handy if you're making a really large extension which uses several pages for options/management. (A gallery perhaps, or a death ray. But that wouldn't really need more than a fire button. Anways.)

You can use fn_generate_navlinks_end to add navlinks.

Oops, should've mentioned that I meant the navigation for the admin pages. roll

ca_admin_menu_new_sublink in common_admin.php ?

Re: Hook requests

liquidat0r wrote:
intedinmamma wrote:
liquidat0r wrote:

You can use fn_generate_navlinks_end to add navlinks.

Oops, should've mentioned that I meant the navigation for the admin pages. roll

ca_admin_menu_new_sublink in common_admin.php ?

Using that one will make the links appear in the very beginning of the navbar, unless I'm wrong about how arrays work in PHP.

Re: Hook requests

Look into the array_insert function? wink

11 (edited by elbekko 2008-01-30 23:50)

Re: Hook requests

Some hooks in include/email.php would be nice for things like secure SMTP support and modifying email headers.

EDIT: Well, not secure SMTP as that seems to be in tongue But still, put some hooks in there.

12 (edited by foxmask 2008-01-31 17:53)

Re: Hook requests

Hi,
A hook in place of the "Online" stat to be able to display them as we want.

For example : changing the color of a given group of users in the "Online" list of users.

i think there is nothing for that arround the line 92 of the footer.php .

Kind Regards.


may be something like that could be used wink

Re: Hook requests

Smartys wrote:

Look into the array_insert function? wink

Forgive me if I'm wrong, but doesn't $array[] = 'value' add an element at the very end of the array? So even if I put my "Death Ray Control Panel?" at, let's say, position 3 (which I fail to see how it would be possible, cause there's no 0, 1 or 2), then adding elements would put them in position 4, 5, and so on... Honestly, I'm far from a PHP Guru, but this is how I always have thought arrays work. smile

14 (edited by elbekko 2008-01-31 22:33)

Re: Hook requests

Arrays in PHP aren't really like in other languages. You can insert values everywhere you want.

Too bad the array_insert() function doesn't exist, but it should be easy enough to implement. Something like this probably:

function array_insert(&$array, $offset, &$insertvals)
{
    array_splice($array, $offset, 0, $insertvals);
}

Another thing I'd like to note is that there seems to be no way to add a section (?action=*) to profile.php. You'd have to add a new page to do so. Not very friendly for simple extensions wanting to have a user setting.
A hook around line 1118 in profile.php would do for that.

Re: Hook requests

array_insert() exists in functions.php, so it's there. smile

//
// Inserts $element into $input at $offset
//
function array_insert(&$input, $offset, $element)
{
    // Out of bounds checks
    if ($offset > count($input))
        $offset = count($input);
    else if ($offset < 0)
        $offset = 0;

    array_splice($input, $offset, 0, 0);
    $input[$offset] = $element;
}

But unless I'm totally wrong (this time to), this won't insert an element at position 5 if there's only 3 elements in the array.

Re: Hook requests

Oh.

And it will insert it there, it'll just appear as element #4 because there is not actual #4. Logical, I'd say.

Re: Hook requests

foxmask wrote:

A hook in place of the "Online" stat to be able to display them as we want.

Yes, please. In our case, we want to display upcoming birthdays and events/shows.

18 (edited by Mediator 2008-02-02 04:26)

Re: Hook requests

vt_post_header_load - Line 249 viewtopic.php after "require PUN_ROOT.'header.php';" - ESSENTIAL - Poll mod, all the content for the poll to be displayed needs to be put immediatly after the header, as is convention on every modification ever written.

hd_announcement - Line 255 header.php after "// END SUBST - <!-- pun_alert -->" - RECOMMENDED - There is a hook for just about every other template type, why not annoucements?

vf_row_loop - Line 215 viewforum.php before "++$pun_page['item_count'];" - QUESTIONABLE - In viewforum the post row loop has no hook inside the loop. I realize loops are not exactly the best play for hooks, but its requires a lot of parsing later on if are not able to change post attributes 'on the fly'

Edit: Sorry Smartys

I enjoy pie :)

Re: Hook requests

may i request a hook for handling external authentication ?

Most succesfull forums like vbulletin and invision power board handle external authentication quite well. I particulary like invision boards authentication system.

Most of the time, a forum is supposed to work with another cms like a blog, or a portal like mambo etc...

but integrating punbb with other systems is really painfull....hope this situation will change with future releases.

Re: Hook requests

gautam.madeshia: We tried to place certain hooks specifically to make that easy. Could you look through the code and tell me where you think more hooks are needed?
Oh, and I disagree that integration is painful, although I certainly think 1.3 improves it tongue

21 (edited by qubertman 2008-02-03 22:20)

Re: Hook requests

Userlist - "Sort results by" drop-down menu

Since additional columns can be displayed, it would nice to be able to sort on these additional columns.

Re: Hook requests

A suggestion from me: a hook in admin/users.php to allow handling a new mass action.

Re: Hook requests

liquidat0r wrote:

Hooks in parser.php (and more hooks in help.php) for adding new BBCode and smilies.

Oh, right. Sorry. Just read this post.

may be the hooks for bbcode are not included in the new parser version ?
so your request seems to be legitimate

Re: Hook requests

No, there are going to be hooks in the new parser, that's part of why it's the new parser tongue

25 (edited by PhaxeNor 2008-02-08 17:26)

Re: Hook requests

A hook in functions.php that allow you to add new functions in functions.php

I found a lot of hooks there. But not one that allowed you to add a new functions

('fn_new_function') or something like that. At the end of functions.php

I think it's needed if someone need a function for their stuff then they can just add it there