temtem Đăng vào 4-12-2011 10:52:51

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

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:function discuzcode(cmd, arg) You'll find out:if(in_array(cmd, ['sml', 'url', 'quote', 'code', 'free', 'hide', 'aud', 'vid', 'fls', 'attach', 'image', 'pasteword', Just add following code behind it:'googlemap'** Search function showEditorMenu(tag, params) , you'll find out the first string like this: case 'pasteword':......break
You add :                        case 'googlemap'://
                        stitle = 'Insert Google Map';
                        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>';
                        menuwidth = 600;
                        menupos = '00';
                        menutype = 'win';
                        //var mapurl=this.frames.document.getElementById("addMap").click(pasteMap);
                        break;        ** The second case 'pasteword':......break
You add these:                        case 'googlemap'://
                                //var mapsrc = window.frames.document.getElementById("mapurl").value;       
                                var mapsrc = document.getElementById(ctrlid + '_param_1').contentWindow.document.getElementById("mapurl").value;
                                var str = '<img src=' + mapsrc + ' border=0 />';
                                if(wysiwyg) {
                                insertText(str, str.length, 0, false, sel);
                                }else {
                                insertText('' + mapsrc + '', 0, 0, false, sel);
                                }
                                hideMenu('', 'win');
                                break;        + Open : \template\default\common\editor.css
Find:#e_bold                        { background-position: 0 0; }Add:    #e_googlemap { background:transparent url({STATICURL}image/common/map.gif) no-repeat 0 0; overflow: hidden;background-position: 5px 1px;}+ Open: \template\default\forum\post_editor_body.htm
Find:                                        <a id="{$editorid}_fls" title="{lang e_flash_title}">{lang e_flash}</a>Add:<a id="{$editorid}_googlemap" title="Insert Google map">Map</a>+ Upload the googlemap folder to your root forum.
+ Update cache & Enjoy ^^
+ Download:
Trang: [1]
Xem phiên bản đầy đủ: Add static Google map into thread. Chèn bản đồ vào bài viết