Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Links 2.0.3 <%if Image%> and <%if URL%> tags

Quote Reply
Links 2.0.3 <%if Image%> and <%if URL%> tags
Hi, i suppose i posted this in the wrong forum before, so please excuse me if this is the wrong forum again. I'm just trying to figure out why my <%if Image%> and <%if URL%> tags are not working.

I have the proper plugin installed, but no matter whether an image is upload or not (or whether the user enters a URL or not) the info within the if statement still shows up. For example: there was no URL submitted, yet the "Click here to visit the associated web site" still shows up even though the code says,

<%if URL%>
<a href="<%URL%>">
Click here to visit the associated web site.
</a>
<%endif%>

Can anyone help?

(: Danny :)
Quote Reply
Re: Links 2.0.3 <%if Image%> and <%if URL%> tags In reply to
Your db might have a NULL value in the field you're retrieving? The script will then think there's a value there, and display the contents between the tag.

Maybe.. :)

R.


Quote Reply
Re: Links 2.0.3 <%if Image%> and <%if URL%> tags In reply to
Thank you, can you tell me how to find out whether my db has a NULL value in the field i'm retrieving?

(: Danny :)
Quote Reply
Re: Links 2.0.3 <%if Image%> and <%if URL%> tags In reply to
Database > Links/Properties

-OR-

MySQLMan

Mods:http://wiredon.net/gt/download.shtml
Installations:http://wiredon.net/gt/
Quote Reply
Re: Links 2.0.3 <%if Image%> and <%if URL%> tags In reply to
 
>> I'm just trying to figure out why my <%if Image%> and <%if URL%> tags are not working

Ok, this is a "sticky" situation. ;)

Let me use an analogy that will perhaps make what is probably happening clearer. A simple "if" will only work if the field contains a NULL, '0' or '' value for it's "empty" state.

Example:

isValidated is stored in the database as "Yes" or as "No"

If you use <% if isValidated %> in the template, it will _always_ be true, since isValidated contains either a "Yes" or a "No". You need to use <% if isValidated eq 'No' %>

You bump into this if you call the link records yourself, rather than through "normal" channels, where I think the values are set to "Yes"=1 and "No"=0, so the simple "if" test will work.

Make sense?




PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.