Merge branch 'master' of github.com:gnuboard/yc5
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ test.php
|
||||
cheditor5/
|
||||
log
|
||||
g5_tree
|
||||
ckeditor43/
|
||||
|
||||
@ -63,4 +63,12 @@ function delete_confirm()
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function delete_confirm2(msg)
|
||||
{
|
||||
if(confirm(msg))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
@ -159,7 +159,9 @@ $frm_submit = '<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="확인" class="btn_submit" accesskey="s">
|
||||
<a href="./board_list.php?'.$qstr.'">목록</a>'.PHP_EOL;
|
||||
if ($w == 'u') $frm_submit .= ' <a href="./board_copy.php?bo_table='.$bo_table.'" id="board_copy" target="win_board_copy">게시판복사</a>
|
||||
<a href="'.G5_BBS_URL.'/board.php?bo_table='.$board['bo_table'].'" class="btn_frmline">게시판 바로가기</a>'.PHP_EOL;
|
||||
<a href="'.G5_BBS_URL.'/board.php?bo_table='.$board['bo_table'].'" class="btn_frmline">게시판 바로가기</a>
|
||||
<a href="./board_thumbnail_delete.php?bo_table='.$board['bo_table'].'&'.$qstr.'" onclick="return delete_confirm2(\'게시판 썸네일 파일을 삭제하시겠습니까?\');">게시판 썸네일 삭제</a>
|
||||
'.PHP_EOL;
|
||||
$frm_submit .= '</div>';
|
||||
?>
|
||||
|
||||
|
||||
52
adm/board_thumbnail_delete.php
Normal file
52
adm/board_thumbnail_delete.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
$sub_menu = '300100';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], 'w');
|
||||
|
||||
if(!$board['bo_table'])
|
||||
alert('존재하지 않는 게시판입니다.');
|
||||
|
||||
$g5['title'] = $board['bo_subject'].' 게시판 썸네일 삭제';
|
||||
include_once('./admin.head.php');
|
||||
?>
|
||||
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>
|
||||
완료 메세지가 나오기 전에 프로그램의 실행을 중지하지 마십시오.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$dir = G5_DATA_PATH.'/file/'.$bo_table;
|
||||
|
||||
$cnt = 0;
|
||||
if(is_dir($dir)) {
|
||||
echo '<ul>';
|
||||
$files = glob($dir.'/thumb-*');
|
||||
if (is_array($files)) {
|
||||
foreach($files as $thumbnail) {
|
||||
$cnt++;
|
||||
@unlink($thumbnail);
|
||||
|
||||
echo '<li>'.$thumbnail.'</li>'.PHP_EOL;
|
||||
|
||||
flush();
|
||||
|
||||
if ($cnt%10==0)
|
||||
echo PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
echo '<li>완료됨</li></ul>'.PHP_EOL;
|
||||
echo '<div class="local_desc01 local_desc"><p><strong>썸네일 '.$cnt.'건의 삭제 완료됐습니다.</strong></p></div>'.PHP_EOL;
|
||||
} else {
|
||||
echo '<p>첨부파일 디렉토리가 존재하지 않습니다.</p>';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm"><a href="./board_form.php?w=u&bo_table=<?php echo $bo_table; ?>&<?php echo $qstr; ?>">게시판 수정으로 돌아가기</a></div>
|
||||
|
||||
<?php
|
||||
include_once('./admin.tail.php');
|
||||
?>
|
||||
BIN
adm/img/logo.jpg
BIN
adm/img/logo.jpg
Binary file not shown.
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 5.9 KiB |
76
bbs/list.php
76
bbs/list.php
@ -61,10 +61,47 @@ if(G5_IS_MOBILE) {
|
||||
$page_rows = $board['bo_page_rows'];
|
||||
}
|
||||
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
|
||||
// 년도 2자리
|
||||
$today2 = G5_TIME_YMD;
|
||||
|
||||
$list = array();
|
||||
$i = 0;
|
||||
$notice_count = 0;
|
||||
$notice_array = array();
|
||||
|
||||
// 공지 처리
|
||||
if (!$sca && !$stx) {
|
||||
$arr_notice = explode(',', trim($board['bo_notice']));
|
||||
for ($k=0; $k<count($arr_notice); $k++) {
|
||||
if (trim($arr_notice[$k])=='') continue;
|
||||
|
||||
$row = sql_fetch(" select * from {$write_table} where wr_id = '{$arr_notice[$k]}' ");
|
||||
|
||||
if (!$row['wr_id']) continue;
|
||||
|
||||
if($page == 1) {
|
||||
$list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
|
||||
$list[$i]['is_notice'] = true;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$notice_array[] = $row['wr_id'];
|
||||
$notice_count++;
|
||||
}
|
||||
}
|
||||
|
||||
$total_page = ceil($total_count / $page_rows); // 전체 페이지 계산
|
||||
if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $page_rows; // 시작 열을 구함
|
||||
|
||||
if($page > 1 && $notice_count)
|
||||
$from_record -= $notice_count;
|
||||
|
||||
if($page == 1 && $notice_count)
|
||||
$page_rows -= $notice_count;
|
||||
|
||||
// 관리자라면 CheckBox 보임
|
||||
$is_checkbox = false;
|
||||
if ($is_member && ($is_admin == 'super' || $group['gr_admin'] == $member['mb_id'] || $board['bo_admin'] == $member['mb_id']))
|
||||
@ -85,7 +122,7 @@ if (!$sst) {
|
||||
$sst = $board['bo_sort_field'];
|
||||
} else {
|
||||
$sst = "wr_num, wr_reply";
|
||||
$sod = "";
|
||||
$sod = "";
|
||||
}
|
||||
} else {
|
||||
// 게시물 리스트의 정렬 대상 필드가 아니라면 공백으로 (nasca 님 09.06.16)
|
||||
@ -101,39 +138,17 @@ if ($sst) {
|
||||
if ($sca || $stx) {
|
||||
$sql = " select distinct wr_parent from {$write_table} where {$sql_search} {$sql_order} limit {$from_record}, $page_rows ";
|
||||
} else {
|
||||
$sql = " select * from {$write_table} where wr_is_comment = 0 {$sql_order} limit {$from_record}, $page_rows ";
|
||||
$sql = " select * from {$write_table} where wr_is_comment = 0 ";
|
||||
if($notice_count && !empty($notice_array))
|
||||
$sql .= " and wr_id not in (".implode(', ', $notice_array).") ";
|
||||
$sql .= " {$sql_order} limit {$from_record}, $page_rows ";
|
||||
}
|
||||
$result = sql_query($sql);
|
||||
|
||||
// 년도 2자리
|
||||
$today2 = G5_TIME_YMD;
|
||||
|
||||
$list = array();
|
||||
$i = 0;
|
||||
|
||||
if (!$sca && !$stx) {
|
||||
$arr_notice = explode(',', trim($board['bo_notice']));
|
||||
for ($k=0; $k<count($arr_notice); $k++) {
|
||||
if (trim($arr_notice[$k])=='') continue;
|
||||
|
||||
$row = sql_fetch(" select * from {$write_table} where wr_id = '{$arr_notice[$k]}' ");
|
||||
|
||||
if (!$row['wr_id']) continue;
|
||||
|
||||
$list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
|
||||
$list[$i]['is_notice'] = true;
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$k = 0;
|
||||
|
||||
while ($row = sql_fetch_array($result))
|
||||
{
|
||||
// 공지글인 경우는 해당글을 같은 페이지에서 다시 노출하지 않는다.
|
||||
if ($arr_notice && in_array($row['wr_id'], $arr_notice)) continue;
|
||||
|
||||
// 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다
|
||||
if ($sca || $stx)
|
||||
$row = sql_fetch(" select * from {$write_table} where wr_id = '{$row['wr_parent']}' ");
|
||||
@ -143,7 +158,10 @@ while ($row = sql_fetch_array($result))
|
||||
$list[$i]['subject'] = search_font($stx, $list[$i]['subject']);
|
||||
}
|
||||
$list[$i]['is_notice'] = false;
|
||||
$list[$i]['num'] = $total_count - ($page - 1) * $page_rows - $k;
|
||||
$list_num = $total_count - ($page - 1) * $page_rows;
|
||||
if($page == 1)
|
||||
$list_num -= $notice_count;
|
||||
$list[$i]['num'] = $list_num - $k;
|
||||
|
||||
$i++;
|
||||
$k++;
|
||||
|
||||
@ -27,4 +27,6 @@
|
||||
.sch_res_list ul {margin:0;padding:0;list-style:none}
|
||||
.sch_res_list li {margin:0 0 10px;padding:0 10px 10px;border-bottom:1px solid #e9e9e9}
|
||||
.sch_res_list a {text-decoration:none}
|
||||
.sch_res_title {display:inline-block;margin:0 0 5px}
|
||||
.sch_res_list p {margin:0 0 10px;line-height:1.8em}
|
||||
.sch_more {padding:0 10px;text-align:right}
|
||||
@ -23,5 +23,6 @@
|
||||
.sch_res_list h2 {margin:0 0 15px;font-size:1.2em}
|
||||
.sch_res_list ul {margin:0;padding:0;list-style:none}
|
||||
.sch_res_list li {margin:0 0 10px;padding:0 0 10px;border-bottom:1px solid #e9e9e9}
|
||||
.sch_res_title {font-weight:bold}
|
||||
.sch_res_title {display:inline-block;margin:0 0 5px}
|
||||
.sch_res_list p {margin:0 0 10px;line-height:1.8em}
|
||||
.sch_more {text-align:right}
|
||||
Reference in New Issue
Block a user