[MOD][BBCode]Flash + 视频 BBcode MOD

PHPBB2.0.X资源收集专用版,提问和建议请发到主版面
Locked
User avatar
土老耄
技术组成员
技术组成员
Posts: 1441
Joined: 2006-11-18 8:17

[MOD][BBCode]Flash + 视频 BBcode MOD

Post by 土老耄 » 2007-07-04 13:55

给你的标准论坛上增加个Flash和视频的BB Code吧!

来源:俺实在忘了,好像在竹猫
如果站长要求不高的话,可以考虑安装这个,因为这个没有按钮,全靠手动增加的BB Code。

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
   $bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);
#
#----[ AFTER, ADD ]-----------------------------------------
#
   //Begin Stream Mod
   $bbcode_tpl['stream'] = str_replace('{URL}', '\\1', $bbcode_tpl['stream']);

   //Flash Mod  
   $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']);
#
#-----[ FIND ]------------------------------------------
#
   // [email]user@domain.tld[/email] code..
   $patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
   $replacements[] = $bbcode_tpl['email'];
#
#----[ AFTER, ADD ]-----------------------------------------
#
   //[ stream ]and[ /stream ]for streaming audio.
   $patterns[] = "#\[stream:$uid\](.*?)\[/stream:$uid\]#si";
   $replacements[] = $bbcode_tpl['stream'];

   // [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'];
#
#-----[ FIND ]------------------------------------------
#
   // [img]image_url_here[/img] code..
   $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
#
#----[ AFTER, ADD ]-----------------------------------------
#
   // [stream]stream_url_here[/stream] code..
   $text = preg_replace("#\[stream\]((ht|f)tp://)([^\t<\"]*?)\[/stream\]#sie", "'[stream:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/stream:$uid]'", $text);

   //[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=640 height=480 loop=false:$uid\]\\1[/flash:$uid]", $text);  
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/bbcode.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->
#
#----[ AFTER, ADD ]-----------------------------------------
#
<!-- BEGIN stream -->
<OBJECT ID="MediaPlayer1" WIDTH=320 HEIGHT=310 CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="FileName" value="{URL}">
<param name="ShowControls" value="1">
<param name="AutoStart" value="0">
<param name="ShowDisplay" value="0">
<param name="ShowStatusBar" value="1">
<param name="AutoSize" value="1">
<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 visible=1 animationatstart=0 transparentatstart=1 loop=0 height=310 width=320>
</embed>
</object>
<!-- END stream -->

<!-- BEGIN flash -->
<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 -->
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
f_help = "{L_BBCODE_F_HELP}";
#
#----[ AFTER, ADD ]-----------------------------------------
#
n_help = "{L_BBCODE_N_HELP}";
r_help = "{L_BBCODE_R_HELP}";
#
#-----[ FIND ]------------------------------------------
#
bbtags = new Array(
#
#-----[ IN-LINE, FIND ]------------------------------------------
#
'[/url]'
#
#----[ AFTER, ADD ]-----------------------------------------
#
,'[stream]','[/stream]','[flash width=640 height=480 loop=false]','[/flash]'
#
#-----[ 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>
#
#----[ AFTER, ADD ]-----------------------------------------
#
         <td><span class="genmed">
           <input type="button" class="button" accesskey="n" name="addbbcode22" value="Stream" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('n')" />
         </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="r" name="addbbcode24" value="Flash" style="width: 40px" onClick="bbstyle(20)" onMouseOver="helpline('r')" />
         </span></td>
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
   'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
#
#----[ AFTER, ADD ]-----------------------------------------
#
   'L_BBCODE_N_HELP' => $lang['bbcode_n_help'],
   'L_BBCODE_R_HELP' => $lang['bbcode_r_help'],
#
#-----[ OPEN ]------------------------------------------
#
languages/lang_chinese_simplified/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['bbcode_f_help'] = "字体大小: [size=x-small]small text[/size]";
#
#----[ AFTER, ADD ]-----------------------------------------
#
$lang['bbcode_n_help'] = "插入影片: [stream]url[/stream] (alt+n)";
$lang['bbcode_r_help'] = '插入Flash: [flash width=640 height=480]http://Flash_url[/flash] (alt+r)';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

Locked