Gossamer Forum
Quote Reply
New total hits global ?
Hello,
I use a simple total hits global:

Quote:

sub {
my ($total) = $DB->table('Links')->select(['SUM(Hits)'])->fetchrow_array;
return $total;
}


but it counts a link twice if it is in 2 categories. I there a way to have the same global but that would consider each link unique even if they are in several categories ?

Thanks in advance,
Brakkar
Quote Reply
Re: [brakkar] New total hits global ? In reply to
I would personally do;

Code:
sub { return $DB->table('Links')->count(); }

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] New total hits global ? In reply to
I made a mistake, I gave the code I used to count the number of hits, not links.
But I wanted the number of unique LINKS, and thus, it seems your code works find for what I wanted.

Smart you.

Thanks,
Brakkar