ต้องแก้ใน Subs.php ด้วยครับ
ขั้นตอนตามนี้ครับ แกะวิธีออกมากจากใน package อีกทีหนึ่ง
วิธีนี้ใช้ได้กับ เวอร์ชั่น 1.1 rc 2 เท่านั้นนะครับ ส่วน 1.0.7 ก็ทำได้แต่ต้องใช้อีกวิธี
ไฟล์ที่ต้องแก้ไขอยู่ใน Sources นะครับ
ไฟล์ : Subs.phpค้นหาบรรทัดนี้
'tag' => 'hr',
'type' => 'closed',
'content' => '<hr style="clear: both;" />',
'block_level' => true,
เพิ่มโค๊ดนี้ไว้ด้านหน้า
'tag' => 'youtube',
'type' => 'unparsed_commas_content',
'test' => '\d+,\d+\]',
'content' => '<object width="$2" height="$3"><param name="movie" value="http://www.youtube.com/v/$1" ></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="$2" height="$3"></embed></object>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';'),
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
ไฟล์ : Post.template.phpค้นหาบรรทัดนี้
'flash' => array('code' => 'flash', 'before' => '[flash=200,200]http://', 'after' => '[/flash]', 'description' => $txt[433]),
เพิ่มโค๊ดนี้ไว้ด้านหน้า
'youtube' => array('code' => 'youtube', 'before' => '[youtube=425,350]', 'after' => '[/youtube]', 'description' => $txt['youtube']),
ไฟล์ภาษา : Modifications.english.phpเพิ่มโค๊ดนี้ไว้ท้ายบรรทัด
$txt['youtube'] = 'YouTube';
ทำแบบนี้กับทุกไฟล์ภาษา ก็เป็นอันจบพิธีการแล้วครับ
วิธีใช้ ใช้เป็น BB code แบบนี้
[youtube=กว้าง,สูง]ไอดีของวีดีโอ[/youtube]
ตัวอย่าง
[youtube=425,350]aCiwhpPb5i0[/youtube]
ผลที่ได้