Gossamer Forum
Home : Products : Links 2.0 : Customization :

special characters in ADD A LINK

Quote Reply
special characters in ADD A LINK
I posted this early last week, but unfortunately didn't receive any replies, so I'm re-posting hoping for some help...

I searched the forum for threads about special characters, but they all seem to deal with using them when creating a category. My problem is using them when adding a listing.

In admin, if I try to enter St. Andrews ,for example, as part of a street address when adding a listing, I get an error message. I am forced to remove the "." from the address. This also happens with other forms of punctuation.

My concern is not so much when I add a listing in admin. My concern is when a visitor to my site fills out the form to add their company to my directory. Sooner or later, someone is going to use punctuation in their address, and they'll get an error message.


Also, in my main directory listing, the subcategories seem to be right up against each other, and it's hard to tell that they are separate subcategories. See www.waterwater.ca. Is there a way to put a space between them?

How do I modify to overcome this problem? Thanks for your help.


P.S. Hope re-posting after 1 week is OK...
Quote Reply
Re: [ceniti] special characters in ADD A LINK In reply to
Why re-post? You could just add another post to your old one to bump it up again to the top Wink I'll delete your old one.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [AndyNewby] special characters in ADD A LINK In reply to
Sorry Andy. Wasn't sure of the procedure. I'll know for the future.
Quote Reply
Re: [ceniti] special characters in ADD A LINK In reply to
What does your field definition look like in links.def? There really shouldn't be any restraint on what characters may be used unless you did not set it to alpha or placed a regex validation on it.

--Philip
Links 2.0 moderator
Quote Reply
Re: [King Junko II] special characters in ADD A LINK In reply to
# Database Definition: LINKS

# --------------------------------------------------------

# Definition of your database file.

%db_def = (

ID => [0, 'numer', 5, 8, 1, '', ''],

Company => [1, 'alpha', 40, 75, 1, '', ''],

URL => [2, 'alpha', 40, 75, 0, 'http://', '^http|news|mailto|ftp'],

Date => [3, 'date', 15, 15, 0, \&get_date, ''],

Category => [4, 'alpha', 0, 150, 1, '', ''],

Description => [5, 'alpha', '40x3', 500, 0, '', ''],

'Contact Name' => [6, 'alpha', 40, 75, 0, '', ''],

'Contact Email' => [7, 'alpha', 40, 75, 0, '', '.+@.+\..+'],

Hits => [8, 'numer', 10, 10, 0, '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'],

Address1 => [14, 'alpha', 40, 75, 1, '', '^[\w\s]+$'],

Address2 => [15, 'alpha', 40, 75, 0, '', '^[\w\s]+$'],

City => [16, 'alpha', 40, 75, 1, '', '^[\w\s]+$'],

State => [17, 'alpha', 40, 75, 1, '', '^[\w\s]+$'],

Zip => [18, 'alpha', 40, 75, 1, '', '^[\dA-Za-z\s]+$'],

Country => [19, 'alpha', 40, 75, 1, '', ''],

Phone => [20, 'alpha', 40, 75, 1, '', '^[\s\d-]+$'],

Fax => [21, 'alpha', 40, 75, 0, '', '^[\s\d-]+$'],

AltCategories => [22, 'alpha', 0, 500, 0, '', ''],

Company_Img => [23, 'alpha', 40, 50, 0, '', '\.(gif|GIF|jpg|JPG)$'],

Product_Img => [24, 'alpha', 40, 50, 0, '', '\.(gif|GIF|jpg|JPG)$']

);

Quote Reply
Re: [ceniti] special characters in ADD A LINK In reply to
just as I suspected... you should either remove the regex ([\w\s]+) or include the special characters you wish to allow.

--Philip
Links 2.0 moderator
Quote Reply
Re: [King Junko II] special characters in ADD A LINK In reply to
Thanks alot, Philip. I'll remove it. Last point: any thoughts on a quick fix for putting a space between subcategories? (see my original post)
Quote Reply
Re: [ceniti] special characters in ADD A LINK In reply to
I assume you are using Paul's subcategories mod? I'm not sure exactly of what the code looks like, but there should be something to effect of
Code:
$output .= qq|,|;
somewhere. All you'd need to do is add a space after the ","

--Philip
Links 2.0 moderator
Quote Reply
Re: [King Junko II] special characters in ADD A LINK In reply to
Fantastic.

I think I've picked your brain quite enough today. I truly appreciate the quick responses.