Gossamer Forum
Quote Reply
Plugin Install Hooks
What do the PRE|POST and FIRST|LAST qualifiers mean when installing a hook? Do these have anything to do with the parameters passed in or returned? What gets passed into the subroutines? Does anyone have some simple plugin examples to help someone get started?

Last edited by:

Eric P: Aug 23, 2005, 8:07 PM
Quote Reply
Re: [Eric P] Plugin Install Hooks In reply to
Hi,

PRE = before the "routine" (i.e at the start)
POST = before the end of "routine" (i.e at the end)

These are useful for using multiple hooks in one plugin;

FIRST = first plugin hook called
LAST = Last hook called

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Plugin Install Hooks In reply to
Andy

That does help. Can you shed some light on the parameters passed in and out? I looked at some other people plugins and am not sure what is getting passed in with @_. Also, are there any rules for returns? Overall I'm just trying to figure out how to incorporate my own functions, how to make them interact with others actions, what gets passed in and what needs to be passed back out. Now these may be dumb questions but without any documentation it's hard to know.
Quote Reply
Re: [Eric P] Plugin Install Hooks In reply to
Hi,

No problem.

The params passed in can vary, depending on where using. The best way to find them out, is with a global, such as;

Code:
sub {
my @args = shift;
use Data::Dumper;
return Dumper(@args);
}

This would return back the paramaters passed into the global.

Hope that helps :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Plugin Install Hooks In reply to
Andy

Now that's a good idea. I'll give it a try. Thanks!