Replace BB Codes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Danny M
    Member
    • May 2010
    • 58

    [Forum] Replace BB Codes

    Hey,

    After I imported my phpBB forum software to VBulletin, I need to fix all of my custom BB Codes.

    One of my BB codes is for WorldStarHipHop videos.

    This is the BB Code I used to use for my phpBB forum:

    Code:
    [wshh]http://www.worldstarhiphop.com/videos/video.php?v=wshhvpf7qedV84D9BUqV[/wshh]
    But here is the code I have to use for my VBulletin forum:

    Code:
    [wshh]wshhvpf7qedV84D9BUqV[/wshh]
    Instead of editing every single one of my forum threads, I am going to use MYSQL to replace the characters. Here are some of the codes I have tried:

    Code:
    UPDATE post
    SET
        pagetext = replace( pagetext, substring(  pagetext, locate( '[wshh][URL]http://www.worldstarhiphop.com/videos/video.php?v=[/URL]',   pagetext ) , 55 ) , '[wshh][URL]http://www.worldstarhiphop.com/videos/video.php?v=[/URL]'  )
      WHERE
        LOCATE( '[wshh]', pagetext ) >0;
    and:

    Code:
    UPDATE post
    SET
        pagetext = replace( pagetext, substring(  pagetext, locate( '[wshh][URL]http://www.worldstarhiphop.com/videos/video.php?v=%[/URL]',   pagetext ) , 56 ) , '[wshh][URL]http://www.worldstarhiphop.com/videos/video.php?v=%[/URL]'  )
      WHERE
        LOCATE( '[wshh]', pagetext ) >0;
    But none have worked.

    Does anyone know how I can do this?

    Hope you understand, thanks
  • Andy
    Senior Member
    • Jan 2002
    • 5886
    • 4.1.x

    #2
    Please make sure you have a proper backup before using.

    UPDATE post SET pagetext = REPLACE(pagetext, 'http://www.worldstarhiphop.com/videos/video.php?v=', '')

    Comment

    • funmasti
      Senior Member
      • Oct 2009
      • 170
      • 3.8.x

      #3
      Ask on .org for coding
      Mastiya

      Comment

      • Danny M
        Member
        • May 2010
        • 58

        #4
        Originally posted by Andy
        Please make sure you have a proper backup before using.

        UPDATE post SET pagetext = REPLACE(pagetext, 'http://www.worldstarhiphop.com/videos/video.php?v=', '')
        I just tried:

        Code:
        UPDATE post
        SET
            pagetext = replace( pagetext, substring( pagetext, locate( 'http://www.worldstarhiphop.com/videos/video.php?v=', pagetext ) , 50 ) , 'http://www.worldstarhiphop.com/videos/video.php?v=' )
        WHERE
            LOCATE( '[wshh]', pagetext ) >0



        But no luck, this is the message I got:

        0 row(s) affected. ( Query took 0.6353 sec )

        Comment

        • Andy
          Senior Member
          • Jan 2002
          • 5886
          • 4.1.x

          #5
          Hi Danny,

          Just enter the query just as I posted into:

          Admin CP -> Maintenance -> Execute SQL Query -> Manual Query

          Comment

          • Danny M
            Member
            • May 2010
            • 58

            #6
            Originally posted by Andy
            Hi Danny,

            Just enter the query just as I posted into:

            Admin CP -> Maintenance -> Execute SQL Query -> Manual Query
            Is that not the same as entering it in phpmyadmin into the VBulletin database?

            Comment

            • Trevor Hannant
              vBulletin Support
              • Aug 2002
              • 24351
              • 5.7.X

              #7
              Yes but what you've posted is not the same as what Andy posted. Try copying and pasting that exactly
              Vote for:

              - Admin Settable Paid Subscription Reminder Timeframe (vB6)
              - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

              Comment

              • Danny M
                Member
                • May 2010
                • 58

                #8
                Originally posted by Trevor Hannant
                Yes but what you've posted is not the same as what Andy posted. Try copying and pasting that exactly
                Some people have just posted the worldstarhiphop links on my forum, so not everyone has used the [wshh] embedding.

                Wouldn't what Andy put mess up them links?

                That's why I have been putting the '[wshh]' before the actual worldstarhiphop link.

                Comment

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