가입후 지정 일자가 지난 후에 글쓰기 가능하게 하기
[code]
/*
* 가입후 지정 일자가 지난 후에 글쓰기 가능하게 하기
* extend/user.config.php 에 추가
*/
function chk_write($bo_table) {
global $member, $g5;
$day = 1; //가입후 1일이 지나야 글쓰기 가능
$list = array('qna', 'test2', 'test3'); //적용할 게시판.
if (in_array($bo_table, $list)) {
$s_date = $member['mb_datetime'];
$e_date = G5_TIME_YMDHIS;
$term = intval((strtotime($e_date) - strtotime($s_date)) / 86400); //날짜 사이의 일수를 구한다.
if ($term < $day) {
alert('가입 후 ' . $day . '일이 지나야 게시물을 작성할 수 있습니다.');
return;
}
return;
}
}
if ($member && strstr($_SERVER['PHP_SELF'], 'write.php')) {
chk_write($bo_table);
}
[/code]
/*
* 가입후 지정 일자가 지난 후에 글쓰기 가능하게 하기
* extend/user.config.php 에 추가
*/
function chk_write($bo_table) {
global $member, $g5;
$day = 1; //가입후 1일이 지나야 글쓰기 가능
$list = array('qna', 'test2', 'test3'); //적용할 게시판.
if (in_array($bo_table, $list)) {
$s_date = $member['mb_datetime'];
$e_date = G5_TIME_YMDHIS;
$term = intval((strtotime($e_date) - strtotime($s_date)) / 86400); //날짜 사이의 일수를 구한다.
if ($term < $day) {
alert('가입 후 ' . $day . '일이 지나야 게시물을 작성할 수 있습니다.');
return;
}
return;
}
}
if ($member && strstr($_SERVER['PHP_SELF'], 'write.php')) {
chk_write($bo_table);
}
[/code]
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 5개
run_event('bbs_write', $board, $wr_id, $w);
이걸 이용하면 더 좋지? 않을까요?