FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » Create automatic links with www. only
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Create automatic links with www. only [message #15045] Sun, 30 November 2003 12:13 Go to next message
Squeebee is currently offline  Squeebee   Canada
Messages: 110
Registered: November 2003
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Hi There;

It appears fudforum will only create a hyperlink automatically when it finds http:// leading URLs. I think it would be beneficial if www. was also used to auto-create a link, as many board users to not apply http:// to the start of links.
Re: Create automatic links with www. only [message #15052 is a reply to message #15045] Sun, 30 November 2003 16:27 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
I've made [url] tags handle this situation, however parsing plain text urls from www. would be to slow and inacurate "www" is often used with no reference to a url and www. would result in a false url.

FUDforum Core Developer
Re: Create automatic links with www. only [message #15056 is a reply to message #15045] Sun, 30 November 2003 17:04 Go to previous messageGo to next message
Squeebee is currently offline  Squeebee   Canada
Messages: 110
Registered: November 2003
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
I can understand that, I am just looking at things from the point of view of my users. They have become accustomed with having www. strings converted to URLs.

That being said, I cannot think of many situations where www. would produce a false positive, as there are not any non-URL situations where you would encounter the string www.
Re: Create automatic links with www. only [message #15057 is a reply to message #15056] Sun, 30 November 2003 17:11 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Most urls are pasted, and thus already have http:// or equivalent prefix. Even when not pasting many people use the http:// prefix, so I do not see this as a critial issue.

FUDforum Core Developer
Re: Create automatic links with www. only [message #15060 is a reply to message #15056] Mon, 01 December 2003 00:00 Go to previous messageGo to next message
melvyn is currently offline  melvyn   Netherlands
Messages: 7
Registered: November 2003
Location: Hilversum, The Netherland...
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Squeebee geschreven op zo, 30 november 2003 23:04


That being said, I cannot think of many situations where www. would produce a false positive, as there are not any non-URL situations where you would encounter the string www.


awwww, you can't? Shocked


Melvyn
Re: Create automatic links with www. only [message #15076 is a reply to message #15060] Mon, 01 December 2003 09:10 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
If you want to do it you can do so by adding:

$str = preg_replace('!(^|\s)(www\.[A-Za-z0-9_]+\.[A-Za-z]+([^\s]?))!i','\1http://\2', $str);



To the top of tags_to_html() function inside post_proc.inc.t. However at this time I am not convinced it is needed in the standard forum distribution.


FUDforum Core Developer
Re: Create automatic links with www. only [message #15086 is a reply to message #15076] Mon, 01 December 2003 17:32 Go to previous messageGo to next message
melvyn is currently offline  melvyn   Netherlands
Messages: 7
Registered: November 2003
Location: Hilversum, The Netherland...
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
_ aren't allowed in domains (long discussion about '_' being used in RR records) but '-' are

[^\s] = \S

[A-Za-z] with /i is redundant

www.country.domain.tld isn't recognized

tld needs a minimum of 2 and I think a max of 6 (.museum) which can be used as an anchor point.



resulting in:




$str = preg_replace('!(^|\s)(www\.[A-Za-z0-9.-]+\.[A-Za-z]{2,6})!','\1http://\2', $str);





Melvyn

[Updated on: Mon, 01 December 2003 17:33]

Report message to a moderator

Re: Create automatic links with www. only [message #15087 is a reply to message #15086] Mon, 01 December 2003 18:04 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
The 'i' flag is needed for "www".



FUDforum Core Developer
Re: Create automatic links with www. only [message #15089 is a reply to message #15087] Mon, 01 December 2003 18:57 Go to previous messageGo to next message
melvyn is currently offline  melvyn   Netherlands
Messages: 7
Registered: November 2003
Location: Hilversum, The Netherland...
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
right - [wW]{3} Wink

Melvyn
Re: Create automatic links with www. only [message #15090 is a reply to message #15089] Mon, 01 December 2003 19:13 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
melvyn wrote on Mon, 01 December 2003 18:57

right - [wW]{3} Wink


good point.

Btw while tld has a maximum number of chars, you'll still want to support query & paths so you need ([\S]*) at the end.


FUDforum Core Developer
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Private message commands at top of page
Next Topic: Cmd line installer.
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 13 19:46:57 EST 2017

Total time taken to generate the page: 0.00828 seconds