시간제한 글쓰기안내 질문드리빈다.
본문
if($bo_table=="HD"){
if(!$is_admin){
$sql = "select * from $write_table where mb_id = '$member[mb_id]' and wr_is_comment = '0' order by wr_id desc limit 0,1";
$row = sql_fetch($sql);
$tondate = time($row["wr_datetime"]) + $config[cf_delay_sec];
$sql2 = " select count(*) as cnt from $write_table where mb_id = '$member[mb_id]' and wr_is_comment = '0' and UNIX_TIMESTAMP(wr_datetime) < $tondate";
$count = sql_fetch($sql2) or die(mysql_error());
if ($count["cnt"] > 0) {
alert("12시간 뒤에 다시 작성할수있습니다.");
$tondate = time($row["wr_datetime"]) + $config[cf_delay_sec];
+CONFIG 이쪽이 12시간으로 설정되어있다는대 6시간으로 바꿀려면 어떻게하나요 .
답변 3
환경설정 - 게시판기본설정 : 글쓰기 간격 값을 수정합니다.
12시간으로 설정되어 있다면 43200초라고 되어 있겠네요.
6시간이니까 21600초로 적으시면 됩니다.
if ( $write_table == "원하시는 보드id" ) {
$tondate = time($row["wr_datetime"]) + 21600;
} else {
$tondate = time($row["wr_datetime"]) + $config[cf_delay_sec];
}
하시면 되지 않을까요?
네 그렇게 하시면 되겠네요.
테스트 한번 해보세요~~