Announcement

Collapse
No announcement yet.

cleaner.php

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

  • 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.

  • #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


    • #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


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

        Blog | Me

        Comment


        • #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


          • #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


            • #7
              I have problem.

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

              Comment


              • #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...
                X