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
# -----------------------------------------------------------------------------
# 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!
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!