Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

1.0 Bug with YouTube Videos..

13

Comments

  • If he/someone does work it out'll I add to Quicktags as well :)
  • MarkMark Vanilla Staff
    We'd best keep bumping this thread, then... :)
  • edited June 2006
    Ok, thanks for waiting.

    The solution is to change Parse() in default.php to look like this:

    function Parse($String, $Object, $FormatPurpose) { $parser = new HTML_BBCodeParser(); if ($FormatPurpose == FORMAT_STRING_FOR_DISPLAY) { $String = $this->ProtectString($String); $String = $parser->qparse($String); $String = preg_replace('/\<youtube\>([a-zA-z0-9]+?)\<\/youtube\>/', '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/$1"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>', $String); return $String; } else return $String; }

    and add this

    'youtube' => array( 'htmlopen' => 'youtube', 'htmlclose' => 'youtube', 'allowed' => 'all', 'attributes'=> array()),

    to the list of tags in BBCodeParser.php

    I'll repackage the extension later, but if you're desperate for youtube support this will work in the meantime.
  • That last one deserves a rockhand, nice work, berg!
  • Verrrr nicee.

    So how would I go about adding this to Quicktags then?
  • Just add a button that makes [youtube]sdaqweo1fe[/youtube].
  • Does this work with a hypen within the youtube tags?
    I'm trying to post video uqgrw5Z-aNc with the hack installed, but it doesn't parse as a video...it only shows the letters and numbers.
  • Anyone have any luck creating a more elegant solution for this? The way it destroys formatting of threads when trying to clean up youtubes doesnt seem like how the html formatter should work. My forum memebers really miss html, bbcode is crap.
  • Oops, didn't realize that youtube hashes could have hyphens.

    $String = preg_replace('/\<youtube\>([a-zA-z0-9]+?)\<\/youtube\>/', '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/$1"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>', $String);

    should be:
    $String = preg_replace('/\<youtube\>(.+?)\<\/youtube\>/', '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/$1"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>', $String);
  • Bergamot - Works beautifully! ^_^
    Now I can post Daily Show/Colbert Report clips EVERYWHERE! MUAHAHAHAHAHA!

    No, but seriously - thanks.
  • Tried it. Definitely made some mistakes in the code switch because it took the whole forum down. Deleted the extension. The forum is back, but now there's lots of writing all over the place at the top of every page: Warning: main(/home/abbylady/public_html/extensions/BetterBBCode/default.php): failed to open stream: No such file or directory in /home/abbylady/public_html/conf/extensions.php on line 16 Warning: main(/home/abbylady/public_html/extensions/BetterBBCode/default.php): failed to open stream: No such file or directory in /home/abbylady/public_html/conf/extensions.php on line 16 Warning: main(): Failed opening '/home/abbylady/public_html/extensions/BetterBBCode/default.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/abbylady/public_html/conf/extensions.php on line 16 Um HELP!
  • a_ja_j
    edited July 2006
    disable the extension via extension manager before deleting the folder off of the server.

    try re-uploading the folder, go to extension manager, un-click bb-code extension, then delete the folder.

    with the html extension, you can allow the embedding of youtube, googlevideo by taking object and embed out of line 29 of the htmlformatter default.php so it looks like this

    "/<[\/]*(link|iframe|frame|frameset|style|applet|meta)[^<]*?>/i",
  • Hoorah! I got the icky code gone. Thanks, a_j. One clarifying question, when you say "the html extension," which one do you mean?
  • I believe he's referring to sirnots extension
  • np abby, glad it worked yes, sirnots htmlformatter extension http://lussumo.com/addons/?PostBackAction=AddOn&AddOnID=33 if you edit this extensions default.php as I explained above, upload and enable it, you will be able to embed flash (youtube, googlevideo, etc..) cheers
  • edited July 2006
    I'm already using that extension. Copied it to the desktop and went to line 29 (using Evrsoft First Page 2006) and my line 29 doesn't look like what you're describing. I'm wondering if this is the line I should alter: $Html_DisallowedTags = array('link', 'iframe', 'frame', 'frameset', 'object', 'embed', 'style', 'applet', 'meta'); If I take the object and embed tags out of that line, does that work? I'm afraid to try it without asking, since making mistakes in the codes of these extensions messes things up in a way I'm not confident I can repair! --- Wait, wait WAIT! That was the row to change. I decided to try it anyway. THANKS SO MUCH! :D I am a happy woman!
  • a_ja_j
    edited July 2006
    Yeah, sorry I had the line number wrong. Glad it's working :)
  • Me, too! Yay! My forum once again has no limits!
  • abbyladybug, u shouldn't remove embed and object tags from there.
  • I could only see a blank space for the video, but there isn't any video showing up... I used the bbcde format [youtube]video_id_here[/youtube]
This discussion has been closed.