Announcement

Collapse
No announcement yet.

youtube links

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

  • youtube links

    We see many [youtube]http://www.youtube.com/watch?v=XXXXXX[/youtube].

    Is there automated way to fix that? It would certainly take forever if done manually.

    phpbb 3.0.4
    vbulletin 3.8.0
    clean import
    Last edited by cooltechie; Sun 18th Jan '09, 11:30am.

  • #2
    You can try this unofficial and unsupported BB Code to add a YouTube tag:

    http://www.vbulletin.com/forum/showt...youtube+bbcode
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      While some bbcode is supported by vBulletin and some is not, the whole key to wrap your head around bbcode is that you are sandboxing html. You want to give your users the ability to use html in the board, without exposing the board to the risk of html.

      You can create any bbcode you want to show on the board, and you can go to any extreme you want to go with it, risk factors aside.
      Anybody who says "it can't be done" will usually be interrupted by somebody who is already doing it.

      Comment


      • #4
        I would suggest replacing

        Code:
        [youtube]
        with


        Code:
        [url]
        I wrote ImpEx.

        Blog | Me

        Comment


        • #5
          Originally posted by Steve Machol View Post
          You can try this unofficial and unsupported BB Code to add a YouTube tag:

          http://www.vbulletin.com/forum/showt...youtube+bbcode
          I looked at that thread but it only applies with video ID and not the entire URL. Since all the posts have been imported with full URL, I'm looking for a better solution to get the existing ones working.

          Comment


          • #6
            Originally posted by Jerry View Post
            I would suggest replacing

            Code:
            [youtube]
            with


            Code:
            [url]
            Already imported from phpbb3, so how can [youtube] be replaced with [url]?

            Comment


            • #7
              I'd back up the vBulletin database then run this SQL on it :

              Code:
              UPDATE vb_post SET pagetext=REPLACE(pagetext,"[youtube]","[url]")
              I wrote ImpEx.

              Blog | Me

              Comment


              • #8
                Sorry, I looked in the database and see that phpbb_posts has youtube listed as this:

                [youtube:123abc]http://www.youtube.com/watch?v=wA235SW[/youtube:123abc]

                How should I adjust your code?

                Comment


                • #9
                  Ah, you'll need to use cleaner.php with a regex to clean that out, something like this should do it :

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

                  Blog | Me

                  Comment


                  • #10
                    Forgive me. I don't understand how to use the code you provided. Do I paste that into a file?

                    Comment


                    • #11
                      You will need to edit, tools/cleaner.php which comes with impex.

                      Set this to true, when you want to use it, then false afterwards (and remove ImpEx completely when done).

                      PHP Code:
                      $active false

                      Then around line 98 you'll have this :

                      PHP Code:
                      #$text = preg_replace('##siU', '', $text); 
                      Replace that with the code I gave you above.

                      Then browse to the file, and make sure you've back up the vBulletin database first.
                      I wrote ImpEx.

                      Blog | Me

                      Comment


                      • #12
                        Your detailed information certainly helped out.

                        Thank you Jerry for your assistance with this.

                        I'm sure I will run into more of these odd post migration issues from phpbb3.

                        There are other similiar type of issues [blahblah:###]example[/blahblah:###], but I don't know what this is called. What is the best search term to use?

                        Comment


                        • #13
                          Originally posted by cooltechie View Post
                          There are other similiar type of issues [blahblah:###]example[/blahblah:###], but I don't know what this is called. What is the best search term to use?
                          If you don't know what they are called then there is no way of looking for them, you'll just have to spot them as you go along.
                          I wrote ImpEx.

                          Blog | Me

                          Comment

                          Working...
                          X