##############################################################
## MOD Title: YouTube BBCode MOD
## MOD Author: Nightrider < phpbb@4fxearth.net > http://4fxearth.net/phpBB2
## MOD Description: This mod adds YouTube BBCode.  
## You must have the Multi-BBCode and BBCode Organizer MODs installed...
## MOD Version: 1.0.0 
## 
## Installation Level: easy 
## Installation Time: 1 Minute using Easymod
## Files To Edit:
##     includes/bbcode.php
##     templates/subSilver/bbcode.tpl
##     templates/subSilver/posting_body.tpl
##     language/your language/lang_main.php
##
## topic on phpbb.com with screenshots : http://www.phpbb.com/phpBB/viewtopic.php?t=458424
############################################################## 
## Author Notes: 
## You must have the Multi-BBCode and BBCode Organizer MODs installed...
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]---------------------------------
#
$EMBB_widths = array(''
#
#-----[ IN-LINE FIND ]---------------------------------
#
)
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
,'60'
#
#-----[ FIND ]---------------------------------
#
$EMBB_values = array(''
#
#-----[ IN-LINE FIND ]---------------------------------
#
)
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
,'YouTube'
#
#-----[ FIND ]------------------------------------------ 
# 
$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$bbcode_tpl['youtube'] = str_replace('{YOUTUBEID}', '\\1', $bbcode_tpl['youtube']); 
$bbcode_tpl['youtube'] = str_replace('{YOUTUBELINK}', $lang['youtube_link'], $bbcode_tpl['youtube']);

#
#-----[ FIND ]------------------------------------------ 
# 
$replacements[] = $bbcode_tpl['email'];

#
#-----[ AFTER, ADD ]------------------------------------------
#
 // [youtube]YouTube URL[/youtube] code.. 
$patterns[] = "#\[youtube\]http://(?:www\.)?youtube.com/watch\?v=([0-9A-Za-z-_]{11})[^[]*\[/youtube\]#is"; 
$replacements[] = $bbcode_tpl['youtube'];

#
#-----[ OPEN ]------------------------------------------
# 
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------ 
# 
$lang['bbcode_f_help']
#
#-----[ AFTER, ADD ]------------------------------------------
# 
$lang['bbcode_help']['youtube'] = 'YouTube: [youtube]YouTube URL[/youtube]'; 
$lang['youtube_link'] = 'Link';

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/bbcode.tpl
#
#-----[ FIND ]------------------------------------------ 
# 
<!-- BEGIN email -->

#
#-----[ AFTER, ADD ]------------------------------------------
# 
<!-- BEGIN youtube --> 
<center>
<object width="425" height="350">
   <param name="movie" value="http://www.youtube.com/v/{YOUTUBEID}"></param>
   <param name="wmode" value="transparent"></param>
   <embed src="http://www.youtube.com/v/{YOUTUBEID}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
</object><br /> 
<a href="http://youtube.com/watch?v={YOUTUBEID}" target="_blank">{YOUTUBELINK}</a></center><br /> 
<!-- END youtube -->

#
#-----[ OPEN ]------------------------------------------
# 
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]------------------------------------------ 
# 
bbtags = new Array(
#
#-----[ IN-LINE FIND ]------------------------------------------ 
# 
)
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
# 
,'[youtube]','[/youtube]'
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM