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


UBB.Dev - 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
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20


UBB.Dev - 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
Joined: Jul 2001
Posts: 1,157
Likes: 82
coffee and code
coffee and code
Joined: Jul 2001
Posts: 1,157
Likes: 82
https://www.youtube.com/watch?v=mVmBL8B-In0

[video:youtube]mVmBL8B-In0[/video]


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
Which versions can this be used on ? smile


BOOM 7.6.+ rocks....
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
I've updated the post, there is code listed for the v7.5.x series and the upcoming 7.6.0 release which has the variable width bits in.


UBB.Dev - 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
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
Hi Guys,
My youtube embedded videos have failed over the last few days.
I'm hoping this is the page with the latest update...

I'm running 7.5.9x
I have tried to import both codes from the first post with out success. I get a white screen, and all permissions are green with the permissions check.

See below for what happened and the code i have running now that is giving me that problem.

I'm assuming this is the page with the latest updates for custom tags.

Thanks in advance.
Attachments
video-tags.JPG (16.23 KB, 91 downloads)
Forum image
video-tags2.JPG (44.43 KB, 91 downloads)
Tag code causing the problem


BOOM 7.6.+ rocks....
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
I have now manually updated the tag code from Pre-v7.6.0 CustomTag.txt above and there is no change.

I was going to post this in the bugs section on ubb but as I pressed the preview its working fine over there ?
Ive not done any updates, and its the members that have come to me with this strange change.

See attached image for the manual entered code.
Attachments
video-tags3.JPG (35.59 KB, 88 downloads)


BOOM 7.6.+ rocks....
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
I get the box size with the latest code above but an error on play.

Same youtube link HeplUHZsHfo entered on this forum.

[video:youtube]HeplUHZsHfo[/video]

OMG i didn't realise its Barry lol
Attachments
video-tags4.JPG (25.39 KB, 86 downloads)
Error on play

Last edited by Mark_S; 08/13/2016 4:18 AM.

BOOM 7.6.+ rocks....
Joined: Jul 2001
Posts: 1,157
Likes: 82
coffee and code
coffee and code
Joined: Jul 2001
Posts: 1,157
Likes: 82
Hey Mark, Im not sure if this will help you out or not, but this is a screen cap from UBBDev's current YouTube Custom Tag for UBB.threads 7.6.0 (Snapshot 20160813)

There is also a "common.css" file which is unique to UBBT v7.6.x series.

You can paste the following code in to your style sheet's EXTRAS section, if you are not currently on a 7.6.x series install. You'll need to do it to each of your styles. And then when you move to 7.6.x, you'll probably need to remove it at that time, since it will duplicate functionality.

Code
/* video embeds */
.video-container {height:0;overflow:hidden;position:relative;padding-bottom:56.25%;padding-top:30px;}
.video-container iframe,.video-container object,.video-container embed {height:100%;left:0;position:absolute;top:0;width:100%;}
Attachments
20160813_04-24-23.PNG (33.74 KB, 86 downloads)

Last edited by id242; 08/13/2016 4:31 AM. Reason: added some css

Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
Hey thanks ID but it did not work.
I got the nice big screen size smile

However an error on play back.

See attached

I have tried this in EDGE and the same issue.
Ive done a google and no one else is moaning yet. . . .
Attachments
video-tags5.JPG (39.51 KB, 78 downloads)
Tag Details
video-tags6.JPG (42.24 KB, 74 downloads)
Displays as expected
video-tags7.JPG (106.08 KB, 74 downloads)
Pressing play gives the following error.


BOOM 7.6.+ rocks....
Sponsored Links
Joined: Jul 2001
Posts: 1,157
Likes: 82
coffee and code
coffee and code
Joined: Jul 2001
Posts: 1,157
Likes: 82
You have too many slashes near your "/embed/\\2" code.

You should not copy/paste the items in to the boxes from the above code. Instead, copy the whole code in to a txt file, and then import that text file to the Tag Editor.


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
It does not work the importer - white screen as posted above.
i will go with "/embed/\\2"

Yes that worked on the new code smile smile

Adding the following code to the media prompt 9my you tube button)

working with
J1v9IqL8Z1g

But not
https://youtu.be/J1v9IqL8Z1g

See attached.

But my old videos are still only showing as previous a tall back box ??
I still have the style sheet extras.

Need to play for a bit and see what is going on. . . .
Attachments
video-tags8.JPG (31.78 KB, 65 downloads)

Last edited by Mark_S; 08/13/2016 5:23 AM.

BOOM 7.6.+ rocks....
Joined: Jul 2001
Posts: 1,157
Likes: 82
coffee and code
coffee and code
Joined: Jul 2001
Posts: 1,157
Likes: 82
Originally Posted by Mark_S
But my old videos are still only showing as previous a tall back box ??
I still have the style sheet extras.

Since you basically "added a new UBBCode" (or updated your current code), you need to run the content rebuilder.

Control Panel » Content Rebuilder > Rebuild Posts

Quote
Rebuild Posts
Select this action if you've added a new UBBCode or if you've edited the list of censored words.

hint: If you enter the post editor on one of your old youtube posts and click the "Preview Post" button, you will get an idea of what the rest of your posts will look like before running the rebuilder on your whole forums.


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
Thanks ID242,
I have the https working now.

The devil is in the detail and your snapshots helped. The code in the first post needs some attention as it has the extra slashes in it and also the regex.

That's a great little trick the preview post...

I'm at a loss what has caused this to randomly fail ??


BOOM 7.6.+ rocks....
Joined: Jul 2001
Posts: 1,157
Likes: 82
coffee and code
coffee and code
Joined: Jul 2001
Posts: 1,157
Likes: 82
Originally Posted by Mark_S
The devil is in the detail and your snapshots helped. The code in the first post needs some attention as it has the extra slashes in it and also the regex.

The code in the first posts works if you dump it in to a text file and then import that text to your Custom Tag editer, by way of the "Import New Tags" button at the bottom. The newly imported tags will be prefixed with "new", so as to not be confused with your current tags.

The additional backslashes ( \\\\ ) in the OP's code, are intentional. They escape the following backslash.
You can read more on that at http://php.net/manual/en/regexp.reference.escape.php

I'm happy to hear that you finally got it all worked out
cheers!


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Yeah, as Isaac stated, these are to be imported (hence "CustomTags.txt") and not just copied over; I'll update the OP with more clarity


UBB.Dev - 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
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
Thanks for the help, appreciated.
However my importer is not working (White Screen upon submitting the file).

It's unlikely i will have to use it again, before version 6 so not worth going in to it.

I will be going clean install when 6 arrives smile



BOOM 7.6.+ rocks....
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Clean install? on your main site? why start from scratch?!?

Does your error log have any entries after you get a white screen trying to import?


UBB.Dev - 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

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
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
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,833
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-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)