제로보드 관련된 유용한 정보를 공유하는 곳입니다.
  • 웹미니 한줄 전광판 영역 입니다.
글 수 98

18

조회 수 : 4298 신고 : 0

작성자 : 맑은숲
포인트 : 2863 | 레벨 : 5
출처 :  
1. 코멘트 수정 버튼 만들기

해당 게시판 스킨에서 view_comment.php를 열고,
소스 본문에서 <?=$a_del?> 부분을 찾아 그 앞에 <?=$a_cmod?><수정></a>을 추가.


2. 제로보드 폴더의 view.php를 수정

                        if($c_data[ismember]) {
                                if($c_data[ismember]==$member[no]||$is_admin||$member[level]<=$setup[grant_delete]) $a_del="<a onfocus=blur() href='del_comment.php?$href$sort&no=$no&c_no=$c_data[no]'>";
                                else $a_del=" <Zeroboard ";
                        } else $a_del="<a onfocus=blur() href='del_comment.php?$href$sort&no=$no&c_no=$c_data[no]'>";

------------------------*위의 부분을 아래처럼 수정*------------------------
if($c_data[ismember]) {
if($c_data[ismember]

==$member[no]||$is_admin||$member[level]<=$setup[grant_delete]) {
$a_del="<a onfocus=blur() href='del_comment.php?

$href$sort&no=$no&c_no=$c_data[no]'>";
$a_cmod="<a onfocus=blur() href='modify_comment.php?

$href$sort&no=$no&c_no=$c_data[no]'>";
}
else {
$a_del=" <Zeroboard ";
$a_cmod=" <Zeroboard ";
}
}
else {
$a_del="<a onfocus=blur() href='del_comment.php?

$href$sort&no=$no&c_no=$c_data[no]'>";
$a_cmod="<a onfocus=blur() href='modify_comment.php?

$href$sort&no=$no&c_no=$c_data[no]'>";
}
             
                                                                                                                   


3. 제로보드 폴더의 _head.php를 수정

/***************************************************************************
* 현재 _head.php를 호출하는 파일이 게시판 관련 파일인지 검사
**************************************************************************/
         $_zb_file_list = array("apply_vote.php","comment_ok.php","del_comment.php","del_comment_ok.php","delete.php","download.php","list_all.php","view.php","vote.php","write.php","write_ok.php","zboard.php","image_box.php");

------------------------*위의 부분을 아래처럼 수정*------------------------

/***************************************************************************
* 현재 _head.php를 호출하는 파일이 게시판 관련 파일인지 검사
**************************************************************************/
        $_zb_file_list =

array("apply_vote.php","comment_ok.php","modify_comment.php","modify_comment_ok.php","del_comment.php","del_commen

t_ok.php","delete.php","download.php","list_all.php","view.php","vote.php","write.php","write_ok.php","zboard.php"

,"image_box.php");


4. 제로보드 폴더에 modify_comment.php를 생성 (del_comment.php를 응용)

<?
/***************************************************************************
* 공통 파일 include
**************************************************************************/
        include "_head.php";

        if(!eregi($HTTP_HOST,$HTTP_REFERER)) Error("정상적으로 글을 수정하여 주시기 바랍니다.");

/***************************************************************************
* 코멘트 수정 페이지 처리
**************************************************************************/

// 원본글을 가져옴
        $s_data=mysql_fetch_array(mysql_query("select * from $t_comment"."_$id where no='$c_no'"));

        if($s_data[ismember]||$is_admin||$member[level]<=$setup[grant_delete]) {
                if(!$is_admin&&$s_data[ismember]!=$member[no]) Error("수정할 권한이 없습니다");
    if ($s_data[ismember]==$member[no]) $name=$member[name];
                else $name=$s_data[name];
        }

        $target="modify_comment_ok.php";

        $memo=trim(stripslashes($s_data[memo]));

        head();

        include $dir."/modify_comment.php";

        foot();

        include "_foot.php";
?>


5. 제로보드 폴더에 modify_comment_ok.php를 생성 (comment_ok.php를 응용)

<?

/***************************************************************************
* 공통 파일 include
**************************************************************************/
        include "_head.php";

        if(!eregi($HTTP_HOST,$HTTP_REFERER)) Error("정상적으로 글을 수정하여 주시기 바랍니다.");

/***************************************************************************
* 코멘트 수정 진행
**************************************************************************/

// 각종 변수 검사;;
        $memo = str_replace("","",$memo);
        if(isblank($memo)) Error("내용을 입력하셔야 합니다");
        if(!$member[no]) {
                if(isblank($name)) Error("이름을 입력하셔야 합니다");
                if(isblank($password)) Error("비밀번호를 입력하셔야 합니다");
        }

// 필터링;; 관리자가 아닐때;;
        if(!$is_admin&&$setup[use_filter]) {
                $filter=explode(",",$setup[filter]);

                $f_memo=eregi_replace("([_-./~@?=%&! ]+)","",strip_tags($memo));
                $f_name=eregi_replace("([_-./~@?=%&! ]+)","",strip_tags($name));
                $f_subject=eregi_replace("([_-./~@?=%&! ]+)","",strip_tags($subject));
                $f_email=eregi_replace("([_-./~@?=%&! ]+)","",strip_tags($email));
                $f_homepage=eregi_replace("([_-./~@?=%&! ]+)","",strip_tags($homepage));
                for($i=0;$i<count($filter);$i++)
                if(!isblank($filter[$i])) {
                        if(eregi($filter[$i],$f_memo)) Error("<b>$filter[$i]</b> 은(는) 등록하기에 적합한 단어가

아닙니다");
                        if(eregi($filter[$i],$f_name)) Error("<b>$filter[$i]</b> 은(는) 등록하기에 적합한 단어가

아닙니다");
                }
        }

// 패스워드를 암호화
        if($password) {
                $temp=mysql_fetch_array(mysql_query("select password('$password')"));
                $password=$temp[0];
        }

// 원본글을 가져옴
        $s_data=mysql_fetch_array(mysql_query("select * from $t_comment"."_$id where no='$c_no'"));

// 회원일때를 확인;;
        if(!$is_admin&&$member[level]>$setup[grant_delete]) {
                if(!$s_data[ismember]) {
                        if($s_data[password]!=$password) Error("비밀번호가 올바르지 않습니다");
                } else {
                        if($s_data[ismember]!=$member[no]) Error("비밀번호를 입력하여 주십시요");
                }
        }

// 관리자이거나 HTML허용레벨이 낮을때 태그의 금지유무를 체크
        if(!$is_admin&&$setup[grant_html]<$member[level]) {
                $memo=del_html($memo);// 내용의 HTML 금지;;
        }

// 회원등록이 되어 있을때 이름등을 가져옴;;
        if($member[no]) {
                if($member[no]!=$s_data[ismember]) $name=$s_data[name];
                else $name=$member[name];
        }

// 각종 변수의 addslashes 시킴
        $name=addslashes(del_html($name));
        $memo=autolink($memo);
        $memo=addslashes($memo);

// 같은 내용이 있는지 검사;;
        if(!$is_admin) {
                $temp=mysql_fetch_array(mysql_query("select count(*) from $t_comment"."_$id where memo='$memo' and

no='$max_no[0]'"));
                if($temp[0]>0) Error("같은 내용의 글은 등록할수가 없습니다");
        }

// 해당글이 있는 지를 검사
        $check = mysql_fetch_array(mysql_query("select count(*) from $t_comment"."_$id where no = '$c_no'",

$connect));
        if(!$check[0]) Error("원본 글이 존재하지 않습니다.");

// 코멘트 수정
        mysql_query("update $t_comment"."_$id set

name='$name',memo='$memo',ismember='$s_data[ismember]',ip='$REMOTE_ADDR',
reg_date='$s_data[reg_date]' where no='$c_no'") or error(mysql_error());

        @mysql_close($connect);

// 페이지 이동
        if($setup[use_alllist]) movepage("zboard.php?

id=$id&page=$page&page_num=$page_num&select_arrange=$select_arrange&desc=$des&sn=$sn&ss=$ss&sc=$sc&keyword=$keywor

d&no=$no");
        else movepage("view.php?

id=$id&page=$page&page_num=$page_num&select_arrange=$select_arrange&desc=$des&sn=$sn&ss=$ss&sc=$sc&keyword=$keywor

d&no=$no");
?>


6. 해당 게시판 스킨 폴더에 modify_comment.php 생성
(view_write_comment.php를 응용, nzeo_ver4 기준)

<table border=0 cellspacing=1 cellpadding=1 class=line1 width=<?=$width?>>
<tr>
        <td bgcolor=white>
                <table border=0 cellspacing=1 cellpadding=8 width=100% height=120 bgcolor=white>
                <script>
                        function check_comment_submit(obj) {
                                if(obj.memo.value.length<10) {
                                        alert("코멘트는 10자 이상 적어주세요");
                                        obj.memo.focus();
                                        return false;
                                }
                                return true;
                        }
                </script>
                <form method=post name=write action=<?=$target?> onsubmit="return

check_comment_submit(this)"><input type=hidden name=page value=<?=$page?>><input type=hidden name=id

value=<?=$id?>><input type=hidden name=no value=<?=$no?>><input type=hidden name=c_no value=<?=$c_no?>><input

type=hidden name=select_arrange value=<?=$select_arrange?>><input type=hidden name=desc value=<?=$desc?>><input

type=hidden name=page_num value=<?=$page_num?>><input type=hidden name=keyword value="<?=$keyword?>"><input

type=hidden name=category value="<?=$category?>"><input type=hidden name=sn value="<?=$sn?>"><input type=hidden

name=ss value="<?=$ss?>"><input type=hidden name=sc value="<?=$sc?>"><input type=hidden name=mode

value="<?=$mode?>">
                <col width=95 align=right style=padding-right:10px></col><col width=></col><col width=95

align=right style=padding-right:10px></col><col width=></col>
                <?if(!$name){?>
                <tr>
                        <td class=list0><font class=list_eng><b>이름</b></td>
                        <td class=list1><font class=list_han><?=$c_name?></font><input type=text name=name

<?=size(8)?> maxlength=20 class=input></td>
                        <?=$hide_c_password_start?>
                        <td class=list0><font class=list_eng><b>암호</b></td>
                        <td class=list1><input type=password name=password <?=size(8)?> maxlength=20

class=input></td>
                        <?=$hide_c_password_end?>
                </tr>
                <?}?>
                <tr>
                        <td class=list0 onclick="document.write.memo.rows=document.write.memo.rows+4"

style=cursor:hand><font class=list_eng><b>짧은글</b><br>▼</td>
                        <td class=list1 colspan=4>
                                <table border=0 cellspacing=2 cellpadding=0 width=100% height=100%>
                                <col width=""></col><col width=100></col>
                                <tr>
                                        <td width=100% colspan=2><textarea name=memo cols=20 rows=8 class=textarea

style=width:100%><?=$memo?></textarea></td>
                                        <td width=100 colspan=2><input type=submit rows=5 class=submit value='  글

쓰기  ' accesskey="s" style=height:100%></td>
                                </tr>
                                </table>
                        </td>
                </tr>
                </form>
                </table>
        </td>
</tr>
</table>




이상 끝입니다~!
소중한 댓글 부탁드립니다.
추천수 10단위당 메달이 1개씩 노출되고, 추천수에 따라 배경색이 변하며, 일정수의 추천수를 받을시 BEST 아이콘이 붙게됩니다.
추천수에 따른 배경색 보기 본문으로 바로가기
  • 추천수 50개이상
  • 추천수 30개이상
  • 추천수 20개이상
  • 추천수 10개이상
  • 추천수 3개이상
닫기

댓글 '7'

맑은숲 (17400)

2004.10.24 00:09:59

작성자
혹시 있으신지 모르겠네요....중복이면 지우시구요..
필요할듯 해서 올려 봅니다.
profile
title: [ani]깜빡이는 표정빽짱구 (17401)

2004.10.24 02:26:40

오우 소스가 굉장히 길어요.. 맑은숲님 사실 저 이거 필요한 팁이었어요.. 시간날때 적용해 볼게요.. 맑은숲님 홈에 적용하셨나요?
맑은숲 (17402)

2004.10.25 23:34:28

작성자
ㅎ 지금 열심히 해보는 중인데요..만만치...않습니다..
맑은숲 (17403)

2004.10.31 16:19:05

작성자
에효~ 드디어...성공이닷....와서 함 보세요..^^
생각한것 보다는..어렵네요.제가...아는게 넘 없어서.
어찌...어찌..우연하게 된거라고...말해야 할듯....ㅡ.ㅡ;;
profile
title: [ani]깜빡이는 표정빽짱구 (17404)

2004.11.04 16:41:14

잘하셨어요.. 저도 적용해봐야지
profile
title: [ani]깜빡이는 표정빽짱구 (17405)

2004.11.04 18:30:35

위에 소스가 잘못되어있어서 에러가 뜨는군요.. 그래서 이글 수정했습니다.
맑은숲 (17406)

2004.11.27 02:12:16

작성자
아 그랬나요? ㅎㅎ 역쉬 대단하세요...고마와요^^;;
List of Articles
번호 제목 글쓴이 날짜 추천 수 조회 수sort
98 hit best of best 쪽지창을 메신저처럼 하기 file [4] title: [ani]깜빡이는 표정빽짱구 2006-11-16 50 17805
97 hit best of best 제로보드 pl8 보안 취약점 패치하세요 [2] title: [ani]깜빡이는 표정빽짱구 2006-06-17 63 10263
96 best of best 제로보드 서버이전 방법 title: [ani]깜빡이는 표정빽짱구 2004-07-12 25 8845
95 best of best 자동글 등록방지하기(광고글) file [1] title: [ani]깜빡이는 표정빽짱구 2006-09-16 35 7588
94 best of best 최근게시물에 카테고리 뽑아오기 [1] title: [ani]깜빡이는 표정빽짱구 2006-11-15 42 7468
93 게시판타이틀메뉴 자동 생성 + 카테고리--->이미지로 바꿀수 있음. title: [ani]깜빡이는 표정빽짱구 2006-06-22 15 7087
92 best of best 글읽기 권한 없을때 로그인 페이지만드는 방법 [1] title: [ani]깜빡이는 표정빽짱구 2006-10-23 38 6888
91 best of best 최근게시물에 new 아이콘 달기 title: [ani]깜빡이는 표정빽짱구 2006-11-15 46 6822
90 best of best 로그아웃시 원하는 페이지로 이동 시키기 title: [ani]깜빡이는 표정빽짱구 2006-10-24 35 6808
89 best of best 최근게시물 클릭시 권한이 없을때 로그인페이지로 이동하기 [1] title: [ani]깜빡이는 표정빽짱구 2006-10-23 45 6449
88 best of best 레벨별로 오른쪽 마우스 금지하기 title: [ani]깜빡이는 표정빽짱구 2006-10-30 44 6248
87 일정시간 페이지사용이 없을시 로그아웃버튼 먹통일때 title: [ani]깜빡이는 표정빽짱구 2006-10-23 12 5762
86 best of best 제로보드 에러 페이지를 경고창으로 띄우기 title: [ani]깜빡이는 표정빽짱구 2006-10-26 26 5628
85 best of best 도배방지 하루 글쓰기 코맨트쓰기 제한하기 title: [ani]깜빡이는 표정빽짱구 2004-04-10 22 5542
84 로그인 자동으로 커서놓기 title: [ani]깜빡이는 표정빽짱구 2006-10-24 18 5458
83 제로보드 비밀글관련 보안패치 4.1 pl7 title: [ani]깜빡이는 표정빽짱구 2005-04-06 17 5435
82 쪽지에 파일을 첨부하자!!! [1] title: [ani]깜빡이는 표정빽짱구 2004-10-24 19 5259
81 회원 탈퇴할 때 비밀번호와 주민등록번호 확인후 탈퇴시키기 title: [ani]깜빡이는 표정빽짱구 2005-01-02 16 5120
80 제로보드, 쪽지오면 자동쪽지함 띄우기 title: [ani]깜빡이는 표정빽짱구 2004-03-07 14 5089
79 자동로그인 경고창에서 [확인] 클릭시 바로 로그인 title: [ani]깜빡이는 표정빽짱구 2006-10-23 19 5085