Topic: List of Hooks?

Hello everyone, I am looking for forum software to integrate into a site I am making. Flux looks good so far, but there is some fucntionalty I will need to add (such as more profile fields and a few extra administrative options). I have been searching the site trying to find a list of hooks currently available for creating extensions, but I can't find any info!

Could someone please help?

Thanks,
Chris

Re: List of Hooks?

The easiest way is to just look through the files that you need to hook into and see if there is one in the right place. We could make a list of hooks names, but describing where each one occurs would take quite a lot of effort and can be hard to do in plain english anyway.

If there are any hooks that you need that don't exist then you can just request them and assuming they makes sense we can add them in for you.

Re: List of Hooks?

Okay cool thanks. I have another couple of questions then, lol.

One thing I am going to try and accomplish is to add some extra fields to the user table, and change the look of the profile. I am guessing the easiest way to do this is just to change the actual code of the profile page? I doubt there are any hooks that would allow me to do this?

Also, I would like to integrate error reporting from my custom site into the forum database. For example, my site contains business profile pages with information stored in a seperate table (I created). Members will be able to comment on these pages, and those comments will be allowed to be reported. I would like to incorporate the "report system" into the fluxbb system, so that administrators can manage both the site and the forum from the same administration panel.

The way it looks to me, I will need a variable to specify whether either a business page or a forum post is being reported (as they may have ID's that overlap). Are there any hooks that would allow me to create a function to differentiate between what is being reported?

Hopefully you understand where I am coming from, and thanks!
-Chris

Edit: I just looked through the misc.php file, and I know how I could make this work by altering the code. However, I am worried that this could cause problems in later editions. It would be better to use an extension wouldn't it?

Last edited by crhayes (2008-10-24 20:32:01)

Re: List of Hooks?

btw ... in the current revision 716 there are 1625 hooks. So, a list would be very long xD

I agree with Reines that it is best to just search the SVN version for "$hook = get_hook(" in all files.

Re: List of Hooks?

All the hooks to do that should be in place.

Ben
SVN repository for my extensions - The thread
Quickmarks 0.5
“Question: How does a large software project get to be one year late? Answer: One day at a time!” - Fred Brooks

Re: List of Hooks?

Okay thanks.

Would these hooks be in v1.3?

I currently have the latest version of PunBB, which I know is similar but not the same to flux. I am going to get flux set up  soon...

Edit: Okay I see in v1.3 there are many hooks. Is there a way to skip from hook to hook? For example, if I want to skip a block of code because I am going to 'hook in' my own?

Last edited by crhayes (2008-10-24 20:56:43)

Re: List of Hooks?

I think I can find a solution.

I was looking at it the wrong way: I was going to try and insert custom reports into the flux report table. Instead I am just going to create a second (custom) report table, and using hooks in the administration report.php file include my custom reports below the forum ones.

Re: List of Hooks?

Here is the list of all 1624 hooks in 1.3-dev-r718: fluxbb-1.3-dev-r718-hooks-list.txt

Re: List of Hooks?

vnpenguin wrote:

Here is the list of all 1624 hooks in 1.3-dev-r718: fluxbb-1.3-dev-r718-hooks-list.txt

damn how long did it take you to make that list? and how did you make it?

~Gizzmo

Re: List of Hooks?

@Gizzmo: haha, it takes me about 30sec to do that smile

find . -name "*.php" | while read f;do echo "=== FILE: $f ==========">>/tmp/toto.txt;grep "get_hook" "$f" >> /tmp/toto.txt;done

and with a small Perl code to parse the file toto.txt

#!/usr/bin/perl
$i=0;
while(<>){
        if(m/get_hook\('([a-z_]+)'\)/){
                printf "  %s\n",$1;
                $i++;
        } else {
                print $_;
        }
}
printf "Total hooks = %d\n",$i;

smile

Re: List of Hooks?

Damn, replied before I could write it sad my slightly less l33t version:

grep -R get_hook ./* | sed "s/:.*get_hook..\([^']*\).*/: \1/"

Re: List of Hooks?

@Connor : it's so cool smile

Re: List of Hooks?

Both are awesome. Everybody loves Unix tools!
Connor, I find yours more 1337, like with sed and all, and smaller.

Anyways... mighty lord... 1000+ hooks!!! I thought they were like 50 or so.

Re: List of Hooks?

It doesn't mean they'll all be used, and there'll be another tidy up of them before beta 3 (once Paul finishes with the markup) so it may be reduced a bit after that.

Re: List of Hooks?

I didn't mean to say it was bad. In fact I like it smile