AboutThis Custom Tag will allow you to syndicate YouTube Videos. Users will need to copy the "Video URL" (or Video ID) into the video tags (or the editor if enabled).
TagsExampleAn example of the embedded video can be found on the
VNC Web Services Demo Forums.
NoteThe code supplied below must be imported to the Custom Tags feature of your UBB.threads install; the coding escapes any slashes, so just copy and pasting to your existing install just plain
will not work, please use the
import function.
InstallSave "CustomTag.txt" (with the code provided) and
import into the "Custom Tags" feature of the control panel:
Control Panel -> Tools & Info -> Content Rebuilder -> Custom Tags -> Import new tags (bottom tab)
UBBT7.6.0-CustomTag.txt
<?php
$export_tags = array (
0 =>
array (
'tag' => 'video:youtube',
'descrip' => 'YouTube Video',
'prompt' => 'YouTube URL or ID; eg: http://www.youtube.com/watch?v=xxxxxxxxxx',
'regex' => '(|.*youtu\\.be/|.*v=)([a-zA-Z0-9_-]{8,12})(|&.*)',
'markup' => '<div class="video-container"><iframe frameborder="0" width="640" height="360" src="https://www.youtube.com/embed/\\\\2" allowfullscreen></iframe></div>',
),
);
?>
UBBT7.5.x-CustomTag.txt
<?php
$export_tags = array (
0 =>
array (
'tag' => 'video:youtube',
'descrip' => 'YouTube Video',
'prompt' => 'YouTube URL or ID; eg: http://www.youtube.com/watch?v=xxxxxxxxxx',
'regex' => '(|.*youtu\\.be/|.*v=)([a-zA-Z0-9_-]{8,12})(|&.*)',
'markup' => '<iframe frameborder="0" width="400" height="255" src="https://www.youtube.com/embed/\\\\2" allowfullscreen></iframe>',
),
);
?>
CompatibilityThe v7.6.0 works with the updated common.css file entries in v7.6.0 to responsively display your videos depending on the size of your browser window (to a maximum of 640x360). As these classes do not exist in previous builds an additional set of code is provided for 7.5.x which displays videos in a 16:9 resolution of 400x255.