New articles Năng lực quản lý: nhân tố thứ năm     ♥ Lựa chọn mục tiêu cuộc đời     ♥ 10 bí quyết cân bằng công việc và gia đình     ♥ Cô đơn trên mạng     ♥ Chứng khoán: Giấc mơ và ác mộng     ♥ Tám     ♥ Những tính năng của blog VnVista     ♥ Các mạng xã hội thống trị Google     ♥ Điều gì tạo nên một giám đốc công nghệ thông tin giỏi?     ♥ Cố gắng xóa bỏ những ấn tượng xấu     ♥ Cần một cách làm ăn mới     ♥ Tiếp thị hướng đến doanh nhân     ♥ Đưa cửa hàng thật lên chợ ảo     ♥ Bí quyết quản lý các nhân viên trẻ     ♥ Một số câu hỏi phỏng vấn “đặc biệt” của Microsoft     ♥ 4 bài học thành công trong kinh doanh     ♥ Tạo dựng hình ảnh một cô gái trẻ chuyên nghiệp     ♥ Góc “khác” của thế giới online đêm     ♥ Phong cách người Mỹ     ♥ Chỉ nghĩ đến tiền cũng làm người ta ích kỷ     
New blog entries SHEET Tình yêu lung linh      ♥ Các loại visa Qatar phổ biến mà bạn cần biết      ♥ Tủ dụng cụ 2 cánh 5 ngăn KT: 1000Wx500Dx1800Hmm      ♥ Tủ dụng cụ 2 cánh 5 ngăn KT: 1000Wx500Dx1800Hmm      ♥ Tủ dụng cụ 2 cánh 5 ngăn KT: 1000Wx500Dx1800Hmm      ♥ SHEET Nếu đời không có anh      ♥ Phụ Gia Nhựa Làm Giảm Co Ngót Sau Gia Công Ép Phun      ♥ Địa chỉ mua giày bảo hộ nam chính hãng      ♥ SHEET Giây phút êm đềm      ♥ Máy Triệt Lông Công Nghệ Cao K18A      ♥ Cách chọn giày bảo hộ tại Đà Nẵng      ♥ hình ảnh Yae Miko Game Genshin Impact      ♥ Cách bảo quản và vệ sinh giày bảo hộ lao động      ♥ SHEET Yêu 1 người sao buồn đến thế      ♥ Bí quyết bảo quản giày bảo hộ lao động      ♥ Máy Triệt Lông Lạnh Diode Laser K17      ♥ Công Nghệ Đùn Ống Nhựa Với Hạt Nhựa Nguyên Sinh      ♥ SHEET Xin cho 1 tiếng kinh cầu      ♥ máy nâng cơ xóa nhăn      ♥ Top 5 dầu gội thảo dược Việt nam 2025      

[ Liệt Kê ] · Bình Thường · Tách Biệt+

Tạo nút post nhạc & flash cho diễn đàn, Copyright by 3T


Tacaza
post Nov 28 2005, 09:33 PM
Gửi vào: #1


Group Icon

The chALLeNgER
**********
Thành viên: 1
Nhập: 3-July 05
Bài viết: 3,003
Tiền mặt: 1,210
Thanked: 1572
Cấp bậc: 43
------
Giới tính: Male
Sinh nhật: 3 Tháng 4 - 1983
Đến từ: Hà Nội
------
Xem blog
Bạn bè: 253 (Xem)
Thêm vào nhóm bạn bè
Gửi thiệp điện tử
Trang thông tin





Vì nhiều bạn hỏi về cách tạo nút post nhạc & flash trong diễn đàn nên mình post lên đây. Nếu bạn hack mod UBBC (như diễn đàn này) thì ko cần phải hack mod này nữa.

Mod này sẽ tạo cho bạn các tag để post rất nhiều thể loại nhạc khác nhau.
+ MEDIA: .wma .wmv .asf .mp3 .mpeg .avi
+ REAL: .ram .rm
+ FLASH: .swf


Mở sources\lib\post_parser.php

Tìm:
CODE

$txt = preg_replace( "#\[s\](.+?)\[/s\]#is", "<s>\\1</s>", $txt );



Thêm phía dưới:

CODE

$txt = preg_replace( "#\[media=(.+?)\](.+?)\[/media\]#is", "<object classid='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6'><param name='url' value='\\2'><param name='volume' value='100'><param name='autostart' value='\\1'><embed type='application/x-mplayer2' src='\\2' showstatusbar='1' autostart='\\1'></object>", $txt );
    $txt = preg_replace( "#\[real=(.+?)\](.+?)\[/real\]#is", "<embed type='audio/x-pn-realaudio-plugin' width='240' height='58' src='\\2' controls='all' autostart='\\1'></embed>", $txt );
    $txt = preg_replace( "#\[flash=(.+?),(.+?)\](.+?)\[/flash\]#is", "<embed type='application/x-shockwave-flash' src='\\3' width='\\1' height='\\2'></embed>", $txt );



Tìm:
CODE

$txt = preg_replace( "#<u>(.+?)</u>#is"  , "\[u\]\\1\[/u\]"  , $txt );



Thêm phía dưới:

CODE

$txt = preg_replace( "#<object classid='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6'><param name='url' value='(.+?)'><param name='volume' value='100'><param name='autostart' value='(.+?)'><embed type='application/x-mplayer2' src='(.+?)' showstatusbar='1' autostart='(.+?)'></object>#is"  , "\[media=\\2\]\\1\[/media\]"  , $txt );
    $txt = preg_replace( "#<embed type='audio/x-pn-realaudio-plugin' width='240' height='58' src='(.+?)' controls='all' autostart='(.+?)'></embed>#is"  , "\[real=\\2\]\\1\[/real\]"  , $txt );
    $txt = preg_replace( "#<embed type='application/x-shockwave-flash' src='(.+?)' width='(.+?)' height='(.+?)'></embed>#is"  , "\[flash=\\2,\\3\]\\1\[/flash\]"  , $txt );



Mở jscripts\ipb_bbcode.js

Tìm:

CODE

function tag_email()
{
  var emailAddress = prompt(text_enter_email, "");

  if (!emailAddress) {
alert(error_no_email);
return;
   }

   doInsert("[EMAIL]"+emailAddress+"[/EMAIL]", "", false);
}



Thêm phía dưới:

CODE

function tag_media()
{
   var FoundErrors = '';
   var enterINFO   = prompt(text_enter_media, "http://");
   var enterSTATE  = prompt(text_enter_state, "1");
   
   if (!enterINFO) {
      FoundErrors += " " + error_no_url;
  }
   
   if (!enterSTATE) {
      FoundErrors += " " + error_no_url;
  }
   
   if (FoundErrors) {
      alert("Error! " + error_no_url);
      return;
  }
   
   doInsert("[MEDIA="+enterSTATE+"]"+enterINFO+"[/MEDIA]", "", false);
}

function tag_real()
{
   var FoundErrors = '';
   var enterINFO   = prompt(text_enter_real, "http://");
   var enterSTATE  = prompt(text_enter_state, "1");
   
   if (!enterINFO) {
      FoundErrors += " " + error_no_url;
  }
   
   if (!enterSTATE) {
      FoundErrors += " " + error_no_url;
  }
   
   if (FoundErrors) {
      alert("Error! " + error_no_url);
      return;
  }
   
   doInsert("[REAL="+enterSTATE+"]"+enterINFO+"[/REAL]", "", false);
}

function tag_flash()
{
   var FoundErrors = '';
   var enterINFO   = prompt(text_enter_flash, "http://");
   var enterWIDTH  = prompt(text_enter_width, "350");
   var enterHEIGHT = prompt(text_enter_height, "300");
   
   if (!enterINFO) {
      FoundErrors += " " + error_no_url;
  }
   
   if (!enterWIDTH) {
      FoundErrors += " " + error_no_url;
  }

   if (FoundErrors) {
      alert("Error! " + error_no_url);
      return;
  }
   
   doInsert("[FLASH="+enterWIDTH+","+enterHEIGHT+"]"+enterINFO+"[/FLASH]", "", false);
}


Mở lang/lang_post.php:

Thêm vào:

CODE

// Media Real Flash mod by TUOI THI THAM
'hb_media'  => "Insert Media (alt + m)",
'hb_real'  => "Insert Real (alt + r)",
'hb_flash'  => "Insert Flash (alt + f)",
'jscode_text_enter_media'    =>    "Enter the URL to the media file",
'jscode_text_enter_real'    =>    "Enter the URL to the real file",
'jscode_text_enter_state'    =>    "Auto play? ( yes = '' 1 ''   ||   no = '' 0 '' )",
'jscode_text_enter_width'    =>    "Enter the width for the flash file",
'jscode_text_enter_height'    =>    "Enter the height for the flash file",



Mở skin_cache/cacheid_2/skin_post.php

Tìm: (dấu "..." là cả một đoạn code to)

CODE

// IBC Code stuff
   var text_enter_url      = "{$ibforums->lang['jscode_text_enter_url']}";
   .......
   .......
   .......
   .......
   //-->



Thay tất cả bằng:

CODE

// IBC Code stuff
var text_enter_url      = "{$ibforums->lang['jscode_text_enter_url']}";
var text_enter_url_name = "{$ibforums->lang['jscode_text_enter_url_name']}";
var text_enter_image    = "{$ibforums->lang['jscode_text_enter_image']}";
var text_enter_email    = "{$ibforums->lang['jscode_text_enter_email']}";
var text_enter_flash    = "{$ibforums->lang['jscode_text_enter_flash']}";
var text_code           = "{$ibforums->lang['jscode_text_code']}";
var text_quote          = "{$ibforums->lang['jscode_text_quote']}";
var error_no_url        = "{$ibforums->lang['jscode_error_no_url']}";
var error_no_title      = "{$ibforums->lang['jscode_error_no_title']}";
var error_no_email      = "{$ibforums->lang['jscode_error_no_email']}";
var error_no_width      = "{$ibforums->lang['jscode_error_no_width']}";
var error_no_height     = "{$ibforums->lang['jscode_error_no_height']}";
var prompt_start        = "{$ibforums->lang['js_text_to_format']}";
var text_enter_media    = "{$ibforums->lang['jscode_text_enter_media']}";
var text_enter_real     = "{$ibforums->lang['jscode_text_enter_real']}";
var text_enter_state    = "{$ibforums->lang['jscode_text_enter_state']}";
var text_enter_width    = "{$ibforums->lang['jscode_text_enter_width']}";
var text_enter_height    = "{$ibforums->lang['jscode_text_enter_height']}";
var help_bold           = "{$ibforums->lang['hb_bold']}";
var help_italic         = "{$ibforums->lang['hb_italic']}";
var help_under          = "{$ibforums->lang['hb_under']}";
var help_font           = "{$ibforums->lang['hb_font']}";
var help_size           = "{$ibforums->lang['hb_size']}";
var help_color          = "{$ibforums->lang['hb_color']}";
var help_close          = "{$ibforums->lang['hb_close']}";
var help_url            = "{$ibforums->lang['hb_url']}";
var help_img            = "{$ibforums->lang['hb_img']}";
var help_email          = "{$ibforums->lang['hb_email']}";
var help_quote          = "{$ibforums->lang['hb_quote']}";
var help_list           = "{$ibforums->lang['hb_list']}";
var help_code           = "{$ibforums->lang['hb_code']}";
var help_click_close    = "{$ibforums->lang['hb_click_close']}";
var list_prompt         = "{$ibforums->lang['js_tag_list']}";
var help_fly            = "{$ibforums->lang['hb_fly']}";
var help_media      = "{$ibforums->lang['hb_media']}";
var help_real      = "{$ibforums->lang['hb_real']}";
var help_flash      = "{$ibforums->lang['hb_flash']}";
var help_highlight  = "{$ibforums->lang['hb_highlight']}";
var help_align      = "{$ibforums->lang['hb_align']}";



Tìm: (trong function postbox_buttons)

CODE

<input type="button" accesskey="l" value=" LIST " onclick="tag_list()" class="codebuttons" name="LIST" onmouseover="hstat('list')" />




Thêm phía dưới:

CODE

<input type='button' accesskey="m" value=" MEDIA "  onClick="tag_media()"  class='codebuttons' name="media" onmouseover="hstat('media')" />
<input type='button' accesskey="r" value=" REAL "  onClick="tag_real()"  class='codebuttons' name="real" onmouseover="hstat('real')" />
<input type='button' accesskey="f" value=" FLASH "  onClick="tag_flash()"  class='codebuttons' name="flash" onmouseover="hstat('flash')" />



##################################################
### Mở ./sources/lib/post_parser.php và XÓA ĐI ###
##################################################

CODE

$txt = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e"  , "\$this->unconvert_flash('\\1')", $txt );


CODE

function unconvert_flash($flash="")
   {
   
$f_arr = explode( "+", $flash );

return '[flash='.$f_arr[0].','.$f_arr[1].']'.$f_arr[2].'[/flash]';

   }


CODE

/*-------------------------------------------------------------------------*/
   // regex_check_flash: Checks, and builds the <object>
   // html.
   /*-------------------------------------------------------------------------*/
   
   function regex_check_flash($width="", $height="", $url="")
   {
global $ibforums;

$default = "\[flash=$width,$height\]$url\[/flash\]";

if (!$ibforums->vars['allow_flash']) {
    return $default;
}

if ($width > $ibforums->vars['max_w_flash']) {
    $this->error = 'flash_too_big';
    return $default;
}

if ($height > $ibforums->vars['max_h_flash']) {
    $this->error = 'flash_too_big';
    return $default;
}

if (!preg_match( "/^http:\/\/(\S+)\.swf$/i", $url) ) {
    $this->error = 'flash_url';
    return $default;
}

return "<!--Flash $width+$height+$url--><OBJECT CLASSID='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' WIDTH=$width HEIGHT=$height><PARAM NAME=MOVIE VALUE=$url><PARAM NAME=PLAY VALUE=TRUE><PARAM NAME=LOOP VALUE=TRUE><PARAM NAME=QUALITY VALUE=HIGH><EMBED SRC=$url WIDTH=$width HEIGHT=$height PLAY=TRUE LOOP=TRUE QUALITY=HIGH></EMBED></OBJECT><!--End Flash-->";
   }



CODE

$txt = preg_replace( "#(\[flash=)(\S+?)(\,)(\S+?)(\])(\S+?)(\[\/flash\])#ie", "\$this->regex_check_flash('\\2','\\4','\\6')", $txt );



Done!


--------------------
Nhóm bạn bè:


dung_buong_tay

tamhonngoc_536

uchinhuong

MTTH

xuxusp2

Xem tất cả


--------------------

Sao không là mặt trời, gieo hạt nắng vô tư?


 
Nếu bạn thấy bài viết này vi phạm nội quy forum, hãy click nút này:
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topicStart Poll
Trả Lời



Thank you! Reply to this topicTopic OptionsStart new topic
 

Bản Rút Gọn Bây giờ là: 18th July 2025 - 10:14 PM
Home | Mạng xã hội | Blog | Thiệp điện tử | Tìm kiếm | Thành viên | Sổ lịch