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

user toplist with link to profile

Quote Reply
user toplist with link to profile
Hi Andy,
who else ;-) Do you know how to integrate the link to the user profile
community.cgi?view_profile=1;user=<%Username%>
into the following global just after the linkowner name?
my $url = $CFG->{db_cgi_url} . "/search.cgi?query=;LinkOwner=$s";


Code:
sub {

my $db = $DB->table('Links');
$db->select_options( "GROUP BY LinkOwner","ORDER BY link_count DESC" );
my $sth = $db->select("LinkOwner", "COUNT(*) as link_count", "SUM(Hits) as hits_count") or die "Query Error: $GT::SQL::error";

my $back;
while (my ($s, $c,$h) = $sth->fetchrow_array) {
if ($c < 7) { next; }
my $url = $CFG->{db_cgi_url} . "/search.cgi?query=;LinkOwner=$s";
$back .= qq|> <a href="$url">$s</a> - $c Eintr├Ąge mit $h Downloads <br />|;
}

return $back;

}

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] user toplist with link to profile In reply to
Hi,

Something like this should work:

Code:
my $back;
while (my ($s, $c,$h) = $sth->fetchrow_array) {
if ($c < 7) { next; }
my $url = $CFG->{db_cgi_url} . "/search.cgi?query=;LinkOwner=$s";
$back .= qq|> <a href="$url">$s</a> - $c Eintr├Ąge mit $h Downloads
<a href="http://www.yoursite.com/cgi-bin/community/community.cgi?view_profile=1;user=$s">$s Profile</a>
<br /> |;
}

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] user toplist with link to profile In reply to
Mmh, I'm getting this error

Unable to compile 'user_list_links': Missing right curly or square bracket at (eval 30) line 14, at end of line (Might be a runaway multi-line || string starting on line 11) syntax error at (eval 30) line 14, at EOF

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] user toplist with link to profile In reply to
Erm, you did update the ORIGINAL global, yes? (not just put the code I gave you above as the global - cos thats only part of it Tongue

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: [Matthias70] user toplist with link to profile In reply to
Upps, sorry Andy
my fault. I forgot
Code:
return $back;

}

at the end of the global

Thanks working fine
Matthias

Matthias
gpaed.de