RadarURL

웹 프로그래밍
2006.11.05 13:56

제로보드 날짜 병경을 내맘대루~

조회 수 5003 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄


http://www.nzeo.com/bbs/zboard.php?id=cgi_tip&page=6&sn1=&divpage=1&sn=off&ss=on&sc=on&keyword=날짜&select_arrange=headnum&desc=asc&no=1742


하지만, 전 새롭게 페이지를 열어서 게시판 이름과 번호를 써서 고치는 것 보다는
그냥 그 게시물을 수정할때, 임의로 고칠 수 있도록 만들고 싶어서 한번 만들어 봤습니다.
더 좋은 방법이 있으면 알려주세요..


1. 제로보드 root 폴더에 있는 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);
                        $memo=stripslashes($data[memo]); // 내용
                        $sitelink1=$data[sitelink1]=stripslashes($data[sitelink1]);
                        $sitelink2=$data[sitelink2]=stripslashes($data[sitelink2]);
           


이 부분 바로 밑에 아래를 소스를 삽입합니다.
//임의날짜 수정 추가
            $reg_date=$data[reg_date];


제로보드 폴더의 write.php 소스수정 끝.


2. 그 다음은 write_ok.php의 수정글일때의 부분만 수정합니다.
아래의 부분을 찾습니다.
/***************************************************************************
* 수정글일때
**************************************************************************/
        if($mode=="modify"&&$no) {


                if($s_data[ismember]) {
                        if(!$is_admin&&$member[level]>$setup[grant_delete]&&$s_data[ismember]!=$member[no]) Error("정상적인 방법으로 수정하세요");
                }


                // 비밀번호 검사;;
                if($s_data[ismember]!=$member[no]&&!$is_admin) {
                        if($password!=$s_data[password]) Error("비밀번호가 틀렸습니다");
                }


                // 파일삭제
                if($del_file1==1) {@z_unlink("./".$s_data[file_name1]);$del_que1=",file_name1='',s_file_name1=''";}
                if($del_file2==1) {@z_unlink("./".$s_data[file_name2]);$del_que2=",file_name2='',s_file_name2=''";}


                // 파일등록
                if($file_name1) {$del_que1=",file_name1='$file_name1',s_file_name1='$s_file_name1'";}
                if($file_name2) {$del_que2=",file_name2='$file_name2',s_file_name2='$s_file_name2'";}


여기 바로 밑에 아래의 소스를 추가합니다.
  //임의 날짜 변환
        if(!$year) {
        $reg_date= $reg_date_old;}
        else {
        $t_time = mktime($hour, $min, $sec, $mon, $day, $year);
        $reg_date=$t_time;}


또 그 아래에 좀 내려가시다 보면 수정할 곳이 또 있습니다.
@mysql_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',reg_date='$reg_date',subject='$subject',memo='$memo',sitelink1='$sitelink1',sitelink2='$sitelink2',use_html='$use_html',reply_mail='$reply_mail',is_secret='$is_secret',category='$category' $del_que1 $del_que2 where no='$no'") or error(mysql_error());


이런 부분이 있는데, 수정글일때 부분의 이런 부분에 reg_date='$reg_date' 소스를 넣어줍니다.
그러니까..
수정글일때 부분에서 // 공지 -> 일반글, // 일반글 -> 공지, // 일반->일반, 공지->공지 일때, 이 세부분만 고쳐시면 됩니다.


3. 그 다음 마지막으로 skin 폴더에 있는 스킨의 write.php 소스에 아래의 소스를 넣어주시면 됩니다.
<?=$hide_notice_start?>
<!--- 날짜 임의 수정 시작-------->
<input type=hidden name='reg_date_old' value=<?=$reg_date ?>>
<tr>
  <td align=right class=listnum width=80><img src=images/t.gif border=0 width=80 height=1><br>날짜수정 </td>
  <td>
  <table border=0 cellpadding=0 cellspacing=0>
  <tr>                            
    <td><input type="text" name="year" size="6" maxlength=4 class=input> 년 <input type="text" name="mon" size="4" maxlength=2 class=input> 월 <input type="text" name="day" size="4" maxlength=2 class=input> 일 (수정 안할시에는 그냥 놔두세요.)
    <input type="hidden" name="hour" size="2" value="0">
    <input type="hidden" name="min" size="2" value="0">
    <input type="hidden" name="sec" size="2" value="0">
    </td>                                                      
  </tr>                                                    
  </table>     
  </td>
</tr>
<!--- 날짜 임의 수정 끝 -------->
<?=$hide_notice_end?>

출처 : http://www.nzeo.com/bbs/zboard.php?id=cgi_tip&page=3&sn1=&divpage=1&sn=off&ss=on&sc=on&keyword=날짜&select_arrange=headnum&desc=asc&no=6160

?

공부 게시판

공부에 도움되는 글을 올려주세요.

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 [공지] 공부 게시판 입니다. 처누 2003.08.18 928100
346 응용 프로그래밍 WIndows Application의 실행 속도 측정 file JaeSoo 2023.09.06 3185
345 웹 프로그래밍 메모리 부족 현상 (allowed memory size of 134217728 bytes..) JaeSoo 2023.08.01 2207
344 웹 프로그래밍 Guzzle - cURL error 60: SSL certificate problem: unable to get local issuer certificate 문제 해결 file JaeSoo 2023.07.30 2188
343 웹 프로그래밍 XE 캐시파일 재성생후 404 Oops, Sorry. Page is not found! 나올때 JaeSoo 2023.07.29 2117
342 응용 프로그래밍 [Apple] 엔터프라이즈 계정신청 (Enterprise Program) file JaeSoo 2023.03.27 267
341 웹 프로그래밍 XE - " Fatal error: Class 'Object' not found in " / class 낫파운드 오류 file JaeSoo 2023.03.20 147
340 응용 프로그래밍 [MSA] MSA란 무엇인가? 개념 이해하기 file JaeSoo 2023.01.26 210
339 웹 프로그래밍 iOS 앱 개발을 위한 인증서 생성 및 관리 file JaeSoo 2023.01.18 218
338 프로그래밍 [ iOS ] 앱 스토어 개인, 회사, 엔터프라이즈 차이점 file JaeSoo 2023.01.09 237
337 웹 프로그래밍 PHP 파서 이해하기 (<?php의 php를 생략하고 간단히 <? 태그 와 ?> 태그를 사용하는 방법) JaeSoo 2016.08.10 322
336 프로그래밍 SVN의 cleanup 에러시 해결방법 JaeSoo 2016.05.05 728
335 프로그래밍 [오류해결] svn cleanup failed-previous operation has not finished; run cleanup if it was interrupted file JaeSoo 2016.05.05 611
334 프로그래밍 TortoiseSVN 계정변경 file JaeSoo 2016.05.05 582
333 프로그래밍 SVN passwd 설정 : 계정 (users/passwd) file JaeSoo 2016.05.04 543
332 웹 프로그래밍 XE 비회원 글쓰기 항목 지우기 file JaeSoo 2016.04.28 499
331 응용 프로그래밍 메모리 영역 (code, data, stack, heap) file JaeSoo 2016.03.23 747
330 응용 프로그래밍 [SVN] Subversion 명령들 file JaeSoo 2016.02.06 967
329 응용 프로그래밍 IBM JDK 1.6 에서 Spring 2.5.2를 사용할 때 GenericTypeResolver 에서 NullPointerException이 발생하는 문제 JaeSoo 2016.01.27 787
328 웹 프로그래밍 오른쪽 마우스 금지 소스 / 드래그 금지 소스 JaeSoo 2016.01.20 475
327 응용 프로그래밍 [전자정부 표준프레임워크] 톰캣(Tomcat) 설치하기 file JaeSoo 2016.01.02 535
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 18 Next
/ 18


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너