Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 26th February 2013, 17:10
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 278
Default Stop Links Opening In Shoutbox
In global.php replace the old format_urls function with this one:

PHP Code:
function format_urls($s)
{
   return 
preg_replace(
       
"/(\A|[^=\]'\"a-zA-Z0-9])((http|ftp|https|ftps|irc):\/\/[^()<>\s]+)/i",
       
"\\1<a href=\"\\2\" target='_blank'>\\2</a>"$s);


and replace the old url bbcodes with this:

PHP Code:
// [url=http://www.example.com]Text[/url]
   
$s preg_replace(
      
"/\[url=([^()<>\s]+?)\]((\s|.)+?)\[\/url\]/i",
      
"<a href=\"\\1\" target='_blank'>\\2</a>"$s);

   
// [url]http://www.example.com[/url]
   
$s preg_replace(
      
"/\[url\]([^()<>\s]+?)\[\/url\]/i",
      
"<a href=\"\\1\" target='_blank'>\\1</a>"$s); 

That's it!
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
The Following User Says Thank You to Chez For This Useful Post:
Marco (12th August 2015)
Reply

Tags
links , opening , shoutbox , stop

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 23:05. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.