분해 #2 - 게시판 설정 - form
플래토
1
10525
0
0
2021.12.02 13:28
$sql = " select count(*) as cnt from {$g5['group_table']} "; $row = sql_fetch($sql); if (!$row['cnt']) alert('게시판그룹이 한개 이상 생성되어야 합니다.', './boardgroup_form.php'); $html_title = '게시판'; if (!isset($board['bo_device'])) { // 게시판 사용 필드 추가 // both : pc, mobile 둘다 사용 // pc : pc 전용 사용 // mobile : mobile 전용 사용 // none : 사용 안함 sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_device
ENUM( 'both', 'pc', 'mobile' ) NOT NULL DEFAULT 'both' AFTERbo_subject
", false); } if (!isset($board['bo_mobile_skin'])) { sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_mobile_skin
VARCHAR(255) NOT NULL DEFAULT '' AFTERbo_skin
", false); } if (!isset($board['bo_gallery_width'])) { sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_gallery_width
INT NOT NULL AFTERbo_gallery_cols
, ADDbo_gallery_height
INT NOT NULL DEFAULT '0' AFTERbo_gallery_width
, ADDbo_mobile_gallery_width
INT NOT NULL DEFAULT '0' AFTERbo_gallery_height
, ADDbo_mobile_gallery_height
INT NOT NULL DEFAULT '0' AFTERbo_mobile_gallery_width
", false); } if (!isset($board['bo_mobile_subject_len'])) { sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_mobile_subject_len
INT(11) NOT NULL DEFAULT '0' AFTERbo_subject_len
", false); } if (!isset($board['bo_mobile_page_rows'])) { sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_mobile_page_rows
INT(11) NOT NULL DEFAULT '0' AFTERbo_page_rows
", false); } if (!isset($board['bo_mobile_content_head'])) { sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_mobile_content_head
TEXT NOT NULL AFTERbo_content_head
, ADDbo_mobile_content_tail
TEXT NOT NULL AFTERbo_content_tail
", false); } if (!isset($board['bo_use_cert'])) { sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_use_cert
ENUM('','cert','adult') NOT NULL DEFAULT '' AFTERbo_use_email
", false); } if (!isset($board['bo_use_sns'])) { sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_use_sns
TINYINT NOT NULL DEFAULT '0' AFTERbo_use_cert
", false);} $sql = " SHOW COLUMNS FROM$result = sql_query(" select bo_table from `{$g5['board_table']}` "); for ($i=0; $row=sql_fetch_array($result); $i++) { sql_query(" ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}` ADD `wr_facebook_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_ip`, ADD `wr_twitter_user` VARCHAR(255) NOT NULL DEFAULT '' AFTER `wr_facebook_user` ", false); }
{$g5['board_table']}
LIKE 'bo_use_cert' "; $row = sql_fetch($sql); if(strpos($row['Type'], 'hp-') === false) { sql_query(" ALTER TABLE{$g5['board_table']}
CHANGEbo_use_cert
bo_use_cert
ENUM('','cert','adult','hp-cert','hp-adult') NOT NULL DEFAULT '' ", false); } if (!isset($board['bo_use_list_file'])) { sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_use_list_file
TINYINT NOT NULL DEFAULT '0' AFTERbo_use_list_view
", false);} if (!isset($board['bo_mobile_subject'])) { sql_query(" ALTER TABLE$result = sql_query(" select bo_table from `{$g5['board_table']}` "); for ($i=0; $row=sql_fetch_array($result); $i++) { sql_query(" ALTER TABLE `{$g5['write_prefix']}{$row['bo_table']}` ADD `wr_file` TINYINT NOT NULL DEFAULT '0' AFTER `wr_datetime` ", false); }
{$g5['board_table']}
ADDbo_mobile_subject
VARCHAR(255) NOT NULL DEFAULT '' AFTERbo_subject
", false); } if (!isset($board['bo_use_captcha'])) { sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_use_captcha
TINYINT NOT NULL DEFAULT '0' AFTERbo_use_sns
", false); } if (!isset($board['bo_select_editor'])) { sql_query(" ALTER TABLE{$g5['board_table']}
ADDbo_select_editor
VARCHAR(50) NOT NULL DEFAULT '' AFTERbo_use_dhtml_editor
", false); } $board_default = array( 'bo_mobile_subject'=>'', 'bo_device'=>'', 'bo_use_category'=>0, 'bo_category_list'=>'', 'bo_admin'=>'', 'bo_list_level'=>0, 'bo_read_level'=>0, 'bo_write_level'=>0, 'bo_reply_level'=>0, 'bo_comment_level'=>0, 'bo_link_level'=>0, 'bo_upload_level'=>0, 'bo_download_level'=>0, 'bo_html_level'=>0, 'bo_use_sideview'=>0, 'bo_select_editor'=>'', 'bo_use_rss_view'=>0, 'bo_use_good'=>0, 'bo_use_nogood'=>0, 'bo_use_name'=>0, 'bo_use_signature'=>0, 'bo_use_ip_view'=>0, 'bo_use_list_content'=>0, 'bo_use_list_file'=>0, 'bo_use_list_view'=>0, 'bo_use_email'=>0, 'bo_use_file_content'=>0, 'bo_use_cert'=>'', 'bo_write_min'=>0, 'bo_write_max'=>0, 'bo_comment_min'=>0, 'bo_comment_max'=>0, 'bo_use_sns'=>0, 'bo_order'=>0, 'bo_use_captcha'=>0, 'bo_content_head'=>'', 'bo_content_tail'=>'', 'bo_mobile_content_head'=>'', 'bo_mobile_content_tail'=>'', 'bo_insert_content'=>'', 'bo_sort_field'=>'', ); for($i=0;$i<=10;$i++){ $boarddefault['bo'.$i.'_subj'] = ''; $boarddefault['bo'.$i] = ''; } $board = array_merge($board_default, $board); run_event('adm_board_form_before', $board, $w); $required = ""; $readonly = ""; $sound_only = ""; $required_valid = ""; if ($w == '') {} else if ($w == 'u') {$html_title .= ' 생성'; $required = 'required'; $required_valid = 'alnum_'; $sound_only = '<strong class="sound_only">필수</strong>'; $board['bo_count_delete'] = 1; $board['bo_count_modify'] = 1; $board['bo_read_point'] = $config['cf_read_point']; $board['bo_write_point'] = $config['cf_write_point']; $board['bo_comment_point'] = $config['cf_comment_point']; $board['bo_download_point'] = $config['cf_download_point']; $board['bo_gallery_cols'] = 4; $board['bo_gallery_width'] = 202; $board['bo_gallery_height'] = 150; $board['bo_mobile_gallery_width'] = 125; $board['bo_mobile_gallery_height'] = 100; $board['bo_table_width'] = 100; $board['bo_page_rows'] = $config['cf_page_rows']; $board['bo_mobile_page_rows'] = $config['cf_page_rows']; $board['bo_subject_len'] = 60; $board['bo_mobile_subject_len'] = 30; $board['bo_new'] = 24; $board['bo_hot'] = 100; $board['bo_image_width'] = 600; $board['bo_upload_count'] = 2; $board['bo_upload_size'] = 1048576; $board['bo_reply_order'] = 1; $board['bo_use_search'] = 1; $board['bo_skin'] = 'basic'; $board['bo_mobile_skin'] = 'basic'; $board['gr_id'] = $gr_id; $board['bo_use_secret'] = 0; $board['bo_include_head'] = '_head.php'; $board['bo_include_tail'] = '_tail.php';
} if ($is_admin != 'super') { $group = get_group($board['gr_id']); $is_admin = is_admin($member['mb_id']); }$html_title .= ' 수정'; if (!$board['bo_table']) alert('존재하지 않은 게시판 입니다.'); if ($is_admin == 'group') { if ($member['mb_id'] != $group['gr_admin']) alert('그룹이 틀립니다.'); } $readonly = 'readonly';