Previous Thread
Next Thread
Print Thread
Hop To
#236502 05/01/2010 4:24 AM
Joined: Jan 2007
Posts: 22
R
newbie
OP Offline
newbie
R
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
Offline
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
SD Offline
Former Developer
Offline
Former Developer
Joined: Apr 2007
Posts: 3,940
yes it is possible by modifying libs/bbcode.inc.php to have the regex parse more URL 'possibilities'


SD #236513 05/01/2010 11:27 AM
Joined: Jan 2007
Posts: 22
R
newbie
OP Offline
newbie
R
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
Offline
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
SD Offline
Former Developer
Offline
Former Developer
Joined: Apr 2007
Posts: 3,940
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 2:38 PM
Joined: Jan 2007
Posts: 22
R
newbie
OP Offline
newbie
R
Joined: Jan 2007
Posts: 22
Looks like it worked, thanks Sirdude!

Joined: Apr 2007
Posts: 3,940
SD Offline
Former Developer
Offline
Former Developer
Joined: Apr 2007
Posts: 3,940
no probs smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
v7.7.5 Active Topics Display Name Incorrect
by Jake - 11/17/2020 4:46 PM
custom islands in forums tool
by Ruben - 11/17/2020 3:21 PM
Captcha bug maybe?
by Morgan - 11/16/2020 8:34 AM
Facebook thumbnail issue
by DBryce - 11/08/2020 7:43 PM
No hop to menu in the category pages
by Morgan - 11/05/2020 4:19 PM
Who's Online Now
2 members (Ruben, JAISP), 38 guests, and 53 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
gallery test
gallery test
by Mors, September 23
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 7.7.5