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

Total Validated Link Count by LinkOwner

Quote Reply
Total Validated Link Count by LinkOwner
While doing search on the forum I found the global sub { return $DB->table('Links')->count( { LinkOwner => $USER->{Username} } ); } that will display total number of Link owned by logged in user. However I was wondering if anyone knew on how to display Total number of Links by Link Owner (which could be displayed on link.html & detailed.html or maybe even on review page).

Thank you.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Total Validated Link Count by LinkOwner In reply to
Hi Vishal,

Below should work

Cheers,

sub {
my $
LinkOwner = GT::Template->tags->{LinkOwner };
return $DB->table('Links')->count( { LinkOwner => "$
LinkOwner" } );

}




Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Total Validated Link Count by LinkOwner In reply to
Hi Dat,

Works Perfectly... Thanks a lot.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Total Validated Link Count by LinkOwner In reply to
For those that started their links from importing (LinkOwner = admin) then users added new ones:

Code:
sub {
my $tags = shift;
my $owner = $tags->{'LinkOwner'};
if ($owner ne 'admin'){
return $DB->table('Links')->count( { LinkOwner => "$owner" } );
}
}




Then:
Code:
<% if LinkOwner != 'admin' %><br><span class="desc">Author <%LinkOwner%> have a total of <%link_own%> links in our database.</span><%endif%>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Blondies can have brains (sometimes...)

Last edited by:

SaraBem: Mar 1, 2007, 1:22 AM