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

Users List Of Links Global

Quote Reply
Users List Of Links Global
Hi

I am using the PageBuilder plug in to create a specific page per user..

I have not been able to come up with a global that will return a list of the specific user's owned links (if any)

The trouble is when you have another logged in user trying to view that page..

Any ideas?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Users List Of Links Global In reply to
I do this. I think you just need to be careful that you only ever use Username for the logged in user. I think that some plugins try to return Username for the owner of the page you are viewing and you'll need to change this. (I'm thinking of old versions of MyLinks and UserMonitor - I think - apologies if I'm wrong). Are you using UserMonitor?
Quote Reply
Re: [afinlr] Users List Of Links Global In reply to
Hi Laura

I do not run UserMonitor, but still unable to create a page specific to each user with a list of their links in it..

Thanks for the advice.
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Users List Of Links Global In reply to
Well, I don't have the pagebuilder plugin so I'm not quite sure how it works. However, if you were building the pages dynamically, you would use something like profile.cgi?user=afinlr - I assume that you must still have this 'user' tag available in the pagebuilder page. This then gives you the tag <%user%> to use for the owner of the profile page and you still have Username as the logged in user.

The global (user_links) would be something like this:

sub {
my $name = shift;
my $db = $DB->table ('Links');
my $sth = $db->select ( { 'LinkOwner' => $name }, ['Title'] );
my $output;
while (my $link = $sth->fetchrow_array){
$output.= qq~<li>$link~;
}
return $output;
}

And then you use the tag <%user_links($user)%>
Quote Reply
Re: [afinlr] Users List Of Links Global In reply to
Thanks a lot

I have modified the sub to display the full link using link.html



sub {
# Displays the newest links on the home page.
my $name = shift;
my ($output,$sth,$link);
my $db = $DB->table ('Links');
my $sth = $db->select ( { 'LinkOwner' => $name }, ['Title'] );
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}

BUT It is not recognizing the ID tag for some reason.. Any ideas?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Users List Of Links Global In reply to
Yes - I had written it to just select the Title and you'll need the whole record.

sub {
# Displays the newest links on the home page.
my $name = shift;
my ($output,$sth,$link);
my $db = $DB->table ('Links');
my $sth = $db->select ( { 'LinkOwner' => $name });
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}