Nét Đẹp Việt Nam

 Quên mật khẩu
 Register
Xem: 3391|Trả lời: 0
In Chủ đề trước Tiếp theo

Add static Google map into thread. Chèn bản đồ vào bài viết

[Lấy địa chỉ]
Nhảy đến trang chỉ định
1#
Discuz! Plugin : Static Google Map for Discuz! X2
Author: Kisson
Transcoded : Vic.0 ( UTF-8 Vietnamese )
Ratings: A Greate plugin for business & travel .

Usage: How to use this Plugin
1. Edit files:
\static\js\editor.js
\template\default\common\editor.css
\template\default\forum\post_editor_body.htm
2. Add Files
\googlemap
\static\image\common\map.gif
3.Modification steps:
+ Open : \static\js\editor.js
** Search:
  1. function discuzcode(cmd, arg)
Sao chép mã
You'll find out:
  1. if(in_array(cmd, ['sml', 'url', 'quote', 'code', 'free', 'hide', 'aud', 'vid', 'fls', 'attach', 'image', 'pasteword',
Sao chép mã
Just add following code behind it:
  1. 'googlemap'
Sao chép mã
** Search function showEditorMenu(tag, params) , you'll find out the first string like this:
case 'pasteword':......break

You add :
  1.                         case 'googlemap'://
  2.                         stitle = 'Insert Google Map';
  3.                         str = '<p class="px" style="height:390px"><iframe id="' + ctrlid + '_param_1" frameborder="0" style="width:100%;height:100%" onload="this.contentWindow.document.body.style.width=\'530px\';this.onload=null" src="./googlemap/googlemap.html"></iframe></p><p class="xg2 pbn">Insert static Google Map!</p>';
  4.                         menuwidth = 600;
  5.                         menupos = '00';
  6.                         menutype = 'win';
  7.                         //var mapurl=this.frames[ctrlid+'_param_1'].document.getElementById("addMap").click(pasteMap);
  8.                         break;       
Sao chép mã
** The second
case 'pasteword':......break

You add these:
  1.                         case 'googlemap'://
  2.                                 //var mapsrc = window.frames[ctrlid + '_param_1'].document.getElementById("mapurl").value;       
  3.                                 var mapsrc = document.getElementById(ctrlid + '_param_1').contentWindow.document.getElementById("mapurl").value;
  4.                                 var str = '<img src=' + mapsrc + ' border=0 />';
  5.                                 if(wysiwyg) {
  6.                                 insertText(str, str.length, 0, false, sel);
  7.                                 }else {
  8.                                 insertText('[img]' + mapsrc + '[/img]', 0, 0, false, sel);
  9.                                 }
  10.                                 hideMenu('', 'win');
  11.                                 break;       
Sao chép mã
+ Open : \template\default\common\editor.css
Find:
  1. #e_bold                        { background-position: 0 0; }
Sao chép mã
Add:
  1.     #e_googlemap { background:transparent url({STATICURL}image/common/map.gif) no-repeat 0 0; overflow: hidden;background-position: 5px 1px;}
Sao chép mã
+ Open: \template\default\forum\post_editor_body.htm
Find:
  1.                                         <a id="{$editorid}_fls" title="{lang e_flash_title}">{lang e_flash}</a>
Sao chép mã
Add:
  1. <a id="{$editorid}_googlemap" title="Insert Google map">Map</a>
Sao chép mã
+ Upload the googlemap folder to your root forum.
+ Update cache & Enjoy ^^
+ Download:

Bài viết liên quan

Bạn phải đăng nhập mới được đăng bài Đăng nhập | Register

Quy tắc điểm

Phòng tối|iPhone|Archiver|G+|Youtube|Facebook|Twitter|Contact| Netdepviet.org

GMT+7, 19-4-2024 10:39 PM , Processed in 0.014517 second(s), 21 queries .

Powered by Discuz! X3.2

© 2006 Made with in Hanoi,Vietnam and Contents are published by all members

Trả lời nhanh Lên trên Trở lại danh sách