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.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | 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
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!
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.

Cheers,
Boris

Facebook, Twitter and Google+ Auth for GLinks and GCommunity | reCAPTCHA for GLinks | Free GLinks Plugins