1 頁 (共 1 頁)

[外掛]Flash&Stream BBCODE

發表於 : 2004-06-20 00:26
銀薰
for PHPBB2 2.0.8

今天重裝論壇的時後整理的

如果有須要就拿去用吧\r

代碼: 選擇全部

# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/bbcode.php 
# 
#-----[ FIND ]------------------------------------------ 
# 
	$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\\1', $bbcode_tpl['email']);
# 
#----[ AFTER, ADD ]----------------------------------------- 
# 
	//Flash Mod Copyright David Smith 2002 
	$bbcode_tpl['flash'] = str_replace('{WIDTH}', '\\\1', $bbcode_tpl['flash']); 
	$bbcode_tpl['flash'] = str_replace('{HEIGHT}', '\\\2', $bbcode_tpl['flash']); 
	$bbcode_tpl['flash'] = str_replace('{LOOP}', '\\\3', $bbcode_tpl['flash']); 
	$bbcode_tpl['flash'] = str_replace('{URL}', '\\\4', $bbcode_tpl['flash']); 

	//Begin Strean Mod Copyright David Smith 2002 
	$bbcode_tpl['stream'] = str_replace('{URL}', '\\\1', $bbcode_tpl['stream']); 
# 
#-----[ FIND ]------------------------------------------ 
# 
	// [email]user@domain.tld[/email] code..
	$patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
	$replacements[] = $bbcode_tpl['email'];
# 
#----[ AFTER, ADD ]----------------------------------------- 
# Note: you may need to change array number if used with other BBcode mods 
# 
	// [flash width= height= loop= ] and [/flash] code.. 
	$patterns[] = "#\[flash width=([0-9]?[0-9]?[0-9]) height=([0-9]?[0-9]?[0-9]) loop=(.*?):$uid\](.*?)\[/flash:$uid\]#si"; 
	$replacements[] = $bbcode_tpl['flash']; 

	//[ stream ]and[ /stream ]for streaming audio. 
	$patterns[] = "#\[stream:$uid\](.*?)\[/stream:$uid\]#si"; 
	$replacements[] = $bbcode_tpl['stream']; 
# 
#-----[ FIND ]------------------------------------------ 
# 
	// [img]image_url_here[/img] code..
	$text = preg_replace("#\[img\]((ht|f)tp://)([^ \?&=\"

\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\\1' . str_replace(' ', '%20', '\\\3') . '[/img:$uid]'", $text);

# 
#----[ AFTER, ADD ]----------------------------------------- 
# 
	//[flash width= heigth= loop=] and [/flash] 
	$text = preg_replace("#\[flash width=([0-9]?[0-9]?[0-9]) height=([0-9]?[0-9]?[0-9]) loop=(.*?)\](([a-z]+?)://([^, 

]+))\[\/flash\]#si","[flash width=\\\1 height=\\\2 loop=\\\3:$uid\]\\\4[/flash:$uid]", $text); 
	$text = preg_replace("#\[flash width=([0-9]?[0-9]?[0-9]) height=([0-9]?[0-9]?[0-9])\](([a-z]+?)://([^, 

]+))\[\/flash\]#si","[flash width=\\\1 height=\\\2 loop=false:$uid\]\\\3[/flash:$uid]", $text); 
	$text = preg_replace("#\[flash\](([a-z]+?)://([^, 

]+))\[\/flash\]#si","[flash width=600 height=450 loop=false:$uid\]\\\1[/flash:$uid]", $text); 

	//[ stream]image_url_here[/stream ]code.. 
	$text = preg_replace("#\[stream\](([a-z]+?)://([^, 

]+))\[/stream\]#si", "[stream:$uid]\\\1[/stream:$uid]", $text); 
# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/bbcode.tpl 
# 
#-----[ FIND ]------------------------------------------ 
# 
<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->

# 
#----[ AFTER, ADD ]----------------------------------------- 
# 
<!-- BEGIN flash --> 
<!-- URL's used in the movie--> 
<!-- text used in the movie--> 
<!-- --> 
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" 
WIDTH={WIDTH} HEIGHT={HEIGHT}> 
<PARAM NAME=movie VALUE="{URL}"> <PARAM NAME=loop VALUE={LOOP}> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=noborder> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=bgcolor VALUE=#000000> <EMBED src="{URL}" loop={LOOP} quality=high scale=noborder wmode=transparent bgcolor=#000000 WIDTH={WIDTH} HEIGHT={HEIGHT} TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED> 
</OBJECT> 
<!-- END flash --> 

<!-- BEGIN stream -->
<object id="wmp" width=300 height=300 classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" 
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" 
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> 
<param name="FileName" value="{URL}"> 
<param name="ShowControls" value="1"> 
<param name="ShowDisplay" value="0"> 
<param name="ShowStatusBar" value="1"> 
<param name="AutoSize" value="1"> 
<param name="autoplay" value="0"> 
<embed type="application/x-mplayer2" 
pluginspage="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" 
src="{URL}" name=MediaPlayer2 showcontrols=1 showdisplay=0 showstatusbar=1 autosize=1 autoplay=0 visible=1 animationatstart=0 transparentatstart=1 loop=0 height=70 width=300> 
</embed> 
</object>
<!-- END stream -->
# 
#-----[ Open templates/your template/posting_body.tpl]------------------------------------------ 
# 
# 
#-----[ Find ]------------------------------------------ 
# 
f_help = "{L_BBCODE_F_HELP}";
# 
#-----[ Add after ]------------------------------------------ 
# 
r_help = "{L_BBCODE_R_HELP}";
m_help = "{L_BBCODE_M_HELP}";
# 
#-----[ Find ]------------------------------------------ 
# 
bbtags = new Array(
# 
#-----[ after '[/url]' Add ]------------------------------------------ 
# 
,'[flash width=400 height=300 loop=false]','[/flash]','[stream]','[/stream]'
# 
#-----[ Find ]------------------------------------------ 
# 
			<td><span class="genmed"> 
			  <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
			  </span></td>
# 
#-----[ Add after ]------------------------------------------ 
Note you may need to change array number if used with other BBcode mods 
# 
			<td><span class="genmed"> 
			  <input type="button" class="button" accesskey="r" name="addbbcode18" value="Flash" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('r')" />
			  </span></td>
			<td><span class="genmed"> 
			  <input type="button" class="button" accesskey="m" name="addbbcode20" value="影片" style="width: 45px" onClick="bbstyle(20)" onMouseOver="helpline('m')" /> 
			  </span></td>
# 
# 
#-----[ OPEN ]------------------------------------------ 
# 

posting.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

	'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

	'L_BBCODE_R_HELP' => $lang['bbcode_r_help'],
	'L_BBCODE_M_HELP' => $lang['bbcode_m_help'],

# 
#-----[ SAVE ]------------------------------------------ 
# 
# 
# 
#-----[ OPEN ]------------------------------------------ 
# 

languages/lang_xxx/lang_main.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$lang['bbcode_f_help'] = "字型大小: [size=x-small]small text[/size]"; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

$lang['bbcode_r_help'] = '插入Flash動畫: [flash width=400 height=300]http://Flash_url[/flash] (alt+m)'; 
$lang['bbcode_m_help'] = '插入影音片段: [stream]URL[/stream] (alt+r)';

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM