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

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

QA

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

답변 3

본문

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

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 129,108
© SIRSOFT
현재 페이지 제일 처음으로