cleaner.php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Taragon
    Member
    • Sep 2007
    • 78
    • 3.8.x

    cleaner.php

    I'm having some difficulties, after moving from phpbb3 to vbulletin organizing the quote, id, and url tags.

    Ie.
    PHP Code:
    [url=http://www.beyondunreal.com/daedalus/singlepost.php?id=8914:92c12]http://www.beyondunreal.com/daedalus/singlepost.php?id=8914[/url:92c12] 
    PHP Code:
    [quote="[DIE16]Lil_john_pi":72945]thats oki'll just beat all your high scores on the arcade.[/quote:72945] 
    id= 8914:92c12] to id= 8914]
    [/url :92c12] to [/u rl]
    and [/q uote:72945] to [/q uote]

    Now these numbers are completely random, and therefore I'm unsure what to fill in at the replacer.

    I hope you can assist me with this.

    All the best,
    Cor
    www.letsgather.com - Message boards, profiles, movies, music, and blogs.
    www.paganfolk.net - Green is the new black.
    www.die16-clan.com - Covering Unreal Tournament, Unreal Tournament 2004 and Unreal Tournament 3.
  • Jerry
    Senior Member
    • Dec 2002
    • 9137
    • 1.1.x

    #2
    line 98 of cleaner.php is this :

    PHP Code:
    #$text = preg_replace('##siU', '', $text); 
    replace that with this :

    PHP Code:
    $text preg_replace('#\[quote="(.*)":([a-z0-9]+)\](.*)\[/quote:\\2\]#siU''[quote=$1]$3[/quote]'$text);
    $text preg_replace('#\[url=(.*):([a-z0-9]+)\](.*)\[/url=\\2\]#siU''[url=$1]$3[/url]'$text); 
    I wrote ImpEx.

    Blog | Me

    Comment

    • Taragon
      Member
      • Sep 2007
      • 78
      • 3.8.x

      #3
      thanks!

      would it be possible to add ' ' around the name perhaps?
      PHP Code:
      $text preg_replace('#\[quote="(.*)":([a-z0-9]+)\](.*)\[/quote:\\2\]#siU''[quote='$1']$3[/quote]'$text); 
      instead of
      PHP Code:
      $text preg_replace('#\[quote="(.*)":([a-z0-9]+)\](.*)\[/quote:\\2\]#siU''[quote=$1]$3[/quote]'$text); 
      www.letsgather.com - Message boards, profiles, movies, music, and blogs.
      www.paganfolk.net - Green is the new black.
      www.die16-clan.com - Covering Unreal Tournament, Unreal Tournament 2004 and Unreal Tournament 3.

      Comment

      • Jerry
        Senior Member
        • Dec 2002
        • 9137
        • 1.1.x

        #4
        You could do, though you would have to escape the quotes.
        I wrote ImpEx.

        Blog | Me

        Comment

        • Taragon
          Member
          • Sep 2007
          • 78
          • 3.8.x

          #5
          Hi Jerry,

          It's almost working
          The escaping quotes did a great job, except for 1 thing.

          As you might have noticed we're running a game related clanbased forum called DIE16 Sniper Clan.
          As you can perhaps imagine being a member of that community will earn you the tag [DIE16] in front of your name, like mine would be [DIE16]Taragon

          Now when using this line (including the correct quoting like you mentioned):
          PHP Code:
          $text preg_replace('#\[quote="(.*)":([a-z0-9]+)\](.*)\[/quote:\\2\]#siU''[quote=\'$1\']$3[/quote]'$text); 
          the username gets somehow broken when the user is tagged with the [TEST] prefix.



          Have you, or anyone else how to fix this perhaps?
          www.letsgather.com - Message boards, profiles, movies, music, and blogs.
          www.paganfolk.net - Green is the new black.
          www.die16-clan.com - Covering Unreal Tournament, Unreal Tournament 2004 and Unreal Tournament 3.

          Comment

          • Jerry
            Senior Member
            • Dec 2002
            • 9137
            • 1.1.x

            #6
            So if the user is [TEST]Jerry in the source database when they are imported it beaks or that regex breaks it ?
            I wrote ImpEx.

            Blog | Me

            Comment

            • Shadown
              Member
              • May 2005
              • 33
              • 4.0.x

              #7
              I have problem.

              PhpBB3 is leave tags hex ( etc) and i revise cleaner.php but nothing happen.

              Comment

              • Shadown
                Member
                • May 2005
                • 33
                • 4.0.x

                #8
                I fix cleaner.php:

                PHP Code:
                #$text = preg_replace('##siU', '', $text); 
                replace that with this :

                PHP Code:
                $text preg_replace('#\[quote="(.*)":([a-z0-9]+)\](.*)\[/quote:\\2\]#siU''[quote=$1]$3[/quote]'$text);
                $text preg_replace('#\[quote:([a-z0-9]+)\](.*)\[/quote:\\1\]#siU''[quote]$2[/quote]'$text);
                $text preg_replace('#\[url=(.*):([a-z0-9]+)\](.*)\[/url:\\2\]#siU''[url=$1]$3[/url]'$text);
                $text preg_replace('#\[url:([a-z0-9]+)\](.*)\[/url:\\1\]#siU''[url]$2[/url]'$text);
                $text preg_replace('#\[img:([a-z0-9]+)\](.*)\[/img:\\1\]#siU''[img]$2[/img]'$text);
                $text preg_replace('#\[code:([a-z0-9]+)\](.*)\[/code:\\1\]#siU''[code]$2[/code]'$text); 
                This clean tags: quote, url, img and code.

                Comment

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