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?
Aug 24, 2005, 2:53 AM
Veteran / Moderator (18436 posts)
Aug 24, 2005, 2:53 AM
Post #2 of 5
Views: 3132
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!
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!
Aug 24, 2005, 7:08 AM
User (57 posts)
Aug 24, 2005, 7:08 AM
Post #3 of 5
Views: 3126
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.
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.
Aug 24, 2005, 7:36 AM
Veteran / Moderator (18436 posts)
Aug 24, 2005, 7:36 AM
Post #4 of 5
Views: 3130
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;
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!
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!