Remove [IMG] BBCode from quoted post

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dirt Bike Addict
    Senior Member
    • May 2010
    • 828
    • 4.1.x

    [Forum] Remove [IMG] BBCode from quoted post

    Hello everyone.

    I run a dirt bike forum and we post a LOT of pictures Everything works fine until somebody quotes a post with pictures in it, then all the pictures are shown again. Which makes the page load a lot slower.

    I know there's a template edit somewhere that will remove the [IMG] tags in quotes, so it looks like this.
    Click image for larger version

Name:	img_tag_removed.png
Views:	1
Size:	24.5 KB
ID:	3718011
    The reason I know this is because I had it on my test site (that's where that last image came from), but now I can't find that thread on here with the code anymore.

    Thanks in advance

    P.S. vB Staff, I'm not sure why it isn't setup like that from the start.
    Last edited by Dirt Bike Addict; Sun 9 Jan '11, 4:10pm. Reason: Links removed
  • Dirt Bike Addict
    Senior Member
    • May 2010
    • 828
    • 4.1.x

    #2
    I hate bumping threads, but "bump".

    Nobody knows how to do this?

    Comment

    • Videx
      Senior Member
      • Jan 2007
      • 848

      #3
      I don't see how a template edit could do that(?); are you sure it wasn't a mod over on vb.org?

      Comment

      • Dirt Bike Addict
        Senior Member
        • May 2010
        • 828
        • 4.1.x

        #4
        Originally posted by Videx
        I don't see how a template edit could do that(?); are you sure it wasn't a mod over on vb.org?
        Thanks for the reply Videx, yes I found it here, I've spent hours searching this site to find it again but can't. Here's one for vB 3.6 that will give you an idea of what I'm talking about. Click Here

        Copied from link

        Modification Instructions:

        1) Open includes/class_bbcode.php
        2) Find the following line:
        PHP Code:
        eval('$html = "' fetch_template($template) . '";'); 
        3) After this line add the following:
        PHP 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!
        Last edited by Dirt Bike Addict; Tue 13 Jul '10, 1:00pm.

        Comment

        • Dirt Bike Addict
          Senior Member
          • May 2010
          • 828
          • 4.1.x

          #5
          Ok I finally figured it out.

          For vB 4.0.3

          1) Edit ./includes/class_bbcode.php
          2) Search:
          PHP Code:
          $templater vB_Template::create($this->printable 'bbcode_quote_printable' 'bbcode_quote'); 
          3) Add this above it:
          PHP Code:
          if ($this->contains_bbcode_img_tags($message)) 
                  {
                  
          $message preg_replace('#\[img\]\s*(https?://([^<>*"]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe'"\$this->handle_bbcode_url(str_replace('\\\"', '\"', '\\1'), '')"$message);
                  } 
          For vB 4.0.5

          1) Edit ./includes/class_bbcode.php
          2) Search:
          PHP Code:
          $templater vB_Template::create($this->printable $this->quote_printable_template $this->quote_template); 
          3) Add this above it:
          PHP Code:
          if ($this->contains_bbcode_img_tags($message)) 
                  {
                  
          $message preg_replace('#\[img\]\s*(https?://([^<>*"]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe'"\$this->handle_bbcode_url(str_replace('\\\"', '\"', '\\1'), '')"$message);
                  } 
          Thanks to vB Style for the vB 4.0.3 code, I had to modify it for vB 4.0.5 though.

          Comment

          • nakedanvil
            Senior Member
            • Mar 2010
            • 1920
            • 4.0.0

            #6
            Bookmarked! Thanks DBA!

            Comment

            • Bulent Tekcan
              Senior Member
              • Feb 2003
              • 1102
              • 4.2.x

              #7
              Is it possible to 4.1.11 ?

              Comment

              • DannyITR
                Senior Member
                • Jan 2002
                • 785

                #8
                I would like to know.
                Danny
                My Site ---->www.montrealracing.com

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...