// 하루 최대 등록 글수
$max_cnt = $g4[max_line_ad]; // config.php 에 있음
if (!$max_cnt)
$max_cnt = 3;
if ($w == "")
{
$sql = " select count(*) as cnt from $write_table
where wr_is_comment = 0
and mb_id = '$member[mb_id]'
and substring(wr_datetime,1,10) = '$g4[time_ymd]' ";
$row = sql_fetch($sql);
if ($row[cnt])
alert("오늘 이미 등록하셨습니다. 내일 다시 등록하여 주십시오.");
$sql = " select count(*) as cnt from $write_table where wr_is_comment = 0 and substring(wr_datetime,1,10) = '$g4[time_ymd]' ";
$row = sql_fetch($sql);
if ($row[cnt] >= $max_cnt)
alert("하루에 최대 {$max_cnt}건만 등록할 수 있습니다. 내일 다시 등록하여 주십시오.");
}
댓글 3개
헐램이님이 공개하신 팁 참고해보세요..
// 하루 최대 등록 글수
$max_cnt = $g4[max_line_ad]; // config.php 에 있음
if (!$max_cnt)
$max_cnt = 3;
if ($w == "")
{
$sql = " select count(*) as cnt from $write_table
where wr_is_comment = 0
and mb_id = '$member[mb_id]'
and substring(wr_datetime,1,10) = '$g4[time_ymd]' ";
$row = sql_fetch($sql);
if ($row[cnt])
alert("오늘 이미 등록하셨습니다. 내일 다시 등록하여 주십시오.");
$sql = " select count(*) as cnt from $write_table where wr_is_comment = 0 and substring(wr_datetime,1,10) = '$g4[time_ymd]' ";
$row = sql_fetch($sql);
if ($row[cnt] >= $max_cnt)
alert("하루에 최대 {$max_cnt}건만 등록할 수 있습니다. 내일 다시 등록하여 주십시오.");
}