시간제한 글쓰기안내 질문드리빈다.

시간제한 글쓰기안내 질문드리빈다.

QA

시간제한 글쓰기안내 질문드리빈다.

본문

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];  

}

하시면 되지 않을까요?

 

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시간 뒤에 다시 작성할수있습니다.");


이거를

if ( $write_table == "원하시는 보드id" ) {
$tondate = time($row["wr_datetime"]) + 21600; 
} else {
$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시간 뒤에 다시 작성할수있습니다.");
}

답변을 작성하시기 전에 로그인 해주세요.
전체 22
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT