목록에서 파일 사용 옵션 추가 - 목록에서 파일을 매번 읽어오지 않으므로 속도가 좀더 빨라짐
This commit is contained in:
@ -22,35 +22,35 @@ if (!isset($board['bo_device'])) {
|
||||
}
|
||||
|
||||
if (!isset($board['bo_show_menu'])) {
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_show_menu` TINYINT NOT NULL DEFAULT '0' AFTER `bo_order_search`, ADD `bo_order` INT NOT NULL DEFAULT '0' AFTER `bo_show_menu` ", false);
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_show_menu` TINYINT NOT NULL DEFAULT '0' AFTER `bo_order_search`, ADD `bo_order` INT NOT NULL DEFAULT '0' AFTER `bo_show_menu` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_mobile_skin'])) {
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_skin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bo_skin` ", false);
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_skin` VARCHAR(255) NOT NULL DEFAULT '' AFTER `bo_skin` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_gallery_width'])) {
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_gallery_width` INT NOT NULL AFTER `bo_gallery_cols`, ADD `bo_gallery_height` INT NOT NULL DEFAULT '0' AFTER `bo_gallery_width`, ADD `bo_mobile_gallery_cols` INT NOT NULL DEFAULT '0' AFTER `bo_gallery_height`, ADD `bo_mobile_gallery_width` INT NOT NULL DEFAULT '0' AFTER `bo_mobile_gallery_cols`, ADD `bo_mobile_gallery_height` INT NOT NULL DEFAULT '0' AFTER `bo_mobile_gallery_width` ", false);
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_gallery_width` INT NOT NULL AFTER `bo_gallery_cols`, ADD `bo_gallery_height` INT NOT NULL DEFAULT '0' AFTER `bo_gallery_width`, ADD `bo_mobile_gallery_cols` INT NOT NULL DEFAULT '0' AFTER `bo_gallery_height`, ADD `bo_mobile_gallery_width` INT NOT NULL DEFAULT '0' AFTER `bo_mobile_gallery_cols`, ADD `bo_mobile_gallery_height` INT NOT NULL DEFAULT '0' AFTER `bo_mobile_gallery_width` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_mobile_subject_len'])) {
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_subject_len` INT(11) NOT NULL DEFAULT '0' AFTER `bo_subject_len` ", false);
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_subject_len` INT(11) NOT NULL DEFAULT '0' AFTER `bo_subject_len` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_mobile_page_rows'])) {
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_page_rows` INT(11) NOT NULL DEFAULT '0' AFTER `bo_page_rows` ", false);
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_page_rows` INT(11) NOT NULL DEFAULT '0' AFTER `bo_page_rows` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_mobile_content_head'])) {
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_content_head` TEXT NOT NULL AFTER `bo_content_head`, ADD `bo_mobile_content_tail` TEXT NOT NULL AFTER `bo_content_tail`", false);
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_mobile_content_head` TEXT NOT NULL AFTER `bo_content_head`, ADD `bo_mobile_content_tail` TEXT NOT NULL AFTER `bo_content_tail`", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_use_cert'])) {
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_use_cert` ENUM('','cert','adult') NOT NULL DEFAULT '' AFTER `bo_use_email` ", false);
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_use_cert` ENUM('','cert','adult') NOT NULL DEFAULT '' AFTER `bo_use_email` ", false);
|
||||
}
|
||||
|
||||
if (!isset($board['bo_use_sns'])) {
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_use_sns` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_cert` ", false);
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_use_sns` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_cert` ", false);
|
||||
|
||||
$result = sql_query(" select bo_table from `{$g4['board_table']}` ");
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
@ -63,6 +63,16 @@ if (!isset($board['bo_use_sns'])) {
|
||||
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` CHANGE `bo_use_cert` `bo_use_cert` ENUM('','cert','adult') NOT NULL DEFAULT '' ", false);
|
||||
|
||||
if (!isset($board['bo_use_list_file'])) {
|
||||
sql_query(" ALTER TABLE `{$g4['board_table']}` ADD `bo_use_list_file` TINYINT NOT NULL DEFAULT '0' AFTER `bo_use_list_view` ", false);
|
||||
|
||||
$result = sql_query(" select bo_table from `{$g4['board_table']}` ");
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
sql_query(" ALTER TABLE `{$g4['write_prefix']}{$row['bo_table']}`
|
||||
ADD `wr_file` TINYINT NOT NULL DEFAULT '0' AFTER `wr_datetime` ", false);
|
||||
}
|
||||
}
|
||||
|
||||
$required = "";
|
||||
$readonly = "";
|
||||
if ($w == '') {
|
||||
@ -526,8 +536,9 @@ $pg_anchor = '<ul class="anchor">
|
||||
<tr>
|
||||
<th scope="row"><label for="bo_use_list_content">목록에서 내용 사용</label></th>
|
||||
<td>
|
||||
<?php echo help("목록에서 게시판 제목외에 내용도 읽어와야 할 경우에 설정하는 옵션입니다. 기본은 사용하지 않습니다."); ?>
|
||||
<input type="checkbox" name="bo_use_list_content" value="1" id="bo_use_list_content" <?php echo $board['bo_use_list_content']?'checked':''; ?>>
|
||||
사용 (사용시 속도 느려질 수 있습니다.)
|
||||
사용 (사용시 속도가 느려질 수 있습니다.)
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_grp_use_list_content" value="1" id="chk_grp_use_list_content">
|
||||
@ -536,6 +547,20 @@ $pg_anchor = '<ul class="anchor">
|
||||
<label for="chk_all_use_list_content">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bo_use_list_file">목록에서 파일 사용</label></th>
|
||||
<td>
|
||||
<?php echo help("목록에서 게시판 첨부파일을 읽어와야 할 경우에 설정하는 옵션입니다. 기본은 사용하지 않습니다."); ?>
|
||||
<input type="checkbox" name="bo_use_list_file" value="1" id="bo_use_list_file" <?php echo $board['bo_use_list_file']?'checked':''; ?>>
|
||||
사용 (사용시 속도가 느려질 수 있습니다.)
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_grp_use_list_file" value="1" id="chk_grp_use_list_file">
|
||||
<label for="chk_grp_use_list_file">그룹적용</label>
|
||||
<input type="checkbox" name="chk_all_use_list_file" value="1" id="chk_all_use_list_file">
|
||||
<label for="chk_all_use_list_file">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bo_use_list_view">전체목록보이기 사용</label></th>
|
||||
<td>
|
||||
|
||||
@ -74,6 +74,7 @@ $sql_common = " gr_id = '{$_POST['gr_id']}',
|
||||
bo_use_signature = '{$_POST['bo_use_signature']}',
|
||||
bo_use_ip_view = '{$_POST['bo_use_ip_view']}',
|
||||
bo_use_list_view = '{$_POST['bo_use_list_view']}',
|
||||
bo_use_list_file = '{$_POST['bo_use_list_file']}',
|
||||
bo_use_list_content = '{$_POST['bo_use_list_content']}',
|
||||
bo_use_email = '{$_POST['bo_use_email']}',
|
||||
bo_use_cert = '{$_POST['bo_use_cert']}',
|
||||
@ -252,6 +253,7 @@ if (is_checked('chk_grp_use_name')) $grp_fields .= " , bo_use_name =
|
||||
if (is_checked('chk_grp_use_signature')) $grp_fields .= " , bo_use_signature = '{$bo_use_signature}' ";
|
||||
if (is_checked('chk_grp_use_ip_view')) $grp_fields .= " , bo_use_ip_view = '{$bo_use_ip_view}' ";
|
||||
if (is_checked('chk_grp_use_list_view')) $grp_fields .= " , bo_use_list_view = '{$bo_use_list_view}' ";
|
||||
if (is_checked('chk_grp_use_list_file')) $grp_fields .= " , bo_use_list_file = '{$bo_use_list_file}' ";
|
||||
if (is_checked('chk_grp_use_list_content')) $grp_fields .= " , bo_use_list_content = '{$bo_use_list_content}' ";
|
||||
if (is_checked('chk_grp_use_email')) $grp_fields .= " , bo_use_email = '{$bo_use_email}' ";
|
||||
if (is_checked('chk_grp_use_cert')) $grp_fields .= " , bo_use_cert = '{$bo_use_cert}' ";
|
||||
@ -336,6 +338,7 @@ if (is_checked('chk_all_use_name')) $all_fields .= " , bo_use_name =
|
||||
if (is_checked('chk_all_use_signature')) $all_fields .= " , bo_use_signature = '{$bo_use_signature}' ";
|
||||
if (is_checked('chk_all_use_ip_view')) $all_fields .= " , bo_use_ip_view = '{$bo_use_ip_view}' ";
|
||||
if (is_checked('chk_all_use_list_view')) $all_fields .= " , bo_use_list_view = '{$bo_use_list_view}' ";
|
||||
if (is_checked('chk_all_use_list_file')) $all_fields .= " , bo_use_list_view = '{$bo_use_list_file}' ";
|
||||
if (is_checked('chk_all_use_list_content')) $all_fields .= " , bo_use_list_content = '{$bo_use_list_content}' ";
|
||||
if (is_checked('chk_all_use_email')) $all_fields .= " , bo_use_email = '{$bo_use_email}' ";
|
||||
if (is_checked('chk_all_use_cert')) $all_fields .= " , bo_use_cert = '{$bo_use_cert}' ";
|
||||
|
||||
@ -107,7 +107,7 @@ if ($is_member) {
|
||||
$nogood_href = './good.php?bo_table='.$bo_table.'&wr_id='.$wr_id.'&good=nogood';
|
||||
}
|
||||
|
||||
$view = get_view($write, $board, $board_skin_path, 255);
|
||||
$view = get_view($write, $board, $board_skin_path);
|
||||
|
||||
if (strstr($sfl, 'subject'))
|
||||
$view['subject'] = search_font($stx, $view['subject']);
|
||||
|
||||
@ -551,6 +551,10 @@ for ($i=(int)$row['max_bf_no']; $i>=0; $i--)
|
||||
// 그렇지 않다면 정보를 삭제합니다.
|
||||
sql_query(" delete from {$g4['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$i}' ");
|
||||
}
|
||||
|
||||
// 파일의 갯수를 게시물에 업데이트 한다.
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g4['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' ");
|
||||
sql_query(" update {$write_table} set wr_file = '{$row['cnt']}' where wr_id = '{$wr_id}' ");
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// 비밀글이라면 세션에 비밀글의 아이디를 저장한다. 자신의 글은 다시 패스워드를 묻지 않기 위함
|
||||
|
||||
@ -417,7 +417,11 @@ function get_list($write_row, $board, $skin_url, $subject_len=40)
|
||||
}
|
||||
|
||||
// 가변 파일
|
||||
$list['file'] = get_file($board['bo_table'], $list['wr_id']);
|
||||
if ($board['bo_use_list_file'] || ($list['wr_file'] && $subject_len == 255) /* view 인 경우 */) {
|
||||
$list['file'] = get_file($board['bo_table'], $list['wr_id']);
|
||||
} else {
|
||||
$list['file']['count'] = $list['wr_file'];
|
||||
}
|
||||
|
||||
if ($list['file']['count'])
|
||||
$list['icon_file'] = '<img src="'.$skin_url.'/img/icon_file.gif" alt="첨부파일">';
|
||||
@ -426,9 +430,9 @@ function get_list($write_row, $board, $skin_url, $subject_len=40)
|
||||
}
|
||||
|
||||
// get_list 의 alias
|
||||
function get_view($write_row, $board, $skin_url, $subject_len=125)
|
||||
function get_view($write_row, $board, $skin_url)
|
||||
{
|
||||
return get_list($write_row, $board, $skin_url, $subject_len);
|
||||
return get_list($write_row, $board, $skin_url, 255);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user