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

LinksSQL: Problems testing globals

Quote Reply
LinksSQL: Problems testing globals
This
<%if some-global($value)%>
<%some-global($value)%> TRUE output
<%else%>
<%some-global($value)%> FALSE output
<%endif%>

always returns the FALSE output.

$value is an ID as input for some-global. The output of <%some-global($value)%> is fine, but unfortunately the test does not work.

What is wrong?

Thanks a million,

Joe

Last edited by:

Joe Cool: Oct 28, 2004, 8:48 AM
Quote Reply
Re: [Joe Cool] LinksSQL: Problems testing globals In reply to
You can't do comparisions like that unfortunatly :(

What you have to do ... is;

<%global_name($Variable)%>

Code:
sub {

my $val = $_[0];

# .... do whatever checks here...
# assign $chk

$chk ? return { field_check => 1 } : return { field_check => 0 };

}

... and then below that tag;

Code:
<%if field_check%>
... do true stuff ...
<%else%>
... do false stuff...
<%endif%>

...etc

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] LinksSQL: Problems testing globals In reply to
Thanks a lot. I will try it.

Joe