Previous Thread
Next Thread
Print Thread
Rate Thread
#321200 09/21/2015 11:02 PM
Joined: Jan 2000
Posts: 5,835
Likes: 20
UBBDev Owner
Time Lord
UBBDev Owner
Time Lord
Joined: Jan 2000
Posts: 5,835
Likes: 20
About
This 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).

Tags
Code
[video:youtube][/video]

Example
An example of the embedded video can be found on the VNC Web Services Demo Forums.

Note
The 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.

Install
Save "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 Code

<?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 Code

<?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>',
),
);
?>


Compatibility
The 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.
Attachments
UBBT7.5.x-CustomTag.txt (407 Bytes, 2 downloads)
SHA1: abe5e89e632972108c965789a0e60e6d98aa5ac0
UBBT7.6.0-CustomTag.txt (442 Bytes, 9 downloads)
SHA1: 090989cdef3f7f2731a1886532153249dd05c3d6


UBBDev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.threads: My UBB Themes, My UBB Scripts
Sponsored Links
Entire Thread
Subject Posted By Posted
YouTube Video - Custom Tag Gizmo 09/22/2015 6:02 AM
Re: YouTube Video - Custom Tag Gizmo 09/22/2015 7:38 AM
Re: YouTube Video - Custom Tag isaac 09/22/2015 7:39 AM
Re: YouTube Video - Custom Tag Mark_S 09/22/2015 8:53 AM
Re: YouTube Video - Custom Tag Gizmo 09/22/2015 2:30 PM
Re: YouTube Video - Custom Tag Mark_S 08/13/2016 10:16 AM
Re: YouTube Video - Custom Tag Mark_S 08/13/2016 10:58 AM
Re: YouTube Video - Custom Tag Mark_S 08/13/2016 11:16 AM
Re: YouTube Video - Custom Tag isaac 08/13/2016 11:26 AM
Re: YouTube Video - Custom Tag Mark_S 08/13/2016 12:01 PM
Re: YouTube Video - Custom Tag isaac 08/13/2016 12:07 PM
Re: YouTube Video - Custom Tag Mark_S 08/13/2016 12:23 PM
Re: YouTube Video - Custom Tag isaac 08/13/2016 12:42 PM
Re: YouTube Video - Custom Tag Mark_S 08/13/2016 1:01 PM
Re: YouTube Video - Custom Tag isaac 08/13/2016 1:10 PM
Re: YouTube Video - Custom Tag Gizmo 08/13/2016 7:22 PM
Re: YouTube Video - Custom Tag Mark_S 08/14/2016 1:15 PM
Re: YouTube Video - Custom Tag Gizmo 08/14/2016 8:21 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,575
Posts293,932
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,835
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)