Re: Hook requests

I just put my functions in co_common.

27

Re: Hook requests

I think it would be easier to find if that was moved to functions. Because i looked there first, then later found "co_common" in common.php

Re: Hook requests

co_common is the place for that. You can't add a hook to functions.php because it's loaded too early.

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

29 (edited by Gizzmo 2008-02-11 12:46)

Re: Hook requests

A hook in post.php before line 190 and edit.php before line 127 would be nice. To be able to add in our own $errors.

oh and maybe a hook after line 272 in admin/groups.php in case we added in our own group options

Re: Hook requests

elbekko wrote:

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

Done.

foxmask wrote:

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

Done. One before the list, one after and one in the loop. Using the one in the loop, it should be easy to, for example, assign a special CSS class to administrators etc.

Mediator wrote:

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.

I added a hook at the end of header.php instead. Just check PUN_PAGE and do your output if you're on the right page.

Wouldn't a hook in viewtopic right before <div class="paged-head"> make more sense by the way? In my opinion, the poll is a part of the topic and should appear "inside the topic" and not above the paging and posting links.

Mediator wrote:

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?

What good would a hook do there? If you want to modify the announcement, you can do it anywhere before that.

Mediator wrote:

vf_row_loop - Line 215 viewforum.php before "++$pun_page['item_count'];"

Done.

qubertman wrote:

Userlist - "Sort results by" drop-down menu

Done.

Smartys wrote:

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

Done.

Gizzmo wrote:

A hook in post.php before line 190 and edit.php before line 127 would be nice. To be able to add in our own $errors.

You probably could use po_form_submitted and and ed_form_submitted, but I added hooks nonetheless.

Gizzmo wrote:

oh and maybe a hook after line 272 in admin/groups.php in case we added in our own group options

Done (a few lines further down though).

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

Re: Hook requests

Did I miss any?

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

Re: Hook requests

The profile.php one I suggested for adding sections I think.

Re: Hook requests

elbekko wrote:

The profile.php one I suggested for adding sections I think.

Done.

Took me a while to figure out you were talking about what I refer to as an action, not a section big_smile Support for adding new sections was already there.

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

Re: Hook requests

Yeah, sorry tongue

Re: Hook requests

Hooks for adding permissions in admin/forums.php.

36

Re: Hook requests

intedinmamma wrote:

Hooks for adding permissions in admin/forums.php.

preferably looking at this section

// Check if the new settings differ from the old

Re: Hook requests

Hmm, a tricky one. Not sure exactly how to do that. We could add a variable, e.g. $ext_has_changed_setting, and then check that in the big if(), but that's kind of a hack. We would then have to do something similar with the next if().

Anyone else have an idea?

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

38 (edited by intedinmamma 2008-02-13 19:51)

Re: Hook requests

Rickard wrote:

Anyone else have an idea?

if(count(array_intersect($perms_new, $perms_old)) != count($perms_new))
{
    if(count(array_intersect($perms_new, $perms_default)) == count($perms_new))
    {
        // Delete
    }
    
    else
    {
        // Insert/Update
    }
}

It should be quite easy to build the queries and the form directly from $perms. If done right, you will just have to add elements to $perms and $perms_default to add permissions. Forms, validation and queries are so similar that it will work most of the time, and when it doesn't you can always use some other hook. Depending on how it's all implemented you might have to use array_intersect_assoc() instead of array_intersect(), as the latter doesn't care about indexes.

Re: Hook requests

User list
- Be able to add columns before/after the Username. This is our user list: country (flag icon), website (link) , ebay (link), blog (link), then username, real name.

40 (edited by gautam.madeshia 2008-02-14 20:18)

Re: Hook requests

Last time i had to integrate punbb with my intranet, i had to edit the punbb source files. I dont know how much things have change since then.

However, for an external auth system to work properly, following hooks may be neccesary:

1. a hook just before the actual login is performed. users may sync user accounts just before the actual login process. ( like wordpress's wp_authenticate hook )

2. a simple sample plugin should be included with new releases, for performing authentication against external database and ldap. These are the most common scenario, and will serve most people.

we can provide easy options for users to fill up:

database connection params, external db table name, name of user field, name of pass field, password hash scheme ( must support atleast md5 and sha1 )

If the external db is using different password encryption scheme ( for example , django uses random salt + sha1 hash ), user must be able to provide a custom fucntion to verify the passwords.

Invision board provides an easy to use sample plugin, that I modified a little bit for integration with django user database.

3. some more hooks to for proper user interface integration in case of external sso:

a. hook to enable / disable password update field within punbb ( just  like wordpress's "show_password_fields" hook )

b. hook to get custom registration url, to show on top menu bar. ( to redirect user to external registration system , instead of redirecting to punbb's registration page )

c. hook to enable/disable password retrieve and reset function in punbb ( just like wordpress's "retrieve_password" and 'password_reset' hooks )

In short, SSO is not "just" user integration. Its about user interface too. And a forum should not try to be the CMS, but try to accompany a CMS. It's destined to work with external systems, so its SSO system should be really flexible.

And please take a look at wodpress's hooks. they seem to have covered almost everything imagineable...from output filters to sso... smile

And as much as i hate invision board, i had to use it this time, because i was able to get it working with django user db in just 10-15 minutes ...

But i am so much in love with punbb's slick interface, that I cant wait to replace it with punbb... wink

Re: Hook requests

hi,

the current 1.3 beta seems to have lots of hooks for sso big_smile

Are there any docs for the new APIs ??

the dev page http://punbb.org/docs/dev.html dont have any info ...

Re: Hook requests

Not yet, no, as everything is still subject to change wink

Re: Hook requests

gautam.madeshia: It would be great if you could look at the actual code before requesting hooks. I just glanced through your post, but I think most of the hooks you suggest have already been put in.

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

Re: Hook requests

Smartys wrote:

gautam.madeshia: It would be great if you could look at the actual code before requesting hooks. I just glanced through your post, but I think most of the hooks you suggest have already been put in.

Yup, i was going through the code smile

It seems that you people have placed lots of hooks .... almost every place has got some kind of hook.

It's nice to see punbb devs taking such interest in making punbb expandable using hooks and plugins big_smile

I will let you know if some specific place may need any kind of hook as soon as soon as I finish browsing the code.

Thanks for your prompt replys Smartys.

Re: Hook requests

No problem, I'm glad the hook placements are working out smile

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

46

Re: Hook requests

Hook requests
Image Awards
Image Rank System

Re: Hook requests

Those are examples of modifications that you want ported to extensions, not hooks.

http://fluxbb.org

Free PunBB Hosting - lots of mods, easy to customize

48 (edited by Hans20 2008-02-15 16:01)

Re: Hook requests

Hello!

Hooks and feature request:

- display the forums moderators (like in punbb 1.2 or/and on viewforum.php)
- display the forums description on viewforum.php
- display the last topic on index.php
- different icons for new / no new threads on index.php and new / no new posts on viewforum.php (?)
- add attachments / polls to posts

Don't hit me... wink

49

Re: Hook requests

Smartys wrote:

Those are examples of modifications that you want ported to extensions, not hooks.

Re: Hook requests

index.php
- Hook to add column(s) before the forum column. For example, be able add icons to distinguish the different forums.

viewforum.php
- Hook to add column(s) before the subject column. In our case, the column is for thumbnails of items for sale. This column could also be use for post icons.