크게 작게 인쇄

[그누보드]SNS 날짜 표시


lib/common.lib.php 의 

        $list['datetime2'] = $list['wr_datetime']; 
        if ($list['datetime'] == $g4['time_ymd']) 
            $list['datetime2'] = substr($list['datetime2'],11,5); 
        else 
            $list['datetime2'] = substr($list['datetime2'],5,5); 

를 
        $timestamp = strtotime($list['wr_datetime']); // 글쓴날짜시간 Unix timestamp 형식 
        $current = $g4['server_time']; // 현재날짜시간 Unix timestamp 형식 
        // 열라 긴 세월 20년 
        if ($timestamp <= $current - 86400 * 7300) { 
            $str = (int)(($current - $timestamp) / (86400 * 7300)) . "열라오래됨"; 
        } 
        // 호랭이 담배피던 시절 10년 
        else if ($timestamp <= $current - 86400 * 3650) { 
            $str = (int)(($current - $timestamp) / (86400 * 3650)) . "호랭이 담배피던 시절"; 
        } 
        else if ($timestamp <= $current - 86400 * 365) { 
            $str = (int)(($current - $timestamp) / (86400 * 365)) . "년전"; 
        } 
        else if ($timestamp <= $current - 86400 * 31) { 
            $str = (int)(($current - $timestamp) / (86400 * 31)) . "개월전"; 
        } 
        else if ($timestamp <= $current - 86400 * 1) { 
            $str = (int)(($current - $timestamp) / 86400) . "일전"; 
        } 
        else if ($timestamp <= $current - 3600 * 1) { 
            $str = (int)(($current - $timestamp) / 3600) . "시간전"; 
        } 
        else if ($timestamp <= $current - 60 * 1) { 
            $str = (int)(($current - $timestamp) / 60) . "분전"; 
        } 
        else { 
            $str = (int)($current - $timestamp) . "초전"; 
        } 
        $list['datetime2'] = $str;

수정



※ 로그인 하시면 원본파일을 볼 수 있습니다. ※

0
코멘트 0
자동등록방지 코드
그누보드팁 | 전체게시물 160
안내

포인트안내닫기

  • 글읽기0
  • 글쓰기100
  • 댓글쓰기50
  • 다운로드-500
그누보드팁리스트
번호 제목 글쓴이 날짜 조회 추천
 공지  텍스트 슈퍼맨 웹스터디 12-17 - -
160 파일첨부 +1 링크 슈퍼맨 웹스터디 12-07 4928 0
159 텍스트 +3 슈퍼맨 웹스터디 12-07 4320 0
158 텍스트 +1 슈퍼맨 웹스터디 01-10 5451 0
157 텍스트 슈퍼맨 웹스터디 12-14 5069 0
156 텍스트 링크 슈퍼맨 웹스터디 12-06 7200 0
155 텍스트 링크 슈퍼맨 웹스터디 11-27 5265 0
154 텍스트 링크 슈퍼맨 웹스터디 09-27 6243 0
153 텍스트 슈퍼맨 웹스터디 09-06 4944 0
152 텍스트 +2 링크 슈퍼맨 웹스터디 08-15 5197 1
151 파일첨부 링크 슈퍼맨 웹스터디 07-19 4557 0
150 파일첨부 링크 슈퍼맨 웹스터디 07-12 6243 0
149 파일첨부 링크 슈퍼맨 웹스터디 07-02 6014 0
148 파일첨부 +2 링크 슈퍼맨 웹스터디 06-06 4789 0
147 텍스트 슈퍼맨 웹스터디 04-02 4809 0
146 파일첨부 링크 슈퍼맨 웹스터디 03-28 4966 0
145 파일첨부 링크 슈퍼맨 웹스터디 03-28 4962 0
144 파일첨부 +1 슈퍼맨 웹스터디 03-19 4808 0
143 파일첨부 슈퍼맨 웹스터디 03-13 4929 0
142 텍스트 +4 슈퍼맨 웹스터디 03-12 6968 0
141 텍스트 링크 슈퍼맨 웹스터디 02-15 5316 0