뽀라닷컴
Loading...




웹디자인,포토샵,그누보드,제로보드,동영상제작 관련 메모 >>


전체(437)인터넷,컴퓨터 (94) | 웹디자인tip (182) | CG,그래픽tip (70) | BBS_Tip (74) | 영상tip (17) |
제로보드 예비필드 활용 2009-02-17 03:49:45
홈페이지홈페이지

예비 필드 x,y 를 활용하자..
자료출처 : NZEO 유메미루님
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
첨부파일 : (0) 0
필드를 추가하는 방법입니다.
※ 수정해야할 부분이 많으니 적용전에 반드시 백업을 해두시기 바랍니다.
    스킨수정에 대한 지식이 없는 분은 적용하기가 어려울 수 있습니다.


1. 적용할 스킨의 write.php 을 수정합니다.
<tr>
  <td style='font-family:Tahoma; font-size:8pt' align=right>예비 필드 1</td>
  <td> <input type=text name=zx value="<?=$data[x]?>" <?=size(20)?> maxlength=100 class=input></td>
</tr>
<tr>
  <td style='font-family:Tahoma; font-size:8pt' align=right>예비 필드 2</td>
  <td> <input type=text name=zy value="<?=$data[y]?>" <?=size(20)?> maxlength=100 class=input></td>
</tr>

위에서 처럼 name=zx , name=zy 로 받으셔야 제대로 작동을 합니다.

2. 두번째 고칠 파일은 제로보드 폴더의 write.php 문입니다.
if($mode=="modify") {

                // 비밀글이고 패스워드가 틀리고 관리자가 아니면 리턴
                if($data[is_secret]&&!$is_admin&&$data[ismember]!=$member[no]&&$HTTP_COOKIE_VARS[zb_s_check]!=$setup[no]."_".$no) error("정상적인 방법으로 수정하세요");

                        $name=stripslashes($data[name]); // 이름
                        $email=stripslashes($data[email]); // 메일
                        $homepage=stripslashes($data[homepage]); // 홈페이지
                        $subject=$data[subject]=stripslashes($data[subject]); // 제목
                        $subject=str_replace("\"",""",$subject);
                        $homepage=str_replace("\"",""",$homepage);
                        $name=str_replace("\"",""",$name);
                        $sitelink1=str_replace("\"",""",$sitelink1);
                                 $sitelink2=str_replace("\"",""",$sitelink2);
                                                // 추가 필드 사용을 위한 추가 by 유메  
                                                $x=stripslashes($data[x]);
                                                $y=stripslashes($data[y]);

위부분을 찾으셔서 위의 두줄을 추가해주세요.. 이것을 해주셔야 저장된 게시물을 수정할때 x,y 의 내용이 보이게 됩니다.

3. 세번째 수정할 파일은 write_ok.php 문입니다.
// 각종 변수의 addslashes 시킴;;
       $homepage=addslashes(del_html($homepage));
        // 예비 추가 필드 사용을 위한 추가 by 유메
        $x=addslashes(del_html($x));
        $y=addslashes(del_html($y));

/***************************************************************************
* 수정글일때
**************************************************************************/
minus_division($s_data[division]);
// 예비 필드 수정모드 사용을 위한 추가 by 유메
@mysql_l_query("update $t_board"."_$id set headnum='$headnum',prev_no='$prev_no',next_no='$next_no',child='$child',depth='$depth',arrangenum='$arrangenum',father='$father',name='$name',email='$email',homepage='$homepage',subject='$subject',memo='$memo',sitelink1='$sitelink1',sitelink2='$sitelink2',use_html='$use_html',reply_mail='$reply_mail',is_secret='$is_secret',x='$x',y='$y',category='$category' $del_que1 $del_que2 where no='$no'") or error(mysql_error());
plus_division($division);

// 일반글 -> 공지
@mysql_query("update $t_board"."_$id set division='$division',headnum='$headnum',prev_no='$prev_no',next_no='$next_no',child='$child',depth='$depth',arrangenum='$arrangenum',father='$father',name='$name',email='$email',homepage='$homepage',subject='$subject',memo='$memo',sitelink1='$sitelink1',sitelink2='$sitelink2',use_html='$use_html',reply_mail='$reply_mail',is_secret='$is_secret',x='$x',y='$y',category='$category' $del_que1 $del_que2 where no='$no'") or error(mysql_error());

// 일반->일반, 공지->공지 일때
} else {
@mysql_query("update $t_board"."_$id set name='$name',subject='$subject',email='$email',homepage='$homepage',memo='$memo',sitelink1='$sitelink1',sitelink2='$sitelink2',use_html='$use_html',reply_mail='$reply_mail',is_secret='$is_secret',x='$x',y='$y',category='$category' $del_que1 $del_que2 where no='$no'") or error(mysql_error());
                        


/***************************************************************************
* 답변글일때
**************************************************************************/
// 답글 데이타 입력;;
mysql_query("insert into $t_board"."_$id (division,headnum,arrangenum,depth,prev_no,next_no,father,child,ismember,memo,ip,password,name,homepage,email,subject,use_html,reply_mail,category,is_secret,sitelink1,sitelink2,file_name1,file_name2,s_file_name1,s_file_name2,x,y,reg_date,islevel) values ('$division','$headnum','$arrangenum','$depth','$prev_no','$next_no','$father','$child','$member[no]','$memo','$ip','$password','$name','$homepage','$email','$subject','$use_html','$reply_mail','$category','$is_secret','$sitelink1','$sitelink2','$file_name1','$file_name2','$s_file_name1','$s_file_name2','$x','$y','$reg_date','$member[is_admin]')") or error(mysql_error());    

/***************************************************************************
* 신규 글쓰기일때
**************************************************************************/

mysql_query("insert into $t_board"."_$id (division,headnum,arrangenum,depth,prev_no,next_no,father,child,ismember,memo,ip,password,name,homepage,email,subject,use_html,reply_mail,category,is_secret,sitelink1,sitelink2,file_name1,file_name2,s_file_name1,s_file_name2,x,y,reg_date,islevel) values ('$division','$headnum','$arrangenum','$depth','$prev_no','$next_no','$father','$child','$member[no]','$memo','$ip','$password','$name','$homepage','$email','$subject','$use_html','$reply_mail','$category','$is_secret','$sitelink1','$sitelink2','$file_name1','$file_name2','$s_file_name1','$s_file_name2','$x','$y','$reg_date','$member[is_admin]')") or error(mysql_error());


4. 적용할 스킨 view.php 파일의 적당한 곳에 <?=$data[x]?>  <?=$data[y]?>을 삽입니다.



    



목록보기 삭제하기