• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
auto_link with 2 urls from the same domain

#31
[eluser]Unknown[/eluser]
i had this problem too, so i modified auto_link().
not well testing, but it works for me so far.

here is the code:

Code:
function auto_link() {
        if ($type != 'email')
    {
      // only accept url start with httP(s):// or www.
          $str = preg_replace("#(https?://|www.)+[a-z0-9-]+[\.a-z]+[\/a-z0-9_\#\@\?\&\=\.\-]*#i", ("$1" != 'www.') ? "<a href='$0'>$0</a>" : "<a href='http://$0'>$0</a>", $str);
    }

}


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.