Gossamer Forum
Home : Products : Gossamer Links : Discussions :

user profile page

Quote Reply
user profile page
hi,

i was wondering in login_success.html, how can i display a user's active links (link to title only), pending links (not validated yet), and a link to each of their reviews?

you can just point me to another thread that explains this if there is one :)

thanks
-simon
http://www.fatscripts.com
Quote Reply
Re: [lastsaga] user profile page In reply to
Could try something like this on that template;

<%show_validated($Username)%>

show_validated =>

Code:
sub {

my $back;
my $username = $_[0];
my $sth = $DB->table('Links')->select( ['Title'], { LinkOwner => $username, isValidated => 'Yes' });

while (my $hit = $sth->fetchrow_hashref) {
$back .= qq|$hit->{Title} <BR>|;
}

$back ? return $back : return 'No links for this user already exist...';

}

...and to show unvalidated links the user has, try....

<%show_unvalidated($Username)%>

show_unvalidated =>

Code:
sub {

my $back;
my $username = $_[0];
my $sth = $DB->table('Links')->select( ['Title'], { LinkOwner => $username, isValidated => 'No' });

while (my $hit = $sth->fetchrow_hashref) {
$back .= qq|$hit->{Title} <BR>|;
}

$back ? return $back : return 'No links for this user already exist...';

}

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!