[uB] Auto Code ALL Links

uBulletin

New Member
This mod involves editing a PHP file from vBulletin.

This mod is perfect for anyone running a download forum that requires users to code all links.

Open the includes/functions_newpost.php ( Edit in control panel or on your computer and reupload ).

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

And replace with:

PHP:
        $urlReplaceArray = array(
            "[code]\\2\\4[/code]"
        );

Feel free to post thanks!
 

UltimaPro

New Member
OR:

You can do this:

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



This one is better, because then they can click on the link that is right inside of the code instead of highlighting it and copying in browser,

for example:

His code:

Code:
http://www.site.com

PHP:
[code]http://www.site.com[/code]


My code::

Code:
[url]http://www.site.com[/url]

PHP:
[code][url]http://www.site.com[/url][/code]

mine is clickable,

:D
 

dana

New Member
with this way it codes all like separate tht is very annoying for files tht r more then just one part like a movie on RS is there any way to make it code all like together?
 

MobileHacks

New Member
Last Way Just Can Put Code Tag Near Every URl And Cant Code Multi Urls Near Like It :

http://www.google.com
http://www.google.com
http://www.google.com
http://www.google.com

If You Want To Code Links Like That To This:

Code:
http://www.google.com
http://www.google.com
http://www.google.com
http://www.google.com
Just Do It :

Replace This :
PHP:
        $urlReplaceArray = array(
            "[url]\\2\\4[/url]"
        );


With This :
PHP:
        $urlReplaceArray = array(
            "[code]\\2\\4[/code]"
        );

And After This :
PHP:
    $text = preg_replace($urlSearchArray, $urlReplaceArray, $messagetext);


Put This Line :
PHP:
$text = str_replace("[/code]\r\n[code]","\r\n",$text);
$text = str_replace("[/code]\n[code]","\n",$text);
 
Top