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

Products: Gossamer Links: Development, Plugins and Globals: Re: [gotze] [UPDATE] MyFaves v2 (SQL support): Edit Log

Here is the list of edits for this post
Re: [gotze] [UPDATE] MyFaves v2 (SQL support)
You could use a global, similar to the below (untested);

Code:
sub {

use Links::Plugins;

# no point doing anything if we dont hae a username...
if (!$USER->{Username}) { return; }

my $opts = Links::Plugins->get_plugin_user_cfg('MyFaves');
my $per_page = $opts->{LinksPerPage} || 25;
my $save_type= $opts->{SaveType} || 'c';

if ($save_type eq "c") {

# grab the old list of ID's...
my $cut_up = $IN->cookie('IDList');

# now explode the list, so we can check this ID doesn't already exist...
my @sliced = split(/ /, $cut_up);
my $count = 0;

# count the links....
foreach (@sliced) {
$count++;
}

return $count;

} else {

return $DB->table('MyFaves')->count( { Username => $USER->{Username} } ) || 0;

}


}

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: Oct 21, 2003, 12:10 AM

Edit Log: