vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   Auto Code ALL Links (https://vborg.vbsupport.ru/showthread.php?t=151746)

SiK xGODx 07-08-2007 10:00 PM

Auto Code ALL Links
 
This mod involves editing a PHP file from vBulletin.

open the includes/functions_newpost.php

Find
PHP Code:

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

And replace with
PHP Code:

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

What this will do is make any link such as http://google.com appear like this:
Code:

http://google.com

SiK xGODx 07-09-2007 04:16 AM

Reserved

NOTE: You can still make clickable URL's you just have to use the [url] tag. It just doesnt auto do the urls anymore.

Hornstar 07-09-2007 05:11 AM

Hey nice work, I can see this being very useful on a fair few sites.

Jibreil 07-09-2007 07:06 AM

Thank you for this mod.

p.s. I guess this needs to be moved to the Template Modification forum

grandfso 07-09-2007 08:09 AM

And where do you see any template modified here? I'll consider using this mod later, thanks!

projectego 07-09-2007 08:19 AM

Nice idea, SiK xGODx. It's not something I need at the moment but I'm sure plenty others will find it useful. :)

Symbian Galaxy 07-09-2007 08:57 AM

Installed!

dartho 07-09-2007 09:35 AM

just a suggestion - wouldn't it be tidier to use NOPARSE rather than CODE tags?

then http://www.google.com = http://www.google.com

Mecho 07-09-2007 10:53 AM

awesooooooooooome .. thanks aloooooot

SiK xGODx 07-09-2007 06:13 PM

i like the code tags because i have a download site and it makes the downloads stick out more

and ya if staff thinks this should b in template mods feel free

HDT 07-09-2007 07:12 PM

Great idea,subscribe first,may be installed later,not need it for now maybe later.

princeedward 07-09-2007 07:33 PM

great and thanks for this... ;)

Xplorer4x4 07-10-2007 04:16 AM

Sorry but i dont see any practicality in this hack when you can already disable urls from being parsed using other hacks that do not require code edits.

Good job all the same just dont find it practical. Sorry.

Triky 07-10-2007 09:26 AM

Maybe this will be usefull for me. Installed. :)

Mecho 07-11-2007 12:27 PM

today i saw live links in my board :D he used like this :
[url=http://link here.com]live link[/url*

is there anyway to fix this too ? thanks

Hendrizius 07-12-2007 03:58 PM

Quote:

Originally Posted by Mecho (Post 1288334)
today i saw live links in my board :D he used like this :
[url=http://link here.com]live link[/url*

is there anyway to fix this too ? thanks

same problem

Luky 07-15-2007 06:40 AM

Quote:

Originally Posted by Mecho (Post 1288334)
today i saw live links in my board :D he used like this :
[url=http://link here.com]live link[/url*

is there anyway to fix this too ? thanks

Put [url in the filtered bad words?

Lag 07-19-2007 01:23 AM

You can still have "live" links. The purpose of this mod is to keep most links coded. This is not to eliminate all live links.

Yours 07-19-2007 01:34 AM

A fix you should make:

It attempts to put the [code] tag around url's in the SHOUTBOX as well. make it so it doesn't do this would be greatly appreciated!

Luky 07-19-2007 04:18 AM

Quote:

Originally Posted by Lag (Post 1295225)
You can still have "live" links. The purpose of this mod is to keep most links coded. This is not to eliminate all live links.

Yes but some forums want that. It may possibly be for privacy reasons? If they stop clickable links, the website they link too cannot easily track their location before that let them know of that site. Its a very common method for illegal sites and sites who just wish to remain unkown.

edongski 11-10-2007 02:48 PM

Nice... Is there a way to keep it specific to a specific forum/subforum only?

360junkie 01-24-2008 09:14 PM

did u still this iv seen this post a diff website about 3months ago

takworld 01-27-2008 04:35 PM

Hi , i change the url to code but does n't work curretly :(

irfreedownload 01-27-2008 08:53 PM

i cant finde these cod?!!!!!!

ReaperUK 01-28-2008 10:16 PM

Quote:

Originally Posted by edongski (Post 1379752)
Nice... Is there a way to keep it specific to a specific forum/subforum only?

would like this feature also

takworld 01-29-2008 04:25 PM

Thanks

Nitro212 01-30-2008 07:28 PM

meh this is good and sucks at the same time.. cuz if u add more then one url u going to have 10 code boxes.. should be better to include all url's in the same code box :)

free-offline 03-16-2008 10:48 PM

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 Code:

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

With This :

PHP Code:

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


And After This :

PHP Code:

    $text preg_replace($urlSearchArray$urlReplaceArray$messagetext); 

Put This Line :

PHP Code:

$text str_replace("[/code]\r\n[code]","\r\n",$text);
$text str_replace("[/code]\n[code]","\n",$text); 


F0xy 03-17-2008 10:27 AM

Quote:

Originally Posted by free-offline (Post 1466554)
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 Code:

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

With This :

PHP Code:

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


And After This :

PHP Code:

    $text preg_replace($urlSearchArray$urlReplaceArray$messagetext); 

Put This Line :

PHP Code:

    $text str_replace("[/code]\r\n[code]","\r\n",$text); 


i did this but it still codes each link separately

free-offline 03-17-2008 07:49 PM

Sorry , Post Edited !
I Forgot To Put One Line ;):D .

sunny_girl 03-17-2008 10:23 PM

Nice idea

ReaperUK 03-17-2008 10:48 PM

thnx again...

F0xy 03-18-2008 09:55 AM

great thanks a million, it works a charm

wage the war 04-06-2008 05:36 PM

Would be great if this was developed a little more. If members put their own code tags around the url it gets double coded :(

dancue 05-01-2008 02:22 PM

anyone know what the code would be to only do the change on certain forums?

Within those specified forums the urls should have the [code] tags. Any other forum should have the default [url].

I imagine it would be something using IF and ELSE but I'm still a noob.

dancue 05-01-2008 03:21 PM

nevermind

Big Barry 05-06-2008 09:36 AM

Is it possible to make this only happen on a certain extension? for example if it was a .mp3 it would automatically code? If it is possible, this would rock as I could use it to auto embed mp3 files (as I have the [mp3] bb code :D :D

smonabav 05-06-2008 12:30 PM

sorry, i'm new in vB, where can i find and edit "includes/functions_newpost.php"

dancue 05-06-2008 03:49 PM

Quote:

Originally Posted by smonabav (Post 1510366)
sorry, i'm new in vB, where can i find and edit "includes/functions_newpost.php"

This is a file uploaded when you first installed vbulletin. If you were to search for it on your server it would be located within your forum under the includes foler.

Mecho 05-16-2008 01:01 PM

Quote:

Originally Posted by free-offline (Post 1467324)
Sorry , Post Edited !
I Forgot To Put One Line ;):D .

not working for me . each link goes separately :(


All times are GMT. The time now is 07:31 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01253 seconds
  • Memory Usage 1,808KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (10)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete