$text = preg_replace('#\[youtube\](http:|https:)?(\/\/www.youtube\.com\/watch\?v=|\/\/youtu\.be\/)?(.*?)\[/youtube\]#si', '<strong>'.$locale['bb_youtube'].'</strong><br /><embed width="425" height="350" src="http://www.youtube.com/v/\3" frameborder="0"></embed>', $text);
?>
Quote
will take a long time to 9 version to be stable 100%
$text = preg_replace('#\[youtube\](http:|https:)?(\/\/www.youtube\.com\/watch\?v=|\/\/youtu\.be\/)?(.*?)\[/youtube\]#si', '<strong>'.$locale['bb_youtube'].'</strong><br /><iframe width="560" height="315" src="https://www.youtube.com/embed/\3" style="border:0" allowfullscreen></iframe>', $text);
Quote
Try this in youtube_bbcode_include.phpCode Download source$text = preg_replace('#\[youtube\](http:|https:)?(\/\/www.youtube\.com\/watch\?v=|\/\/youtu\.be\/)?(.*?)\[/youtube\]#si', '<strong>'.$locale['bb_youtube'].'</strong><br /><iframe width="560" height="315" src="https://www.youtube.com/embed/\3" style="border:0" allowfullscreen></iframe>', $text);
- by Wanabo
https://www.youtube.com/embed/\3
<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) PHPFusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: youtube_bbcode_include.php
| Author: Wooya
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
add_to_head("<style type='text/css'>
.flexible-container { position: relative; padding-bottom: 56.25%; padding-top: 30px;
height: 0; overflow: hidden; margin-bottom: -50px; }
.flexible-container iframe,
.flexible-container object,
.flexible-container embed { position: absolute; top: 0; left: 0; width: 80%; height: 80%; }
</style>");
$text = preg_replace('#\[youtube\](http:|https:)?(\/\/www.youtube\.com\/watch\?v=|\/\/youtu\.be\/)?(.*?)\[/youtube\]#si', '<strong>'.$locale['bb_youtube'].'</strong><br /><div class="flexible-container"><iframe width="560" height="315" src="https://www.youtube.com/embed/\3" style="border:0" allowfullscreen></iframe></div>', $text);
?>
Category Forum
Content Administration - 8Labels
None yet
Statistics
6 participants
Notifications
You are not receiving notifications from this thread.
Related Questions