Diễn đàn Trái Tim Yên Bái 2024

 Quên mật khẩu
 Đăng ký
Xem: 1376|Trả lời: 0
Thu gọn cột thông tin

[Discuz X2] Chèn static Googlemap vào trong bài viết Discuz! X2 (rất hay)

[Lấy địa chỉ]
  • Tâm trạng hàng ngày
    Hạnh phúc
    4-12-2011 11:39 AM
  • Đã viết: 1 ngày

    [LV.1]Spam 1

    Đăng lúc 4-12-2011 11:42 AM | Xem tất |Chế độ đọc

    Mời bạn đăng ký để giao lưu kết bạn nhé <3

    Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký

    x
    Lâu lâu mới vào discuz.net và mình tìm được 1 mod ưng ý: Static Google Map . Tiện ích của mod này: tìm kiếm địa danh ( shop, địa điểm du lịch...) định vị bằng Google Map và chèn trực tiếp vào bài viết luôn. Hi vọng Mod này giúp ích cho nhiều bạn webmaster .
    ===============
    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

                                   
    Đăng nhập/Đăng ký mở rộng

    IMG URL: http://maps.google.com/maps/api/staticmap?center=16.30597022823268,107.48618337499998&zoom=5&size=512x320&maptype=roadmap&markers=21.09122635926271,105.728370875&sensor=false
    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%" 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: Google map for Discuz! X2
    googlemap-discuzx2-20111204.zip (46.45 KB, Lượt tải về: 1)
    Bạn phải đăng nhập mới được đăng bài Đăng nhập | Đăng ký

    Quy tắc điểm

    Đóng

    Thông báoTrước /1 Sau

    Phòng tối|Lưu trữ|Diễn đàn Yên Bái 2024 Community Guidelines |

    GMT+7, 6-12-2026 09:58 AM , Processed in 0.023705 second(s), 24 queries .

    Powered by Discuz! X3.4

    © 2001-2013 Comsenz Inc.

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