답변 3개
채택된 답변
+20 포인트
해당 게시판의 view.skin.php
=============================
<?php
if (!defined("_GNUBOARD_")) exit;
// 1. 관리자, 본인, 포인트 설정이 0인 경우 제외
if (!$is_admin && $write['mb_id'] != $member['mb_id'] && $board['bo_read_point'] != 0) {
$is_today_post = (substr($write['wr_datetime'], 0, 10) == G5_TIME_YMD);
// 2. 오늘 글이 아닐 때만 환급 로직 가동
if (!$is_today_post) {
$refund_point = abs($board['bo_read_point']);
$rel_action = '과거글환급'; // 중복 환급 방지용 키워드
// 오늘 이 글에서 환급받은 내역이 있는지 확인
$sql = " select count(*) as cnt from {$g5['point_table']}
where mb_id = '{$member['mb_id']}'
and po_rel_table = '{$bo_table}'
and po_rel_id = '{$wr_id}'
and po_rel_action = '{$rel_action}' ";
$row = sql_fetch($sql);
if (!$row['cnt']) {
// 포인트 즉시 복구
insert_point($member['mb_id'], $refund_point, "{$board['bo_subject']} {$wr_id} 과거글 무료 읽기", $bo_table, $wr_id, $rel_action);
// 실시간 포인트 반영을 위해 현재 페이지 새로고침 (선택 사항)
// goto_url($_SERVER['REQUEST_URI']);
}
}
}
?>
참고 삼아 보세요.
=============================
<?php
if (!defined("_GNUBOARD_")) exit;
// 1. 관리자, 본인, 포인트 설정이 0인 경우 제외
if (!$is_admin && $write['mb_id'] != $member['mb_id'] && $board['bo_read_point'] != 0) {
$is_today_post = (substr($write['wr_datetime'], 0, 10) == G5_TIME_YMD);
// 2. 오늘 글이 아닐 때만 환급 로직 가동
if (!$is_today_post) {
$refund_point = abs($board['bo_read_point']);
$rel_action = '과거글환급'; // 중복 환급 방지용 키워드
// 오늘 이 글에서 환급받은 내역이 있는지 확인
$sql = " select count(*) as cnt from {$g5['point_table']}
where mb_id = '{$member['mb_id']}'
and po_rel_table = '{$bo_table}'
and po_rel_id = '{$wr_id}'
and po_rel_action = '{$rel_action}' ";
$row = sql_fetch($sql);
if (!$row['cnt']) {
// 포인트 즉시 복구
insert_point($member['mb_id'], $refund_point, "{$board['bo_subject']} {$wr_id} 과거글 무료 읽기", $bo_table, $wr_id, $rel_action);
// 실시간 포인트 반영을 위해 현재 페이지 새로고침 (선택 사항)
// goto_url($_SERVER['REQUEST_URI']);
}
}
}
?>
참고 삼아 보세요.
순정 일때
bbs/board.php
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글읽기('.number_format($board['bo_read_point']).')가 불가합니다.\\n\\n포인트를 모으신 후 다시 글읽기 해 주십시오.');
//2026-02-13
$sql = " select wr_datetime from {$write_table} where wr_id=".$wr_id;
$chl_dat = sql_fetch($sql);
$chl_db= date("Y-m-d" , strtotime($chl_dat[wr_datetime]));
$chl_td=date("Y-m-d");
$if_chl= (strtotime($chl_td) - strtotime($chl_db)) / 86400;
if($if_chl==0){
//echo "오늘";
insert_point($member['mb_id'], $board['bo_read_point'], ((G5_IS_MOBILE && $board['bo_mobile_subject']) ? $board['bo_mobile_subject'] : $board['bo_subject']).' '.$wr_id.' 글읽기', $bo_table, $wr_id, '읽기');
}
//2026-02-13
// insert_point($member['mb_id'], $board['bo_read_point'], ((G5_IS_MOBILE && $board['bo_mobile_subject']) ? $board['bo_mobile_subject'] : $board['bo_subject']).' '.$wr_id.' 글읽기', $bo_table, $wr_id, '읽기');
}
set_session($ss_name, TRUE);
}
이러게 하면 됩니다 .
참고 하세요
bbs/board.php
alert('보유하신 포인트('.number_format($member['mb_point']).')가 없거나 모자라서 글읽기('.number_format($board['bo_read_point']).')가 불가합니다.\\n\\n포인트를 모으신 후 다시 글읽기 해 주십시오.');
//2026-02-13
$sql = " select wr_datetime from {$write_table} where wr_id=".$wr_id;
$chl_dat = sql_fetch($sql);
$chl_db= date("Y-m-d" , strtotime($chl_dat[wr_datetime]));
$chl_td=date("Y-m-d");
$if_chl= (strtotime($chl_td) - strtotime($chl_db)) / 86400;
if($if_chl==0){
//echo "오늘";
insert_point($member['mb_id'], $board['bo_read_point'], ((G5_IS_MOBILE && $board['bo_mobile_subject']) ? $board['bo_mobile_subject'] : $board['bo_subject']).' '.$wr_id.' 글읽기', $bo_table, $wr_id, '읽기');
}
//2026-02-13
// insert_point($member['mb_id'], $board['bo_read_point'], ((G5_IS_MOBILE && $board['bo_mobile_subject']) ? $board['bo_mobile_subject'] : $board['bo_subject']).' '.$wr_id.' 글읽기', $bo_table, $wr_id, '읽기');
}
set_session($ss_name, TRUE);
}
이러게 하면 됩니다 .
참고 하세요
답변을 작성하려면 로그인이 필요합니다.