1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Other Auto Code ALL Links

Discussion in 'Resource and Add-on Requests' started by dandanch, Jul 1, 2016.

  1. dandanch

    dandanch Member

    Hello,
    is there a way that I can auto code links similar to a modification that vb has on their .org forum where someone showed on how to modify the PHP file, for example:

    Find

    PHP:
     $urlReplaceArray = array(
    "[url]\\2\\4[/url]"
    );  
    And replace with

    PHP:
    $urlReplaceArray = array(
                
    "[code]\\2\\4[/code]"
            
    );
    If so which file and line can I find it on and would it be similar to this if not how would I go about doing this modification. Thanks in advance
     
  2. dandanch

    dandanch Member

    Can I please get some help or at least direct me to the file that may need editing. Thanks
     
  3. Aayush Agrawal

    Aayush Agrawal Well-Known Member

    File:
    Code:
    library/XenForo/BbCode/Formatter/BbCode/AutoLink.php
    Method:
    PHP:
    protected function _autoLinkUrl($url)
    Find:
    PHP:
    if ($link['url'] === $link['linkText'])
    Add Above:
    PHP:
    return '[CODE]' $link['url'] . '[/CODE]';
    This will only auto code links which are not wrapped inside URL tag
     
    dandanch likes this.
  4. dandanch

    dandanch Member

    Thank you so much it worked like a charm!
     

Share This Page