웹마스터 팁

적용하시기전 먼저 http://www.zeroboard.com/16700971 반드시 읽어 주세요.

1.modules/editor/editor.admin.controller.php

line161 부분에                 소스를 삽입한다.
          $editor_config->enable_autosave = Context::get('enable_autosave');
          $editor_config->enable_only_upload_editor = Context::get('enable_only_upload_editor');

            if($editor_config->enable_height_resizable != 'Y') $editor_config->enable_height_resizable = 'N';
            if($editor_config->enable_comment_height_resizable != 'Y') $editor_config->enable_comment_height_resizable = 'N';
            if($editor_config->enable_autosave != 'Y') $editor_config->enable_autosave = 'N';
            if($editor_config->enable_only_upload_editor != 'Y'+ '+ ') $editor_config->enable_only_upload_editor = 'N';

2. modules/editor/editor.model.php

line45 부분에                 소스를 삽입한다.
            if(!$editor_config->editor_height) $editor_config->editor_height = 500;
            if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 120;
            if($editor_config->enable_height_resizable!='N') $editor_config->enable_height_resizable= "Y";
            if($editor_config->enable_comment_height_resizable!='Y') $editor_config->enable_comment_height_resizable= "N";
            if($editor_config->enable_autosave!='N') $editor_config->enable_autosave = "Y";
            if($editor_config->enable_only_upload_editor != 'Y') $editor_config->enable_only_upload_editor = 'N';

            return $editor_config;
}

        /**
         * @brief 에디터 template을 return
         * upload_target_srl은 글의 수정시 호출하면 됨.
         * 이 upload_target_srl은 첨부파일의 유무를 체크하기 위한 루틴을 구현하는데 사용됨.
         **/
        function getEditor($upload_target_srl = 0, $option = null) {
            /**
             * 기본적인 에디터의 옵션을 정리
             **/

            // 에디터 업로드만 사용 옵션 설정
            if(!$option->enable_only_upload_editor) $enable_only_upload_editor = false;
            else $enable_only_upload_editor = true;
    

 line 166
 /**
             * 에디터 컴포넌트 체크
             **/
            if($enable_component) {
                if(!Context::get('component_list')) {
                    $component_list = $this->getComponentList();
                    Context::set('component_list', $component_list);
                }
            }
            Context::set('enable_component', $enable_component);
            Context::set('enable_default_component', $enable_default_component);

    /**
             * 에디터 업로드 기능만 가능한지 변수 설정
             **/
            Context::set('enable_only_upload_editor', $enable_only_upload_editor);
     

line 220
function getModuleEditor($type = 'document', $module_srl, $upload_target_srl, $primary_key_name, $content_key_name) {
            // 지정된 모듈의 에디터 설정을 구해옴
            $editor_config = $this->getEditorConfig($module_srl);

            // type에 따른 설정 정리
            if($type == 'document') {
                $config->editor_skin = $editor_config->editor_skin;
                $config->upload_file_grant = $editor_config->upload_file_grant;
                $config->enable_default_component_grant = $editor_config->enable_default_component_grant;
                $config->enable_component_grant = $editor_config->enable_component_grant;
                $config->enable_html_grant = $editor_config->enable_html_grant;
                $config->editor_height = $editor_config->editor_height;
                $config->enable_height_resizable = $editor_config->enable_height_resizable;
                $config->enable_autosave = $editor_config->enable_autosave;
               $config->enable_only_upload_editor = 'N';
           } elseif($type == 'extra_vars'){
               $config->enable_only_upload_editor = 'Y';
            } elseif($type == '+ 'comment') {
                $config->editor_skin = $editor_config->comment_editor_skin;
                $config->upload_file_grant = $editor_config->comment_upload_file_grant;
                $config->enable_default_component_grant = $editor_config->enable_comment_default_component_grant;
                $config->enable_component_grant = $editor_config->enable_comment_component_grant;
                $config->enable_html_grant = $editor_config->enable_comment_html_grant;
                $config->editor_height = $editor_config->comment_editor_height;
                $config->enable_height_resizable = $editor_config->enable_comment_height_resizable;
                $config->enable_autosave = 'N';
               $config->enable_only_upload_editor = 'N';
            }

line 293
 // HTML 편집 권한
            $enable_html = false;
            if(count($config->enable_html_grant)) {
                foreach($group_list as $group_srl => $group_info) {
                    if(in_array($group_srl, $config->enable_html_grant)) {
                        $enable_html = true;   
                        break;
                    }
                }
            } else $enable_html = true;

            if($enable_html) $option->disable_html = false;
            else $option->disable_html = true;

   // 에디터 업로드만 설정
            $option->enable_only_upload_editor = $config->enable_only_upload_editor=='Y'?true:false;
     

3. moudles/editor/tpl/js/uploader.js

line 247 부분                   소스를 삽입한다.
// 이미지 파일의 경우
    } else if(/\.(jpg|jpeg|png|gif)$/i.test(uploaded_filename)) {
        html = "<img src=\""+uploaded_filename+"\" border=\"0\" width=\"110\" height=\"110\" onclick=\"copyContent(this.href);return false\" />";

line 끝부분에 아래의                  소스를 삽입한다.
function copyContent(trb)
{
    var IE=(document.all)?true:false;  
if (IE) {  
if(confirm("이 글의 주소를 클립보드에 복사하시겠습니까?"))  
window.clipboardData.setData("Text", trb);  
}  
};

<<보충설명>>
 1> 이 소스는 글쓰기 폼에서 이미지 파일이 업로드 되면 미리보기가 지원되는데, 미리보기 이미지를 클릭하면 업로드된 파일의 위치를 클립보드에 복사 합니다.

2>  위의 방법으로 복사된 이미지 파일의 주소를  확장변수의 이미지 주소창에 사용자가 붙여넣기하여  사용하기 위함입니다.

4. modules/editor/tpl/editor_module_config.html

전체 파일입니다. 조건식을 넣어 게시글/댓글의 위지웍 에디터 활성/비활성에 따라 추가설정에서 게시글/댓글의 활성/비활성 시킴.

<!--@if($module_info->enable_comment_editor !='N' || $module_info->enable_editor!='N')-->
<!--%import("filter/insert_editor_module_config.xml")-->

<form action="./" method="post" onsubmit="return procFilter(this, insert_editor_module_config)">
<input type="hidden" name="target_module_srl" value="{$module_info->module_srl?$module_info->module_srl:$module_srls}" />

    <table cellspacing="0" class="adminTable">
    <col width="150" />
   
<!--@if($module_info->enable_editor!='N')--><col /><!--@end-->
   
<!--@if($module_info->enable_comment_editor !='N')--><col /><!--@end-->
    <caption>{$lang->editor}</caption>
    <tr>
        <th scope="col">&nbsp;</th>
       
<!--@if($module_info->enable_editor!='N')--><th scope="col">{$lang->document}</th><!--@end-->
       
<!--@if($module_info->enable_comment_editor !='N')--><th scope="col">{$lang->comment}</th><!--@end-->
    </tr>
    <tr>   
        <th rowspan="2">{$lang->editor_skin}</th>
       
<!--@if($module_info->enable_editor!='N')--><td>
            <select name="editor_skin">
            <
!--@foreach($editor_skin_list as $editor)-->
            <option value="{$editor}" <
!--@if($editor==$editor_config->editor_skin)-->selected="selected"<!--@end-->>{$editor}</option>
            <
!--@end-->
            </select> 
        </td
><!--@end-->
        <
!--@if($module_info->enable_comment_editor !='N')--><td>
            <select name="comment_editor_skin">
            <
!--@foreach($editor_skin_list as $editor)-->
            <option value="{$editor}" <
!--@if($editor==$editor_config->comment_editor_skin)-->selected="selected"<!--@end-->>{$editor}</option>
            <
!--@end-->
            </select>
        </td
><!--@end-->
    </tr>
    <tr>
        <td
<!--@if($module_info->enable_comment_editor !='N' && $module_info->enable_editor!='N')-->colspan="2"<!--@end-->>{$lang->about_editor_skin}</td>
    </tr>
    <tr>   
        <th rowspan="2">{$lang->enable_html_grant}</th>
       
<!--@if($module_info->enable_editor!='N')--><td>
            <
!--@foreach($group_list as $k => $v)-->
            <input type="checkbox" name="enable_html_grant" value="{$k}" id="enable_html_{$k}" <
!--@if(in_array($k, $editor_config->enable_html_grant))-->checked="checked"<!--@end-->/> <label for="enable_html_{$k}">{$v->title}</label> <br />
            <
!--@end-->
        </td>
<!--@end-->
        <
!--@if($module_info->enable_comment_editor !='N')--><td>
            <
!--@foreach($group_list as $k => $v)-->
            <input type="checkbox" name="enable_comment_html_grant" value="{$k}" id="enable_comment_html_{$k}" <
!--@if(in_array($k, $editor_config->enable_comment_html_grant))-->checked="checked"<!--@end-->/> <label for="enable_comment_html_{$k}">{$v->title}</label> <br />
            <
!--@end-->
        </td>
<!--@end-->
    </tr>
    <tr>
        <td
<!--@if($module_info->enable_comment_editor !='N' && $module_info->enable_editor!='N')-->colspan="2"<!--@end-->>{$lang->about_enable_html_grant}</td>
    </tr>
    <tr>   
        <th rowspan="2">{$lang->upload_file_grant}</th>
       
<!--@if($module_info->enable_editor!='N')--><td>
            <
!--@foreach($group_list as $k => $v)-->
            <input type="checkbox" name="upload_file_grant" value="{$k}" id="fileupload_{$k}" <
!--@if(in_array($k, $editor_config->upload_file_grant))-->checked="checked"<!--@end-->/> <label for="fileupload_{$k}">{$v->title}</label> <br />
            <
!--@end-->
        </td>
<!--@end-->
        <
!--@if($module_info->enable_comment_editor !='N')--><td>
            <
!--@foreach($group_list as $k => $v)-->
            <input type="checkbox" name="comment_upload_file_grant" value="{$k}" id="comment_fileupload_{$k}" <
!--@if(in_array($k, $editor_config->comment_upload_file_grant))-->checked="checked"<!--@end-->/> <label for="comment_fileupload_{$k}">{$v->title}</label> <br />
            <
!--@end-->
        </td>
<!--@end-->
    </tr>
    <tr>
        <td
<!--@if($module_info->enable_comment_editor !='N' && $module_info->enable_editor!='N')-->colspan="2"<!--@end-->>{$lang->about_upload_file_grant}</td>
    </tr>
    <tr>   
        <th rowspan="2">{$lang->enable_default_component_grant}</th>
       
<!--@if($module_info->enable_editor!='N')--><td>
            <
!--@foreach($group_list as $k => $v)-->
            <input type="checkbox" name="enable_default_component_grant" value="{$k}" id="default_componen_{$k}" <
!--@if(in_array($k, $editor_config->enable_default_component_grant))-->checked="checked"<!--@end-->/> <label for="default_componen_{$k}">{$v->title}</label> <br />
            <
!--@end-->
        </td>
<!--@end-->
        <
!--@if($module_info->enable_comment_editor !='N')--><td>
            <
!--@foreach($group_list as $k => $v)-->
            <input type="checkbox" name="enable_comment_default_component_grant" value="{$k}" id="comment_default_component_{$k}" <
!--@if(in_array($k, $editor_config->enable_comment_default_component_grant))-->checked="checked"<!--@end-->/> <label for="comment_default_component_{$k}">{$v->title}</label> <br />
            <
!--@end-->
        </td>
<!--@end-->
    </tr>
    <tr>
        <td
<!--@if($module_info->enable_comment_editor !='N' && $module_info->enable_editor!='N')-->colspan="2"<!--@end-->>{$lang->about_default_component_grant}</td>
    </tr>
    <tr>   
        <th rowspan="2">{$lang->enable_component_grant}</th>
       
<!--@if($module_info->enable_editor!='N')--><td>
            <
!--@foreach($group_list as $k => $v)-->
            <input type="checkbox" name="enable_component_grant" value="{$k}" id="componen_{$k}" <
!--@if(in_array($k, $editor_config->enable_component_grant))-->checked="checked"<!--@end-->/> <label for="componen_{$k}">{$v->title}</label> <br />
            <
!--@end-->
        </td>
<!--@end-->
        <
!--@if($module_info->enable_comment_editor !='N')--><td>
            <
!--@foreach($group_list as $k => $v)-->
            <input type="checkbox" name="enable_comment_component_grant" value="{$k}" id="comment_component_{$k}" <
!--@if(in_array($k, $editor_config->enable_comment_component_grant))-->checked="checked"<!--@end-->/> <label for="comment_component_{$k}">{$v->title}</label> <br />
            <
!--@end-->
        </td>
<!--@end-->
    </tr>
    <tr>
        <td
<!--@if($module_info->enable_comment_editor !='N' && $module_info->enable_editor!='N')-->colspan="2"<!--@end-->>{$lang->about_component_grant}</td>
    </tr>
    <tr>   
        <th rowspan="2">{$lang->editor_height}</th>
       
<!--@if($module_info->enable_editor!='N')--><td>
            <input type="text" name="editor_height" value="{$editor_config->editor_height}" class="inputTypeText w80" />px
        </td>
<!--@end-->
        <
!--@if($module_info->enable_comment_editor !='N')--><td>
            <input type="text" name="comment_editor_height" value="{$editor_config->comment_editor_height}" class="inputTypeText w80" />px
        </td>
<!--@end-->
    </tr>
    <tr>
        <td
<!--@if($module_info->enable_comment_editor !='N' && $module_info->enable_editor!='N')-->colspan="2"<!--@end-->>{$lang->about_editor_height}</td>
    </tr>
    <tr>   
        <th rowspan="2">{$lang->height_resizable}</th>
       
<!--@if($module_info->enable_editor!='N')--><td>
            <input type="checkbox" value="Y" name="enable_height_resizable" <
!--@if($editor_config->enable_height_resizable=='Y')-->checked="checked"<!--@end-->/>
        </td>
<!--@end-->
        <
!--@if($module_info->enable_comment_editor !='N')--><td>
            <input type="checkbox" value="Y" name="enable_comment_height_resizable" <
!--@if($editor_config->enable_comment_height_resizable=='Y')-->checked="checked"<!--@end-->/>
        </td>
<!--@end-->
    </tr>
    <tr>
        <td
<!--@if($module_info->enable_comment_editor !='N' && $module_info->enable_editor!='N')-->colspan="2"<!--@end-->>{$lang->about_editor_height_resizable}</td>
    </tr>
 
<!--@if($module_info->enable_editor!='N')-->
    <tr>   
        <th rowspan="2">{$lang->enable_autosave}</th>
        <td
<!--@if($module_info->enable_comment_editor !='N' && $module_info->enable_editor!='N')-->colspan="2"<!--@end-->><input type="checkbox" value="Y" name="enable_autosave" <!--@if($editor_config->enable_autosave=='Y')-->checked="checked"<!--@end-->/></td>
    </tr>
    <tr>
        <td
<!--@if($module_info->enable_comment_editor !='N' && $module_info->enable_editor!='N')-->colspan="2"<!--@end-->>{$lang->about_enable_autosave}</td>
    </tr>
 
<!--@end-->
    <tr>
        <th class="button"
<!--@if($module_info->enable_comment_editor !='N'+ ' && $module_info->enable_editor!='N')-->colspan="3"<!--@else-->colspan="2"<!--@end-->>
            <span class="button"><input type="submit" value="{$lang->cmd_save}"/></span>
        </th>
    </tr>
    </table>

</form>

<div class="gap1"></div>
<!--@end-->

5. module/editor/skins/default/editor.html

line 9 부분에                 소스를 삽입한다.
<!-- 자동저장용 폼 -->
<!--@if($enable_autosave && !$enable_only_upload_editor)-->
<input type="hidden" name="_saved_doc_title" value="{htmlspecialchars($saved_doc->title)}" />
<input type="hidden" name="_saved_doc_content" value="{htmlspecialchars($saved_doc->content)}" />
<input type="hidden" name="_saved_doc_message" value="{$lang->msg_load_saved_doc}" />
<!--@end-->

<!-- 에디터 -->
<div class="xeEditor">
<!--@if(!$enable_only_upload_editor
)-->

line 142 부분에                 소스를 삽입한다.
<!-- 에디터 크기 조절 bar -->
    <
!--@if($enable_resizable)-->
    <div class="textAreaDragIndicator"><div class="textAreaDragIndicatorBar" id="editor_drag_bar_{$editor_sequence}"></div></div>
    <
!--@end-->
 
<!--@else-->
 <!-- 에디터 출력 -->
 <div><iframe id="editor_iframe_{$editor_sequence}" frameborder="0" height="0" style="background-color:transparent;" allowTransparency="true"></iframe></div>
    <textarea id="editor_textarea_{$editor_sequence}" class="editor_iframe_textarea" style="display:none; height:0"  rows="10" cols="10"></textarea>
 <
!--@end
-->

line 169 부분에                 소스를 삽입한다.
<!-- 파일 업로드 영역 -->
            <div class="fileListArea">
                <select id="uploaded_file_list_{$editor_sequence}" multiple="multiple" size="5" class="fileList" onclick="editor_preview(this, '{$editor_sequence}');"></select>
            </div>
            <div class="fileUploadControl">
                <a href="#" onclick="editor_upload_file('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->upload_file}</span></a>
                <a href="#" onclick="editor_remove_file('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->delete_selected}</span></a>
    <!--@if(!$enable_only_upload_editor)-->
                <a href="#" onclick="editor_insert_file('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->link_file}</span></a><!--@end-->
            </div>
제목 글쓴이 날짜
''권한이 없습니다'' 라는 문구를 조금 더 부드럽게 바꾸기 [3] file RainSky 2008.03.21
양력/음력DB 홈페이지에 사용하기 [2] 감뿌리 2008.03.29
탭 형태 문서출력에서 목록수 지정하기. [3] Zerode 2008.03.31
카테고리부분의 너비조절하기 [3] file gajagu 2008.04.01
갓난아기 상태의 제로보드 유저를 위한 팁. [2] font 2008.04.01
게시판을 외부레이아웃에 넣기 [4] file 박봉수610 2008.04.03
환율 계산 팝업창 띄우기 [9] file RainSky 2008.04.03
플래시로 페이지에 랜덤 이미지 돌리기 [3] ☜ TeRy ☞ 2008.04.04
최근 이미지 목록 + 라이트박스 [6] file 베니 2008.04.04
사각박스 코너를 이미지없이 둥글게 만드는법 [5] 느까끼 2008.04.07
플래시 컨트럴 활성화하라는 메시지 없애기 [4] file 달구벌 2008.04.08
에디터 사용 옵션으로 처리하기[BOARD MODULE][ver 1.0.1][Page4-4] 대암지기 2008.04.08
에디터 사용 옵션으로 처리하기[EDITOR MODULE][ver 1.0.1][Page4-3] 대암지기 2008.04.08
에디터 사용 옵션으로 처리하기[기타 MODULE][ver 1.0.1][Page4-2] 대암지기 2008.04.08
에디터 사용 옵션으로 처리하기[안내][ver 1.0.1][Page4-1] [2] file 대암지기 2008.04.08
DIV라운드 박스를 제로보드 스킨에 적용하는 방법 [4] file 팔공산 2008.04.09
제로보드 설치 후 뭘 어떻해야 할지 깜깜할때 dharma0999 2008.04.09
[3-1차 수정]확장변수 자유롭게 내 마음대로 게시글 리스트에 표현 합시다!![ver1.0.1] [16] file 대암지기 2008.04.09
신청서 양식의 게시판에서 관리자가 아니면 게시판 리스트 안보이게 하기. [1] burster 2008.04.10
404 에러 페이지를 만들어 보자 [2] hangoon 2008.04.11