[2.0.19] Youtube Video BBCode

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
125
64%
Very Good
23
12%
Good
21
11%
Fair
5
3%
Poor
21
11%
 
Total votes: 195

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 29216
Joined: Sat Aug 16, 2003 7:36 am

[2.0.19] Youtube Video BBCode

Post by Extensions Robot »

MOD Name: Youtube Video BBCode
Author: michaeltripp
MOD Description: Adds a new bbcode allowing you to easily embed videos from YouTube.com.


MOD Version: 1.0.1 (Updated 03/21/06)

Download File: youtube-1.0.1.mod
mods overview page: View
File Size: 5790 Bytes

Security Score: 0

Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version in the topic title. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:31 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Validated/Released

Notes:
As the title suggests, this adds an additional bbcode in your posting page which allows posting of Youtube links.
ndonezn
Registered User
Posts: 118
Joined: Fri Nov 11, 2005 10:05 pm
Location: pasadena
Contact:

Post by ndonezn »

so this will actually embed the f.player?
michaeltripp
Registered User
Posts: 17
Joined: Mon Mar 06, 2006 7:16 pm

Post by michaeltripp »

ndonezn wrote: so this will actually embed the f.player?
Yes, you put the URL for a Youtube video's page between the tags and it will embed that youtube video into your post so that people can watch the video without leaving the board.

For example, to embed the video found at http://youtube.com/watch?v=UY0xwRIGOdc just put this into your post:

Code: Select all

[youtube]http://youtube.com/watch?v=UY0xwRIGOdc[/youtube]
This tag also puts a link next to the video so users can go directly to the YouTube page, i.e. if they want to rate the video, add it to their favorites on YouTube, send the link to someone else, etc. It's also useful because YouTube's embedded player doesn't seem to work with Opera -- videos viewed on YouTube's pages work fine, but they don't work when they're embedded on other sites.

If you want to see an example of this BBCode in use, go here: http://forums.itsbeenconfirmed.com/viewtopic.php?t=8624
ndonezn
Registered User
Posts: 118
Joined: Fri Nov 11, 2005 10:05 pm
Location: pasadena
Contact:

Post by ndonezn »

im having trouble using this mod along with video bbcode mod...by default the video button is referring to you tube...im going to uninstall video to see if this helps
michaeltripp
Registered User
Posts: 17
Joined: Mon Mar 06, 2006 7:16 pm

Post by michaeltripp »

ndonezn wrote: im having trouble using this mod along with video bbcode mod...by default the video button is referring to you tube...im going to uninstall video to see if this helps
I haven't looked at the code for that mod so I can't be sure what the problem is, but I can take a pretty good guess. If you want to use both mods together, see if this works:

In the mod, change this line

Code: Select all

$bbcode_tpl['youtube'] = str_replace('{VIDEO}', '\\1', $bbcode_tpl['youtube']);
to this

Code: Select all

$bbcode_tpl['youtube'] = str_replace('{YOUTUBEID}', '\\1', $bbcode_tpl['youtube']);
and instead of this

Code: Select all

<!-- BEGIN youtube -->
<object width="425" height="350">
	<param name="movie" value="http://www.youtube.com/v/{VIDEO}"></param>
	<embed src="http://www.youtube.com/v/{VIDEO}" type="application/x-shockwave-flash" width="425" height="350"></embed>
</object><br />
<a href="http://youtube.com/watch?v={VIDEO}" target="_blank">{LINK}</a><br />
<!-- END youtube -->
use this

Code: Select all

<!-- BEGIN youtube -->
<object width="425" height="350">
	<param name="movie" value="http://www.youtube.com/v/{YOUTUBEID}"></param>
	<embed src="http://www.youtube.com/v/{YOUTUBEID}" type="application/x-shockwave-flash" width="425" height="350"></embed>
</object><br />
<a href="http://youtube.com/watch?v={YOUTUBEID}" target="_blank">{LINK}</a><br />
<!-- END youtube -->
ndonezn
Registered User
Posts: 118
Joined: Fri Nov 11, 2005 10:05 pm
Location: pasadena
Contact:

Post by ndonezn »

hey michael...i tried using your code but that doesn.t seem to fix it...
im going over my multiple bbcode mod install to see if i could have missed something, but it doesn.t look like it..

it.s strange...the video and youtube button are side by side but they both point to youtube...and when i do use the correct link...nothing shows up..i don.t want to rob this thread, so i will see if i can fix it and im excited to use it!!!
yots
Registered User
Posts: 4
Joined: Fri Sep 30, 2005 11:50 pm

Post by yots »

michaeltripp wrote: It's also useful because YouTube's embedded player doesn't seem to work with Opera -- videos viewed on YouTube's pages work fine, but they don't work when they're embedded on other sites.


using only this string in the bbcode.tpl:

Code: Select all

<p><embed src="http://www.youtube.com/v/{VIDEO}" width="425" height="350" type="application/x-shockwave-flash"></embed></p>
the video seems to work also in opera :wink:
groove collection
Registered User
Posts: 38
Joined: Mon Mar 06, 2006 11:30 pm

Post by groove collection »

it works

only problem now is with the BBcode [hr] mod
the [hr] button is gone from the posting body !?

Code: Select all

##############################################################
## MOD Title: BBcode [hr]
## MOD Author: Cr@ter$ < n/a > (n/a) http://www.craterz.com/
## MOD Description: A BBcode, allowing you to add a horizontal rule into a post.
## MOD Version: 1.0.4
##
## Installation Level: (Easy)
## Installation Time: 2 Minutes
## Files To Edit: includes/bbcode.php,
##      language/lang_english/lang_bbcode.php,
##      language/lang_english/lang_main.php,
##      templates/subSilver/bbcode.tpl,
##      templates/subSilver/posting_body.tpl
##
## Included Files: (N/A)
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## IMPORTANT: Requires Multi BBCode 1.4.0c or later (http://www.phpbb.com/)
##
##############################################################
## MOD History:
##
##   2006-02-05 - Version 1.0.4
##      - Corrected a few typos.
##
##   2006-01-16 - Version 1.0.2
##      - Changed a couple FINDs to reflect other BBCodes installed.
##
##   2006-01-15 - Version 1.0.0
##      - Released
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

# 
#-----[ OPEN ]------------------------------------------ 
#
includes/bbcode.php
# 
#-----[ FIND ]------------------------------------------ 
#
/***************************************************************************
 *                              bbcode.php
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//-- mod : BBCode - HR ---------------------------------------------------------
# 
#-----[ FIND ]------------------------------------------ 
#
#	//NOTE: the first element of each array must be ''   Add new elements AFTER the ''
#		Full line may be longer than shown.
	$EMBB_widths = array(''
# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
) ;
# 
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------ 
#
, '30'
# 
#-----[ FIND ]------------------------------------------ 
#
# NOTE --- This is a Partial search
#
	$EMBB_values = array(''
# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
) ;
# 
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------ 
#
, 'hr'
# 
#-----[ FIND ]------------------------------------------ 
#
	// [i] and [/i] for italicizing text.
	$text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text);
	$text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text);
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

//-- mod : BBCode - HR ---------------------------------------------------------
//-- add
	// [hr] for inserting a horizontal rule. 
	$text = str_replace("[hr:$uid]", $bbcode_tpl['hr'], $text);
//-- fin mod : BBCode - HR -----------------------------------------------------
# 
#-----[ FIND ]------------------------------------------ 
#
	// [i] and [/i] for italicizing text.
	$text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text);
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

//-- mod : BBCode - HR ---------------------------------------------------------
//-- add
	// [hr] for inserting a horizontal rule.
	$text = preg_replace("#\[hr\]#si", "[hr:$uid]", $text);
//-- fin mod : BBCode - HR -----------------------------------------------------
# 
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_bbcode.php
# 
#-----[ FIND ]------------------------------------------ 
#
/***************************************************************************
 *                         lang_bbcode.php [english]
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//-- mod : BBCode - HR ---------------------------------------------------------
# 
#-----[ FIND ]------------------------------------------ 
#
$faq[] = array("--", "Creating Links");
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//-- mod : BBCode - HR ---------------------------------------------------------
//-- add
$faq[] = array("--", "Adding a HR (Horizontal Rule) to your post");
$faq[] = array("How to add a horizontal rule in your post", "To add a horizontal rule to your post, just use the <b>[hr]</b> tag. Keep in mind that how the horizontal rule appears will vary depending on the viewers browser and system, as well as any cascading style sheet (css) set attributes for the (x)html tag. An example of the horizontal rule is this:<hr width=\"95%\" />The above line is a horizontal rule, or otherwise known as a hr tag.");
//-- fin mod : BBCode - HR -----------------------------------------------------

# 
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_main.php
# 
#-----[ FIND ]------------------------------------------ 
#
/***************************************************************************
 *                            lang_main.php [English]
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//-- mod : BBCode - HR ---------------------------------------------------------
# 
#-----[ FIND ]------------------------------------------ 
#
$lang['bbcode_f_help'] = 'Font size: [size=x-small]small text[/size]';
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
//-- mod : BBCode - HR ---------------------------------------------------------
//-- add
$lang['bbcode_help']['hr'] = 'Adds a horizontal rule: [hr]. (alt+%s)';
//-- fin mod : BBCode - HR -----------------------------------------------------
# 
#-----[ OPEN ]------------------------------------------ 
#
templates/subSilver/bbcode.tpl
# 
#-----[ FIND ]------------------------------------------ 
#
<!-- BEGIN i_open --><span style="font-style: italic"><!-- END i_open -->
<!-- BEGIN i_close --></span><!-- END i_close -->
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
#	NOTE: If you would like the width of the rule to be wider (or narrower)
#			change "90%" to a desired value, preferably as a percentage, such
#			as "100%" (or "75%").

<!-- BEGIN hr --></span><hr width="90%" /><span class="postbody"><!-- END hr -->
# 
#-----[ OPEN ]------------------------------------------ 
#
templates/subSilver/posting_body.tpl
# 
#-----[ FIND ]------------------------------------------ 
#
# NOTE --- This is a Partial search
#
bbtags = new Array('[b]','[/b]','[i]','[/i]',
# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
);
# 
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------ 
#
# NOTE: It has to be the same order like the buttons are placed.
#
,'[hr]',''
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
groove collection
Registered User
Posts: 38
Joined: Mon Mar 06, 2006 11:30 pm

Post by groove collection »

Mmm.. Had to uninstall this mod, cause it disables the resize fix that is in my stylesheet (AdInfinnitum)

from bbcode.tpl:

Code: Select all

<!-- BEGIN img --><img src="{URL}" style="border: 0;" onLoad="if(this.width > 550) {this.width = 550;}" onmouseout="nd();" onmouseover="if(this.width == 550) {return overlib('<img src=templates/AI/images/resized-image.gif>', ol_fgcolor='', ol_bgcolor='', ol_width=147, ol_offsetx=22, ol_offsety=-7, CAPTION, '');}" onclick="if(this.width == 550) { window.open('templates/AI/resizefix.php?originalsize={URL}', '_blank' , 'scrollbars=1, toolbar=no, resizable=1, menubar=no, directories=no, status=yes'); return false; }" /><!-- END img -->
resizefix.php:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	lang="en"
	xml:lang="en">

<head>
<!--

	ResizeFix v1.00 for phpBB
	www.mikelothar.com (c) 2004 - 2005

//-->

<title>Original size</title>

<meta http-equiv="Content-Type"
	content="text/html;
	charset=iso-8859-1" />
	
<meta http-equiv="imagetoolbar"
	content="no" />

<link rel="icon"
	href="templates/AI/images/favicon.ico" />

<link rel="stylesheet"
	href="AI.css" type="text/css">

<script language="JavaScript"
	src="AI.js"></script>
	
<script language="JavaScript">
window.onload = maxWindow;
</script>

</head>

<body>
<table cellspacing="0" style="height: 96%;">
  <tr>
    <td><a href="javascript:window.close();"><span class="avatar"><img src="<?PHP print $HTTP_GET_VARS[originalsize];?>" alt="Close this window" border="0"></span></a><br />
		<a href="javascript:window.close();">Close this window</a></td>
  </tr>
</table>
</body>
</html>
this doesn't work anymore, so it screwed up the lay-out on all the page with pictures in them.

Too bad. I really wanted to use this video mod
michaeltripp
Registered User
Posts: 17
Joined: Mon Mar 06, 2006 7:16 pm

Post by michaeltripp »

yots wrote:
michaeltripp wrote:It's also useful because YouTube's embedded player doesn't seem to work with Opera -- videos viewed on YouTube's pages work fine, but they don't work when they're embedded on other sites.


using only this string in the bbcode.tpl:

Code: Select all

<p><embed src="http://www.youtube.com/v/{VIDEO}" width="425" height="350" type="application/x-shockwave-flash"></embed></p>
the video seems to work also in opera :wink:
For me that works the same as the original code I wrote, that is, the player embeds, but it will not play the video. Can anybody else confirm whether the above code makes any difference in Opera? Post what version of Opera you're using, I'm using 8.52.
michaeltripp
Registered User
Posts: 17
Joined: Mon Mar 06, 2006 7:16 pm

Post by michaeltripp »

michaeltripp wrote:
yots wrote:using only this string in the bbcode.tpl:

Code: Select all

<p><embed src="http://www.youtube.com/v/{VIDEO}" width="425" height="350" type="application/x-shockwave-flash"></embed></p>
the video seems to work also in opera :wink:
For me that works the same as the original code I wrote, that is, the player embeds, but it will not play the video. Can anybody else confirm whether the above code makes any difference in Opera? Post what version of Opera you're using, I'm using 8.52.
I upgraded my installation of Opera to 9.0 Preview 2, the forth-coming release of Opera (the current version is 8.53) and your code worked, but so did my original code.

So I recommend that people leave in the link next to the video to support old versions of Opera (especially since the "old version" in this case is the current version) and other browsers which might have trouble playing the video. Plus, it's still useful for users who want to pass the video link on to a friend or for users who are active on YouTube and might want to comment on the video there or add it to their favorites or whatever.
ndonezn
Registered User
Posts: 118
Joined: Fri Nov 11, 2005 10:05 pm
Location: pasadena
Contact:

Post by ndonezn »

so i have messed around with this, but i can not get it to work :?
i had video bbcode when i installed this and it looks like it has mixed up with this--for both "youtube" and "video" buttons refer to "youtube tags."

i rechecked all the coding and i still get this reply when posting a youtube link

Image



im starting ot wonder if my multiple bbcode mod is installed properly...i installed that mod some time ago but i have never used another mod that required it...is that a possiblility for this error im having?


**edit**

i removed video bbcode mod and it works great!!! this is a lot more efficient than video bbcode...when i was removing the mod i remember seeing something that i would have to change the array # if used with another mod...i have no idea how to do that...so if anyone wants to use both this is what they must do

thanks for the MOD michael :wink:
ndonezn
Registered User
Posts: 118
Joined: Fri Nov 11, 2005 10:05 pm
Location: pasadena
Contact:

Post by ndonezn »

quick question...

is there a way to incorporate a youtube toolbar...much like the imageshack one?
The_Kaiser
Registered User
Posts: 4
Joined: Sun Feb 20, 2005 10:24 pm

Excellent work

Post by The_Kaiser »

I was just looking to put a youtube link into my forum when the mod was posted on saturday.

I do have one quick question concerning an error that I ran into which is not significant, but something I just wanted to know if I could fix. After I posted the movie there is the hyperlink underneath the movie itself, and underneath that is a line that says "undefined". I was wondering if I made a mistake in the code somewhere because ive gone over it 3 times and still havent found the fix.

A link to the post is here: http://www.jg51.org/forum/viewtopic.php?t=121

Any help is greatly appreciated.
Post Reply

Return to “[2.0.x] MOD Database Releases”