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

Advice on bookmark plugin hook

Quote Reply
Advice on bookmark plugin hook
Hi,

I've added a new field called my_date_added to Bookmark_Links table.
I need this field to do some stats on bookmark activity from users but could not to determine from which hook is the best place update this field when link is successfully added to bookmarks.

I'm looking on bookmarks_link_add hook but there seems so many checks and error exits if addition is unsuccessful.

I appreciate any advice on this.

rgrdz
Boris

Facebook Login for GLinks | reCAPTCHA for GLinks | Free GLinks Plugins
Quote Reply
Re: [eupos] Advice on bookmark plugin hook In reply to
Hi,

It could be as simple as doing something like this, to get the value of error;

Code:
my (@args) = @_;

my $results = shift;
return @args if $results->{error};

$results->{error} just holds the error message, if it is defined - so you can tell your system/plugin to quit doing whatever it is doing - and just carry on normally with displaying the error message.

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Advice on bookmark plugin hook In reply to
Hi Andy,

Thanks for feedback, but I ended with an lazy solution, I have setup the new field as TIMESTAMP with default value CURRENT_TIMESTAMP and that do the trick without need to add a new hook for this case Tongue

I love simple solutions.

rgrdz
Boris

Facebook Login for GLinks | reCAPTCHA for GLinks | Free GLinks Plugins