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

global get_links_by_owner

Quote Reply
global get_links_by_owner
Hi,
I'm using this global, to show other link entries from a user in the detailed page.

Code:
sub {

my $user = $_[0];

my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;

my $back;
while (my $hit = $sth->fetchrow_hashref) {
$back .= qq|<p><a href="$CFG->{db_cgi_url}/jump.cgi?Detailed=$hit->{ID}">$hit->{Title}</a></p>|;
}

return $back;
}

How can I insert a control if there is a detailed page or not.
At the moment all links go to the detailed page, even if the link has no detailed page.
But when there is no detailed page I just get this error message
Sorry, Detailed information is turned off for this record.

Is it possible to integrate the "if detailed" tag in this global?

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] global get_links_by_owner In reply to
Hi,

Just change:

Code:
my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes' } ) || return $GT::SQL::error;

..to:

Code:
my $sth = $DB->table('Links')->select( { LinkOwner => $user, isValidated => 'Yes', Build_Detailed_Page => 1 } ) || return $GT::SQL::error;

Hope that helps.

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] global get_links_by_owner In reply to
Hi Andy,
yes this code helped ;-)

Thanks
Matthias

Matthias
gpaed.de