저의 bbs/good.php 소스입니다. 질문 하나만요.

· 2010-08-31 (화) 10:04:29 · 1642 · 1
<?
include_once("./_common.php");

$sql = " select count(*) as cnt from $g4[board_good_table] where mb_id = '$member[mb_id]' and substring(bg_datetime,1,10) = '$g4[time_ymd]' ";
$cnt = sql_fetch($sql);

if ($cnt['cnt'] >= '3') {

alert("하루에 세 번만 추천 또는 신고 가능합니다.");

}

@include_once("$board_skin_path/good.head.skin.php");

echo "<meta http-equiv='content-type' content='text/html; charset=$g4[charset]'>";

if (!$is_member)
{
$href = "./login.php?$qstr&url=".urlencode("./board.php?bo_table=$bo_table&wr_id=$wr_id");

echo "<script language='JavaScript'>alert('회원만 가능합니다.'); top.location.href = '$href';</script>";
exit;
}

if (!($bo_table && $wr_id))
alert_close("값이 제대로 넘어오지 않았습니다.");

$ss_name = "ss_view_{$bo_table}_{$wr_id}";
if (!get_session($ss_name))
alert_close("해당 게시물에서만 추천 또는 신고 하실 수 있습니다.");

$row = sql_fetch(" select count(*) as cnt from {$g4[write_prefix]}{$bo_table} ", FALSE);
if (!$row[cnt])
alert_close("존재하는 게시판이 아닙니다.");

if ($good == "good" || $good == "nogood")
{
if($write[mb_id] == $member[mb_id])
alert_close("자신의 글에는 추천 또는 신고 하실 수 없습니다.");

if (!$board[bo_use_good] && $good == "good")
alert_close("이 게시판은 추천 기능을 사용하지 않습니다.");

if (!$board[bo_use_nogood] && $good == "nogood")
alert_close("이 게시판은 신고 기능을 사용하지 않습니다.");

$sql = " select bg_flag from $g4[board_good_table]
where bo_table = '$bo_table'
and wr_id = '$wr_id'
and mb_id = '$member[mb_id]'
and bg_flag in ('good', 'nogood') ";
$row = sql_fetch($sql);
if ($row[bg_flag])
{
if ($row[bg_flag] == "good")
$status = "추천";
else
$status = "신고";

echo "<script language='JavaScript'>alert('이미 \'$status\' 하신 글 입니다.');</script>";
}
else
{
// 추천(찬성), 신고(반대) 카운트 증가
sql_query(" update {$g4[write_prefix]}{$bo_table} set wr_{$good} = wr_{$good} + 1 where wr_id = '$wr_id' ");
// 내역 생성
sql_query(" insert $g4[board_good_table] set bo_table = '$bo_table', wr_id = '$wr_id', mb_id = '$member[mb_id]', bg_flag = '$good', bg_datetime = '$g4[time_ymdhis]' ");

if ($good == "good") {
$status = "추천";
// 추천 포인트 지급
insert_point($write['mb_id'], 5, "{$bo_table} - {$wr_id} 추천", $bo_table, $wr_id, $member['mb_id']);
} else {
$status = "신고";
// 신고 포인트 감소
insert_point($write['mb_id'], -5, "{$bo_table} - {$wr_id} 신고", $bo_table, $wr_id, $member['mb_id']);
}
echo "<script language='JavaScript'> alert('이 글을 \'$status\' 하셨습니다.');</script>";
}
}

@include_once("$board_skin_path/good.tail.skin.php");
?>
<script language="JavaScript"> window.close(); </script>


-----------------------------------------------------------------------------------

저의 good.php 소스 입니다.

비추천을 신고 기능으로 사용하고 있습니다.

추천 또는 신고시에 "신고하시겠습니까" 라는 <예> <아니오> 확인창이 한번 더 뜨게

하고 싶은데 어디를 어떻게 수정하면 되나요?
|

댓글 1개

여긴 없고 borad.php 에 있을듯요
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
10-08-31 조회 1,656
10-08-31 조회 1,221
10-08-31 조회 1,815
10-08-31 조회 1,671
10-08-31 조회 1,398
10-08-31 조회 1,641
10-08-31 조회 2,593
10-08-31 조회 1,064
10-08-31 조회 1,161
10-08-31 조회 1,342
10-08-31 조회 1,215
10-08-31 조회 1,634
10-08-31 조회 1,643
10-08-31 조회 1,323
10-08-31 조회 2,040
10-08-31 조회 1,724
10-08-31 조회 1,644
10-08-31 조회 1,679
10-08-31 조회 1,658
10-08-31 조회 1,632