|
Joined: Aug 2006
Posts: 45
newbie
|
newbie
Joined: Aug 2006
Posts: 45 |
Is there a setting or a way to dig in and stop the automatic conversion of text containing http or www to working links...? I get lots of these on my board, and they all eventually become dead links, and because I hate dead links it becomes hard work looking for them and cleaning them up. I'd like to head off the problem by making people have to actually intend to create a live link, rather than it being automatically created for them every time they enter some http text. (e.g. stop the auto-conversion of .www.this-link-is-dead.com to www.this-link-is-dead.com ) Where do I look for this, please...?
Last edited by Helice; 07/13/2007 2:42 PM.
|
|
|
|
Joined: Aug 2006
Posts: 45
newbie
|
newbie
Joined: Aug 2006
Posts: 45 |
Still searching for a way to stop this, haven't discovered it yet...
|
|
|
|
Joined: Nov 2006
Posts: 3,095 Likes: 1
Carpal Tunnel
|
Carpal Tunnel
Joined: Nov 2006
Posts: 3,095 Likes: 1 |
In your Control Panel
CP-Feature Settings-Active Text
|
|
|
|
Joined: Jun 2006
Posts: 16,299 Likes: 116
|
Joined: Jun 2006
Posts: 16,299 Likes: 116 |
NT, actually, the forum automatically adds 'http://' to links you type in, type in any link without the http: www.corthell.net for example
|
|
|
|
Joined: Aug 2006
Posts: 45
newbie
|
newbie
Joined: Aug 2006
Posts: 45 |
ntdoc, thanks for replying, but Active Text is not what I'm looking for -- Gizmo is right, the forum software auto-converts any text starting with www. or http:// to a clickable link, and I'm looking for a way to stop that. I only want links to be clickable if the user deliberately makes them into an URL, I don't want the automatic conversion of text. I want to know where to look to comment out the code that automagically does this job.
|
|
|
|
Joined: Jun 2006
Posts: 16,299 Likes: 116
|
Joined: Jun 2006
Posts: 16,299 Likes: 116 |
Well, that would be libs/ubbthreads.inc.php: // Link regexes here
$body = preg_replace( "#\[url\](https|http|ftp)://([^\"\[\]<>]+?)\[/url]#i", '<a href="\1://\2" target="_blank">\1://\2</a>',$body );
$body = preg_replace( "#\[url\]([^\"\[\]<>]+?)\[/url\]#i", '<a href="http://\1" target="_blank">\1</a>',$body );
$body = preg_replace( "#\[url=(https|http|ftp)://([^\"\[\]<> ]+?)\](.+?)\[/url]#i", '<a href="\1://\2" target="_blank">\3</a>',$body);
$body = preg_replace("#(<br />|^|\s)(http|https|ftp)://([^<\"\[\s]+)(\.|\,|\?|\)|\s)?#i", '\1<a href="\2://\3" target="_blank">\2://\3</a>\4',$body);
$body = preg_replace( "#(<br />|^|\s)(www\.[^<\"\[\s]+)(\.|\,|\?|\)|\s)?#i", '\1<a href="http://\2" target="_blank">http://\2</a>\3',$body ); Thats lines 1169-1174; if you comment them all out, then you'll never have a link converted period.
|
|
|
|
Joined: Aug 2006
Posts: 45
newbie
|
newbie
Joined: Aug 2006
Posts: 45 |
Thanks for pointing me to those lines of code, Gizmo. A little experimenting showed me that commenting out only the last two lines of that block gives me exactly what I wanted -- the ability to have people post links using ubb code or html by entering them deliberately, but stopping the automatic conversion of text which was not working out well in my boards because of the dead link factor. Much appreciated.
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
|
1 members (Napalm),
806
guests, and
165
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|