Gossamer Forum
Home : Products : Gossamer Links : Discussions :

New field hell

Quote Reply
New field hell
Hi,

I have created one new field called French by cut&paste the field isPopular in the links.def and uploading by ftp :( & some retouchs by Mysqlman & after some retouchs by text editor to links.def
This field is for identify the links based in french language. If the link is french I want to show one french flag gif image.

The new field is:

'French' => {
'values' => [
'No',
'Yes',
],

'type' => 'ENUM',
'pos' => '8',
'not_null' => '1',
'form_type' => 'SELECT',
'default' => 'No',

After Resync Database this is the results:

1 ID INT Yes TEXT ^\d+$
2 Title VARCHAR(100) Yes TEXT 3
3 URL VARCHAR(255) Yes http:// TEXT ^(https?|ftp|news|mailto):\/\/ 1
4 LinkOwner VARCHAR(50) Yes admin TEXT
5 Add_Date DATE Yes 0000-00-00 DATE
6 Mod_Date DATE Yes 0000-00-00 DATE
7 Description TEXT No TEXTAREA 1
8 French ENUM(No, Yes) Yes No SELECT
9 Hits SMALLINT Yes TEXT ^\d+$
10 isNew ENUM(No, Yes) Yes No SELECT
11 isChanged ENUM(No, Yes) Yes No SELECT
12 isPopular ENUM(No, Yes) Yes No SELECT
13 isValidated ENUM(No, Yes) Yes Yes SELECT
14 Rating FLOAT Yes 0.00 TEXT ^\d+\.?\d*$
15 Votes SMALLINT Yes TEXT ^\d+$
16 Status SMALLINT Yes TEXT ^\-?\d+$
17 Date_Checked DATETIME No DATE
18 Timestmp TIMESTAMP No DATE


I added this in the link.html template:
<%if French%>
<img src="http://www.domain.com/frenchflag.gif">
<%endif%>

This .gif appears in all added links, but only the 10% of links is in french (French = yes), the others links arent in other languages (French = no). I dont understand this problem.

Anyone can help me?



Quote Reply
Re: New field hell In reply to
what about...

<%if French = 'yes'%>
<img src="http://www.domain.com/frenchflag.gif">
<%endif%>

The way you had it it's asking "does french have a value?" and because you've got both 'yes' and 'no' as values it always returns true and displays the flag. If you be more specific and ask "does french = yes" then it will be able to sort itself out.

hope that helps! (works!) :)

Regan.

Quote Reply
Re: New field hell In reply to
Actually, you should use:

Code:

<%if French eq 'Yes'%>
DO SOMETHING
<%endif%>


Regards,

Eliot Lee Wink
http://anthrotech.com/
Quote Reply
Re: New field hell In reply to
I stand corrected. :)

R.


Quote Reply
Re: New field hell In reply to
 
Thank you very much for the reply ryeld01 & Anthrorules. Works fine fine. :):)

Quote Reply
Re: New field hell In reply to
You're welcome.

Regards,

Eliot Lee Wink
http://anthrotech.com/