비표준 그누보드4 첫커밋
4
bbs/_common.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?
|
||||
$g4_path = ".."; // common.php 의 상대 경로
|
||||
include_once("$g4_path/common.php");
|
||||
?>
|
||||
4
bbs/_head.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
include_once("$g4[path]/head.php");
|
||||
?>
|
||||
4
bbs/_tail.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
include_once("$g4[path]/tail.php");
|
||||
?>
|
||||
228
bbs/board.php
Normal file
@ -0,0 +1,228 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
|
||||
if (!$board[bo_table])
|
||||
{
|
||||
if ($cwin) // 코멘트 보기
|
||||
alert_close("존재하지 않는 게시판입니다.", $g4[path]);
|
||||
else
|
||||
alert("존재하지 않는 게시판입니다.", $g4[path]);
|
||||
}
|
||||
|
||||
if ($write[wr_is_comment])
|
||||
{
|
||||
/*
|
||||
if ($cwin) // 코멘트 보기
|
||||
alert_close("코멘트는 상세보기 하실 수 없습니다.");
|
||||
else
|
||||
alert("코멘트는 상세보기 하실 수 없습니다.");
|
||||
*/
|
||||
goto_url("./board.php?bo_table=$bo_table&wr_id=$write[wr_parent]#c_{$wr_id}");
|
||||
}
|
||||
|
||||
if (!$bo_table)
|
||||
{
|
||||
$msg = "bo_table 값이 넘어오지 않았습니다.\\n\\nboard.php?bo_table=code 와 같은 방식으로 넘겨 주세요.";
|
||||
if ($cwin) // 코멘트 보기
|
||||
alert_close($msg);
|
||||
else
|
||||
alert($msg);
|
||||
}
|
||||
|
||||
// wr_id 값이 있으면 글읽기
|
||||
if ($wr_id)
|
||||
{
|
||||
// 글이 없을 경우 해당 게시판 목록으로 이동
|
||||
if (!$write[wr_id])
|
||||
{
|
||||
$msg = "글이 존재하지 않습니다.\\n\\n글이 삭제되었거나 이동된 경우입니다.";
|
||||
if ($cwin)
|
||||
alert_close($msg);
|
||||
else
|
||||
alert($msg, "./board.php?bo_table=$bo_table");
|
||||
}
|
||||
|
||||
// 그룹접근 사용
|
||||
if ($group[gr_use_access])
|
||||
{
|
||||
if (!$member[mb_id]) {
|
||||
$msg = "비회원은 이 게시판에 접근할 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.";
|
||||
if ($cwin)
|
||||
alert_close($msg);
|
||||
else
|
||||
alert($msg, "./login.php?wr_id=$wr_id{$qstr}&url=".urlencode("./board.php?bo_table=$bo_table&wr_id=$wr_id"));
|
||||
}
|
||||
|
||||
// 그룹관리자 이상이라면 통과
|
||||
if ($is_admin == "super" || $is_admin == "group")
|
||||
;
|
||||
else
|
||||
{
|
||||
// 그룹접근
|
||||
$sql = " select count(*) as cnt
|
||||
from $g4[group_member_table]
|
||||
where gr_id = '$board[gr_id]' and mb_id = '$member[mb_id]' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row[cnt])
|
||||
alert("접근 권한이 없으므로 글읽기가 불가합니다.\\n\\n궁금하신 사항은 관리자에게 문의 바랍니다.", $g4[path]);
|
||||
}
|
||||
}
|
||||
|
||||
// 로그인된 회원의 권한이 설정된 읽기 권한보다 작다면
|
||||
if ($member[mb_level] < $board[bo_read_level])
|
||||
{
|
||||
if ($member[mb_id])
|
||||
//alert("글을 읽을 권한이 없습니다.");
|
||||
alert("글을 읽을 권한이 없습니다.", $g4[path]);
|
||||
else
|
||||
alert("글을 읽을 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.", "./login.php?wr_id=$wr_id{$qstr}&url=".urlencode("./board.php?bo_table=$bo_table&wr_id=$wr_id"));
|
||||
}
|
||||
|
||||
// 자신의 글이거나 관리자라면 통과
|
||||
if (($write[mb_id] && $write[mb_id] == $member[mb_id]) || $is_admin)
|
||||
;
|
||||
else
|
||||
{
|
||||
// 비밀글이라면
|
||||
if (strstr($write[wr_option], "secret"))
|
||||
{
|
||||
// 회원이 비밀글을 올리고 관리자가 답변글을 올렸을 경우
|
||||
// 회원이 관리자가 올린 답변글을 바로 볼 수 없던 오류를 수정
|
||||
$is_owner = false;
|
||||
if ($write[wr_reply] && $member[mb_id])
|
||||
{
|
||||
$sql = " select mb_id from $write_table
|
||||
where wr_num = '$write[wr_num]'
|
||||
and wr_reply = ''
|
||||
and wr_is_comment = '0' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row[mb_id] == $member[mb_id])
|
||||
$is_owner = true;
|
||||
}
|
||||
|
||||
$ss_name = "ss_secret_{$bo_table}_$write[wr_num]";
|
||||
|
||||
if (!$is_owner)
|
||||
{
|
||||
//$ss_name = "ss_secret_{$bo_table}_{$wr_id}";
|
||||
// 한번 읽은 게시물의 번호는 세션에 저장되어 있고 같은 게시물을 읽을 경우는 다시 패스워드를 묻지 않습니다.
|
||||
// 이 게시물이 저장된 게시물이 아니면서 관리자가 아니라면
|
||||
//if ("$bo_table|$write[wr_num]" != get_session("ss_secret"))
|
||||
if (!get_session($ss_name))
|
||||
goto_url("./password.php?w=s&bo_table=$bo_table&wr_id=$wr_id{$qstr}");
|
||||
}
|
||||
|
||||
set_session($ss_name, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
// 한번 읽은글은 브라우저를 닫기전까지는 카운트를 증가시키지 않음
|
||||
$ss_name = "ss_view_{$bo_table}_{$wr_id}";
|
||||
if (!get_session($ss_name))
|
||||
{
|
||||
sql_query(" update $write_table set wr_hit = wr_hit + 1 where wr_id = '$wr_id' ");
|
||||
|
||||
// 자신의 글이면 통과
|
||||
if ($write[mb_id] && $write[mb_id] == $member[mb_id]) {
|
||||
;
|
||||
} else if ($is_guest && $board[bo_read_level] == 1 && $write[wr_ip] == $_SERVER['REMOTE_ADDR']) {
|
||||
// 비회원이면서 읽기레벨이 1이고 등록된 아이피가 같다면 자신의 글이므로 통과
|
||||
;
|
||||
} else {
|
||||
/*
|
||||
// 회원이상 글읽기가 가능하다면
|
||||
if ($board[bo_read_level] > 1) {
|
||||
if ($member[mb_point] + $board[bo_read_point] < 0)
|
||||
alert("보유하신 포인트(".number_format($member[mb_point]).")가 없거나 모자라서 글읽기(".number_format($board[bo_read_point]).")가 불가합니다.\\n\\n포인트를 모으신 후 다시 글읽기 해 주십시오.");
|
||||
|
||||
insert_point($member[mb_id], $board[bo_read_point], "$board[bo_subject] $wr_id 글읽기", $bo_table, $wr_id, '읽기');
|
||||
}
|
||||
*/
|
||||
// 글읽기 포인트가 설정되어 있다면
|
||||
if ($board[bo_read_point] && $member[mb_point] + $board[bo_read_point] < 0)
|
||||
alert("보유하신 포인트(".number_format($member[mb_point]).")가 없거나 모자라서 글읽기(".number_format($board[bo_read_point]).")가 불가합니다.\\n\\n포인트를 모으신 후 다시 글읽기 해 주십시오.");
|
||||
|
||||
insert_point($member[mb_id], $board[bo_read_point], "$board[bo_subject] $wr_id 글읽기", $bo_table, $wr_id, '읽기');
|
||||
}
|
||||
|
||||
set_session($ss_name, TRUE);
|
||||
}
|
||||
|
||||
$g4[title] = "$group[gr_subject] > $board[bo_subject] > " . strip_tags(conv_subject($write[wr_subject], 255));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($member[mb_level] < $board[bo_list_level])
|
||||
{
|
||||
if ($member[mb_id])
|
||||
alert("목록을 볼 권한이 없습니다.", $g4[path]);
|
||||
else
|
||||
alert("목록을 볼 권한이 없습니다.\\n\\n회원이시라면 로그인 후 이용해 보십시오.", "./login.php?wr_id=$wr_id{$qstr}&url=".urlencode("board.php?bo_table=$bo_table&wr_id=$wr_id"));
|
||||
}
|
||||
|
||||
if (!$page) $page = 1;
|
||||
|
||||
$g4[title] = "$group[gr_subject] > $board[bo_subject] $page 페이지";
|
||||
}
|
||||
|
||||
include_once("$g4[path]/head.sub.php");
|
||||
|
||||
$width = $board[bo_table_width];
|
||||
if ($width <= 100) $width .= '%';
|
||||
|
||||
// IP보이기 사용 여부
|
||||
$ip = "";
|
||||
$is_ip_view = $board[bo_use_ip_view];
|
||||
if ($is_admin) {
|
||||
$is_ip_view = true;
|
||||
$ip = $write[wr_ip];
|
||||
} else // 관리자가 아니라면 IP 주소를 감춘후 보여줍니다.
|
||||
$ip = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $write[wr_ip]);
|
||||
|
||||
// 분류 사용
|
||||
$is_category = false;
|
||||
$category_name = "";
|
||||
if ($board[bo_use_category]) {
|
||||
$is_category = true;
|
||||
$category_name = $write[ca_name]; // 분류명
|
||||
}
|
||||
|
||||
// 추천 사용
|
||||
$is_good = false;
|
||||
if ($board[bo_use_good])
|
||||
$is_good = true;
|
||||
|
||||
// 비추천 사용
|
||||
$is_nogood = false;
|
||||
if ($board[bo_use_nogood])
|
||||
$is_nogood = true;
|
||||
|
||||
$admin_href = "";
|
||||
// 최고관리자 또는 그룹관리자라면
|
||||
if ($member[mb_id] && ($is_admin == 'super' || $group[gr_admin] == $member[mb_id]))
|
||||
$admin_href = "$g4[admin_path]/board_form.php?w=u&bo_table=$bo_table";
|
||||
|
||||
if (!($board[bo_use_comment] && $cwin))
|
||||
include_once("./board_head.php");
|
||||
|
||||
echo "<script type=\"text/javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";
|
||||
|
||||
if (!($board[bo_use_comment] && $cwin)) {
|
||||
// 게시물 아이디가 있다면 게시물 보기를 INCLUDE
|
||||
if ($wr_id)
|
||||
include_once("./view.php");
|
||||
|
||||
// 전체목록보이기 사용이 "예" 또는 wr_id 값이 없다면 목록을 보임
|
||||
//if ($board[bo_use_list_view] || empty($wr_id))
|
||||
if ($member[mb_level] >= $board[bo_list_level] && $board[bo_use_list_view] || empty($wr_id))
|
||||
include_once ("./list.php");
|
||||
|
||||
include_once("./board_tail.php");
|
||||
}
|
||||
else
|
||||
include_once("./view_comment.php");
|
||||
|
||||
echo "\n<!-- 사용스킨 : $board[bo_skin] -->\n";
|
||||
|
||||
include_once("$g4[path]/tail.sub.php");
|
||||
?>
|
||||
15
bbs/board_head.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// 게시판 관리의 상단 파일 경로
|
||||
if ($board[bo_include_head])
|
||||
@include ($board[bo_include_head]);
|
||||
|
||||
// 게시판 관리의 상단 이미지 경로
|
||||
if ($board[bo_image_head])
|
||||
echo "<img src='$g4[path]/data/file/$bo_table/$board[bo_image_head]' border='0'>";
|
||||
|
||||
// 게시판 관리의 상단 내용
|
||||
if ($board[bo_content_head])
|
||||
echo stripslashes($board[bo_content_head]);
|
||||
?>
|
||||
15
bbs/board_tail.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// 게시판 관리의 하단 내용
|
||||
if ($board[bo_content_tail])
|
||||
echo stripslashes($board[bo_content_tail]);
|
||||
|
||||
// 게시판 관리의 하단 이미지 경로
|
||||
if ($board[bo_image_tail])
|
||||
echo "<img src='$g4[path]/data/file/$bo_table/$board[bo_image_tail]' border='0'>";
|
||||
|
||||
// 게시판 관리의 하단 파일 경로
|
||||
if ($board[bo_include_tail])
|
||||
@include ($board[bo_include_tail]);
|
||||
?>
|
||||
141
bbs/calendar.php
Normal file
@ -0,0 +1,141 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
|
||||
$g4[title] = "달력";
|
||||
include_once("$g4[path]/head.sub.php");
|
||||
|
||||
// 글자 색상
|
||||
$weekday_color = "#000000"; // 평일
|
||||
$saturday_color = "#000000"; // 토요일
|
||||
$sunday_color = "#FF3300"; // 일요일 (공휴일)
|
||||
// 배경 색상
|
||||
$today_bgcolor = "yellow"; // 오늘
|
||||
$select_bgcolor = "#BAFFF6"; // 선택일
|
||||
|
||||
// 요일
|
||||
$yoil = array ("일", "월", "화", "수", "목", "금", "토");
|
||||
|
||||
// mktime() 함수는 1970 ~ 2038년까지만 계산되므로 사용하지 않음
|
||||
// 참고 : http://phpschool.com/bbs2/inc_view.html?id=3924&code=tnt2&start=0&mode=search&s_que=mktime&field=title&operator=and&period=all
|
||||
function spacer($year, $month)
|
||||
{
|
||||
$day = 1;
|
||||
$spacer = array(0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4);
|
||||
$year = $year - ($month < 3);
|
||||
$result = ($year + (int) ($year/4) - (int) ($year/100) + (int) ($year/400) + $spacer[$month-1] + $day) % 7;
|
||||
return $result;
|
||||
}
|
||||
|
||||
// 오늘
|
||||
$today = getdate($g4[server_time]);
|
||||
$mon = substr("0".$today[mon],-2);
|
||||
$mday = substr("0".$today[mday],-2);
|
||||
|
||||
// delimiter 를 없앤다
|
||||
$cur_date = preg_replace("/([^0-9]*)/", "", $cur_date);
|
||||
|
||||
if ($cur_date && !$yyyy)
|
||||
{
|
||||
$yyyy = substr($cur_date,0,4);
|
||||
$mm = substr($cur_date,4,2);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$yyyy) $yyyy = $today['year'];
|
||||
if (!$mm) $mm = $today['mon'];
|
||||
}
|
||||
$yyyy = (int)$yyyy;
|
||||
$mm = (int)$mm;
|
||||
|
||||
$f = @file("./calendar/$yyyy.txt");
|
||||
if ($f) {
|
||||
while ($line = each($f)) {
|
||||
$tmp = explode("|", $line[value]);
|
||||
$nal[$tmp[0]] = $tmp;
|
||||
//print_r2($nal);
|
||||
}
|
||||
}
|
||||
|
||||
$spacer = spacer($yyyy, $mm);
|
||||
|
||||
$endday = array(1=>31, 28, 31, 30 , 31, 30, 31, 31, 30 ,31 ,30, 31);
|
||||
// 윤년 계산 부분이다. 4년에 한번꼴로 2월이 28일이 아닌 29일이 있다.
|
||||
if( $yyyy%4 == 0 && $yyyy%100 != 0 || $yyyy%400 == 0 )
|
||||
$endday[2] = 29; // 조건에 적합할 경우 28을 29로 변경
|
||||
|
||||
// 해당월의 1일
|
||||
$mktime = mktime(0,0,0,$mm,1,$yyyy);
|
||||
$dt = getdate(strtotime(date("Y-m-1", $mktime)));
|
||||
|
||||
$dt[wday] = $spacer;
|
||||
|
||||
// 해당월의 마지막 날짜,
|
||||
//$last_day = date("t", $mktime);
|
||||
$last_day = $endday[$mm];
|
||||
|
||||
$yyyy_before = $yyyy;
|
||||
$mm_before = $mm - 1;
|
||||
if ($mm_before < 1)
|
||||
{
|
||||
$yyyy_before--;
|
||||
$mm_before = 12;
|
||||
}
|
||||
|
||||
$yyyy_after = $yyyy;
|
||||
$mm_after = $mm + 1;
|
||||
if ($mm_after > 12)
|
||||
{
|
||||
$yyyy_after++;
|
||||
$mm_after = 1;
|
||||
}
|
||||
|
||||
$fr_yyyy = $yyyy - 80;
|
||||
$to_yyyy = $yyyy + 80;
|
||||
|
||||
$yyyy_before_href = "$_SERVER[PHP_SELF]?yyyy=".($yyyy-1)."&mm={$mm}&cur_date={$cur_date}&fld={$fld}&delimiter={$delimiter}";
|
||||
$yyyy_after_href = "$_SERVER[PHP_SELF]?yyyy=".($yyyy+1)."&mm={$mm}&cur_date={$cur_date}&fld={$fld}&delimiter={$delimiter}";
|
||||
|
||||
$mm_after_href = "$_SERVER[PHP_SELF]?yyyy={$yyyy_after}&mm={$mm_after}&cur_date={$cur_date}&fld={$fld}&delimiter={$delimiter}";
|
||||
$mm_before_href = "$_SERVER[PHP_SELF]?yyyy={$yyyy_before}&mm={$mm_before}&cur_date={$cur_date}&fld={$fld}&delimiter={$delimiter}";
|
||||
|
||||
$yyyy_select = "<select name=yyyy onchange='document.fcalendar.submit();'>";
|
||||
for ($i=$fr_yyyy; $i<=$to_yyyy; $i++)
|
||||
{
|
||||
if ($i == $yyyy) $selected = " selected";
|
||||
else $selected = "";
|
||||
$yyyy_select .= "<option value='{$i}'{$selected}>$i 년</option>";
|
||||
}
|
||||
$yyyy_select .= "</select>";
|
||||
|
||||
$mm_select = "<select name=mm onchange='document.fcalendar.submit();'>";
|
||||
for ($i=1; $i<=12; $i++)
|
||||
{
|
||||
if ($i == $mm) $selected = " selected";
|
||||
else $selected = "";
|
||||
$mm_select .= "<option value='{$i}'{$selected}>$i 월</option>";
|
||||
}
|
||||
$mm_select .= "</select>";
|
||||
|
||||
$member_skin_path = "$g4[path]/skin/member/$config[cf_member_skin]";
|
||||
include_once("$member_skin_path/calendar.skin.php");
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
//
|
||||
// year : 4자리
|
||||
// month : 1~2자리
|
||||
// day : 1~2자리
|
||||
// wday : 요일 숫자 (0:일 ~ 6:토)
|
||||
// handay : 요일 한글
|
||||
//
|
||||
function date_send(year, month, day, wday, handay)
|
||||
{
|
||||
var delimiter = document.getElementById('delimiter').value;
|
||||
opener.document.getElementById('<?=$fld?>').value = year + delimiter + month + delimiter + day;
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<?
|
||||
include_once("$g4[path]/tail.sub.php");
|
||||
?>
|
||||
21
bbs/calendar/2005.txt
Normal file
@ -0,0 +1,21 @@
|
||||
04-28|그누보드4 정식버전 출시일
|
||||
08-07|입추
|
||||
08-14|말복
|
||||
08-15|광복절|*
|
||||
09-07|사회복지의 날, 백로
|
||||
09-17|추석연휴|*
|
||||
09-18|추석|*
|
||||
09-19|추석연휴|*
|
||||
09-23|추분
|
||||
10-03|개천절|*
|
||||
10-01|국군의날
|
||||
10-08|한로
|
||||
10-09|한글날|*
|
||||
10-23|상강
|
||||
11-03|학생의날
|
||||
11-07|입동
|
||||
11-22|소설
|
||||
12-07|대설
|
||||
12-10|세계 인권선언 기념일
|
||||
12-22|동지
|
||||
12-25|성탄절|*
|
||||
67
bbs/calendar/2006.txt
Normal file
@ -0,0 +1,67 @@
|
||||
01-01|신정|*
|
||||
01-05|소한
|
||||
01-20|대한
|
||||
01-28|설 연휴|*
|
||||
01-29|설날|*
|
||||
01-30|설 연휴|*
|
||||
03-01|삼일절|*
|
||||
03-03|납세자의날
|
||||
03-06|경칩
|
||||
03-21|춘분
|
||||
03-22|물의 날
|
||||
03-23|기상의날
|
||||
04-05|식목일,청명
|
||||
04-06|한식
|
||||
04-07|보건의날
|
||||
04-19|4.19혁명 기념일
|
||||
04-20|곡우,장애인의날
|
||||
04-21|과학의 날
|
||||
04-22|정보통신의날
|
||||
04-25|법의날
|
||||
04-28|충무공탄신일
|
||||
05-01|근로자의날
|
||||
05-05|어린이날, 석가탄신일|*
|
||||
05-06|입하
|
||||
05-08|어버이날
|
||||
05-15|스승의날, 성년의날
|
||||
05-18|5.18 민주화운동 기념일
|
||||
05-21|소만
|
||||
05-31|단오
|
||||
06-06|현충일,망종
|
||||
06-21|하지
|
||||
06-25|6.25사변일
|
||||
07-07|소서
|
||||
07-17|제헌절|*
|
||||
07-20|초복
|
||||
07-23|대서
|
||||
07-30|중복
|
||||
07-31|칠석
|
||||
08-08|입추
|
||||
08-09|말복
|
||||
08-15|광복절|*
|
||||
08-23|처서
|
||||
09-07|사회복지의 날, 백로
|
||||
09-18|철도의날
|
||||
09-23|추분
|
||||
10-01|국군의날
|
||||
10-03|개천절|*
|
||||
10-05|추석연휴|*
|
||||
10-06|추석|*
|
||||
10-07|추석연휴|*
|
||||
10-08|한로
|
||||
10-09|한글날
|
||||
10-20|문화의날
|
||||
10-23|상강
|
||||
10-24|국제연합일
|
||||
10-31|저축의날
|
||||
11-03|학생의날
|
||||
11-07|입동
|
||||
11-09|소방의날
|
||||
11-11|농업인의날
|
||||
11-17|순국선열의날
|
||||
11-22|소설
|
||||
11-30|무역의날
|
||||
12-07|대설
|
||||
12-10|세계 인권선언 기념일
|
||||
12-22|동지
|
||||
12-25|성탄절|*
|
||||
40
bbs/current_connect.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
|
||||
$g4[title] = "현재접속자";
|
||||
include_once("./_head.php");
|
||||
|
||||
$list = array();
|
||||
|
||||
$sql = " select a.mb_id, b.mb_nick, b.mb_name, b.mb_email, b.mb_homepage, b.mb_open, b.mb_point, a.lo_ip, a.lo_location, a.lo_url
|
||||
from $g4[login_table] a left join $g4[member_table] b on (a.mb_id = b.mb_id)
|
||||
where a.mb_id <> '$config[cf_admin]'
|
||||
order by a.lo_datetime desc ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$list[$i] = $row;
|
||||
|
||||
if ($row[mb_id])
|
||||
//$list[$i][name] = get_sideview($row[mb_id], $row[mb_nick], $row[mb_email], $row[mb_homepage]);
|
||||
$list[$i][name] = get_sideview($row[mb_id], cut_str($row[mb_nick], $config[cf_cut_name]), $row[mb_email], $row[mb_homepage]);
|
||||
else
|
||||
{
|
||||
if ($is_admin)
|
||||
$list[$i][name] = $row[lo_ip];
|
||||
else
|
||||
$list[$i][name] = preg_replace("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", "\\1.♡.\\3.\\4", $row[lo_ip]);
|
||||
}
|
||||
|
||||
$list[$i][num] = sprintf("%03d",$i+1);
|
||||
}
|
||||
|
||||
$write_pages = get_paging($config[cf_write_pages], $page, $total_page, "?gr_id=$gr_id&page=");
|
||||
|
||||
echo "<script type=\"text/javascript\" src=\"$g4[path]/js/sideview.js\"></script>\n";
|
||||
|
||||
$connect_skin_path = "$g4[path]/skin/connect/$config[cf_connect_skin]";
|
||||
include_once("$connect_skin_path/current_connect.skin.php");
|
||||
|
||||
include_once("./_tail.php");
|
||||
?>
|
||||
125
bbs/delete.php
Normal file
@ -0,0 +1,125 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
|
||||
if ($is_admin)
|
||||
{
|
||||
if (!($token && get_session("ss_delete_token") == $token))
|
||||
alert("토큰 에러로 삭제 불가합니다.");
|
||||
}
|
||||
|
||||
//$wr = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
|
||||
|
||||
@include_once("$board_skin_path/delete.head.skin.php");
|
||||
|
||||
if ($is_admin == "super") // 최고관리자 통과
|
||||
;
|
||||
else if ($is_admin == "group") { // 그룹관리자
|
||||
$mb = get_member($write[mb_id]);
|
||||
if ($member[mb_id] != $group[gr_admin]) // 자신이 관리하는 그룹인가?
|
||||
alert("자신이 관리하는 그룹의 게시판이 아니므로 삭제할 수 없습니다.");
|
||||
else if ($member[mb_level] < $mb[mb_level]) // 자신의 레벨이 크거나 같다면 통과
|
||||
alert("자신의 권한보다 높은 권한의 회원이 작성한 글은 삭제할 수 없습니다.");
|
||||
} else if ($is_admin == "board") { // 게시판관리자이면
|
||||
$mb = get_member($write[mb_id]);
|
||||
if ($member[mb_id] != $board[bo_admin]) // 자신이 관리하는 게시판인가?
|
||||
alert("자신이 관리하는 게시판이 아니므로 삭제할 수 없습니다.");
|
||||
else if ($member[mb_level] < $mb[mb_level]) // 자신의 레벨이 크거나 같다면 통과
|
||||
alert("자신의 권한보다 높은 권한의 회원이 작성한 글은 삭제할 수 없습니다.");
|
||||
} else if ($member[mb_id]) {
|
||||
if ($member[mb_id] != $write[mb_id])
|
||||
alert("자신의 글이 아니므로 삭제할 수 없습니다.");
|
||||
} else {
|
||||
if ($write[mb_id])
|
||||
alert("로그인 후 삭제하세요.", "./login.php?url=".urlencode("./board.php?bo_table=$bo_table&wr_id=$wr_id"));
|
||||
else if (sql_password($wr_password) != $write[wr_password])
|
||||
alert("패스워드가 틀리므로 삭제할 수 없습니다.");
|
||||
}
|
||||
|
||||
$len = strlen($write[wr_reply]);
|
||||
if ($len < 0) $len = 0;
|
||||
$reply = substr($write[wr_reply], 0, $len);
|
||||
|
||||
// 원글만 구한다.
|
||||
$sql = " select count(*) as cnt from $write_table
|
||||
where wr_reply like '$reply%'
|
||||
and wr_id <> '$write[wr_id]'
|
||||
and wr_num = '$write[wr_num]'
|
||||
and wr_is_comment = 0 ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row[cnt] && !$is_admin)
|
||||
alert("이 글과 관련된 답변글이 존재하므로 삭제 할 수 없습니다.\\n\\n우선 답변글부터 삭제하여 주십시오.");
|
||||
|
||||
// 코멘트 달린 원글의 삭제 여부
|
||||
$sql = " select count(*) as cnt from $write_table
|
||||
where wr_parent = '$wr_id'
|
||||
and mb_id <> '$member[mb_id]'
|
||||
and wr_is_comment = 1 ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row[cnt] >= $board[bo_count_delete] && !$is_admin)
|
||||
alert("이 글과 관련된 코멘트가 존재하므로 삭제 할 수 없습니다.\\n\\n코멘트가 {$board[bo_count_delete]}건 이상 달린 원글은 삭제할 수 없습니다.");
|
||||
|
||||
|
||||
// 사용자 코드 실행
|
||||
@include_once("$board_skin_path/delete.skin.php");
|
||||
|
||||
|
||||
// 나라오름님 수정 : 원글과 코멘트수가 정상적으로 업데이트 되지 않는 오류를 잡아 주셨습니다.
|
||||
//$sql = " select wr_id, mb_id, wr_comment from $write_table where wr_parent = '$write[wr_id]' order by wr_id ";
|
||||
$sql = " select wr_id, mb_id, wr_is_comment from $write_table where wr_parent = '$write[wr_id]' order by wr_id ";
|
||||
$result = sql_query($sql);
|
||||
while ($row = sql_fetch_array($result))
|
||||
{
|
||||
// 원글이라면
|
||||
if (!$row[wr_is_comment])
|
||||
{
|
||||
// 원글 포인트 삭제
|
||||
if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '쓰기'))
|
||||
insert_point($row[mb_id], $board[bo_write_point] * (-1), "$board[bo_subject] $row[wr_id] 글삭제");
|
||||
|
||||
// 업로드된 파일이 있다면 파일삭제
|
||||
$sql2 = " select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' ";
|
||||
$result2 = sql_query($sql2);
|
||||
while ($row2 = sql_fetch_array($result2))
|
||||
@unlink("$g4[path]/data/file/$bo_table/$row2[bf_file]");
|
||||
|
||||
// 파일테이블 행 삭제
|
||||
sql_query(" delete from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' ");
|
||||
|
||||
$count_write++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 코멘트 포인트 삭제
|
||||
if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '코멘트'))
|
||||
insert_point($row[mb_id], $board[bo_comment_point] * (-1), "$board[bo_subject] {$write[wr_id]}-{$row[wr_id]} 코멘트삭제");
|
||||
|
||||
$count_comment++;
|
||||
}
|
||||
}
|
||||
|
||||
// 게시글 삭제
|
||||
sql_query(" delete from $write_table where wr_parent = '$write[wr_id]' ");
|
||||
|
||||
// 최근게시물 삭제
|
||||
sql_query(" delete from $g4[board_new_table] where bo_table = '$bo_table' and wr_parent = '$write[wr_id]' ");
|
||||
|
||||
// 스크랩 삭제
|
||||
sql_query(" delete from $g4[scrap_table] where bo_table = '$bo_table' and wr_id = '$write[wr_id]' ");
|
||||
|
||||
// 공지사항 삭제
|
||||
$notice_array = explode("\n", trim($board[bo_notice]));
|
||||
$bo_notice = "";
|
||||
for ($k=0; $k<count($notice_array); $k++)
|
||||
if ((int)$write[wr_id] != (int)$notice_array[$k])
|
||||
$bo_notice .= $notice_array[$k] . "\n";
|
||||
$bo_notice = trim($bo_notice);
|
||||
sql_query(" update $g4[board_table] set bo_notice = '$bo_notice' where bo_table = '$bo_table' ");
|
||||
|
||||
// 글숫자 감소
|
||||
if ($count_write > 0 || $count_comment > 0)
|
||||
sql_query(" update $g4[board_table] set bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' where bo_table = '$bo_table' ");
|
||||
|
||||
@include_once("$board_skin_path/delete.tail.skin.php");
|
||||
|
||||
goto_url("./board.php?bo_table=$bo_table&page=$page" . $qstr);
|
||||
?>
|
||||
140
bbs/delete_all.php
Normal file
@ -0,0 +1,140 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
|
||||
// 4.11
|
||||
@include_once("$board_skin_path/delete_all.head.skin.php");
|
||||
|
||||
$count_write = 0;
|
||||
$count_comment = 0;
|
||||
|
||||
$tmp_array = array();
|
||||
if ($wr_id) // 건별삭제
|
||||
$tmp_array[0] = $wr_id;
|
||||
else // 일괄삭제
|
||||
$tmp_array = $_POST[chk_wr_id];
|
||||
|
||||
|
||||
// 사용자 코드 실행
|
||||
@include_once("$board_skin_path/delete_all.skin.php");
|
||||
|
||||
|
||||
// 거꾸로 읽는 이유는 답변글부터 삭제가 되어야 하기 때문임
|
||||
for ($i=count($tmp_array)-1; $i>=0; $i--)
|
||||
{
|
||||
$write = sql_fetch(" select * from $write_table where wr_id = '{$tmp_array[$i]}' ");
|
||||
|
||||
if ($is_admin == "super") // 최고관리자 통과
|
||||
;
|
||||
else if ($is_admin == "group") // 그룹관리자
|
||||
{
|
||||
$mb = get_member($write[mb_id]);
|
||||
if ($member[mb_id] == $group[gr_admin]) // 자신이 관리하는 그룹인가?
|
||||
{
|
||||
if ($member[mb_level] >= $mb[mb_level]) // 자신의 레벨이 크거나 같다면 통과
|
||||
;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else if ($is_admin == "board") // 게시판관리자이면
|
||||
{
|
||||
$mb = get_member($write[mb_id]);
|
||||
if ($member[mb_id] == $board[bo_admin]) // 자신이 관리하는 게시판인가?
|
||||
if ($member[mb_level] >= $mb[mb_level]) // 자신의 레벨이 크거나 같다면 통과
|
||||
;
|
||||
else
|
||||
continue;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else if ($member[mb_id] && $member[mb_id] == $write[mb_id]) // 자신의 글이라면
|
||||
{
|
||||
;
|
||||
}
|
||||
else if ($wr_password && !$write[mb_id] && sql_password($wr_password) == $write[wr_password]) // 패스워드가 같다면
|
||||
{
|
||||
;
|
||||
}
|
||||
else
|
||||
continue; // 나머지는 삭제 불가
|
||||
|
||||
$len = strlen($write[wr_reply]);
|
||||
if ($len < 0) $len = 0;
|
||||
$reply = substr($write[wr_reply], 0, $len);
|
||||
|
||||
// 원글만 구한다.
|
||||
$sql = " select count(*) as cnt from $write_table
|
||||
where wr_reply like '$reply%'
|
||||
and wr_id <> '$write[wr_id]'
|
||||
and wr_num = '$write[wr_num]'
|
||||
and wr_is_comment = 0 ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row[cnt])
|
||||
continue;
|
||||
|
||||
// 나라오름님 수정 : 원글과 코멘트수가 정상적으로 업데이트 되지 않는 오류를 잡아 주셨습니다.
|
||||
//$sql = " select wr_id, mb_id, wr_comment from $write_table where wr_parent = '$write[wr_id]' order by wr_id ";
|
||||
$sql = " select wr_id, mb_id, wr_is_comment from $write_table where wr_parent = '$write[wr_id]' order by wr_id ";
|
||||
$result = sql_query($sql);
|
||||
while ($row = sql_fetch_array($result))
|
||||
{
|
||||
// 원글이라면
|
||||
if (!$row[wr_is_comment])
|
||||
{
|
||||
// 원글 포인트 삭제
|
||||
if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '쓰기'))
|
||||
insert_point($row[mb_id], $board[bo_write_point] * (-1), "$board[bo_subject] $row[wr_id] 글삭제");
|
||||
|
||||
// 업로드된 파일이 있다면
|
||||
$sql2 = " select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' ";
|
||||
$result2 = sql_query($sql2);
|
||||
while ($row2 = sql_fetch_array($result2))
|
||||
// 파일삭제
|
||||
@unlink("$g4[path]/data/file/$bo_table/$row2[bf_file]");
|
||||
|
||||
// 파일테이블 행 삭제
|
||||
sql_query(" delete from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' ");
|
||||
|
||||
$count_write++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 코멘트 포인트 삭제
|
||||
if (!delete_point($row[mb_id], $bo_table, $row[wr_id], '코멘트'))
|
||||
insert_point($row[mb_id], $board[bo_comment_point] * (-1), "$board[bo_subject] {$write[wr_id]}-{$row[wr_id]} 코멘트삭제");
|
||||
|
||||
$count_comment++;
|
||||
}
|
||||
}
|
||||
|
||||
// 게시글 삭제
|
||||
sql_query(" delete from $write_table where wr_parent = '$write[wr_id]' ");
|
||||
|
||||
// 최근게시물 삭제
|
||||
sql_query(" delete from $g4[board_new_table] where bo_table = '$bo_table' and wr_parent = '$write[wr_id]' ");
|
||||
|
||||
// 스크랩 삭제
|
||||
sql_query(" delete from $g4[scrap_table] where bo_table = '$bo_table' and wr_id = '$write[wr_id]' ");
|
||||
|
||||
// 공지사항 삭제
|
||||
$notice_array = explode("\n", trim($board[bo_notice]));
|
||||
$bo_notice = "";
|
||||
for ($k=0; $k<count($notice_array); $k++)
|
||||
if ((int)$write[wr_id] != (int)$notice_array[$k])
|
||||
$bo_notice .= $notice_array[$k] . "\n";
|
||||
$bo_notice = trim($bo_notice);
|
||||
sql_query(" update $g4[board_table] set bo_notice = '$bo_notice' where bo_table = '$bo_table' ");
|
||||
$board[bo_notice] = $bo_notice;
|
||||
}
|
||||
|
||||
// 글숫자 감소
|
||||
if ($count_write > 0 || $count_comment > 0)
|
||||
sql_query(" update $g4[board_table] set bo_count_write = bo_count_write - '$count_write', bo_count_comment = bo_count_comment - '$count_comment' where bo_table = '$bo_table' ");
|
||||
|
||||
// 4.11
|
||||
@include_once("$board_skin_path/delete_all.tail.skin.php");
|
||||
|
||||
goto_url("./board.php?bo_table=$bo_table&page=$page" . $qstr);
|
||||
?>
|
||||
87
bbs/delete_comment.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?
|
||||
// 코멘트 삭제
|
||||
include_once("./_common.php");
|
||||
|
||||
if ($is_admin)
|
||||
{
|
||||
if (!($token && get_session("ss_delete_token") == $token))
|
||||
alert("토큰 에러로 삭제 불가합니다.");
|
||||
}
|
||||
|
||||
// 4.1
|
||||
@include_once("$board_skin_path/delete_comment.head.skin.php");
|
||||
|
||||
$write = sql_fetch(" select * from $write_table where wr_id = '$comment_id' ");
|
||||
|
||||
if (!$write[wr_id] || !$write[wr_is_comment])
|
||||
alert("등록된 코멘트가 없거나 코멘트 글이 아닙니다.");
|
||||
|
||||
if ($is_admin == "super") // 최고관리자 통과
|
||||
;
|
||||
else if ($is_admin == "group") { // 그룹관리자
|
||||
$mb = get_member($write[mb_id]);
|
||||
if ($member[mb_id] == $group[gr_admin]) { // 자신이 관리하는 그룹인가?
|
||||
if ($member[mb_level] >= $mb[mb_level]) // 자신의 레벨이 크거나 같다면 통과
|
||||
;
|
||||
else
|
||||
alert("그룹관리자의 권한보다 높은 회원의 코멘트이므로 삭제할 수 없습니다.");
|
||||
} else
|
||||
alert("자신이 관리하는 그룹의 게시판이 아니므로 코멘트를 삭제할 수 없습니다.");
|
||||
} else if ($is_admin == "board") { // 게시판관리자이면
|
||||
$mb = get_member($write[mb_id]);
|
||||
if ($member[mb_id] == $board[bo_admin]) { // 자신이 관리하는 게시판인가?
|
||||
if ($member[mb_level] >= $mb[mb_level]) // 자신의 레벨이 크거나 같다면 통과
|
||||
;
|
||||
else
|
||||
alert("게시판관리자의 권한보다 높은 회원의 코멘트이므로 삭제할 수 없습니다.");
|
||||
} else
|
||||
alert("자신이 관리하는 게시판이 아니므로 코멘트를 삭제할 수 없습니다.");
|
||||
} else if ($member[mb_id]) {
|
||||
if ($member[mb_id] != $write[mb_id])
|
||||
alert("자신의 글이 아니므로 삭제할 수 없습니다.");
|
||||
} else {
|
||||
if (sql_password($wr_password) != $write[wr_password])
|
||||
alert("패스워드가 틀립니다.");
|
||||
}
|
||||
|
||||
$len = strlen($write[wr_comment_reply]);
|
||||
if ($len < 0) $len = 0;
|
||||
$comment_reply = substr($write[wr_comment_reply], 0, $len);
|
||||
|
||||
$sql = " select count(*) as cnt from $write_table
|
||||
where wr_comment_reply like '$comment_reply%'
|
||||
and wr_id <> '$comment_id'
|
||||
and wr_parent = '$write[wr_parent]'
|
||||
and wr_comment = '$write[wr_comment]'
|
||||
and wr_is_comment = 1 ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row[cnt] && !$is_admin)
|
||||
alert("이 코멘트와 관련된 답변코멘트가 존재하므로 삭제 할 수 없습니다.");
|
||||
|
||||
// 코멘트 삭제
|
||||
if (!delete_point($write[mb_id], $bo_table, $comment_id, '코멘트'))
|
||||
insert_point($write[mb_id], $board[bo_comment_point] * (-1), "$board[bo_subject] {$write[wr_parent]}-{$comment_id} 코멘트삭제");
|
||||
|
||||
// 코멘트 삭제
|
||||
sql_query(" delete from $write_table where wr_id = '$comment_id' ");
|
||||
|
||||
// 코멘트가 삭제되므로 해당 게시물에 대한 최근 시간을 다시 얻는다.
|
||||
$sql = " select max(wr_datetime) as wr_last from $write_table where wr_parent = '$write[wr_parent]' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
// 원글의 코멘트 숫자를 감소
|
||||
sql_query(" update $write_table set wr_comment = wr_comment - 1, wr_last = '$row[wr_last]' where wr_id = '$write[wr_parent]' ");
|
||||
|
||||
// 코멘트 숫자 감소
|
||||
sql_query(" update $g4[board_table] set bo_count_comment = bo_count_comment - 1 where bo_table = '$bo_table' ");
|
||||
|
||||
// 새글 삭제
|
||||
sql_query(" delete from $g4[board_new_table] where bo_table = '$bo_table' and wr_id = '$comment_id' ");
|
||||
|
||||
// 사용자 코드 실행
|
||||
@include_once("$board_skin_path/delete_comment.skin.php");
|
||||
// 4.1
|
||||
@include_once("$board_skin_path/delete_comment.tail.skin.php");
|
||||
|
||||
goto_url("./board.php?bo_table=$bo_table&wr_id=$write[wr_parent]&cwin=$cwin&page=$page" . $qstr);
|
||||
?>
|
||||
106
bbs/download.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
|
||||
$no = (int)$no;
|
||||
|
||||
@include_once("$board_skin_path/download.head.skin.php");
|
||||
|
||||
// 쿠키에 저장된 ID값과 넘어온 ID값을 비교하여 같지 않을 경우 오류 발생
|
||||
// 다른곳에서 링크 거는것을 방지하기 위한 코드
|
||||
if (!get_session("ss_view_{$bo_table}_{$wr_id}"))
|
||||
alert("잘못된 접근입니다.");
|
||||
|
||||
$sql = " select bf_source, bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' ";
|
||||
$file = sql_fetch($sql);
|
||||
if (!$file[bf_file])
|
||||
alert_close("파일 정보가 존재하지 않습니다.");
|
||||
|
||||
if ($member[mb_level] < $board[bo_download_level]) {
|
||||
$alert_msg = "다운로드 권한이 없습니다.";
|
||||
if ($member[mb_id])
|
||||
alert($alert_msg);
|
||||
else
|
||||
alert($alert_msg . "\\n\\n회원이시라면 로그인 후 이용해 보십시오.", "./login.php?wr_id=$wr_id&$qstr&url=".urlencode("$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$wr_id"));
|
||||
}
|
||||
|
||||
$filepath = "$g4[path]/data/file/$bo_table/$file[bf_file]";
|
||||
$filepath = addslashes($filepath);
|
||||
if (!is_file($filepath) || !file_exists($filepath))
|
||||
alert("파일이 존재하지 않습니다.");
|
||||
|
||||
// 사용자 코드 실행
|
||||
@include_once("$board_skin_path/download.skin.php");
|
||||
|
||||
// 이미 다운로드 받은 파일인지를 검사한 후 게시물당 한번만 포인트를 차감하도록 수정
|
||||
$ss_name = "ss_down_{$bo_table}_{$wr_id}";
|
||||
if (!get_session($ss_name))
|
||||
{
|
||||
// 자신의 글이라면 통과
|
||||
// 관리자인 경우 통과
|
||||
if (($write[mb_id] && $write[mb_id] == $member[mb_id]) || $is_admin)
|
||||
;
|
||||
else if ($board[bo_download_level] > 1) // 회원이상 다운로드가 가능하다면
|
||||
{
|
||||
// 다운로드 포인트가 음수이고 회원의 포인트가 0 이거나 작다면
|
||||
if ($member[mb_point] + $board[bo_download_point] < 0)
|
||||
alert("보유하신 포인트(".number_format($member[mb_point]).")가 없거나 모자라서 다운로드(".number_format($board[bo_download_point]).")가 불가합니다.\\n\\n포인트를 적립하신 후 다시 다운로드 해 주십시오.");
|
||||
|
||||
// 게시물당 한번만 차감하도록 수정
|
||||
insert_point($member[mb_id], $board[bo_download_point], "$board[bo_subject] $wr_id 파일 다운로드", $bo_table, $wr_id, "다운로드");
|
||||
}
|
||||
|
||||
// 다운로드 카운트 증가
|
||||
$sql = " update $g4[board_file_table] set bf_download = bf_download + 1 where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$no' ";
|
||||
sql_query($sql);
|
||||
|
||||
set_session($ss_name, TRUE);
|
||||
}
|
||||
|
||||
$g4[title] = "$group[gr_subject] > $board[bo_subject] > " . conv_subject($write[wr_subject], 255) . " > 다운로드";
|
||||
|
||||
if (preg_match("/^utf/i", $g4[charset]))
|
||||
$original = urlencode($file[bf_source]);
|
||||
else
|
||||
$original = $file[bf_source];
|
||||
|
||||
@include_once("$board_skin_path/download.tail.skin.php");
|
||||
|
||||
if(preg_match("/msie/i", $_SERVER[HTTP_USER_AGENT]) && preg_match("/5\.5/", $_SERVER[HTTP_USER_AGENT])) {
|
||||
header("content-type: doesn/matter");
|
||||
header("content-length: ".filesize("$filepath"));
|
||||
header("content-disposition: attachment; filename=\"$original\"");
|
||||
header("content-transfer-encoding: binary");
|
||||
} else {
|
||||
header("content-type: file/unknown");
|
||||
header("content-length: ".filesize("$filepath"));
|
||||
header("content-disposition: attachment; filename=\"$original\"");
|
||||
header("content-description: php generated data");
|
||||
}
|
||||
header("pragma: no-cache");
|
||||
header("expires: 0");
|
||||
flush();
|
||||
|
||||
$fp = fopen("$filepath", "rb");
|
||||
|
||||
// 4.00 대체
|
||||
// 서버부하를 줄이려면 print 나 echo 또는 while 문을 이용한 방법보다는 이방법이...
|
||||
//if (!fpassthru($fp)) {
|
||||
// fclose($fp);
|
||||
//}
|
||||
|
||||
$download_rate = 10;
|
||||
|
||||
while(!feof($fp)) {
|
||||
//echo fread($fp, 100*1024);
|
||||
/*
|
||||
echo fread($fp, 100*1024);
|
||||
flush();
|
||||
*/
|
||||
|
||||
print fread($fp, round($download_rate * 1024));
|
||||
flush();
|
||||
usleep(1000);
|
||||
}
|
||||
fclose ($fp);
|
||||
flush();
|
||||
?>
|
||||
21
bbs/email_certify.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
|
||||
$sql = " select mb_id, mb_email, mb_datetime from $g4[member_table] where mb_id = '$mb_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row[mb_id])
|
||||
alert("존재하는 회원이 아닙니다.", $g4[path]);
|
||||
|
||||
if ($mb_md5)
|
||||
{
|
||||
$tmp_md5 = md5($row[mb_id].$row[mb_email].$row[mb_datetime]);
|
||||
if ($mb_md5 == $tmp_md5)
|
||||
{
|
||||
sql_query(" update $g4[member_table] set mb_email_certify = '$g4[time_ymdhis]' where mb_id = '$mb_id' ");
|
||||
|
||||
alert("E-mail 인증 처리를 완료 하였습니다.", $g4[path]);
|
||||
}
|
||||
}
|
||||
|
||||
alert("제대로 된 값이 넘어오지 않았습니다.", $g4[path]);
|
||||
?>
|
||||
21
bbs/email_stop.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
|
||||
$sql = " select mb_id, mb_email, mb_datetime from $g4[member_table] where mb_id = '$mb_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row[mb_id])
|
||||
alert("존재하는 회원이 아닙니다.", $g4[path]);
|
||||
|
||||
if ($mb_md5)
|
||||
{
|
||||
$tmp_md5 = md5($row[mb_id].$row[mb_email].$row[mb_datetime]);
|
||||
if ($mb_md5 == $tmp_md5)
|
||||
{
|
||||
sql_query(" update $g4[member_table] set mb_mailling = '0' where mb_id = '$mb_id' ");
|
||||
|
||||
alert("정보메일을 보내지 않도록 수신거부 하였습니다.", $g4[path]);
|
||||
}
|
||||
}
|
||||
|
||||
alert("제대로 된 값이 넘어오지 않았습니다.", $g4[path]);
|
||||
?>
|
||||
4
bbs/fonts/.htaccess
Normal file
@ -0,0 +1,4 @@
|
||||
<Files ~ "*">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Files>
|
||||
BIN
bbs/fonts/antiqua.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
bbs/fonts/baskerville.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
bbs/fonts/batang.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
bbs/fonts/bookman.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
bbs/fonts/calisto.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
bbs/fonts/cambria.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
bbs/fonts/centaur.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
bbs/fonts/century.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
bbs/fonts/chaparral.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
bbs/fonts/constantia.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
bbs/fonts/footlight.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
bbs/fonts/garamond.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
bbs/fonts/georgia.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
bbs/fonts/goudy_old.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
bbs/fonts/kozuka.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
bbs/fonts/lucida.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
bbs/fonts/minion.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
bbs/fonts/palatino.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
bbs/fonts/perpetua.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
bbs/fonts/rockwell.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
bbs/fonts/times.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
bbs/fonts/warnock.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
43
bbs/formmail.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
|
||||
if (!$config[cf_email_use])
|
||||
alert("환경설정에서 \'메일발송 사용\'에 체크하셔야 메일을 발송할 수 있습니다.\\n\\n관리자에게 문의하시기 바랍니다.");
|
||||
|
||||
if (!$is_member && $config[cf_formmail_is_member])
|
||||
alert_close("회원만 이용하실 수 있습니다.");
|
||||
|
||||
if ($is_member && !$member[mb_open] && $is_admin != "super" && $member[mb_id] != $mb_id)
|
||||
alert_close("자신의 정보를 공개하지 않으면 다른분에게 메일을 보낼 수 없습니다.\\n\\n정보공개 설정은 회원정보수정에서 하실 수 있습니다.");
|
||||
|
||||
if ($mb_id)
|
||||
{
|
||||
$mb = get_member($mb_id);
|
||||
if (!$mb[mb_id])
|
||||
alert_close("회원정보가 존재하지 않습니다.\\n\\n탈퇴하였을 수 있습니다.");
|
||||
|
||||
if (!$mb[mb_open] && $is_admin != "super")
|
||||
alert_close("정보공개를 하지 않았습니다.");
|
||||
}
|
||||
|
||||
$sendmail_count = (int)get_session('ss_sendmail_count') + 1;
|
||||
if ($sendmail_count > 3)
|
||||
alert_close('한번 접속후 일정수의 메일만 발송할 수 있습니다.\n\n계속해서 메일을 보내시려면 다시 로그인 또는 접속하여 주십시오.');
|
||||
|
||||
$g4[title] = "메일 쓰기";
|
||||
include_once("$g4[path]/head.sub.php");
|
||||
|
||||
if (!$name)
|
||||
$name = base64_decode($email);
|
||||
|
||||
if (!isset($type))
|
||||
$type = 0;
|
||||
|
||||
$type_checked[0] = $type_checked[1] = $type_checked[2] = "";
|
||||
$type_checked[$type] = "checked";
|
||||
|
||||
$member_skin_path = "$g4[path]/skin/member/$config[cf_member_skin]";
|
||||
include_once("$member_skin_path/formmail.skin.php");
|
||||
|
||||
include_once("$g4[path]/tail.sub.php");
|
||||
?>
|
||||
55
bbs/formmail_send.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
include_once("$g4[path]/lib/mailer.lib.php");
|
||||
|
||||
if (!$config[cf_email_use])
|
||||
alert("환경설정에서 \'메일발송 사용\'에 체크하셔야 메일을 발송할 수 있습니다.\\n\\n관리자에게 문의하시기 바랍니다.");
|
||||
|
||||
if (!$is_member && $config[cf_formmail_is_member])
|
||||
alert_close("회원만 이용하실 수 있습니다.");
|
||||
|
||||
$to = base64_decode($to);
|
||||
|
||||
if (substr_count($to, "@") > 1)
|
||||
alert_close('한번에 한사람에게만 메일을 발송할 수 있습니다.');
|
||||
|
||||
|
||||
$key = get_session("captcha_keystring");
|
||||
if (!($key && $key == $_POST[wr_key])) {
|
||||
session_unregister("captcha_keystring");
|
||||
alert("정상적인 접근이 아닌것 같습니다.");
|
||||
}
|
||||
|
||||
|
||||
for ($i=1; $i<=$attach; $i++)
|
||||
{
|
||||
if ($_FILES["file".$i][name])
|
||||
$file[] = attach_file($_FILES["file".$i][name], $_FILES["file".$i][tmp_name]);
|
||||
}
|
||||
|
||||
$content = stripslashes($content);
|
||||
if ($type == 2)
|
||||
{
|
||||
$type = 1;
|
||||
$content = preg_replace("/\n/", "<br>", $content);
|
||||
}
|
||||
|
||||
// html 이면
|
||||
if ($type)
|
||||
{
|
||||
$current_url = $g4[url];
|
||||
$mail_content = "<html><head><meta http-equiv='content-type' content='text/html; charset=$g4[charset]'><title>메일보내기</title><link rel='stylesheet' href='$current_url/style.css' type='text/css'></head><body>$content</body></html>";
|
||||
}
|
||||
else
|
||||
$mail_content = $content;
|
||||
|
||||
mailer($fnick, $fmail, $to, $subject, $mail_content, $type, $file);
|
||||
|
||||
//$html_title = $tmp_to . "님께 메일발송";
|
||||
$html_title = "메일 발송중";
|
||||
include_once("$g4[path]/head.sub.php");
|
||||
|
||||
alert_close("메일을 정상적으로 발송하였습니다.");
|
||||
|
||||
include_once("$g4[path]/tail.sub.php");
|
||||
?>
|
||||
71
bbs/good.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?
|
||||
include_once("./_common.php");
|
||||
|
||||
@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 type='text/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 type='text/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 = "추천";
|
||||
else
|
||||
$status = "비추천";
|
||||
|
||||
echo "<script type='text/javascript'> alert('이 글을 \'$status\' 하셨습니다.');</script>";
|
||||
}
|
||||
}
|
||||
|
||||
@include_once("$board_skin_path/good.tail.skin.php");
|
||||
?>
|
||||
<script type="text/javascript"> window.close(); </script>
|
||||
39
bbs/group.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?
|
||||
// 상대 경로
|
||||
$g4_path = "..";
|
||||
include_once("$g4_path/common.php");
|
||||
include_once("$g4[path]/lib/latest.lib.php");
|
||||
|
||||
$g4[title] = $group[gr_subject];
|
||||
include_once("./_head.php");
|
||||
?>
|
||||
|
||||
<!-- 메인화면 최신글 시작 -->
|
||||
<table width="100%" cellpadding=0 cellspacing=0>
|
||||
<tr>
|
||||
<td valign=top>
|
||||
<?
|
||||
// 최신글
|
||||
$sql = " select bo_table, bo_subject from $g4[board_table]
|
||||
where gr_id = '$gr_id'
|
||||
and bo_list_level <= '$member[mb_level]'
|
||||
order by bo_table ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
|
||||
// 스킨은 입력하지 않을 경우 관리자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다.
|
||||
|
||||
// 사용방법
|
||||
// latest(스킨, 게시판아이디, 출력라인, 글자수);
|
||||
echo latest("basic", $row[bo_table], 5, 70);
|
||||
echo "<p>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- 메인화면 최신글 끝 -->
|
||||
|
||||
<?
|
||||
include_once("./_tail.php");
|
||||
?>
|
||||
BIN
bbs/img/a.gif
Normal file
|
After Width: | Height: | Size: 61 B |
BIN
bbs/img/arrow_01.gif
Normal file
|
After Width: | Height: | Size: 76 B |
BIN
bbs/img/back_bg_1.gif
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
bbs/img/bar_bg_img.gif
Normal file
|
After Width: | Height: | Size: 51 B |
BIN
bbs/img/bar_count.gif
Normal file
|
After Width: | Height: | Size: 455 B |
BIN
bbs/img/bg_search.gif
Normal file
|
After Width: | Height: | Size: 46 B |
BIN
bbs/img/btn_close.gif
Normal file
|
After Width: | Height: | Size: 200 B |
BIN
bbs/img/btn_comment_delete.gif
Normal file
|
After Width: | Height: | Size: 312 B |
BIN
bbs/img/btn_confirm.gif
Normal file
|
After Width: | Height: | Size: 192 B |
BIN
bbs/img/btn_dup_check.gif
Normal file
|
After Width: | Height: | Size: 518 B |
BIN
bbs/img/btn_get_paper_off.gif
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
bbs/img/btn_get_paper_on.gif
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
bbs/img/btn_go.gif
Normal file
|
After Width: | Height: | Size: 698 B |
BIN
bbs/img/btn_go_home.gif
Normal file
|
After Width: | Height: | Size: 994 B |
BIN
bbs/img/btn_list.gif
Normal file
|
After Width: | Height: | Size: 153 B |
BIN
bbs/img/btn_list_view.gif
Normal file
|
After Width: | Height: | Size: 215 B |
BIN
bbs/img/btn_mail_send.gif
Normal file
|
After Width: | Height: | Size: 240 B |
BIN
bbs/img/btn_memo_del.gif
Normal file
|
After Width: | Height: | Size: 118 B |
BIN
bbs/img/btn_next.gif
Normal file
|
After Width: | Height: | Size: 204 B |
BIN
bbs/img/btn_next_01.gif
Normal file
|
After Width: | Height: | Size: 159 B |
BIN
bbs/img/btn_paper_send.gif
Normal file
|
After Width: | Height: | Size: 235 B |
BIN
bbs/img/btn_post_search.gif
Normal file
|
After Width: | Height: | Size: 161 B |
BIN
bbs/img/btn_recv_paper_off.gif
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
bbs/img/btn_recv_paper_on.gif
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
bbs/img/btn_reply.gif
Normal file
|
After Width: | Height: | Size: 227 B |
BIN
bbs/img/btn_send.gif
Normal file
|
After Width: | Height: | Size: 262 B |
BIN
bbs/img/btn_send_mail.gif
Normal file
|
After Width: | Height: | Size: 266 B |
BIN
bbs/img/btn_send_paper_off.gif
Normal file
|
After Width: | Height: | Size: 187 B |
BIN
bbs/img/btn_send_paper_on.gif
Normal file
|
After Width: | Height: | Size: 187 B |
BIN
bbs/img/btn_write_paper_off.gif
Normal file
|
After Width: | Height: | Size: 181 B |
BIN
bbs/img/btn_write_paper_on.gif
Normal file
|
After Width: | Height: | Size: 181 B |
BIN
bbs/img/btn_zip.gif
Normal file
|
After Width: | Height: | Size: 281 B |
BIN
bbs/img/close.gif
Normal file
|
After Width: | Height: | Size: 223 B |
BIN
bbs/img/dot_bg.gif
Normal file
|
After Width: | Height: | Size: 43 B |
BIN
bbs/img/dot_bg_img.gif
Normal file
|
After Width: | Height: | Size: 577 B |
BIN
bbs/img/dot_bg_img_01.gif
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
bbs/img/dot_bg_img_02.gif
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
bbs/img/dot_down_bg.gif
Normal file
|
After Width: | Height: | Size: 47 B |
BIN
bbs/img/dot_left_bg.gif
Normal file
|
After Width: | Height: | Size: 46 B |
BIN
bbs/img/dot_left_down_img.gif
Normal file
|
After Width: | Height: | Size: 51 B |
BIN
bbs/img/dot_left_top_img.gif
Normal file
|
After Width: | Height: | Size: 53 B |
BIN
bbs/img/dot_line.gif
Normal file
|
After Width: | Height: | Size: 44 B |
BIN
bbs/img/dot_right_bg.gif
Normal file
|
After Width: | Height: | Size: 47 B |
BIN
bbs/img/dot_right_down_img.gif
Normal file
|
After Width: | Height: | Size: 53 B |
BIN
bbs/img/dot_right_top_img.gif
Normal file
|
After Width: | Height: | Size: 53 B |
BIN
bbs/img/dot_top_bg.gif
Normal file
|
After Width: | Height: | Size: 46 B |
BIN
bbs/img/down_line.gif
Normal file
|
After Width: | Height: | Size: 368 B |
BIN
bbs/img/gray_bg_img.gif
Normal file
|
After Width: | Height: | Size: 886 B |
BIN
bbs/img/icon.gif
Normal file
|
After Width: | Height: | Size: 45 B |
BIN
bbs/img/icon_01.gif
Normal file
|
After Width: | Height: | Size: 49 B |
BIN
bbs/img/icon_02.gif
Normal file
|
After Width: | Height: | Size: 61 B |
BIN
bbs/img/icon_1.gif
Normal file
|
After Width: | Height: | Size: 112 B |
BIN
bbs/img/icon_flower.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
bbs/img/icon_formmail.gif
Normal file
|
After Width: | Height: | Size: 337 B |
BIN
bbs/img/icon_home.gif
Normal file
|
After Width: | Height: | Size: 74 B |
BIN
bbs/img/icon_mail.gif
Normal file
|
After Width: | Height: | Size: 76 B |
BIN
bbs/img/icon_memo.gif
Normal file
|
After Width: | Height: | Size: 74 B |