Announcement

Collapse
No announcement yet.

Need Cleaner code for "exposed" HTML on import

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need Cleaner code for "exposed" HTML on import

    I recently did a test import from IPB, and I am seeing this code in the quoted posts:

    <div class='quotetop'>QUOTE (SpeedCostsMoney @ May 6 2009, 09:25 AM) <{POST_SNAPBACK}></div>

    Please give me the code necessary for the cleaner.php file to clean this up - thanks!

    Don

  • #2
    What version of IPB did that come from ?
    I wrote ImpEx.

    Blog | Me

    Comment


    • #3
      Version 2.2

      Comment


      • #4
        You'll have to use tools/cleaner.php if you've already done the import.

        Around line 99 is this :

        PHP Code:
        #$text = preg_replace('##siU', '', $text); 
        Change that to :

        PHP Code:
        $text preg_replace("#<div class='quotetop'>QUOTE \((.*) @(.*)<{POST_SNAPBACK}></div>#isU"'[QUOTE=$1]'$text); 
        I wrote ImpEx.

        Blog | Me

        Comment


        • #5
          Thank you, Jerry!

          That was wonderful and perfect.

          Now, on to the sigs, and that should be it:

          <div align='center'>Proud to be your 2008 PresidenT[/b]</div> is what we're seeing

          I think:

          PHP Code:
          $text preg_replace("#<div align='center'> \((.*) @(.*)[/b]</div>#isU"'[QUOTE=$1]'$text); 

          Would that be correct?

          Don

          Comment


          • #6
            Is that HTML you showed, the beginning of what should be a quote tag, or something you just want to remove ?
            I wrote ImpEx.

            Blog | Me

            Comment


            • #7
              That's a signature with HTML code and the exposed code is what we want to eliminate.

              Comment


              • #8
                I'd just use the cleaner array for that :

                PHP Code:
                $replacer = array(
                            
                "<div align='center'>"    => "",
                            
                "[/b]</div>"    => ""
                ); 
                and just above it, set :

                PHP Code:
                $do_posts            false;
                $do_sigs            true;
                $do_thread_titles    false;
                $do_pm_text        false;
                $do_pm_text_title    false
                I wrote ImpEx.

                Blog | Me

                Comment


                • #9
                  Im running into a similar issue, I want to remove:
                  HTML Code:
                  <div class='quotetop'>CITATION(gerre @ 15 Apr 2008, 20:11 ) [url="index.php?act=findpost&pid=51023"]<{POST_SNAPBACK}>[/url]</div>
                  trying
                  Code:
                  $text = preg_replace("#<div class='quotetop'>CITATION\((.*) @(.*)<{POST_SNAPBACK}>[/url]</div>#isU", '[QUOTE=$1]', $text);
                  doesnt work that way, can someone enlight me a little? ,) Thanks in advance!

                  Comment


                  • #10
                    Try this :

                    PHP Code:
                    $text preg_replace("#<div class='quotetop'>CITATION\((.*) @ (.*)\[url=\"index.php(.*)</div>#isU"'[QUOTE=$1]'$text); 
                    I wrote ImpEx.

                    Blog | Me

                    Comment


                    • #11
                      I'm trying to upgrade from ipb 2.3.6. the problem is that after convertation I have that code:

                      PHP Code:
                      <div class='quotetop'>&#1062;итата(Vladislav @ 7.12.2008, 17:57) <{POST_SNAPBACK}></div> 
                      After usage of your previous code
                      PHP Code:
                      $text preg_replace("#<div class='quotetop'>CITATION\((.*) @ (.*)\[url=\"index.php(.*)</div>#isU"'[QUOTE=$1]'$text); 
                      I get such code:
                      PHP Code:
                      [QUOTE=UserXXX][QUOTEtext [/QUOTE
                      So there is one missing quote tag

                      How to remove the second tag QUOTE ? I was trying
                      PHP Code:
                      $text preg_replace("#<div class='quotetop'>Цитата\((.*) @ (.*)\[url=\"index.php(.*)</div>[quote]#isU"'[QUOTE=$1]'$text); 
                      But no result

                      Comment

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