Previous Thread
Next Thread
Print Thread
Hop To
Joined: Aug 2006
Posts: 45
H
newbie
newbie
H Offline
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...? smile

Last edited by Helice; 07/13/2007 2:42 PM.
Joined: Aug 2006
Posts: 45
H
newbie
newbie
H Offline
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,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
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


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Aug 2006
Posts: 45
H
newbie
newbie
H Offline
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. smile

Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
Well, that would be libs/ubbthreads.inc.php:
Code
                // 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.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Aug 2006
Posts: 45
H
newbie
newbie
H Offline
Joined: Aug 2006
Posts: 45
Thanks for pointing me to those lines of code, Gizmo. smile

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. smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
0 members (), 744 guests, and 147 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)