Jump to content


Tạo nút chèn Media,Flash,Youtube trong IPC 2.3.x


  • Bạn không được tạo chủ đề mới
  • Please log in to reply
No replies to this topic

#1 kenshinvnu

kenshinvnu

    Newbie

  • Thành viên
  • Pip
  • 1 Bài viết:
  • Joined 11-December 08
  • Reputation: 0

    Posted 11 December 2008 - 01:34 AM

    Media, Flash, Real, YouTube, Google Video with buttons in your post
    Version: 2
    Description: Allows you to insert Media, Flash, Real, YouTube, Google Video, Clips from Clip.vn (wma, wmv, mp3, swf, rm, ...) with buttons in your post.
    Compatibility: IPB v2.2.x & IPB 2.3.x
    By zero84vn
    Contact me: zero84ls(at)gmail.com

    Log in to your ACP --> LOOK & FEEL --> click on the options button beside a skin
    --> click Edit Template HTML --> click Post / PM Editor --> click ips_editor:

    Find:
    <td><div class="rte-normal" id="{$editor_id}_cmd_ipb_code"><img src="{$images_path}rte-code-button.png"  alt="{$this->ipsclass->lang['js_rte_lite_code']}" title="{$this->ipsclass->lang['js_rte_lite_code']}"></div></td>
    			</tr>
    Add below:
    <tr><td><div class="rte-normal" id="{$editor_id}_cmd_insertyoutube"><img src="{$images_path}cool_media/youtube.gif"  alt="{$this->ipsclass->lang['js_rte_lite_youtube']}" title="{$this->ipsclass->lang['js_rte_lite_youtube']}"></div></td>
    <td><div class="rte-normal" id="{$editor_id}_cmd_insertgvideo"><img src="{$images_path}cool_media/gvideo.gif"  alt="{$this->ipsclass->lang['js_rte_lite_gvideo']}" title="{$this->ipsclass->lang['js_rte_lite_gvideo']}"></div></td>
    <td><div class="rte-normal" id="{$editor_id}_cmd_insertmedia"><img src="{$images_path}cool_media/media.gif"  alt="{$this->ipsclass->lang['js_rte_lite_media']}" title="{$this->ipsclass->lang['js_rte_lite_media']}"></div></td>
    <td><div class="rte-normal" id="{$editor_id}_cmd_insertflash"><img src="{$images_path}cool_media/flash.gif"  alt="{$this->ipsclass->lang['js_rte_lite_flash']}" title="{$this->ipsclass->lang['js_rte_lite_flash']}"></div></td>
    <td><div class="rte-normal" id="{$editor_id}_cmd_insertclipvn"><img src="{$images_path}cool_media/clipvn.gif"  alt="{$this->ipsclass->lang['js_rte_lite_clipvn']}" title="{$this->ipsclass->lang['js_rte_lite_clipvn']}"></div></td></tr>
    Find:
    <td><div class="rte-normal" id="{$editor_id}_cmd_ipb_code"><img src="{$images_path}rte-code-button.png"  alt="{$this->ipsclass->lang['js_rte_lite_code']}" title="{$this->ipsclass->lang['js_rte_lite_code']}"></div></td>
    Add below:
    <td><div class="rte-normal" id="{$editor_id}_cmd_insertreal"><img src="{$images_path}cool_media/real.gif"  alt="{$this->ipsclass->lang['js_rte_lite_real']}" title="{$this->ipsclass->lang['js_rte_lite_real']}"></div></td>
    Save Templete Bit !
    Open ./jscripts/ips_text_editor.js.
    Find:
    this.init();}function ips_editor_events(){}ips_editor_events.prototype.button_onmouse_event=function(e)
    Add before:
    this.insertmedia=function(){var _text=this.get_selection();_text=_text.replace( /\n|\r|<br \/>/g,'');if(_text.match( /(<a href|\[media)/ig)){this.format_text(false);}else{var _url=prompt(ipb_global_lang['editor_media_autoplay'],'1');if(!_url||_url==null){return false;}_text=_text?_text:prompt(ipb_global_lang['editor_media_url'],'http://');if(!_text||_text==null){return false;}this.wrap_tags('media',_url,_text);}};this.insertflash=function(){var _text=this.get_selection();_text=_text.replace( /\n|\r|<br \/>/g,'');if(_text.match( /(<a href|\[flash)/ig)){this.format_text(false);}else{var _url=prompt(ipb_global_lang['editor_flash_size'],'500');if(!_url||_url==null){return false;}_text=_text?_text:prompt(ipb_global_lang['editor_flash_url'],'http://');if(!_text||_text==null){return false;}this.wrap_tags('flash',_url,_text);}};this.insertreal=function(){var _text=this.get_selection();_text=_text.replace( /\n|\r|<br \/>/g,'');if(_text.match( /(<a href|\[real)/ig)){this.format_text(false);}else{var _url=prompt(ipb_global_lang['editor_real_autoplay'],'1');if(!_url||_url==null){return false;}_text=_text?_text:prompt(ipb_global_lang['editor_real_url'],'http://');if(!_text||_text==null){return false;}this.wrap_tags('real',_url,_text);}};this.insertyoutube=function(){var _text=this.get_selection();_text=_text.replace( /\n|\r|<br \/>/g,'');if(_text.match( /(<a href|\[youtube)/ig)){this.format_text(false);}else{var _url=prompt(ipb_global_lang['editor_youtube_size'],'400');if(!_url||_url==null){return false;}_text=_text?_text:prompt(ipb_global_lang['editor_youtube_url'],'Insert Google Video ID here, ex: bBLc1TKWXtM');if(!_text||_text==null){return false;}this.wrap_tags('youtube',_url,_text);}};this.insertclipvn=function(){var _text=this.get_selection();_text=_text.replace( /\n|\r|<br \/>/g,'');if(_text.match( /(<a href|\[clipvb)/ig)){this.format_text(false);}else{var _url=prompt(ipb_global_lang['editor_clipvn_size'],'400');if(!_url||_url==null){return false;}_text=_text?_text:prompt(ipb_global_lang['editor_clipvn_url'],'Insert clipvn ID here, ex: mP');if(!_text||_text==null){return false;}this.wrap_tags('clipvn',_url,_text);}};this.insertgvideo=function(){var _text=this.get_selection();_text=_text.replace( /\n|\r|<br \/>/g,'');if(_text.match( /(<a href|\[gvideo)/ig)){this.format_text(false);}else{var _url=prompt(ipb_global_lang['editor_gvideo_size'],'400');if(!_url||_url==null){return false;}_text=_text?_text:prompt(ipb_global_lang['editor_gvideo_url'],'Insert Google Video ID here, ex: -7233445036972827652');if(!_text||_text==null){return false;}this.wrap_tags('gvideo',_url,_text);}};
    Open ./cache/lang_cache/en/lang_editors.php:
    Find:
    <?php
    
    $lang = array (
    Add below:
    // Media, Flash, Real, Google Video, YouTube (v2) in post, upgrade and code by zero84vn
    'js_rte_lite_media'				=> "Insert your media",
    'js_rte_lite_flash'				=> "Insert your Flash",
    'js_rte_lite_real'				=> "Insert your Real",
    'js_rte_lite_youtube'				=> "Insert your YouTube",
    'js_rte_lite_gvideo'				=> "Insert your Goolge Video",
    'js_rte_lite_clipvn'				=> "Insert Clip VN",
    Open ./cache/lang_cache/en/lang_javascript.js:
    Find:
    // EDITORS
    Add below:
    // Media, Flash, Real, Google Video, YouTube (v2) in post, upgrade and code by zero84vn
    		'editor_media_autoplay'		 : 'AUTO PLAY MEDIA ? Yes: 1; No: 0',
    		'editor_media_url'			  : 'Insert MEDIA URL',
    		'editor_flash_size'			 : 'Insert FLASH SIZE',
    		'editor_flash_url'			  : 'Insert FLASH URL',
    		'editor_real_autoplay'		 : 'AUTO PLAY REAL ? Yes: 1; No: 0',
    		'editor_real_url'		 : 'Insert REAL URL',
    		'editor_youtube_size'			  : 'Insert YouTube Size',
    		'editor_youtube_url'			  : 'Insert YouTube ID (Example: bBLc1TKWXtM)',
    		'editor_gvideo_size'			  : 'Insert Google Video SIZE',
    		'editor_gvideo_url'			  : 'Insert Google Video ID (Example: -7233445036972827652)',
    		'editor_clipvn_size'			  : 'Insert Clipvn Size',
    		'editor_clipvn_url'			  : 'Insert Clipvn ID (Example: mP)',
    Now it' time to add new BBcode. Log in to your ACP --> MANAGEMENT --> Add New BBCode:
    MEDIA
    Custom BBCode Title: Media
    Custom BBCode Description: Insert Media in your post
    Custom BBCode Example:
    [media="1"]url[/media]
    Custom BBCode Tag: media
    Use Option in tag?: Yes
    Custom BBCode Replacement:
    <CENTER><OBJECT id=Player height=320 width=350
    			classid=clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6><PARAM NAME="URL" VALUE='{content}'>
    <PARAM NAME="rate" VALUE="1">
    <PARAM NAME="balance" VALUE="0">
    <PARAM NAME="currentPosition" VALUE="1">
    <PARAM NAME="defaultFrame" VALUE="">
    <PARAM NAME="playCount" VALUE="1">
    <PARAM NAME="autoStart" VALUE="{option}">
    <PARAM NAME="loop" VALUE="-1">
    <PARAM NAME="currentMarker" VALUE="0">
    <PARAM NAME="invokeURLs" VALUE="-1">
    <PARAM NAME="baseURL" VALUE="">
    <PARAM NAME="volume" VALUE="100">
    <PARAM NAME="mute" VALUE="0">
    <PARAM NAME="uiMode" VALUE="full">
    <PARAM NAME="stretchToFit" VALUE="0">
    <PARAM NAME="windowlessVideo" VALUE="0">
    <PARAM NAME="enabled" VALUE="-1">
    <PARAM NAME="enableContextMenu" VALUE="0">
    <PARAM NAME="fullScreen" VALUE="0">
    <PARAM NAME="ShowDisplay" VALUE="0">
    <PARAM NAME="ShowStatusBar" VALUE="0">
    <PARAM NAME="SAMIStyle" VALUE="">
    <PARAM NAME="SAMILang" VALUE="">
    <PARAM NAME="SAMIFilename" VALUE="">
    <PARAM NAME="captioningID" VALUE="">
    <PARAM NAME="enableErrorDialogs" VALUE="0">
    <PARAM NAME="_cx" VALUE="7938">
    <PARAM NAME="_cy" VALUE="6482">
    
    <embed type='application/x-mplayer2' src='{content}' height="400" width="450" autostart="{option}"></embed>
    
    </OBJECT></CENTER>
    Click Edit BBcode !
    FLASH:
    Custom BBCode Title: Flash
    Custom BBCode Description: Insert Flash in your post
    Custom BBCode Example:
    [Flash="500"]url[/Flash]
    Custom BBCode Tag: Flash
    Use Option in tag?: Yes
    Custom BBCode Replacement:
    <center> <table border=1><tr><td><embed type='application/x-shockwave-flash' src='{content}' width='{option}' height='{option}'></embed></td></tr></table></center>
    REAL
    Custom BBCode Title: Real
    Custom BBCode Description: Insert Real in your post
    Custom BBCode Example:
    [real=1]url[/real]
    Custom BBCode Tag: real
    Use Option in tag?: Yes
    Custom BBCode Replacement:
    <center><object classid='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6'>
    <param name='url' value='{content}'><param name='volume' value='100'>
    <param name='autostart' value='{option}'>
    <embed type='audio/x-pn-realaudio-plugin' width='260' height='60' src='{content}' controls='all' autostart='{option}'></object></center>
    YouTube
    Custom BBCode Title: YouTube
    Custom BBCode Description: Insert YouTube in your post
    Custom BBCode Example:
    [youtube="400"]YouTube ID here[/youtube]
    Custom BBCode Tag: youtube
    Use Option in tag?: Yes
    Custom BBCode Replacement:
    <center><object width="425" height="350"> <param value="http://www.youtube.com/v/{content}" name="movie"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{content}" type="application/x-shockwave-flash" wmode="transparent" width="{option}" height="{option}"></embed></object></center>
    Google Video
    Custom BBCode Title: Google Video
    Custom BBCode Description: Insert Google Video in your post
    Custom BBCode Example:
    [gvideo="400"]Google Video ID here[/gvideo]
    Custom BBCode Tag: gvideo
    Use Option in tag?: Yes
    Custom BBCode Replacement:
    <center><object width="425" height="350"><param name="wmode" value="transparent"></param><embed src="http://video.google.com/googleplayer.swf?docid={content}" type="application/x-shockwave-flash" wmode="transparent" width="{option}" height="{option}"></embed></object></center>
    Clip.Vn
    Custom BBCode Title: ClipVn
    Custom BBCode Description: Insert Clip from Clip.vn in your post
    Custom BBCode Example:
    [clipvn="400"]ID of Clipvn file[/clipvn]
    Custom BBCode Tag: clipvn
    Use Option in tag?: Yes
    Custom BBCode Replacement:
    <center><object width="448" height="372"><param name="movie" value="http://www.clip.vn/w/{content},vn,0"/><param name="allowFullScreen" value="true"/><embed src="http://www.clip.vn/w/{content},vn,0" type="application/x-shockwave-flash" allowFullScreen="true" width="{option}" height="{option}"></embed></object></center>
    Now download the folder "cool_media.zip" and unzip, then upload to ./style_images/your images style/folder_editor_images/
    http://www.mediafire.com/?ftm7uxezlyt
    http://rapidshare.com/files/51755453/cool_media.zip.html



    * Notice:
    - Only insert ID of youtube, googlevideo, clipvn file, not full URL.
    - Where is their ID ?
    A full url of YouTube:


    Its ID: Hm2BdCbZkKY
    A full url of Google Video:
    http://video.google....596276754701357

    Its ID: 3203596276754701357
    A full url of Clip.vn:
    http://www.clip.vn/w...g-mat-thoi.html

    Its ID: y3x

    If you want to insert a video from a shared video website in your post, just give me a url of it.



    Kính mời các đồng nghiệp xa gần đóng góp cho cuộc thi Chất Động Pangaea lần thứ XIII - năm 2016 Thời gian bắt đầu cuộc thi: 06/03/2016

    Facebook Comments



    Bài viết tương tự Collapse