1 頁 (共 1 頁)

[問題]請問可以加入聲音文件嗎﹖

發表於 : 2004-08-21 21:53
澞逸定
使用PHPBB發帖時可以在帖中加入聲音文件嗎﹖好象只看見插入圖片而已\r

謝謝

發表於 : 2004-08-21 22:00
右手
這個看看用bbcode的

發表於 : 2004-08-22 12:31
leeman
右手 寫:這個看看用bbcode的
請問 我照上面的改好會出現\r

Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in c:\appserv\www\phpbb2\includes\bbcode.php(61) : eval()'d code on line 24

我用的是php2.0.3

發表於 : 2004-08-22 12:31
吉川拓也
bbcode.php 24 行上下 5 行貼一下 !!

發表於 : 2004-08-22 12:34
leeman
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}

define("BBCODE_UID_LEN", 10);

// global that holds loaded-and-prepared bbcode templates, so we only have to do
// that stuff once.

$bbcode_tpl = null;

/**
* Loads bbcode templates from the bbcode.tpl file of the current template set.
* Creates an array, keys are bbcode names like "b_open" or "url", values
* are the associated template.
* Probably pukes all over the place if there's something really screwed
* with the bbcode.tpl file.
*
* Nathan Codding, Sept 26 2001.
*/
function load_bbcode_template()
{
global $template;
$tpl_filename = $template->make_filename('bbcode.tpl');
$tpl = fread(fopen($tpl_filename, 'r'), filesize($tpl_filename));

// replace \ with \\\ and then ' with \'.
$tpl = str_replace('\\\', '\\\\\\\', $tpl);
$tpl = str_replace('\'', '\\\\\'', $tpl);

// strip newlines.
$tpl = str_replace("
", '', $tpl);

// Turn template blocks into PHP assignment statements for the values of $bbcode_tpls..
$tpl = preg_replace('#<!-- BEGIN (.*?) -->(.*?)<!-- END (.*?) -->#', "
" . '$bbcode_tpls[\'\\\1\'] = \'\\\2\';', $tpl);

$bbcode_tpls = array();

eval($tpl);

return $bbcode_tpls;
}

發表於 : 2004-08-22 12:39
吉川拓也
leeman 寫:恕刪 !
請打包一下 bbcode.php 的檔案 !
我幫你除錯看看 !

發表於 : 2004-08-22 12:46
leeman
吉川拓也 寫:
leeman 寫:恕刪 !
請打包一下 bbcode.php 的檔案 !
我幫你除錯看看 !
請問怎麼打包?..我找不到上傳檔案的地方\r

還是把全部的CODE 貼上來?

發表於 : 2004-08-22 12:47
吉川拓也
leeman 寫:
吉川拓也 寫:
leeman 寫:恕刪 !
請打包一下 bbcode.php 的檔案 !
我幫你除錯看看 !
請問怎麼打包?..我找不到上傳檔案的地方\r

還是把全部的CODE 貼上來?
全包上來太佔用資源了 ...
網站目前看得到嗎 不是本機喔 ?
那你把你剛修改的部份貼一下看看 !

發表於 : 2004-08-22 12:50
leeman

代碼: 選擇全部

#-----[ 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 ]------------------------------------------ 
# 
   // user@domain.tld 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 
\n# 
#-----[ 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 --> 
?>[/php]

發表於 : 2004-08-22 18:37
skeptic
leeman 寫:

代碼: 選擇全部

#-----[ 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 ]------------------------------------------ 
# 
   // user@domain.tld 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 --> 
?>[/php]
請問一下上面這個可伸縮的程式碼表格是怎麼弄出來的? :oops:

發表於 : 2004-08-22 18:42
神川小羽
skeptic 寫: 請問一下上面這個可伸縮的程式碼表格是怎麼弄出來的? :oops:
http://www.forumimages.com/forum/viewtopic.php?t=324

發表於 : 2004-08-24 17:02
&#38451;光社&#2
神川小羽 寫:
skeptic 寫: 請問一下上面這個可伸縮的程式碼表格是怎麼弄出來的? :oops:
http://www.forumimages.com/forum/viewtopic.php?t=324
应该是Javascript做的