Files
firstgarden-web-gnu/theme/rb.basic/skin/board/rb.bbs/list.skin.php
2025-07-02 14:13:16 +09:00

147 lines
5.0 KiB
PHP

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
@include_once($board_skin_path."/list.core.php"); // 그누보드 코어 list.php 스틸
// 최초 1회 설치 후 삭제하셔도 됩니다. {
$columns_to_add = [
'bo_rb_skin_top' => 'VARCHAR(255) NOT NULL DEFAULT \'basic\'',
'bo_rb_skin_list' => 'VARCHAR(255) NOT NULL DEFAULT \'basic\'',
'bo_rb_skin_view' => 'VARCHAR(255) NOT NULL DEFAULT \'basic\'',
'bo_rb_skin_write' => 'VARCHAR(255) NOT NULL DEFAULT \'basic\'',
'bo_rb_skin_cmt' => 'VARCHAR(255) NOT NULL DEFAULT \'basic\'',
'bo_rb_skin_category' => 'VARCHAR(255) NOT NULL DEFAULT \'basic\'',
'bo_rb_skin_search' => 'VARCHAR(255) NOT NULL DEFAULT \'basic\'',
'bo_rb_skin_update' => 'VARCHAR(255) NOT NULL DEFAULT \'basic\'',
'bo_mobile_gallery_cols' => 'INT(4) NOT NULL DEFAULT \'2\'',
'bo_gap_pc' => 'INT(4) NOT NULL DEFAULT \'20\'',
'bo_gap_mo' => 'INT(4) NOT NULL DEFAULT \'20\'',
'bo_border' => 'INT(4) NOT NULL DEFAULT \'0\'',
'bo_radius' => 'INT(4) NOT NULL DEFAULT \'10\'',
'bo_viewer' => 'VARCHAR(255) NOT NULL DEFAULT \'\'',
'bo_lightbox' => 'INT(4) NOT NULL DEFAULT \'1\'',
];
foreach ($columns_to_add as $column => $attributes) {
// 컬럼이 있는지 확인
$column_check = sql_query("SHOW COLUMNS FROM {$g5['board_table']} LIKE '{$column}'", false);
if (!sql_num_rows($column_check)) {
// 컬럼 추가
sql_query("ALTER TABLE {$g5['board_table']} ADD {$column} {$attributes}", true);
}
}
// }
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/css/style.css">', 0);
if (isset($board['bo_rb_skin_top']) && $board['bo_rb_skin_top']) {
$board['bo_rb_skin_top'] = $board['bo_rb_skin_top'];
} else {
$board['bo_rb_skin_top'] = 'basic';
}
?>
<div class="rb_bbs_wrap" id="scroll_container" style="width:<?php echo $width; ?>">
<form name="fboardlist" id="fboardlist" action="<?php echo G5_BBS_URL; ?>/board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="sw" value="">
<?php include_once($board_skin_path."/skin/list/{$board['bo_rb_skin_list']}/skin.php"); ?>
</form>
</div>
<?php include_once($board_skin_path."/skin/search/{$board['bo_rb_skin_search']}/skin.php"); ?>
<?php if($is_checkbox) { ?>
<noscript>
<p>자바스크립트를 사용하지 않는 경우<br>별도의 확인 절차 없이 바로 선택삭제 처리하므로 주의하시기 바랍니다.</p>
</noscript>
<?php } ?>
<?php if ($is_checkbox) { ?>
<script>
function all_checked(sw) {
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function fboardlist_submit(f) {
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(document.pressed + "할 게시물을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택복사") {
select_copy("copy");
return;
}
if(document.pressed == "선택이동") {
select_copy("move");
return;
}
if(document.pressed == "선택삭제") {
if (!confirm("선택한 게시물을 정말 삭제하시겠습니까?\n\n한번 삭제한 자료는 복구할 수 없습니다\n\n답변글이 있는 게시글을 선택하신 경우\n답변글도 선택하셔야 게시글이 삭제됩니다."))
return false;
f.removeAttribute("target");
f.action = g5_bbs_url+"/board_list_update.php";
}
return true;
}
// 선택한 게시물 복사 및 이동
function select_copy(sw) {
var f = document.fboardlist;
if (sw == 'copy')
str = "복사";
else
str = "이동";
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = g5_bbs_url+"/move.php";
f.submit();
}
// 게시판 리스트 관리자 옵션
jQuery(function($){
$(".btn_more_opt.is_list_btn").on("click", function(e) {
e.stopPropagation();
$(".more_opt.is_list_btn").toggle();
});
$(document).on("click", function (e) {
if(!$(e.target).closest('.is_list_btn').length) {
$(".more_opt.is_list_btn").hide();
}
});
});
</script>
<?php } ?>
<!-- } 게시판 목록 끝 -->