From 557e0111a5722dccb60e36984a044cbeb7db3f3e Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 22 Oct 2014 17:59:15 -0700 Subject: [PATCH] Added a pref to make youtube bbcodes responsive. (ie. behave like media-manager youtube videos) --- e107_admin/image.php | 3 ++- e107_core/bbcodes/bb_youtube.php | 30 ++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/e107_admin/image.php b/e107_admin/image.php index 90834b412..0ddf4376f 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -729,7 +729,8 @@ class media_admin_ui extends e_admin_ui 'youtube_showinfo' => array('title'=> "Show Video Info", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''), 'youtube_cc_load_policy' => array('title'=> "Show Closed-Captions by default", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''), 'youtube_modestbranding' => array('title'=> "Use Modest Branding", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''), - + 'youtube_bbcode_responsive' => array('title'=> "Make the YouTube bbcode responsive", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''), + // ); diff --git a/e107_core/bbcodes/bb_youtube.php b/e107_core/bbcodes/bb_youtube.php index 64909e8ff..0395b5987 100644 --- a/e107_core/bbcodes/bb_youtube.php +++ b/e107_core/bbcodes/bb_youtube.php @@ -333,17 +333,27 @@ class bb_youtube extends e_bb_base $class = "bbcode ".e107::getBB()->getClass('youtube'); // consistent classes across all themes. $ret = "\n"; // <-- DO NOT MODIFY - used for detection by bbcode handler. - $ret .= ' - - - - - '; - - // Not XHTML - but needed for compatibility. - $ret .= ''; - $ret .= ''; + + if(e107::getConfig()->get('youtube_bbcode_responsive') == 1) // Responsive Mode. + { + $ret .= e107::getParser()->toVideo($yID.".youtube"); + } + else // Legacy Mode. + { + $ret .= ' + + + + + '; + + // Not XHTML - but needed for compatibility. + $ret .= ''; + + $ret .= ''; + } + $ret .= ""; // <-- DO NOT MODIFY.