Merge branch 'master' of github.com:gnuboard/g4s
This commit is contained in:
@ -15,7 +15,7 @@ check_token();
|
||||
define('_BOARD_DELETE_', TRUE);
|
||||
|
||||
// include 전에 $bo_table 값을 반드시 넘겨야 함
|
||||
$tmp_bo_table = mysql_real_escape_string(trim($_POST['bo_table']));
|
||||
$tmp_bo_table = escape_trim($_GET['bo_table']);
|
||||
$sql = " select * from {$g4['board_table']} where bo_table = '{$tmp_bo_table}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?
|
||||
$sub_menu = "300100";
|
||||
//define('_EDITOR_', true);
|
||||
define('_EDITOR_', 1);
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], 'w');
|
||||
@ -558,7 +558,7 @@ if (!preg_match("/([m|M])$/", $upload_max_filesize)) {
|
||||
<tr>
|
||||
<th scope="row"><label for="tx_bo_content_head">상단 내용</label></th>
|
||||
<td>
|
||||
<?=editor("bo_content_head", $board['bo_content_head']);?>
|
||||
<?=editor_html("bo_content_head", $board['bo_content_head']);?>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" id="chk_content_head" name="chk_content_head" value="1">
|
||||
@ -568,7 +568,7 @@ if (!preg_match("/([m|M])$/", $upload_max_filesize)) {
|
||||
<tr>
|
||||
<th scope="row"><label for="tx_bo_content_tail">하단 내용</label></th>
|
||||
<td>
|
||||
<?=editor("bo_content_tail", $board['bo_content_tail']);?>
|
||||
<?=editor_html("bo_content_tail", $board['bo_content_tail']);?>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" id="chk_content_tail" name="chk_content_tail" value="1">
|
||||
@ -819,8 +819,8 @@ function set_point(f) {
|
||||
|
||||
function fboardform_submit(f)
|
||||
{
|
||||
<?=editor_getdata("bo_content_head");?>
|
||||
<?=editor_getdata("bo_content_tail");?>
|
||||
<?=get_editor_js("bo_content_head");?>
|
||||
<?=get_editor_js("bo_content_tail");?>
|
||||
|
||||
if (parseInt(f.bo_count_modify.value) < 1) {
|
||||
alert("원글 수정 불가 댓글수는 1 이상 입력하셔야 합니다.");
|
||||
|
||||
@ -276,18 +276,5 @@ if ($fields) {
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
if ($_FILES['bo_image_head']['name']) {
|
||||
$bo_image_head_path = $board_path.'/'.$bo_image_head_urlencode;
|
||||
move_uploaded_file($_FILES['bo_image_head']['tmp_name'], $bo_image_head_path);
|
||||
chmod($bo_image_head_path, 0606);
|
||||
}
|
||||
|
||||
if ($_FILES['bo_image_tail']['name']) {
|
||||
$bo_image_tail_path = $board_path.'/'.$bo_image_tail_urlencode;
|
||||
move_uploaded_file($_FILES['bo_image_tail']['tmp_name'], $bo_image_tail_path);
|
||||
chmod($bo_image_tail_path, 0606);
|
||||
}
|
||||
|
||||
goto_url("./board_form.php?w=u&bo_table={$bo_table}&{$qstr}");
|
||||
?>
|
||||
|
||||
@ -4,11 +4,6 @@ include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], 'r');
|
||||
|
||||
// DHTML 에디터 사용 필드 추가 : 061021
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_use_dhtml_editor` TINYINT NOT NULL AFTER `bo_use_secret` ", false);
|
||||
// RSS 보이기 사용 필드 추가 : 061106
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_use_rss_view` TINYINT NOT NULL AFTER `bo_use_dhtml_editor` ", false);
|
||||
|
||||
$sql_common = " from {$g4['board_table']} a ";
|
||||
$sql_search = " where (1) ";
|
||||
|
||||
@ -39,10 +34,7 @@ if (!$sst) {
|
||||
}
|
||||
$sql_order = " order by $sst $sod ";
|
||||
|
||||
$sql = " select count(*) as cnt
|
||||
{$sql_common}
|
||||
{$sql_search}
|
||||
{$sql_order} ";
|
||||
$sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
@ -51,11 +43,7 @@ $total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select *
|
||||
{$sql_common}
|
||||
{$sql_search}
|
||||
{$sql_order}
|
||||
limit {$from_record}, {$rows} ";
|
||||
$sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$from_record}, {$rows} ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$listall = '';
|
||||
@ -128,8 +116,7 @@ var list_delete_php = 'board_list_delete.php';
|
||||
// 스킨디렉토리
|
||||
$skin_options = '';
|
||||
$arr = get_skin_dir('board');
|
||||
for ($k=0; $k<count($arr); $k++)
|
||||
{
|
||||
for ($k=0; $k<count($arr); $k++) {
|
||||
$option = $arr[$k];
|
||||
if (strlen($option) > 10)
|
||||
$option = substr($arr[$k], 0, 18) . '…';
|
||||
@ -141,8 +128,8 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$s_upd = '<a href="./board_form.php?w=u&bo_table='.$row['bo_table'].'&'.$qstr.'">수정</a>';
|
||||
$s_del = "";
|
||||
if ($is_admin == 'super') {
|
||||
//$s_del = '<a href="javascript:del(\'./board_delete.php?bo_table='.$row['bo_table'].'&'.$qstr.'\');">삭제</a>';
|
||||
$s_del = '<a href="javascript:post_delete(\'board_delete.php\', \''.$row['bo_table'].'\');">삭제</a>';
|
||||
//$s_del = '<a href="javascript:post_delete(\'board_delete.php\', \''.$row['bo_table'].'\');">삭제</a>';
|
||||
$s_del = "<a href=\"./board_delete.php?bo_table={$row['bo_table']}\" class=\"board_delete\">삭제</a>";
|
||||
}
|
||||
$s_copy = '<a href="javascript:board_copy(\''.$row['bo_table'].'\');">복사</a>';
|
||||
?>
|
||||
@ -234,6 +221,16 @@ function post_delete(action_url, val)
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$(".board_delete").click(function(){
|
||||
if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
|
||||
$("#fpost").attr("action", this.href);
|
||||
$("#fpost").submit();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<form id="fpost" name="fpost" method="post">
|
||||
@ -243,7 +240,7 @@ function post_delete(action_url, val)
|
||||
<input type="hidden" name="stx" value="<?=$stx?>">
|
||||
<input type="hidden" name="page" value="<?=$page?>">
|
||||
<input type="hidden" name="token" value="<?=$token?>">
|
||||
<input type="hidden" name="bo_table">
|
||||
<!-- <input type="hidden" name="bo_table"> -->
|
||||
</form>
|
||||
|
||||
<?
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?
|
||||
define('_CAPTCHA_', 1);
|
||||
include_once('./_common.php');
|
||||
|
||||
if (!$board['bo_table']) {
|
||||
|
||||
141
bbs/calendar.php
141
bbs/calendar.php
@ -1,141 +0,0 @@
|
||||
<?
|
||||
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>
|
||||
//
|
||||
// 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');
|
||||
?>
|
||||
@ -1,21 +0,0 @@
|
||||
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|성탄절|*
|
||||
@ -1,67 +0,0 @@
|
||||
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|성탄절|*
|
||||
35
bbs/ckeditor/ckeditor.lib.php
Normal file
35
bbs/ckeditor/ckeditor.lib.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
function editor_html($id, $content, $class="")
|
||||
{
|
||||
if ( (isset($GLOBALS['is_dhtml_editor']) && $GLOBALS['is_dhtml_editor']) || !isset($GLOBALS['is_dhtml_editor']) ) {
|
||||
$str = "<textarea id=\"$id\" name=\"$id\" class=\"ckeditor $class\" rows=\"10\" style=\"width:100%;\">$content</textarea>\n";
|
||||
//if (_EDITOR_) $str .= "<script>CKEDITOR.replace('$id',{height:'500px'});</script>\n";
|
||||
} else {
|
||||
$str = "<textarea id=\"$id\" name=\"$id\" class=\"$class\" rows=\"10\" style=\"width:100%;\">$content</textarea>\n";
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
// textarea 로 값을 넘긴다. javascript 반드시 필요
|
||||
function get_editor_js($id)
|
||||
{
|
||||
if ( (isset($GLOBALS['is_dhtml_editor']) && $GLOBALS['is_dhtml_editor']) || !isset($GLOBALS['is_dhtml_editor']) ) {
|
||||
$str = "var {$id}_editor_data = CKEDITOR.instances.{$id}.getData();\n";
|
||||
} else {
|
||||
$str = "var {$id}_editor = document.getElementById('{$id}');\n";
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
// textarea 의 값이 비어 있는지 검사
|
||||
function chk_editor_js($id, $textarea_name="내용을")
|
||||
{
|
||||
if ( (isset($GLOBALS['is_dhtml_editor']) && $GLOBALS['is_dhtml_editor']) || !isset($GLOBALS['is_dhtml_editor']) ) {
|
||||
return "if (!{$id}_editor_data) { alert(\"$textarea_name 입력해 주십시오.\"); CKEDITOR.instances.{$id}.focus(); return false; }\n";
|
||||
} else {
|
||||
return "if (!{$id}_editor.value) { alert(\"$textarea_name 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user