Gossamer Forum
Home : Products : Gossamer Links : Discussions :

business directory - some with websites others without

Quote Reply
business directory - some with websites others without
Hi,

I took the plunge and bought Link SQL! Now I'll start bugging you with questions...Tongue I'm not an expert on either PHP or MySQL to say the least, so please bare with me.

I looked up this one in the forums, but couldn't find quite the thing (I did find some similar questions, but I'm afraid it didn't help me Unsure). So, here goes -

I want to create a directory of cat related businesses. Some will have a website, others will not. Right now (just had the script installed yesterday), the URL field is required. I want to set it up so that users can either provide a URL for their site if they have one, or just list their business without a URL (if they don't have their own website). Then, if they did give a valid URL, I do want it to be used to make their business name into an active clickable link. If they didn't give a URL, the business name should be just plain text (NOT a link with a non existent empty "http://" URL).

How do I do this? Please please tell me it can be done and it won't be very complicated. I couldn't write a script if my life depended on it, so I really hope there's some built-in option in LSQL.

Thanks!!!!

Anne

If you love cats - visit www.TheCatSite.com

Visit my LinkSQL based Cat Site - www.Meowhoo.com
Quote Reply
Re: [Anat] business directory - some with websites others without In reply to
Simply solution would be making the URL field NOT required, allow NULL values (via MySQL) and specify it as not required in the admin configurations (def file).
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] business directory - some with websites others without In reply to
>>
Simply solution would be making the URL field NOT required, allow NULL values (via MySQL) and specify it as not required in the admin configurations (def file).
<<

I think you are thinking in terms of your old Links SQL 1.13 copy....this should be done via the table editor in the control panel, no def files should be changed and it shouldn't be edited using mysqlman.
Quote Reply
Re: [Anat] business directory - some with websites others without In reply to
Eliot is right, but it can all be done in the Links SQL admin, no need to edit def files.

Go to "Database -> Links -> Properties" then click on "URL". Then set "Not Null" to "No", and remove anything that is in "Form Regex". That should do the job.

As for displaying: you want to edit the template "link.html". Use something like
Code:
<%if URL%>
<a href="<%URL%>"><%Title%></a>
<%else%>
<%Title%
<%endif%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] business directory - some with websites others without In reply to
Thank you!!! Ivan - thanks for explaining it in a "for dummies" version Blush well needed! I'll let you know if this worked for me.

If you love cats - visit www.TheCatSite.com

Visit my LinkSQL based Cat Site - www.Meowhoo.com
Quote Reply
Re: [Paul] business directory - some with websites others without In reply to
Well, I was actually referring to the END RESULT, which IS editing the Def files, but through the admin web administration, PAUL!
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [yogi] business directory - some with websites others without In reply to
It says:

A column must be defined as not null if you want to index it

when I try to set the URL to no - not Null

so, I'm changing the column index to NONE. Hope that okay.

If you love cats - visit www.TheCatSite.com

Visit my LinkSQL based Cat Site - www.Meowhoo.com
Quote Reply
Re: [Anat] business directory - some with websites others without In reply to
Yes that's fine you don't really need to index the url column.
Quote Reply
Re: [Paul] business directory - some with websites others without In reply to
Cool Thank you! Thank you! Thank you!

It's working!!!

You guys are the best!

If you love cats - visit www.TheCatSite.com

Visit my LinkSQL based Cat Site - www.Meowhoo.com