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


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] LinksSQL: Problems testing globals In reply to
Thanks a lot. I will try it.

Joe