I'm working on the Ace_Category plugin...which will allow users to submit a category before adding their link. The problem I am having, is that the hook doesn't appear to be working!
This is the code I have in Install.pm regarding to the hooks;
$mgr->install_hooks ( 'Ace_Category', [ ['add_link', 'PRE', 'Plugins::Ace_Category::add_link', 'FIRST'] ]);
$mgr->install_hooks ( 'Ace_Category', [ ['add_link', 'PRE', 'Plugins::Ace_Category::add_link2', 'LAST'] ]);
ANd the sub relating to it, in Ace_Category.pm, is;
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'add_link'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
print $IN->header();
print "test";
exit;
my (@args) = @_;
my $table = $DB->table('Category');
my $sth = $table->select;
my $opts;
# grab all the money, and add it up...
while (my $hit = $sth->fetchrow_hashref) {
$opts .= "<option value=\"$hit->{ID}\">$hit->{Full_Name}</option>"
}
my $category = qq|
<select size="1" name="new_category_sub">
$opts
</select>
|;
print $IN->header();
print Links::SiteHTML::display('pre_add_link', { category_list => $category });
exit;
return @args;
}
Can anyone see anything that may cause the hook not to be called? After installing it, and running add.cgi, all I get is the normal adding page!
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!
This is the code I have in Install.pm regarding to the hooks;
$mgr->install_hooks ( 'Ace_Category', [ ['add_link', 'PRE', 'Plugins::Ace_Category::add_link', 'FIRST'] ]);
$mgr->install_hooks ( 'Ace_Category', [ ['add_link', 'PRE', 'Plugins::Ace_Category::add_link2', 'LAST'] ]);
ANd the sub relating to it, in Ace_Category.pm, is;
Code:
sub add_link { # -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'add_link'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
print $IN->header();
print "test";
exit;
my (@args) = @_;
my $table = $DB->table('Category');
my $sth = $table->select;
my $opts;
# grab all the money, and add it up...
while (my $hit = $sth->fetchrow_hashref) {
$opts .= "<option value=\"$hit->{ID}\">$hit->{Full_Name}</option>"
}
my $category = qq|
<select size="1" name="new_category_sub">
$opts
</select>
|;
print $IN->header();
print Links::SiteHTML::display('pre_add_link', { category_list => $category });
exit;
return @args;
}
Can anyone see anything that may cause the hook not to be called? After installing it, and running add.cgi, all I get is the normal adding page!

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!