Previous Thread
Next Thread
Print Thread
Hop To
#236502 05/01/2010 5:24 AM
Joined: Jan 2007
Posts: 22
R
newbie
newbie
R Offline
Joined: Jan 2007
Posts: 22
Good morning,

I have a question about web links in Ubb.threeads 7.5.5. When one posts a link like the following one

http://stockcharts.com/h-sc/ui?s=$HUI:$GOLD&p=D&yr=0&mn=5&dy=0&id=p13871188943&a=199150417&listNum=2

it does not become clickable in the post for some reason. However the same link posted in version 7.2.2 becomes clicable right away when posted. I understand that one can make it clicable using ubb code, but my question is is it possible to change forum settings (or modify code slightly) so that a link like this would become clicable right away when posted?

Thanks a lot!
Roman

Joined: Jul 2007
Posts: 91
journeyman
journeyman
Joined: Jul 2007
Posts: 91
You either need to use the Globe/Paper clip link Button in the reply or add the UBB code insert http://yada.html without the spaces.

I don't always use the buttons but just type the code I need.

Opening Code enter the URL address you want, then close with

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
yes it is possible by modifying libs/bbcode.inc.php to have the regex parse more URL 'possibilities'


SD #236513 05/01/2010 12:27 PM
Joined: Jan 2007
Posts: 22
R
newbie
newbie
R Offline
Joined: Jan 2007
Posts: 22
Originally Posted by Sirdude
yes it is possible by modifying libs/bbcode.inc.php to have the regex parse more URL 'possibilities'

Could you please be more specific?

Joined: Jul 2007
Posts: 91
journeyman
journeyman
Joined: Jul 2007
Posts: 91
Unless you are really good at php code, there are a couple of members here who can write a Modification for you. I am not ready to tackle php coding but maybe some day I will.

You will probably get some pointer to get you started.

Val

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
the regexes used are bloated, but a quickie fix would be:

(added to not break the flow)
PHP Code
if ($this->allow_magic_urls) {
	for ($i = 0; $i < 3; $i++) {
		$body = preg_replace('#(\n|\r|\]|^|\s|\(|&lt;)([a-zA-Z0-9]+?)://(([a-zA-Z0-9\.\+\,\-\%\_\?=\:\@\#/&\$]|&amp;)+)(&gt;|&lt;|\n|\r|$|,(\s|$)|\?(\s|$)|\)|\s|\.(\s|$))#ie', '\'$1\'.$this->handle_url(\'$2://$3\').\'$5\'', $body);
	}
	$body = preg_replace('#(\n|\r|\]|^|\s|&lt;|\()www\.(([a-zA-Z0-9\.\+\-\:\,\%\_\@\?&/\#=\$]|&amp;)+)($|&gt;|\)|,(\s|$)|\?(\s|$)|\)(\s|$)|\s|\.(\s|$))#ie', '\'$1\'.$this->handle_url(\'http://www.$2\',\'www.$2\').\'$4\'', $body);
}
 

search for "if ($this->allow_magic_urls) {"

you'll see the current code there..

if i have time, i can shorten up that code to be cleaner.. i brute force added parsing the '$' and ':' in there.. there is too much escaping than needed, but it works..

SD #236584 05/03/2010 3:38 PM
Joined: Jan 2007
Posts: 22
R
newbie
newbie
R Offline
Joined: Jan 2007
Posts: 22
Looks like it worked, thanks Sirdude!

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
no probs 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
1 members (Havenofsobriety), 458 guests, and 91 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)