팝업 코멘트 글쓰기 '올바른 방법으로 이용해 주십시오.' 도움이 필요합니다.

팝업 코멘트 글쓰기 '올바른 방법으로 이용해 주십시오.' 도움이 필요합니다.

QA

팝업 코멘트 글쓰기 '올바른 방법으로 이용해 주십시오.' 도움이 필요합니다.

본문

몇년전 빈집넷이라는 곳에서 받은 치비툴 게시판을 그누5에서 로드용으로 사용하려고 게조중입니다.

 

문제가 발생한것은 여러군데지만 일단 팝업창에서 코멘트를 작성 할때 '올바른 방법으로 이용해 주십시오.' 오류창 부분의 도움을 받고싶습니다.

(설정하면 팝업이 아닌 다음페이지로 넘어가서 작성하여 목록으로 돌아오는 버전으로 바꿀 수 있고, 작성이 되었습니다만, 팝업쪽이 더 편하다고 생각되어서 팝업형태로 사용하고 싶습니다.)

 

테스트 아이디 : test/1111

 

크롬 콘솔에서 뜨는 오류는

Uncaught ReferenceError: set_comment_token is not defined
    at fviewcomment_submit (view_comment.skin.pop.php?w=c&bo_table=test3&wr_id=16&comment_id=&sfl=&stx=&spt=&page=1&cwin=&g_com=g_com&pop=1&ftarget=:222)
    at HTMLFormElement.onsubmit (view_comment.skin.pop.php?w=c&bo_table=test3&wr_id=16&comment_id=&sfl=&stx=&spt=&page=1&cwin=&g_com=g_com&pop=1&ftarget=:42)

입니다.

 

view_comment.skin.pop.php


<?
include_once('../../../common.php');
if(file_exists('./a_config_id_'.$bo_table.'.php'))
    @include './a_config_id_'.$bo_table.'.php';
else
    @include './a_config.php';
include $board_skin_path.'/a_function.php';
if($is_admin){ //코멘트 글자수 제한
    $comment_min = $comment_max = 0;
}else{
    $comment_min = (int)$board['bo_comment_min'];
    $comment_max = (int)$board['bo_comment_max'];
}
if($comment_min||$comment_max)$min_max=true;
else $min_max=false;
if(($board['bo_html_level']<=$member['mb_level'])&&$board['bo_use_dhtml_editor'])$is_dhtml_editor=true; //dhtml 사용 설정 반영
else $is_dhtml_editor=false;
if(!$pop){ //새창이 아니면 헤드 불러오기
    include_once G5_PATH.'/head.sub.php';
    @include_once '../../../'.$board['bo_include_head'];
    if($board['bo_image_head'])echo'<img src="'.G5_DATA_URL.'/file/'.$bo_table.'/'.$board['bo_image_head'].'" border="0">';
    if($board['bo_content_head'])echo stripslashes($board['bo_content_head']);
}
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php'); //자동등록방지 불러오기
$captcha_html = "";
if ($is_guest && $board['bo_comment_level'] < 2) {
    $captcha_html = captcha_html('_comment');
}
$c_id = isset($_GET['c_id']) ? clean_xss_tags($_GET['c_id'], 1, 1) : '';
$c_wr_content = '';

$write_is_notice=explode("\n",$board['bo_notice']);
if((in_array($wr_id,$write_is_notice))&&!$is_admin&&$notice_per)die('권한이 없습니다.');
$is_comment_write = false;
if ($member['mb_level'] >= $board['bo_comment_level'])
    $is_comment_write = true;
if($w!='c') {
    if ($is_admin||(($write['mb_id']==$member['mb_id'])&&$is_member)) {
        ;
    } else {
        if (sql_password($wr_password) != $write['wr_password']) alert("password error");
    }
}
if($w=='u')$w='cu';
if ($w=='c') {
    if($c_id)$nono=$c_id;
    else $nono=$wr_id;
    $rep=_fetch_array(sql_query("select wr_name,wr_option from $write_table where wr_id ='$nono' "));
    if(($rep['wr_option']=='secret')&&!$is_admin)$rep['wr_name']='<span style="secret_text1">* 비밀글입니다.</span>';
}
if(get_cookie('webgcooa')){
    $cookie_id = 'wr_cookie_del';
    $cookie_text = '쿠키삭제';
} else {
    $cookie_id = 'wr_cookie_save';
    $cookie_text = '쿠키저장';
}
if(get_cookie('webgcoob')){
    $cookie_id2 = 'wr_cookie_pdel';
    $cookie_text2 = '비번삭제';
} else {
    $cookie_id2 = 'wr_cookie_psave';
    $cookie_text2 = '비번저장';
}
if($board['bo_html_level']>$member['mb_level']) $is_html=false; else $is_html=true;
$dice_value=false;
$dice_value2=false;
if($w=='cu'){
    $wwr4=explode('|',$write['wr_4']);
    $dice_value=$wwr4[1];
    $guild_name_ex=explode(',',$wwr4[2]);
    if($d_o3_arr_[1]||$d_o4_arr_[1]){
        $wwr4_4_ex=explode('/',$wwr4[1]);
        $dice_value=$wwr4_4_ex[0];
        $dice_value2=$wwr4_4_ex[1];
    }
}
if(!$guild_name_ex[0])$guild_name_ex[0]=get_cookie('guild_cookie');
if(!$guild_name_ex[1])$guild_name_ex[1]=get_cookie('guild_cookie2');
if(!$guild_name_ex[2])$guild_name_ex[2]=get_cookie('guild_cookie3');
$ip_ex2_ex=explode('.',$_SERVER['REMOTE_ADDR']);
if($browser_check=='Safari')$select_style='';
else $select_style='class="select_style"';
$write['wr_1']=explode('|',$write['wr_1']);
if($is_dhtml_editor){
    $enter=array("\r","\n");
    $write['wr_content']=nl2br($write['wr_content']);
    $write['wr_content']=str_replace($enter,"",$write['wr_content']);
    if((substr($write['wr_content'],-1,1)=='<')&&($browser_check=='MSIE'))$write['wr_content']=substr_replace($write['wr_content'],'< ',-1,1);
    if($min_max)$write['wr_content']=get_icon($write['wr_content'],1);
} else {
    $enter=array("<br>","<br/>","<br />","<BR>","<BR/>","<BR />");
    $write['wr_content']=str_replace($enter,"\n",$write['wr_content']);
    $write['wr_content']=get_icon($write['wr_content'],1);
}
$d_o1_arr_[0]=$d_o1_arr_[0]?$d_o1_arr_[0]:'주사위';
$d_o3_arr_[0]=$d_o3_arr_[0]?$d_o3_arr_[0]:'주사위2';
if($d_o3_arr_[1]||$d_o4_arr_[1])$com_form_width=506;
else $com_form_width=466;
if($nw_o_arr[4])$com_form_width=$com_form_width+$nw_o_arr[4];
$winput=intval(($com_form_width/3)-32);$com_form_width_bt=$com_form_width-(!$pop?55:0)-($is_guest?($w_o_arr[4]==1?(($browser_check=='Firefox')?148:140):($w_o_arr[4]==2?(($browser_check=='Firefox')?143:137):0)):0);
$tttt1='<div style="float:left;">';
$tttt2='</div><div style="float:right;">';
$tttt3='</div>';
if($pop){
?>
<?php
if (G5_IS_MOBILE) {
    echo '<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10">'.PHP_EOL;
    echo '<meta name="HandheldFriendly" content="true">'.PHP_EOL;
    echo '<meta name="format-detection" content="telephone=no">'.PHP_EOL;
} else {
    echo '<meta http-equiv="imagetoolbar" content="no">'.PHP_EOL;
    echo '<meta http-equiv="X-UA-Compatible" content="IE=Edge">'.PHP_EOL;
}
if($config['cf_add_meta'])
    echo $config['cf_add_meta'].PHP_EOL;
?>
<?php if (defined('G5_IS_ADMIN')) {
    if(!defined('_THEME_PREVIEW_'))
        echo '<link rel="stylesheet" href="'.run_replace('head_css_url', G5_ADMIN_URL.'/css/admin.css?ver='.G5_CSS_VER, G5_URL).'">'.PHP_EOL;
} else {
    $shop_css = '';
    if (defined('_SHOP_')) $shop_css = '_shop';
    echo '<link rel="stylesheet" href="'.run_replace('head_css_url', G5_CSS_URL.'/'.(G5_IS_MOBILE?'mobile':'default').$shop_css.'.css?ver='.G5_CSS_VER, G5_URL).'">'.PHP_EOL;
} ?>
    <script type="text/javascript">
        // 자바스크립트에서 사용하는 전역변수 선언
        var G5_PATH      = "<?php echo G5_PATH ?>";
        var G5_URL       = "<?php echo G5_URL ?>";
        var G5_BBS_URL   = "<?php echo G5_BBS_URL ?>";
        var g5_is_member = "<?php echo isset($is_member)?$is_member:''; ?>";
        var g5_is_admin  = "<?php echo isset($is_admin)?$is_admin:''; ?>";
        var g5_is_mobile = "<?php echo G5_IS_MOBILE ?>";
        var g5_bo_table  = "<?php echo isset($bo_table)?$bo_table:''; ?>";
        var g5_sca       = "<?php echo isset($sca)?$sca:''; ?>";
        var g5_editor    = "<?php echo ($config['cf_editor'] && $board['bo_use_dhtml_editor'])?$config['cf_editor']:''; ?>";
        var g5_bbs_img   = "<?php echo G5_IMG_DIR ?>";
        var g5_cookie_domain = "<?php echo G5_COOKIE_DOMAIN ?>";
        var g5_is_gecko  = navigator.userAgent.toLowerCase().indexOf("gecko") != -1;
        var g5_is_ie     = navigator.userAgent.toLowerCase().indexOf("msie") != -1;
        var bo_skin_p    = '<?php $board_skin_url ?>';
        <? if ($is_admin) { 
            echo 'var g5_admin = "'.G5_ADMIN_DIR.'";'; 
        } ?>
        <?php if(defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
            var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
        <?php } 
        if(defined('G5_IS_ADMIN')) { ?>
            var g5_admin_url = "<?php echo G5_ADMIN_URL; ?>";
        <?php } ?>
        var g5_captcha_url = "<?php echo G5_CAPTCHA_URL; ?>";
        var g5_page = "<?php echo $page?>";
        var g5_editor_url = "<?php echo G5_EDITOR_URL; ?>";
    </script>
    <script language="JavaScript">
        // 글자수 제한
        var char_min = parseInt(0); // 최소
        var char_max = parseInt(0); // 최대
    </script>
<script src="<?php echo G5_JS_URL ?>/jquery-1.12.4.min.js"></script>
<?}?>
<link rel="stylesheet" href="<?php echo $board_skin_url ?>/css.css" type="text/css">
<link rel="stylesheet" href="<?php echo $board_skin_url ?>/com_write.css" type="text/css">
<? if($is_dhtml_editor) { ?>
    <script type="text/javascript" src="<?php echo G5_EDITOR_URL ?>/smarteditor2/js/service/HuskyEZCreator.js" charset="utf-8"></script>
<? }
if($pop){
    add_javascript('<script src="'.G5_JS_URL.'/jquery.menu.js?ver='.G5_JS_VER.'"></script>', 0);
    add_javascript('<script src="'.G5_JS_URL.'/common.js?ver='.G5_JS_VER.'"></script>', 0);
    add_javascript('<script src="'.G5_JS_URL.'/wrest.js?ver='.G5_JS_VER.'"></script>', 0);
    add_javascript('<script src="'.G5_JS_URL.'/placeholders.min.js"></script>', 0);
    add_stylesheet('<link rel="stylesheet" href="'.G5_JS_URL.'/font-awesome/css/font-awesome.min.css">', 0);
 
if(G5_IS_MOBILE) {
    add_javascript('<script src="'.G5_JS_URL.'/modernizr.custom.70111.js"></script>', 1); // overflow scroll 감지
}
if(!defined('G5_IS_ADMIN'))
    echo $config['cf_add_script'];
}?>
<div id="com_write">
    <div align="center">
        <? if ($is_comment_write) {
        if($w == '') $w = 'c'; ?>
        <!-- 코멘트 입력테이블시작 -->
        <table cellpadding="0" cellspacing="0" id="main_table" <? if(!$pop) echo 'style="height:20%;"';?>>
            <tr>
                <td>
                    <span id="comment_write">
                        <form id="ir1<?php echo $wr_id?>" name="fviewcomment" method="post" action="<?php echo G5_BBS_URL ?>/write_comment_update.php" onsubmit="return fviewcomment_submit(this,'');" autocomplete="off" <?php echo ($ftarget?'target="'.$board['bo_3'].'"':($pop?'target="_parent"':''));?>>
                            <input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
                            <input type="hidden" name="w"           id="w" value="<?php echo $w?>">
                            <input type="hidden" name="bo_table"    value="<?php echo $bo_table?>">
                            <input type="hidden" name="wr_id"       value="<?php echo $wr_id?>">
                            <input type="hidden" name="comment_id"  id="comment_id" value="<?php echo $c_id?>">
                            <input type="hidden" name="sca"            value="<?php echo $sca?>">
                            <input type="hidden" name="sfl"         value="<?php echo $sfl?>">
                            <input type="hidden" name="stx"         value="<?php echo $stx?>">
                            <input type="hidden" name="spt"         value="<?php echo $spt?>">
                            <input type="hidden" name="page"        value="<?php echo $page?>">
                            <input type="hidden" name="cwin"        value="<?php echo $cwin?>">
                            <div style="width:10px;height:10px;position:absolute;top:-300px;left:-300px;z-index:1">
                                <input type="submit" value="" style="width:0px;height:0px;border: #dcdcdc 0px solid;">
                            </div>
                            <div align="center">
                                <div id="main_div" style="width:<?php echo $com_form_width?>px;">
<? if(!$pop){ //코멘트 팝업 제목
        if($c_id){
            $com_target=sql_fetch("select wr_name from $write_table where wr_id = '$c_id'");
            $com_target_name=$com_target['wr_name'];
        }
        else $com_target_name=$write['wr_name'];?>
        <div class="com_target">
            '<?php echo $com_target_name?>'님의 <? if($w=='cu'){?>댓글을 수정합니다.<?}
            else{
                echo ($c_id?'댓글':'글');?>에 댓글을 작성합니다.
            <? } ?>
        </div>
<? } ?>
                           
<?php if($is_guest){
    if($w=='cu'){
        $wname=$write['wr_name'];
        $whomepage=$write['wr_homepage'];?>
        <input type="hidden" name="guest_edit" value="1">
    <? }
} ?>
                                    <!-- 손님 및 옵션으로 메모 추가 입력 설정시 나오는 테이블 start -->
                                    <table cellspacing="0" cellpadding="0" class="com_write_table" style="width:100%;">
                                        <tbody>
                                        <? if($is_guest){ //손님의 경우 추가 입력 폼 ?>
                                            <tr>
                                                <td id="td1">
                                                    <?php echo $tttt1?>이름<?php echo $tttt2?><input type="text" maxLength="100" name="wr_name" id="wr_name" itemname="이름" value="<?php echo $wname?$wname:get_cookie('webgcooa')?>" required class="write_input1" style="width:<?php echo $winput?>px;"><?php echo $tttt3?>
                                                </td>
                                                <td id="td2">
                                                    <?php echo $tttt1?>비번<?php echo $tttt2?><input type="password" maxLength="20" name="wr_password" id="wr_password" itemname="패스워드" required value="<?php echo get_cookie('webgcoob')?>" class="write_input1" style="width:<?php echo $winput?>px;"><?php echo $tttt3?>
                                                </td>
                                                <td id="td2">
                                                    <?php echo $tttt1?>홈피<?php echo $tttt2?><input type="text" maxLength="200" name="wr_homepage" id="wr_homepage" itemname="홈페이지" value="<?php echo $whomepage?$whomepage:get_cookie('webgcooc')?>" class="write_input1" style="width:<?php echo $winput?>px;"><?php echo $tttt3?>
                                                </td>
                                            </tr>
                                        <? } ?>
                                        <? if($memo_option_ex[0]) { // 메모 사용으로 설정시?>
                                            <tr>
                                                <td colspan="3" id="<?php echo $is_member?'td4':'td3'?>">
                                                    <?php echo $tttt1?>메모<?php echo $tttt2?><input name="wr_memo" id="wr_memo" itemname="메모" value="<?php echo (($w=='cu')?$write['wr_1'][1]:'');?>" class="write_input1" style="width:<?php echo ($com_form_width-30)?>px;"><?php echo $tttt3?>
                                                </td>
                                            </tr>
                                        <? } ?>
                                        </tbody>
                                    </table>
                                    <!-- 손님 및 옵션으로 메모 추가 입력 설정시 나오는 테이블 end -->
                                    <span id="ck">
                                        <? if($board['bo_use_secret']==1) { ?>
                                            <input type="checkbox" id="wr_secret<?php echo $wr_id?>" name="wr_secret" value="secret"<?php echo (($write['wr_option']=='secret')&&($w=='cu'))?'checked':'';?>>
                                            <label for="wr_secret">비밀</label>
                                            <? if($board['bo_6_subj']&&($board['bo_6_subj']!=2)) { ?>
    <span class="div_toggle" id="sc_view1" ><a href="#" onclick="layer_toggle(document.getElementById('sc_view1')); layer_toggle(document.getElementById('sc_view2')); return false;">▼</a></span>
    <? }
} if($is_guest&&!$w_o_arr[4]) { ?>
    <input type="checkbox" id="<?php echo $cookie_id ?>" name="<?php echo $cookie_id ?>" value="1"><label for="<?php echo $cookie_id ?>"><?php echo $cookie_text ?></label>
    <input type="checkbox" id="<?php echo $cookie_id2 ?>" name="<?php echo $cookie_id2 ?>" value="1"><label for="<?php echo $cookie_id2 ?>"><?php echo $cookie_text2 ?></label>
    <? } ?>
    <input type="checkbox" id="comclose" name="comclose" value="1" <? if($w=='cu')echo$wwr4[0]?'checked':'';?>>
<label for="comclose">코멘트접기</label>
<input type="text" name="wr_1" value="<?php echo ($w=='cu')?$write['wr_1'][0]:''; ?>" class="write_input2">
<? if($is_html) { ?>
    <a href="#" onClick="icon_box_open2(); return false;" class="default_link">[아이콘]</a>
<? } ?>
<? if(!$dice_value&&($d_o1_arr_[1]||$d_o2_arr_[1])) { ?>
    <input type="checkbox" id="dice" name="dice" value="1" title="<?php echo $d_o1_arr_[0] ?>"><label for="dice" title="<?php echo $d_o1_arr_[0] ?>"><?php echo $d_o1_arr_[0] ?></label>
<? } ?>
<? if(!$dice_value2&&($d_o3_arr_[1]||$d_o4_arr_[1])) { ?>
    <input type="checkbox" id="dice_b" name="dice_b" value="1" title="<?php echo $d_o3_arr_[0] ?>">
    <label for="dice_b" title="<?php echo $d_o3_arr_[0] ?>"><?php echo $d_o3_arr_[0] ?></label>
<? } ?>
</span>
<div class="div_toggle" id="sc_view2" style="<?php echo (get_cookie('sc_view_code')&&$board['bo_6_subj']&&($board['bo_6_subj']!=2))?'display:block;':'display:none;'; ?>margin-bottom:3px;">비밀글 보기 비번<input type="password" name="sc_view_code" value="<?php echo get_cookie('sc_view_code')?get_cookie('sc_view_code'):''; ?>" class="write_input2"> <img src="<?php echo $board_skin_url ?>/img/config_h.gif" class="cursor_pointer" onclick="sc_view_code_help(); return false;" align="absmiddle"></div>
<div id="sc_view_code_help" style="display:none;">
<div id="sc_view_code_help2">
    <ul>
    <li>비밀글을 보기 위한 비밀번호로 입력하지 않아도 상관없습니다. 해당 기능은 다른 사람이 비밀글을 볼 수 있도록 하기 위해 삽입된 기능으로서 만약 입력할경우 글 작성 비밀번호와 다르게 설정하길 권장합니다.</li>
    <li>'비밀'에 체크가 되어있지 않다면 '비밀글 보기 비번'에 입력된 값은 저장되지 않습니다.</li>
    </ul>
</div>
</div>
<div><?php echo guild_input($select_style); ?></div>
<div class="write_textarea_div">
    <textarea name="wr_content" id="wr_content" class="write_textarea" itemname="내용" required style="width:<?php echo ($com_form_width-1) ?>px;" <? if($min_max){ ?>onkeyup="check_str(this,'min_max','');" onmousemove="check_str(this,'min_max','');" onfocus="check_str(this,'min_max','');"
    <? } ?>>
<? if($w=='cu')echo get_text($write['wr_content'], 0);
else if($is_dhtml_editor&&($browser_check=='Firefox'))echo'<br>'; ?>
    </textarea>
</div>
    <!--자동등록방지start-->
    <?php if ($is_guest){ ?>
    <div class="write_div">
        <?php echo $captcha_html ?>
    </div>
    <?}?>
    <!--자동등록방지end-->
</div>
<? if($is_guest&&($w_o_arr[4]==1)) { ?>
    <input type="checkbox" id="<?php echo $cookie_id ?>" name="<?php echo $cookie_id ?>" value="1">
    <label for="<?php echo $cookie_id ?>"><?php echo $cookie_text ?></label>
    <input type="checkbox" id="<?php echo $cookie_id2 ?>" name="<?php echo $cookie_id2 ?>" value="1">
    <label for="<?php echo $cookie_id2 ?>"><?php echo $cookie_text2 ?></label> 
<? } ?>
    <input type="submit" id="ok" name="pushbutton" value="댓글을 등록합니다" border="0" accesskey="s" class="default_button"<?php echo ($is_dhtml_editor?'onclick="_onSubmit();"':'');?>style="width:<?php echo $com_form_width_bt?>px;">
<? if($is_guest&&($w_o_arr[4]==2)) { ?>
    <input type="checkbox" id="<?php echo $cookie_id ?>" name="<?php echo $cookie_id ?>" value="1">
    <label for="<?php echo $cookie_id ?>"><?php echo $cookie_text ?></label>
    <input type="checkbox" id="<?php echo $cookie_id2 ?>" name="<?php echo $cookie_id2 ?>" value="1">
    <label for="<?php echo $cookie_id2 ?>"><?php echo $cookie_text2 ?></label>
<? } ?>
<? if(!$pop) { ?>
    <input type="button" name="pushbutton" value="취소" class="default_button" onclick="_cancel()" style="width:50px;margin-left:2px;">
<? } ?><? if($min_max) { ?>
    <div class="min_max_style" style="text-align:right;width:<?php echo $com_form_width?>px;">
        <span id="min_max"><?php echo ($write['wr_content']?mb_strlen($write['wr_content'],utf-8):0) ?></span>/<?php echo ($comment_min?'Min:'.$comment_min:'').($comment_min&&$comment_max?'~':'').($comment_max?'Max:'.$comment_max:''); ?>
    </div>
<? } ?>
<? if($is_html) {
    $icon_dir=str_replace('../','../',$icon_dir);
    $icon_dir2=str_replace('./../../','',$icon_dir);
    include $board_skin_path.'/'.$icon_include;?>
<? } ?>
</form>
</div>
</div>
</span>
<? if($cwin==1) { ?>
    <p align=center><a href="javascript:window.close();"><img src="<?php echo $board_skin_url ?>/img/btn_close.gif" width="48" height="20" border="0"></a>
<? } ?>
<script type="text/javascript">
var bo_skin_p    = '<?php echo $board_skin_url ?>';
var w = '<?php echo $w ?>';
var pop = '<?php echo $pop ?>';
var pop2 = 1;
var wr_id = '<?php echo $wr_id ?>';
var webgcooa = '<?php echo (get_cookie('webgcooa')?1:'') ?>';
var webgcoob = '<?php echo (get_cookie('webgcoob')?1:'') ?>';
var comment_min = '<?php echo $comment_min ?>';
var comment_max = '<?php echo $comment_max ?>';
<? if($is_dhtml_editor) { ?>
    var oEditors = [];
    nhn.husky.EZCreator.createInIFrame({
    oAppRef: oEditors,
    elPlaceHolder: "wr_content",
    sSkinURI: g5_editor_url+"/smarteditor2/SmartEditor2Skin.html",
    fCreator: "createSEditorInIFrame"
});
function showHTML(){
    alert(oEditors.getById["wr_content"].getIR());
}
function _onSubmit(elClicked){
    // 에디터의 내용을 에디터 생성시에 사용했던 textarea에 넣어 줍니다.
    oEditors.getById["wr_content"].exec("UPDATE_IR_FIELD", []);
    // 에디터의 내용에 대한 값 검증은 이곳에서 document.getElementById("wr_content").value를 이용해서 처리하면 됩니다.
    var content_c = document.getElementById("wr_content").value.replace(/<br>|<p>|<\/p>|<br type=\"_moz\">| /gi,'');
    if(!content_c) document.getElementById("wr_content").value='';
    <? if($browser_check=='Chrome'||$browser_check=='Firefox'){ ?>
        if(!document.getElementById("wr_content").value){
            alert('내용을 입력하세요');
            return false;
        }
    <? } ?>
    try{
        elClicked.form.submit();
    }catch(e){}
}
<? } else { ?>
    function _onSubmit(){
    var a ='';
}
<?}?>
    function icon_box_open2() {
    <? if($pop) { ?>
        iconmodalbox=dhtmlmodal.open('agebox', 'div', 'icon_box', '아이콘', 'width=470px,height=250px,center=1,resize=1,scrolling=1');
    <? } else { ?>
        NewWindow('<?php echo $board_skin_url ?>/a_icon_auto.php?bo_table=<?php echo $bo_table ?>&wr_id=<?php echo $wr_id ?>&icon_pop=1','icon',470,250,'no','center');
    <? } ?>}
function pasteHTMLDemo(icon,sub,i){
    if(sub)
        var sub2 = sub;
    else sub2 = '[/'+i+']';
    <? if($is_dhtml_editor) { ?>
    sHTML = sub2;
    oEditors.getById['wr_content'].exec('PASTE_HTML', [sHTML]);
    <? } else { ?>
        document.getElementById('wr_content').value+=sub2;
    <? } ?>
}
function icon_box_close(icon,sub,w,i){
    pasteHTMLDemo(icon,sub,i);
    iconmodalbox.hide();
}
function _cancel(){
    <? if($sno==2||$sno==22||$iuv||get_session('ss_secret_'.$bo_table.'_'.$view['wr_num'])) $wridd='&wr_id='.$wr_id;
    else $wridd='';?>
    location.replace('<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table?>&page=<?php echo $page?><?php echo $wridd?>');
}
</script>
<?php } ?>
<? if (!$member['mb_id']) { ?>
    <script language='javascript' src='<?php echo G5_JS_URL ?>/md5.js'></script>
<? } ?>
        
<script type="text/javascript" src="<?php echo $board_skin_url ?>/js_lib.js"></script>
</td>
</tr>
</table>
<? if($is_html) { ?>
<link rel="stylesheet" href="<?php echo $board_skin_url ?>/dhtmlmodal/windowfiles/dhtmlwindow.css" type="text/css" />
<script type="text/javascript" src="<?php echo $board_skin_url ?>/dhtmlmodal/windowfiles/dhtmlwindow.js"></script>
<link rel="stylesheet" href="<?php echo $board_skin_url ?>/dhtmlmodal/modalfiles/modal.css" type="text/css" />
<script type="text/javascript" src="<?php echo $board_skin_url ?>/dhtmlmodal/modalfiles/modal.js"></script>
<? } ?>
</div>
</div>
<script>
function fviewcomment_submit(f,a){
    var content = '';
    var error1='';
    var error2='';
    var error3='';
    $.ajax({
        url: bo_skin_p+'/ajax.filter.php',
        type: 'POST',
        data: {
            'w':f.w.value,
            'content': f.wr_content.value,
            'bo_table': f.bo_table.value
        },
        dataType: 'json',
        async: false,
        cache: false,
        success: function(data, textStatus){
            content = data.content;
            error1 = data.error1;
            error2 = data.error2;
            error3 = data.error3;
        }
    });
    if(content){
        alert('내용에 금지단어("'+content+'")가 포함되어있습니다');
        if(pop2&&is_dhtml_editor){
            if(typeof(ed_wr_content)!='undefined')ed_wr_content.returnFalse();
        }else{
            f.wr_content.focus();
        }
        return false;
     }
    if (error1){
        alert('스팸글로 의심되어 차단되었습니다');
        f.wr_content.focus();
        return false;
    }
    if (error2){
        alert(error2);
        f.wr_content.focus();
        return false;
    }
    if (error3){
        alert(error3);
        f.wr_content.focus();
        return false;
    }
    
    <?php if($is_guest) echo chk_captcha_js();  ?>
    set_comment_token(f,a);
    document.getElementById("ok").disabled = "disabled";
    return true;
}
</script>
<? if($pop) {?>
</body>
</html>

 

이 질문에 댓글 쓰기 :

답변 1

fviewcomment_submit(f,a)가 js파일의 function c_k(rr)의 아래에 있었습니다.

<?php if($is_guest) echo chk_captcha_js();  ?>를 js에 넣는 법을 몰라 php파일로 가져왔습니다.

 

js_lib.js


//토글
function layer_toggle(obj){
    if (obj.style.display == 'none') obj.style.display = 'block';
    else if (obj.style.display == 'block') obj.style.display = 'none';
}
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
    if(pos=="random"){
        LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
        TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
    }
    if(pos=="center"){
        LeftPosition=(screen.width)?(screen.width-w)/2:100;
        TopPosition=(screen.height)?(screen.height-h)/2:100;
    }
    else if((pos!="center" && pos!="random") || pos==null){
        LeftPosition=0;
        TopPosition=20
    }
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
    win=window.open(mypage,myname,settings);
}
// 별점&추천 업데이트
function StarUpdate(bo_table,wr_id,Srating,good,bad){$.ajax({type: 'POST',url: bo_skin_p+'/a_rating.php',data: 'bo_table='+bo_table+'&wr_id='+wr_id+'&star_rating='+Srating+'&good='+good+'&bad='+bad,cache: false,success: function(data) {$('#starview'+wr_id).html(data);},error: function(){alert('error');}});}
//셀렉트메뉴
//Cannot read properties of undefined (reading 'msie') 해결start
(function () {
    var matched, browser;
 
    // Use of jQuery.browser is frowned upon.
    // More details: http://api.jquery.com/jQuery.browser
    // jQuery.uaMatch maintained for back-compat
    jQuery.uaMatch = function (ua) {
        ua = ua.toLowerCase();
 
        var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
            /(webkit)[ \/]([\w.]+)/.exec(ua) ||
            /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
            /(msie) ([\w.]+)/.exec(ua) ||
            ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
            [];
 
        return {
            browser: match[1] || "",
            version: match[2] || "0"
        };
    };
 
    matched = jQuery.uaMatch(navigator.userAgent);
    browser = {};
 
    if (matched.browser) {
        browser[matched.browser] = true;
        browser.version = matched.version;
    }
 
    // Chrome is Webkit, but Webkit is also Safari.
    if (browser.chrome) {
        browser.webkit = true;
    } else if (browser.webkit) {
        browser.safari = true;
    }
 
    jQuery.browser = browser;
})();
//Cannot read properties of undefined (reading 'msie') 해결end
(function($){
 $.fn.extend({
     customStyle : function(options) {
      if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
      return this.each(function() {
            var currentSelected = $(this).find(':selected');
            $(this).after('<span class="customStyleSelectBox"><span class="customStyleSelectBoxInner">'+currentSelected.text()+'</span></span>').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
            var selectBoxSpan = $(this).next();
            var selectBoxWidth = parseInt($(this).width()) - parseInt(selectBoxSpan.css('padding-left')) -parseInt(selectBoxSpan.css('padding-right'));            
            var selectBoxSpanInner = selectBoxSpan.find(':first-child');
            selectBoxSpan.css({display:'inline-block'});
            selectBoxSpanInner.css({width:selectBoxWidth, display:'inline-block'});
            var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom'));
            $(this).height(selectBoxHeight).change(function(){
            selectBoxSpanInner.text($(this).find(':selected').text()).parent().addClass('changed');
            });
      });
      }
    }
 });
})(jQuery);
$(document).ready(function(){$('select.select_style').customStyle();});
function sc_view_update(n,t){
    $('#sc_view_loading'+n).empty().html('<img src="'+bo_skin_p+'/'+theme_img_dir+'/87.gif" />');
    var string = $('form[name=sc_view_form_'+n+']').serialize();
    $.ajax({
        type: 'POST',
        url: bo_skin_p+'/a_sc_view.php',
        data: string,
        dataType: 'html',
        cache: false,
        success: function(data){
            if(data == 'error'){
                alert('error');    $('#sc_view_loading'+n).empty().html('');
                return false;
            } else {
                $('#pnlDisplay'+n).html(data);
                $('#sc_view_loading'+n).empty().html('');
            }
        },
        error: function(){
            alert('호출에 실패했습니다.');
            $('#sc_view_loading'+n).empty().html('');
        }
    });
}
/*@author Jan Jarfalk
@author-email *** 개인정보보호를 위한 이메일주소 노출방지 ***
@author-website http://www.unwrongest.com
@licence MIT License - http://www.opensource.org/licenses/mit-license.php*/
(function($){
    jQuery.fn.extend({
        elastic: function(){
            var mimics = ['paddingTop','paddingRight','paddingBottom','paddingLeft','fontSize','lineHeight','fontFamily','width','fontWeight','border-top-width','border-right-width','border-bottom-width','border-left-width','borderTopStyle','borderTopColor','borderRightStyle','borderRightColor','borderBottomStyle','borderBottomColor','borderLeftStyle','borderLeftColor'];
            return this.each( function(){
                if(this.type !== 'textarea'){return false;}
                var $textarea=jQuery(this),
                    $twin=jQuery('<div />').css({'position':'absolute','display':'none','word-wrap':'break-word','white-space':'normal'}),
                    lineHeight=parseInt($textarea.css('line-height'),10) || parseInt($textarea.css('font-size'),'10'),minheight=parseInt($textarea.css('height'),10) || lineHeight*3,maxheight=parseInt($textarea.css('max-height'),10) || Number.MAX_VALUE,goalheight=0;
                if(maxheight < 0) { maxheight = Number.MAX_VALUE;}$twin.appendTo($textarea.parent());
                var i = mimics.length;
                while(i--){$twin.css(mimics[i].toString(),$textarea.css(mimics[i].toString()));}
                function setTwinWidth(){
                    var curatedWidth = Math.floor(parseInt($textarea.width(),10));
                    if($twin.width() !== curatedWidth){$twin.css({'width': curatedWidth + 'px'});update(true);}
                }
                function setHeightAndOverflow(height, overflow){
                    var curratedHeight = Math.floor(parseInt(height,10));
                    if($textarea.height() !== curratedHeight){$textarea.css({'height': curratedHeight + 'px','overflow':overflow});}}
                function update(forced){
                    var textareaContent = $textarea.val().replace(/&/g,'&').replace(/ {2}/g, ' ').replace(/<|>/g, '>').replace(/\n/g, '<br />');
                    var twinContent = $twin.html().replace(/<br>/ig,'<br />');
                    if(forced || textareaContent+' ' !== twinContent){
                        $twin.html(textareaContent+' ');
                        if(Math.abs($twin.height() + lineHeight - $textarea.height()) > 3){
                            var goalheight = $twin.height()+lineHeight;
                            if(goalheight >= maxheight){setHeightAndOverflow(maxheight,'auto');}
                            else if(goalheight <= minheight){setHeightAndOverflow(minheight,'hidden');}
                            else{setHeightAndOverflow(goalheight,'hidden');}
                        }
                    }
                }
                $textarea.css({'overflow':'auto'});
                $textarea.bind('keyup change cut paste', function(){update();});
                $(window).bind('resize', setTwinWidth);
                $textarea.bind('resize', setTwinWidth);
                $textarea.bind('update', update);
                $textarea.bind('blur',function(){
                    if($twin.height() < maxheight){
                        if($twin.height() > minheight){
                            $textarea.height($twin.height());
                        }else{
                            $textarea.height(minheight);
                        }
                    }
                });
                $textarea.bind('input paste',function(e){ setTimeout( update, 250); });
                update();
            });
        }
    });
})(jQuery);
$(document).ready(function(){
    $('.textarea .write_textarea').elastic();
    $('.textarea .write_textarea').trigger('update');
});
function jquery_toggle(id,wr_id){
    if($(id+wr_id).css('display')=='none')$(id+wr_id).show();
    else if($(id+wr_id).css('display')=='block')$(id+wr_id).hide();
    return $(id+wr_id).css('display');
}
var rrid = '';
var rrr = '';
var clone_form = '';
var pass = '';
function get_pass_cookie(){
    $.ajax({
        url: bo_skin_p+'/ajax.filter.php',
        type: 'POST',
        data: {
            'get_pass':'1',
            'bo_table': g5_bo_table
        },
        dataType: 'json',
        async: false,
        cache: false,
        success: function(data, textStatus){pass = data.pass;}
});
}
//댓글모달창
function opennewsletter_(wr_id,sfl,stx,spt,cwin,wr_name,m_title,comment_id,com_re_ur,com_re_file,w,h,c,rr){
    if(rr){
        get_pass_cookie();
        if(rrid&&(rrid!=comment_id)&&($('#rr'+rrid).css('display')=='block')){jquery_toggle('#rr',rrid);}
        if($('#rr'+comment_id).css('display')=='none'){
            $('#rr'+comment_id).html($('#rrf'+wr_id));
            $('#rr'+comment_id).show();
            $('#rr'+comment_id+' .com_write_form_bottom').show();
            $('#rr'+comment_id+' .com_write_form_bottom').attr('id','');
            $('#rr'+comment_id+' form').attr('name','fviewcomment'+comment_id);
            $('#rr'+comment_id+' input[name=wr_password]').val(pass);
            $('#rr'+comment_id+' #rrb'+wr_id).html('<input type="submit" name="pushbutton" value="write" border="0" accesskey="s" onclick="c_k('+comment_id+');" class="default_button">');
            $('#rr'+comment_id+' #rrb'+wr_id+' input').attr('id','ok'+comment_id);
            $('#rr'+comment_id+' input[name=comment_id]').val(comment_id);
            if(comment_min||comment_max){
                $('#rr'+comment_id+' .min_max_style span').attr('id','min_max'+comment_id);
                $('#rr'+comment_id+' .textarea').html('<textarea name="wr_content" id="wr_content" class="write_textarea" style="height:auto;" cols="" rows="2" itemname="내용" required onkeyup="check_str(this,\'min_max\','+comment_id+');" onmousemove="check_str(this,\'min_max\','+comment_id+');" onfocus="check_str(this,\'min_max\','+comment_id+');"></textarea>');
            }
            (function(){
                $('.write_textarea').elastic();
                $('.write_textarea').trigger('update');
            })(jQuery);
        } else if($('#rr'+comment_id).css('display')=='block'){
            $('#rrfi'+wr_id).html($('#rrf'+wr_id));
            if(com_btn==1)$('#rrfi'+wr_id+' .com_write_form_bottom').hide();
            $('#rrfi'+wr_id+' .com_write_form_bottom').attr('id','cwfb'+wr_id);
            $('#rrfi'+wr_id+' form').attr('name','fviewcomment'+wr_id);
            $('#rrfi'+wr_id+' input[name=wr_password]').val(pass);
            $('#rrfi'+wr_id+' #rrb'+wr_id).html('<input type="submit" name="pushbutton" value="write" border="0" accesskey="s" onclick="c_k();" class="default_button">');
            $('#rrfi'+wr_id+' #rrb'+wr_id+' input').attr('id','ok'+wr_id);
            $('#rrfi'+wr_id+' input[name=comment_id]').val('');
            if(comment_min||comment_max){
                $('#rrfi'+wr_id+' .min_max_style span').attr('id','min_max'+wr_id);
                $('#rrfi'+wr_id+' .textarea').html('<textarea name="wr_content" id="wr_content" class="write_textarea" style="height:auto;" cols="" rows="2" itemname="내용" required onkeyup="check_str(this,\'min_max\','+wr_id+');" onmousemove="check_str(this,\'min_max\','+wr_id+');" onfocus="check_str(this,\'min_max\','+wr_id+');"></textarea>');
            }
            $('#rr'+comment_id).html('');
            $('#rr'+comment_id).hide();
        }
        rrid = comment_id;
        return false;
    }
    var do_width = document.body.clientWidth-20;
    var do_height = document.body.clientHeight-60;
    var scrollTop = document.body.scrollTop;
    if(scrollTop == 0)scrollTop = document.documentElement.scrollTop;
    if(com_re_ur && com_re_file && w){
        var wr_id = comment_id;
        var bo_skin_p2 = G5_URL+com_re_ur;
        var cfile = com_re_file;
        var comedit = '&comedit=1';
    } else {
        var bo_skin_p2 = bo_skin_p;
        var cfile = 'view_comment.skin.pop.php';
        var w = 'c';
    }
    if(comment_id) g_com = '';
    else g_com = 'g_com';
    var modal_height = (g5_is_member?(is_dhtml_editor?393:318):(is_dhtml_editor?418:338))+30;
    if(m_o_arr_0)var modal_height = parseInt(modal_height)+20;
    if(620>do_width) var modal_width = parseInt(do_width)-20;
    else var modal_width = 600;
    if(gv1||gv2||gv3) modal_height = parseInt(modal_height)+(gv1?+25:'')+((!go_arr_0||!go_arr_2)&&gv2?+26:'')+((!go_arr_2||!go_arr_5)&&gv3?+27:'');
    if(!nw_o_arr_0){
    if(nw_o_arr_4) modal_width = parseInt(modal_width)+parseInt(nw_o_arr_4);
    if(nw_o_arr_5) modal_height = parseInt(modal_height)+parseInt(nw_o_arr_5);
    if(d_o3_arr_1||d_o4_arr_1) modal_width = parseInt(modal_width)+40;
    var pos_w = parseInt((do_width-modal_width)/2,10);
    if(!nw_o_arr_1){
        var pos_h = ($((h?'#hview':(c?'#cview':'#view'))+(comment_id?comment_id:wr_id)).offset().top)-scrollTop;
    }else{
        var pos_h = parseInt(((screen.availHeight-(modal_height*1.5))/2)+h_scrollTop,10);
    }
    emailwindow=dhtmlmodal.open('EmailBox', 'iframe', bo_skin_p2+'/'+cfile+'?w='+w+'&bo_table='+g5_bo_table+'&wr_id='+wr_id+'&comment_id='+comment_id+'&sfl='+sfl+'&stx='+stx+'&spt='+spt+'&page='+g5_page+'&cwin='+cwin+'&g_com='+g_com+'&pop=1&ftarget='+ftarget, '<'+wr_name+'>님의 '+m_title+'.', 'width='+modal_width+'px,height='+modal_height+'px,left='+pos_w+',top='+pos_h+',resize=1,scrolling=1')
    }else{
    location.replace(bo_skin_p2+'/'+cfile+'?w='+w+'&bo_table='+g5_bo_table+'&wr_id='+wr_id+'&comment_id='+comment_id+'&sfl='+sfl+'&stx='+stx+'&spt='+spt+'&page='+g5_page+'&cwin='+cwin+'&g_com='+g_com);
    }
}
//애니모달창
function openanime_(wr_id,width,height,fbox,box_w_size,box_h_size){
    var do_width = document.body.clientWidth-20;
    var do_height = document.body.clientHeight-60;
    var scrollTop = document.body.scrollTop;
    if(scrollTop == 0)scrollTop = document.documentElement.scrollTop;
    if(width && height) var text = '로딩이 조금 오래 걸릴 수도 있습니다';
    else var text = '크게보기';
    if(box_w_size>do_width) var box_w_size = parseInt(do_width);
    if(!nw_o_arr_0){
    var pos_w_ani = parseInt((do_width-box_w_size)/2,10);
    if(!nw_o_arr_1){
        var pos_h_ani = ($('#view'+wr_id).offset().top)-scrollTop;
    }else{
        var pos_h_ani = parseInt(((screen.availHeight-(box_h_size*1.5))/2)+h_scrollTop,10)
        };
    emailwindow=dhtmlmodal.open('EmailBox', 'iframe', bo_skin_p+'/a_play.php?wr_id='+wr_id+'&ow='+width+'&oh='+height+'&bo_table='+g5_bo_table+'&fbox='+fbox, text, 'width='+box_w_size+'px,height='+box_h_size+'px,left='+pos_w_ani+',top='+pos_h_ani+',resize=1,scrolling=1')
    }else{
    NewWindow(bo_skin_p+'/a_play.php?wr_id='+wr_id+'&ow='+width+'&oh='+height+'&bo_table='+g5_bo_table,'play',box_w_size,box_h_size,'no','center');
    }
}
//로드링크창
function load_link(){
    var do_width = document.body.clientWidth-20;
    var do_height = document.body.clientHeight-60;
    var scrollTop = document.body.scrollTop;
    if(scrollTop == 0)scrollTop = document.documentElement.scrollTop;
    if(!nw_o_arr_0){
        var modal_height_ul = (g5_is_member?(is_dhtml_editor?460:340):(is_dhtml_editor?480:360))+30+(w_o_arr_2?(is_dhtml_editor?-300:-180):'');
        if(m_o_arr_0) var modal_height_ul = parseInt(modal_height_ul)+10;
        if(600>do_width) var modal_width_ul = parseInt(do_width)+30;
        else var modal_width_ul = 600+30;
        if(gv1||gv2||gv3)modal_height_ul = parseInt(modal_height_ul)+(gv1?+20:'')+((!go_arr_0||!go_arr_2)&&gv2?+20:'')+((!go_arr_2||!go_arr_5)&&gv3?+20:'');
        if(is_category) modal_width_ul = parseInt(modal_width_ul)+70;if(nw_o_arr_2) modal_width_ul = parseInt(modal_width_ul)+parseInt(nw_o_arr_2);
        if(nw_o_arr_3) modal_height_ul = parseInt(modal_height_ul)+parseInt(nw_o_arr_3);
        if(d_o3_arr_1||d_o4_arr_1) modal_width_ul = parseInt(modal_width_ul)+50;
        if(co2_arr_5&&!w_o_arr_2)  modal_height_ul = parseInt(modal_height_ul)+20;
        if(write_min||write_max)modal_height_ul = parseInt(modal_height_ul)+10;
        var pos_w_ul = parseInt((do_width-modal_width_ul)/2,10);
        var pos_h_ul = ($('#top_button').offset().top)-scrollTop;
        emailwindow=dhtmlmodal.open('EmailBox', 'iframe',G5_BBS_URL+'/write.php?bo_table='+g5_bo_table+'&pop=1&ftarget='+ftarget,'Load . Link','width='+modal_width_ul+'px,height='+modal_height_ul+'px,left='+pos_w_ul+',top='+pos_h_ul+',resize=1,scrolling=0')
    }else{
        location.replace(G5_BBS_URL+'/write.php?bo_table='+g5_bo_table+'&page='+g5_page);
    }
}
function nametag_config(){
    var do_width = document.body.clientWidth-20;
    var do_height = document.body.clientHeight-60;
    var scrollTop = document.body.scrollTop;
    if(scrollTop == 0)scrollTop = document.documentElement.scrollTop;
    var n_width = '380';var n_height = '200';
    if(!nw_o_arr_0){
        var pos_w_n = parseInt((do_width-n_width)/2,10);
        var pos_h_n = ($('#top_button').offset().top)-scrollTop;
        emailwindow=dhtmlmodal.open('EmailBox', 'iframe',bo_skin_p+'/a_nametag_config.php?bo_table='+g5_bo_table+'&page='+g5_page+'&pop=1','「'+nt_tn+'」님 네임택 설정','width='+n_width+'px,height='+n_height+'px,left='+pos_w_n+',top='+pos_h_n+',resize=1,scrolling=1');
    }else{
        NewWindow(bo_skin_p+'/a_nametag_config.php?bo_table='+g5_bo_table+'&page='+g5_page+'&pop=1','nametag',400,150,'no','center');
    }
}
function com_form_open(wr_id,id){
    if(id == 'dio'){
        $('#'+id+wr_id).css('width',
        $('#ck').width()+'px');
    }
    if($('#'+id+wr_id).css('display')=='none')$('#'+id+wr_id).show();
    else if($('#'+id+wr_id).css('display')=='block')$('#'+id+wr_id).hide();
    (function(){
        $('.write_textarea').elastic();
        $('.write_textarea').trigger('update');
    })(jQuery);
}
function c_k(rr){
    if(rr)rrr = rr;
    $.ajax({
        type: 'POST',
        url: g5_captcha_url+'/kcaptcha_session.php',
        cache: false,
        async: false,
        success: function(text) {
            var test = '';
        }
    });
}
function sc_view_code_help(){if(pop){iconmodalbox=dhtmlmodal.open('agebox', 'div', 'sc_view_code_help', '도움말', 'width=400px,height=150px,center=1,resize=1,scrolling=1');}else{NewWindow(bo_skin_p+'/a_icon_auto.php?bo_table='+g5_bo_table+'&wr_id='+wr_id+'&icon_pop=1&scvh=1','icon',400,150,'no','center');}}
if(pop2&&!g5_is_member){if(!webgcooa)$('#wr_name').focus(); else if(!webgcoob)$('#wr_password').focus(); else $('#wr_content').focus();}
function check_str(w,t,wr){
    var len = w.value.length;
    var c_max = parseInt(comment_max);
    if((len >= (c_max+1)) && c_max != 0) {$('#ok'+wr).focus();w.value=w.value.substr(0,c_max);alert(c_max+'자 이상 작성할 수 없습니다');w.focus();return false;}
    $('#'+t+wr).html(len);
}
function icon_box_open(){iconmodalbox=dhtmlmodal.open('agebox', 'div', 'icon_box', '아이콘', 'width=470px,height=250px,center=1,resize=1,scrolling=1')}
function m3rate_o(a,r,c){
    var n = parseInt(c);
    var r_int = parseInt(r);
    if(!r){
        for(i=1;i<=n;i++) {if(i%2)sr=bo_skin_p+'/'+theme_img_dir+'/sc1.png';else sr=bo_skin_p+'/'+theme_img_dir+'/sc2.png';document.getElementById('s_img'+a+i).src=sr;}
        for(i=n+1;i<=10;i++){if(i%2)sr=bo_skin_p+'/'+theme_img_dir+'/sb1.png';else    sr=bo_skin_p+'/'+theme_img_dir+'/sb2.png';document.getElementById('s_img'+a+i).src=sr;}
        document.getElementById('m3rate_comment'+a).innerHTML=m3rate_commentdefault;
    }else{
        for(i=1;i<=r_int;i++){if(i%2)sr=bo_skin_p+'/'+theme_img_dir+'/sch1.png';else sr=bo_skin_p+'/'+theme_img_dir+'/sch2.png';document.getElementById('s_img'+a+i).src=sr;}
        for(i=r_int+1;i<=10;i++){if(i%2)sr=bo_skin_p+'/'+theme_img_dir+'/sb1.png';else    sr=bo_skin_p+'/'+theme_img_dir+'/sb2.png';document.getElementById('s_img'+a+i).src=sr;}
        document.getElementById('m3rate_comment'+a).innerHTML=m3rate_commentarr[(r_int-1)]+m3rate_commentdefault;
    }
}
function all_checked(sw){var f = document.fboardlist;for (var i=0;i<f.length;i++){if(f.elements[i].name == "chk_wr_id[]")f.elements[i].checked = sw;}}
function check_confirm(str){var f = document.fboardlist;var chk_count = 0;for (var i=0;i<f.length;i++){if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)chk_count++;}if(!chk_count){alert(str+"할 게시물을 하나 이상 선택하세요.");return false;}return true;}
function select_delete(){var f = document.fboardlist;str = "삭제";if (!check_confirm(str))return;if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))return;f.action = "./delete_all.php";f.submit();}
function select_copy(sw){var f = document.fboardlist;if (sw == "copy")str = "복사"; else str = "이동";if (!check_confirm(str)) return;var sub_win = window.open("", "move", "left=50, top=50, width=396, height=550, scrollbars=1");f.sw.value = sw;f.target = "move";f.action = "./move.php";f.submit();}
답변을 작성하시기 전에 로그인 해주세요.
전체 123,594 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT