Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [EZFrag] Hook not found...

Quote Reply
Re: [EZFrag] Hook not found... In reply to
Hi,

Mmm. odd :/ I can't see any reason why it would give that problem :/

BTW - this may be a little bit quicker - not that it really matters, but hey ho :D

Code:
sub post_add_link {
# -----------------------------------------------------------------------------
# This subroutine will be called whenever the hook 'add_link' is run. You
# should call $PLG->action(STOP) if you don't want the regular
# 'add_link' code to run, otherwise the code will continue as normal.
#

my (@args) = @_;
my $max_id = $DB->table('Links')->select( ['MAX(ID)'] )->fetchrow;
my $table = $DB->table('Links');
my $isval = $table->select( ['isValidated'], {ID => $max_id } )->fetchrow;

my $link = $DB->table('Links')->select( { ID => $max_id } )->fetchrow_hashref;
if($isval eq 'Yes') {
use Plugins::ConvertVideo;
my $link2 = Plugins::ConvertVideo::convert_video($link );
$DB->table('Links')->update( $link2, { ID => $max_id } );
}
return @args;

}

Just saves doing a while() loop, when you only wanna get one result :)

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!
Subject Author Views Date
Thread Hook not found... EZFrag 2917 Mar 7, 2008, 12:44 AM
Thread Re: [EZFrag] Hook not found...
Andy 2828 Mar 7, 2008, 12:56 AM
Thread Re: [Andy] Hook not found...
EZFrag 2826 Mar 7, 2008, 1:01 AM
Post Re: [EZFrag] Hook not found...
Andy 2820 Mar 7, 2008, 1:08 AM