Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorADM
    • CommentTimeOct 31st 2005 edited
     # 1
    How would I go about making the BBCode plugin autolink urls?
    • CommentAuthorSirNot
    • CommentTimeOct 31st 2005
     # 2
    Take a look at how the text formatter does it.
    •  
      CommentAuthorADM
    • CommentTimeNov 1st 2005 edited
     # 3
    Thanks for that, didn't think of that heh.

    For those that want to do it:

    Add this to your BBCode.php extension (at the bottom.. anywhere really, just not in another function):

    function AutoLink($String) {
    // autolink example from www.zend.com (Code Gallery ) by http://www.zend.com/search_code_author.php?author=goten
    return preg_replace("/(?)((http|https|ftp):\/\/[\w?=&.\/-;#~%-]+)/","\\1",$String);
    }


    Then search for this:

    }
    return $String;

    and above that add:

    $String = $this->AutoLink($String);

    That's it.
  1.  # 4
    Just to make sure that the comment //... all goes on one line when you copy and paste. There's no reason it shouldnt but if it doesnt then you need to move it onto one line or it'l break.
    • CommentAuthorNathan_A
    • CommentTimeNov 1st 2005
     # 5
    I'm having some issues with this.
    It seems to only autolink links when in text-only mode. when I switch text-only off, the addresses are no longer linked.


    (also, text-only mode removes the formatting bbcode too, like [b] and [i]. Is that normal? I'm new to setting up Vanilla)
    •  
      CommentAuthorADM
    • CommentTimeNov 1st 2005
     # 6
    You'll need to get the BBCode extension then add the changes I posted above to that extension file. That'll get everything working :)
Add your comments
    Username Password
  • Format comments as