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

Products: Gossamer Links: Development, Plugins and Globals: Re: [Coyu] function isBookmarked?: Edit Log

Here is the list of edits for this post
Re: [Coyu] function isBookmarked?
Hi,

This will work (just tested it). Make a new global called "check_bookmarked", with the following code:

Code:
sub {

my $count = $DB->table('Bookmark_Links')->count( { my_link_id_fk => $_[0], my_user_username_fk => $USER->{Username} } ) || 0;

$count ? return { isBookmarked => 1 } : return { isBookmarked => 0 }

}

The, in link.html add:

Code:
<%check_bookmarked($ID)%>

at the top of the template.

Then, you can use:

Code:
<%if isBookmarked%>alreadybookmarked<%else%>show bookmark link<%endif%>

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!

Last edited by:

Andy: Jan 20, 2008, 11:45 PM

Edit Log: