ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 그누보드 댓글 에디터 적용(댓글 수정,삭제,등록일 수정)
    그누보드 스킨 2021. 2. 16. 17:49

    /skin/view_comment.skin.php 상단 에디터 라이브러리 로드

     

    include_once(G5_EDITOR_LIB);

     

     

     

     

    <input type="hidden" value="<?php echo strstr($list[$i]['wr_option'],"secret"?>" id="secret_comment_<?php echo $comment_id ?>">

    밑에

     

    <input type="hidden" value="<?php echo $list[$i]['wr_datetime'?>" id="save_datetime_<?php echo $comment_id ?>">

    //등록일값 추가

     

     

    <script>

    var oEditors = [];

     

    function _editor() {

        nhn.husky.EZCreator.createInIFrame({

            oAppRef : oEditors,

            elPlaceHolder : "wr_content",

            sSkinURI : "/plugin/editor/smarteditor2/SmartEditor2Skin.html"

            htParams : {

                bUseToolbar : true,             // 툴바 사용 여부 (true:사용/ false:사용하지 않음)

                bUseVerticalResizer : true,     // 입력창 크기 조절바 사용 여부 (true:사용/ false:사용하지 않음)

                bUseModeChanger : true,         // 모드 탭(Editor | HTML | TEXT) 사용 여부 (true:사용/ false:사용하지 않음)

                //aAdditionalFontList : aAdditionalFontSet,     // 추가 글꼴 목록

                fOnBeforeUnload : function(){

                    //alert("완료!");

                }

            }, //boolean

            fOnAppLoad : function(){

                //예제 코드

                //oEditors.getById["ir1"].exec("PASTE_HTML", ["로딩이 완료된 후에 본문에 삽입되는 text입니다."]);

            },

            fCreator : "createSEditor2"

        });

    }

     

     

    //에디터를 재정의하여 수정시 에디터를 다시 로드하도록 함수 추가

     

     

    function comment_box(comment_idwork)

    {

        var el_id;

        // 댓글 아이디가 넘어오면 답변, 수정

        if (comment_id)

        {

            if (work == 'c')

                el_id = 'reply_' + comment_id;

            else

                el_id = 'edit_' + comment_id;

        }

        else

            el_id = 'bo_vc_w'

     

        if (save_before != el_id)

        {

            if (save_before)

            {

                document.getElementById(save_before).style.display = 'none';

                document.getElementById(save_before).innerHTML = '';

            }

     

            document.getElementById(el_id).style.display = '';

            document.getElementById(el_id).innerHTML = save_html;

            // 댓글 수정

            if (work == 'cu')

            {

                document.getElementById('wr_content').value = document.getElementById('save_comment_' + comment_id).value;

                  <!--추가-->

                document.getElementById('wr_datetime').value = document.getElementById('save_datetime_' + comment_id).value;

        <!--추가-->

                if (typeof char_count != 'undefined')

                    check_byte('wr_content''char_count');

                if (document.getElementById('secret_comment_'+comment_id).value)

                    document.getElementById('wr_secret').checked = true;

                else

                    document.getElementById('wr_secret').checked = false;

     

            }

     

            document.getElementById('comment_id').value = comment_id;

            document.getElementById('w').value = work;

     

            if(save_before)

                $("#captcha_reload").trigger("click");

     

            save_before = el_id;

        }

        <!--추가-->

        if(comment_id_editor();

        <!--추가-->

    }

     

    //수정버튼을 누른경우 해당값을 필드에 입력후 에디터를 다시 로드하여 해당내용이 에디터에 들어가도록 추가

     

     

     

     

    </script>

     

     

     

    그누보드 댓글에디터사용.zip
    0.00MB

     

    //스킨폴더 댓글 스킨에 덮어 씌우기

     

    댓글

Designed by Tistory.