新增youtube視訊連接 BBCODE

Officially Approved MODs
由 phpBB Group 官方發展小組認證的 MOD!

版主: 版主管理群

版面規則
請注意!只有發表在 [2.0.x] MOD Database Releases 的外掛,才算是官方認證的外掛。
主題已鎖定
karobi
星球公民
星球公民
文章: 31
註冊時間: 2005-12-23 12:37

新增youtube視訊連接 BBCODE

文章 karobi »

外掛英文名稱:Youtube Video BBCode
外掛版本:1.0.1 (Updated 03/21/06)
安裝時間:約五分鐘
安裝程度:簡單
說明:新增一個新的BBCODE,讓你簡單且容易的從你的網頁中播放youtube.com視訊


展示頁面:http://www.kbsdkp.why3s.net/kbs/viewtopic.php?t=833

下載點:http://www.phpbb.com/phpBB/catdb.php?mo ... id=2047488
檔案大小:5790 Bytes

注意事項
## 你必須先裝上 Multiple BBCode MOD 才能夠安裝此youtube video bbcode
## Multiple BBCode MOD下載點:http://www.phpbb.com/phpBB/viewtopic.php?t=74705
##
## 安裝之後的範例:
## [youtube]YouTube URL[/youtube]
##
## YouTube URL 是指連結上的youtube網頁的網址,而不是Embeddable Player的網址
●OS:windowsXP
●架站軟體:phpBB2
●phpBB版本:phpbb-2.0.22
●上網方式:ADSL 動態IP
連接網址http://forum.kbsguild.com

外掛一覽
偽子分區
youtube BBCODE
全區公告
快速砍人

頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8643
註冊時間: 2004-04-30 01:54
來自: Taiwan

Re: 新增youtube視訊連接 BBCODE

文章 心靈捕手 »

karobi 寫:注意事項
## 你必須先裝上 Multiple BBCode MOD 才能夠安裝此youtube video bbcode
## Multiple BBCode MOD下載點:http://www.phpbb.com/phpBB/viewtopic.php?t=74705
上頭關於 'Multiple BBCode MOD下載點' 的連結, 有讀取權限的問題, 修正如下:
http://www.phpbb.com/phpBB/viewtopic.php?t=145513
施比受有福,歡迎來信賜教,謝謝 & 再見!
祝福您 好運 ^_^
歡迎加入★★心靈捕手★★ :: 討論區!!
http://wang5555.hopto.org/phpBB3/
p.s. 奉老婆之命:在晚上十一點前,得關機睡覺!!!

頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8643
註冊時間: 2004-04-30 01:54
來自: Taiwan

文章 心靈捕手 »

此官方認證外掛, 參考連結已更新. 如下:
http://www.phpbb.com/community/viewtopic.php?t=375183
施比受有福,歡迎來信賜教,謝謝 & 再見!
祝福您 好運 ^_^
歡迎加入★★心靈捕手★★ :: 討論區!!
http://wang5555.hopto.org/phpBB3/
p.s. 奉老婆之命:在晚上十一點前,得關機睡覺!!!

頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8643
註冊時間: 2004-04-30 01:54
來自: Taiwan

[轉貼] 安裝說明檔全文

文章 心靈捕手 »

代碼: 選擇全部

############################################################## 
## MOD Title: YouTube Video BBCode 
## MOD Author: michaeltripp < iamdrscience@hotmail.com > (Mike) http://itsbeenconfirmed.com 
## MOD Description: Adds a new bbcode allowing you to easily embed videos from YouTube.com.
## MOD Version: 1.0.1 
## 
## Installation Level: (Easy) 
## Installation Time: ~5 Minutes
## Files To Edit: - includes/bbcode.php,
##                - langugage/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: 
##   You must have Multiple BBCode MOD installed for this to work.
##      Get it here: http://www.phpbb.com/phpBB/viewtopic.php?t=74705
##
##      example:
##  [youtube]YouTube URL[/youtube]
##
##  YouTube URL is the "Video URL (Permalink)" or the URL of the page the video 
##  is on, NOT the "Embeddable Player" code they have on their video pages.
## 
############################################################## 
## MOD History: 
##
##  2006-03-20 - Version 1.0.1
##	-Changed the names of the variables tbat are replaced in bbcode.tpl
##	from VIDEO and LINK to YOUTUBEID and YOUTUBELINK, because the names
##	were too common making it likely that they would conflict with other mods.
##
##  2006-03-17 - Version 1.0.0
##
##  2006-03-16 - Version 0.9.3
##	-Fixed a problem in the regex that allowed some invalid but benign input
##
##  2006-03-15 - Version 0.9.2
##	-Made the word "link" was a language variable
##	-Made the link open in a new window
##	-YouTube video IDs can have dashes, so I changed the regex to account for this
##	-Moved the link underneath the video instead of beside it
##
##  2006-03-07 - Version 0.9.1
##	-Added link for browsers YouTube's player doesn't like, i.e. Opera :(
##
##  2006-03-06 - Version 0.9.0
##
############################################################## 
## 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 ]---------------------------------
#
 array(''

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
,'60'

#
#-----[ FIND ]---------------------------------
#
$EMBB_values = array(''

#
#-----[ IN-LINE FIND ]---------------------------------
#
$EMBB_values = array(''

#
#-----[ IN-LINE AFTER, 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 ]---------------------------------
#
# NOTE: the full line to look for is:
#$lang['bbcode_f_help'] = "Font size: [size=x-small]small text[/size]";
#
$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 --><a href="mailto:{EMAIL}">{EMAIL}</a><!-- END email -->
#
#-----[ AFTER, ADD ]------------------------------------------ 
#

<!-- 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">{YOUTUBELINK}</a><br />
<!-- END youtube -->
#
#-----[ OPEN ]---------------------------------
#
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]---------------------------------
#
# NOTE: the actual line to find is MUCH longer, containing all the bbcode tags
#
bbtags = new Array(

#
#-----[ IN-LINE FIND ]---------------------------------
#
'[url]','[/url]'

#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
,'[youtube]','[/youtube]'

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
#
# EoM
施比受有福,歡迎來信賜教,謝謝 & 再見!
祝福您 好運 ^_^
歡迎加入★★心靈捕手★★ :: 討論區!!
http://wang5555.hopto.org/phpBB3/
p.s. 奉老婆之命:在晚上十一點前,得關機睡覺!!!

御津闇慈
竹貓忠實會員
竹貓忠實會員
文章: 648
註冊時間: 2001-11-17 10:59

文章 御津闇慈 »

因應台灣版部分

打開bbcode.php

搜尋

代碼: 選擇全部

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

代碼: 選擇全部

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

主題已鎖定

回到「官方認證外掛」