Gossamer Forum
Home : Products : Links 2.0 : Customization :

isLinked problem

Quote Reply
isLinked problem
I install isLinked mod. when i try to add a site without URL, it keeps saying - isLinked (Can not be left blank)

I did some changes as the following :
links.def
_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Title => [1, 'alpha', 40, 75, 1, '', ''],
URL => [2, 'alpha', 40, 75, 0, 'http://', '^http|news|mailto|ftp'],
Date => [3, 'date', 15, 15, 1, \&get_date, ''],
Category => [4, 'alpha', 0, 150, 1, '', ''],
Description => [5, 'alpha', '40x3', 500, 0, '', ''],
'Contact Name' => [6, 'alpha', 40, 75, 1, '', ''],
'Contact Email' => [7, 'alpha', 40, 75, 1, '', '.+@.+\..+'],
Hits => [8, 'numer', 10, 10, 1, '0', '\d+'],
isNew => [9, 'alpha', 0, 5, 0, 'No', ''],
isPopular => [10, 'alpha', 0, 5, 0, 'No', ''],
Rating => [11, 'numer', 10, 10, 1, 0, '^[\d\.]+$'],
Votes => [12, 'numer', 10, 10, 1, 0, '^\d+$'],
ReceiveMail => [13, 'alpha', 10, 10, 1, 'Yes', 'No|Yes'],
isLinked => [14, 'alpha', 0, 5, 1, 'No', 'No|Yes']

);

# where the first field equals 0.
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 8; $db_isnew = 9; $db_ispop = 10;
$db_contact_name = 6; $db_contact_email = 7; $db_title = 1;
$db_votes = 12; $db_rating = 11; $db_mail = 13;
$db_islinked = 14;

_select_fields = (
isNew => 'Yes,No',
isPopular => 'Yes,No',
ReceiveMail => 'Yes,No',
isLinked => 'Yes,No'
);

site_html_templates.pl
# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
($rec{'isLinked'} eq 'Yes') ? ($rec{'isLinked'} = 1) : (delete $rec{'isLinked'});

link.html
<%if isLinked%>
<a href="<%URL%>" target="_Blank"><%Title%></a>
<%endif%>
<%ifnot isLinked%><%Title%><%endif%>

Please help

Thanks



Quote Reply
Re: isLinked problem In reply to
That is the correct response based on the field settings:

Code:
isLinked => [14, 'alpha', 0, 5, 1, 'No', 'No|Yes']
See the red text...with the 1,. Well, that means that the field is required and you need to specify either Yes or No.

In the add templates, add a hidden field:

Code:

<input type="hidden" name="isLinked" value="Yes">


I would also add this field in the d_system_fields in the links.def as follows:

Code:

isLinked => 'No'


Regards,


Eliot Lee
Quote Reply
Re: isLinked problem In reply to
I've been thinking about using this mod.....but not quite sure on one thing. If a site is listed without a url, wouldn't that cause problems with the random jump? Thanks.

Quote Reply
Re: isLinked problem In reply to
Possibly not...since the url.db file depends on the ID and URL fields. And if there is NO URL, then the random function will skip that record.

What you can do is add the following codes in the link.html file:

Code:

<%if isLinked%>
<a href="<_cgi_url%>/jump.cgi?ID=<%ID%>">
<%Title%></a>
<%endif%>
<%ifnot isLinked%>
<%Title%>
<%endif%>


And I do believe that similar codes are posted in the isLinked instructions.

Regards,

Eliot Lee
Quote Reply
Re: isLinked problem In reply to
Ok...great, thanks Eliot!

Quote Reply
Re: isLinked problem In reply to
You're welcome.

Regards,

Eliot Lee
Quote Reply
Re: isLinked problem In reply to
Ok...this doesn't make sense! I thought I figured it out but, I was wrong. I've added this mod, and instead of adding this:

<%if isLinked%><a href="<%URL%>"><%Title%></a><%endif%><%ifnot
isLinked%><%Title%><%endif%>

...in the link.html file, I've added it to my detail page. So now, I have the Yes|No option in the admin section. I thought if you selected No that it would not show up? I've tried modifying a link and changing a link to both options and it still shows the url. Now here is the strange part-- if I modify a link and leave the field blank, by selecting this option in the admin:

--- (this is what I select)
Yes
No

...then it works fine?? I'm probably missing something......any ideas? Thanks. Also, just thinking, couldn't I just add something like this:

<%if URL%><a href="<%URL%>"><%Title%></a><%endif%><%ifnot URL%><%Title%><%endif%>

rather than even messing with this mod? It makes sense, I just haven't tried yet...I'll try right now.

P.S. Is this board draggin or is it just me??

Thanks

Quote Reply
Re: isLinked problem In reply to
Do you have the following codes in your sub site_html_link and sub site_html_detailed routines:

Code:

($rec{'isLinked'} eq 'Yes') ? ($rec{'isLinked'} = 1) : (delete $rec{'isLinked'});


Regards,

Eliot Lee
Quote Reply
Re: isLinked problem In reply to
Duh....I knew I was missing something!! I forgot to place it in the detail sub!! Thanks for pointing that out Eliot, you saved me from a headache......see ya!

Quote Reply
Re: isLinked problem In reply to
You're welcome....

Regards,

Eliot Lee
Quote Reply
Re: isLinked problem In reply to
Hi There,

Glad to see you got it working OK in the end.

Thanks eliot.



Quote Reply
Re: isLinked problem In reply to
You're welcome...

Regards,

Eliot Lee
Quote Reply
Re: isLinked problem In reply to
Hey mdj1,

Fortunately Eliot pointed out my mistake! And thank you for the mod....works great.

Quote Reply
Re: isLinked problem In reply to
Where can I find a lsit of parameters I can use in the templates like
<%if URL%>
<%ifnot URL%>
<%endif%>

Regards, Chris



Quote Reply
Re: isLinked problem In reply to
Uh...open your admin.cgi file and in the FAQ section and also in each of the template edit screens, there is a link called Template Help and Codes you can use! ---> click on it and you will see a list of tags you can use.

Regards,

Eliot Lee

Quote Reply
Re: isLinked problem In reply to
Sorry,

but there isn't listed ifnot?!

Quote Reply
Re: isLinked problem In reply to
You need the Enhanced Template Support mod found in the resource center to use ifnot's.