[G5] 게시판관리 > 내용관리 > 글쓰기(에디터) > 내용 에 javascript(자바스크립트) 사용하기 > 기술자료 | 해피정닷컴

[G5] 게시판관리 > 내용관리 > 글쓰기(에디터) > 내용 에 javascript(자바스크립트) 사용하기 > 기술자료

본문 바로가기

사이트 내 전체검색

[G5] 게시판관리 > 내용관리 > 글쓰기(에디터) > 내용 에 javascript(자바스크립트) 사용하기 > 기술자료

그누보드 [G5] 게시판관리 > 내용관리 > 글쓰기(에디터) > 내용 에 javascript(자바스크립트) 사용하기

페이지 정보


본문

컨텐츠(content)에 입력되는 내용에 javascript 가 입력되어야 하는 경우가 있습니다
예를 들면 아래와 같이 사이즈 지정된 크기의 새창이 열린다거나 할때
<a href="#" onclick="window.open('/delivery.php','evaluate','resizable=no, scrollbars=no, width=500, height=500');">배송서비스신청</a>

아래와 같이 수정하면 본문에 입력된 자바스크립트 등이 문제없이 사용 할 수 있습니다

1-1. adm / contentform.php

    <tr>
        <th scope="row">내용</th>
        <td><?php echo editor_html('co_content', get_text(html_purifier($co['co_content']), 0)); ?></td>
    </tr>
                <tr>
                    <th scope="row"><label for="co_skin">스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
                    <td>
                        <?php echo get_skin_select('content', 'co_skin', 'co_skin', $co['co_skin'], 'required'); ?>
                    </td>
                </tr>
    <tr>
        <th scope="row">모바일 내용</th>
        <td><?php echo editor_html('co_mobile_content', get_text(html_purifier($co['co_mobile_content']), 0)); ?></td>
    </tr>
                <tr>
                    <th scope="row"><label for="co_mobile_skin">모바일스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
                    <td>
                        <?php echo get_mobile_skin_select('content', 'co_mobile_skin', 'co_mobile_skin', $co['co_mobile_skin'], 'required'); ?>
                    </td>
                </tr>

를 아래와 같이 변경

    <?php if ($co['co_tag_filter_use']==1) { // 태그 필터링 사용 ?>
    <tr>
        <th scope="row">내용</th>
        <td><?php echo editor_html('co_content', get_text(html_purifier($co['co_content']), 0)); ?></td>
    </tr>
                <tr>
                    <th scope="row"><label for="co_skin">스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
                    <td>
                        <?php echo get_skin_select('content', 'co_skin', 'co_skin', $co['co_skin'], 'required'); ?>
                    </td>
                </tr>
    <tr>
        <th scope="row">모바일 내용</th>
        <td><?php echo editor_html('co_mobile_content', get_text(html_purifier($co['co_mobile_content']), 0)); ?></td>
    </tr>
                <tr>
                    <th scope="row"><label for="co_mobile_skin">모바일스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
                    <td>
                        <?php echo get_mobile_skin_select('content', 'co_mobile_skin', 'co_mobile_skin', $co['co_mobile_skin'], 'required'); ?>
                    </td>
                </tr>
    <?php } else { ?>
    <tr>
        <th scope="row">내용</th>
        <td><?php echo editor_html('co_content', get_text($co['co_content'], 0)); ?></td>
    </tr>
                <tr>
                    <th scope="row"><label for="co_skin">스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
                    <td>
                        <?php echo get_skin_select('content', 'co_skin', 'co_skin', $co['co_skin'], 'required'); ?>
                    </td>
                </tr>
    <tr>
        <th scope="row">모바일 내용</th>
        <td><?php echo editor_html('co_mobile_content', get_text($co['co_mobile_content'], 0)); ?></td>
    </tr>
                <tr>
                    <th scope="row"><label for="co_mobile_skin">모바일스킨 디렉토리<strong class="sound_only">필수</strong></label></th>
                    <td>
                        <?php echo get_mobile_skin_select('content', 'co_mobile_skin', 'co_mobile_skin', $co['co_mobile_skin'], 'required'); ?>
                    </td>
                </tr>
    <?php } ?>


1-2. adm / contentform.php
아래 내용이 작동하도록 주석해제

    <!--
    <tr>
        <th scope="row"><label for="co_tag_filter_use">태그 필터링 사용</label></th>
        <td>
            <?php echo help("내용에서 iframe 등의 태그를 사용하려면 사용안함으로 선택해 주십시오."); ?>
            <select name="co_tag_filter_use" id="co_tag_filter_use">
                <option value="1"<?php echo get_selected($co['co_tag_filter_use'], 1); ?>>사용함</option>
                <option value="0"<?php echo get_selected($co['co_tag_filter_use'], 0); ?>>사용안함</option>
            </select>
        </td>
    </tr>
    -->


2. bbs / content.php

$co['co_tag_filter_use'] = 1;
$str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']);

를 아래와 같이 변경

//$co['co_tag_filter_use'] = 1;
//$str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']);
if ($co['co_tag_filter_use']==1) { // 태그 필터링 사용
    $str = conv_content($co['co_content'], $co['co_html'], $co['co_tag_filter_use']);
} else {
    $str = $co['co_content'];
}

댓글목록

등록된 댓글이 없습니다.


Total 2,643건 2 페이지
  • RSS
기술자료 목록
2623
일반   3364  2023-12-15 18:33  
2622
Android   2589  2023-11-30 18:48 ~ 2023-11-30 19:41  
2621
전자결제   4819  2023-11-23 19:53  
2620
PHP   3821  2023-11-20 10:56 ~ 2023-11-20 11:14  
2619
Linux   2970  2023-11-09 19:55  
2618
그누보드   3187  2023-11-06 20:38  
2617
Linux   3457  2023-11-01 21:41 ~ 2023-11-02 10:30  
2616
영카트   2749  2023-10-07 23:31  
2615
SNS   3664  2023-09-24 17:56  
2614
ClassicASP   3257  2023-09-14 08:38  
2613
APP   2813  2023-09-08 12:34 ~ 2023-09-08 17:36  
2612
Apple   4648  2023-09-01 18:16 ~ 2023-09-01 18:36  
2611
SNS   3407  2023-08-30 17:10  
2610
전자결제   3249  2023-08-24 13:32  
2609
Editor   3292  2023-08-11 12:23  
2608
Editor   3480  2023-08-09 21:54 ~ 2023-08-09 21:56  
2607
JavaScript   3173  2023-08-01 23:01 ~ 2023-08-01 23:35  
2606
Android   2996  2023-07-19 14:30 ~ 2023-07-19 14:39  
2605
MSSQL   3467  2023-06-28 17:51 ~ 2023-06-28 17:53  
2604
Android   3212  2023-06-09 17:06 ~ 2023-06-13 16:49  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2025 해피정닷컴. All Rights Reserved.