vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   BB Code Enhancements - IMG to URL BBCode Converter (In Quotes) (https://vborg.vbsupport.ru/showthread.php?t=155629)

Dannyloski 08-18-2007 10:00 PM

IMG to URL BBCode Converter (In Quotes)
 
Hey Guys,

I know I was searching for a feature like this for the longest time and had no luck. Well I decided to do some digging and after a while I was able to find the code that you can use to remove the [IMG] Tag from Quotes in Posts under vB 3.6.0 and up.

This specific Modification will change all [IMG] Tags into [URL] Tags when they are inside a Quote. I guess that's pretty self explanatory.

Special thanks to masalaman for the code, I'm just posting it here for others to use it as they may be searching for it and it took me a while to find it. I guess this will just make you life's easier :up:

Modification Instructions:

1) Open includes/class_bbcode.php
2) Find the following line:
Code:

eval('$html = "' . fetch_template($template) . '";');
3) After this line add the following:
Code:

// Start IMG to URL BBCode Converter
if ($this->contains_bbcode_img_tags($html))
{
$html = preg_replace('#\[img\]\s*(https?://([^<>*"]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "\$this->handle_bbcode_url(str_replace('\\\"', '\"', '\\1'), '')", $html);
}
// End IMG to URL BBCode Converter

4) Repeat steps 2-3 for every place that the line on Step 2 appears in the class_bbcode.php file (Four Times)
5) Save & Overwrite the File to your Server ... That's it! Enjoy!

- Danny

Dannyloski 08-19-2007 03:36 AM

Reserved, just in case I need to update something ;)

HDT 08-19-2007 04:10 AM

Subscibed first,installed later :) thanks for the mod

Dismounted 08-19-2007 05:48 AM

You don't really need a file modification to do this...It can be done via plugins.

maxicep 08-19-2007 03:03 PM

nice thanks.

Dannyloski 08-19-2007 05:32 PM

Glad it can be useful for others :up:

Quote:

Originally Posted by Dismounted (Post 1320765)
You don't really need a file modification to do this...It can be done via plugins.

Well I do not know how to do plugins, if you wish to create one using the code above, feel free to do so and post it here. I did not write the code, it was written by masalaman, like I said in the first post. I just posted the code here so that other can use it since if you search for it you really have to do some digging until you find it on the forums.

Zia 08-20-2007 02:29 AM

thnx...would be really nice if it could be done via plugins (previously it was done by HeLLcat)

if [img] likes [Img] or [iMg] or [IMG] or [imG] will that work too?
asking cos hellcat's plugin had that error ..tho later on it was fixed by him.

waiting fr a plugings

Dannyloski 08-20-2007 02:45 PM

Zai, Im not going to be releasing a Plugin Version, so if you're gonna be waiting for that, you should ask someone else to see if they are willing to make a plug in. I might do it in the future, but I'm too busy right now to learn how to do Plugins, so I wont be dong it anytime soon.

As far as the error on the [img], [Img], [iMg], [IMG], [imG] that is not a problem with this Modification. It converts it anyway.

Stifmeister2 08-21-2007 03:39 PM

Quote:

Originally Posted by Dannyloski (Post 1321077)
Glad it can be useful for others :up:


Well I do not know how to do plugins, if you wish to create one using the code above, feel free to do so and post it here. I did not write the code, it was written by masalaman, like I said in the first post. I just posted the code here so that other can use it since if you search for it you really have to do some digging until you find it on the forums.

I would love that Dismounted. :)

Zia 08-25-2007 03:05 AM

Quote:

Originally Posted by Dannyloski (Post 1321655)
Zai,

Hhaha

Zia here not Zai :D

any way thnx mate


All times are GMT. The time now is 06:59 PM.

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.01094 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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