|
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)
Sao chép mã You'll find out:- 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:** 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[ctrlid+'_param_1'].document.getElementById("addMap").click(pasteMap);
- break;
Sao chép mã ** The secondcase 'pasteword':......break
You add these:- case 'googlemap'://
- //var mapsrc = window.frames[ctrlid + '_param_1'].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('[img]' + mapsrc + '[/img]', 0, 0, false, sel);
- }
- hideMenu('', 'win');
- break;
Sao chép mã + Open : \template\default\common\editor.css
Find:- #e_bold { background-position: 0 0; }
Sao chép mã Add:- #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:- <a id="{$editorid}_fls" title="{lang e_flash_title}">{lang e_flash}</a>
Sao chép mã Add:- <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: |
|