그룹5개, 그룹당 보드 5개 일괄 생성
매번 그룹 만들고 게시판 만드는게 귀찮아서 그룹5개, 그룹당 게시판 5개를 일괄 생성 수 수정해서 사용중
사용법 : 첨부파일을 root에 업로드해서 실행 (주소창에 도메인/board_set.php)
그룹 갯수 수정
[code]
// make group
for($i=1; $i<=5; $i++){
[/code]
에서 $i<=5 를 원하는 그룹 갯수로 수정
그룹당 게시판 갯수 수정
[code]
//make board
for($j=1; $j<=5; $j++){
[/code]
에서 $j<=5 를 원하는 그룹 갯수로 수정
첨부파일 내용
[code]
<?php
include_once("./_common.php");
if ($is_admin != 'super') {
alert("관리자 로그인 후 사용");
die();
}
// make group
for($i=1; $i<=5; $i++){
$gr_id = sprintf("%02d",$i);
$sql_common = " gr_subject = '그룹_{$gr_id}',
gr_device = 'both',
gr_admin = '',
gr_1_subj = '',
gr_2_subj = '',
gr_3_subj = '',
gr_4_subj = '',
gr_5_subj = '',
gr_6_subj = '',
gr_7_subj = '',
gr_8_subj = '',
gr_9_subj = '',
gr_10_subj = '',
gr_1 = '',
gr_2 = '',
gr_3 = '',
gr_4 = '',
gr_5 = '',
gr_6 = '',
gr_7 = '',
gr_8 = '',
gr_9 = '',
gr_10 = '',
gr_use_access = '0',
gr_order = '{$i}'
";
$sql = " select count(*) as cnt from {$g5['group_table']} where gr_id = '{$_POST['gr_id']}' ";
$row = sql_fetch($sql);
if (!$row['cnt']) {
$sql = " insert into {$g5['group_table']}
set gr_id = '{$gr_id}',
{$sql_common}
";
sql_query($sql);
}
//make board
for($j=1; $j<=5; $j++){
$bo_table = $gr_id."_".sprintf("%02d",$j);
$board_path = G5_DATA_PATH.'/file/'.$bo_table;
// 게시판 디렉토리 생성
@mkdir($board_path, G5_DIR_PERMISSION);
@chmod($board_path, G5_DIR_PERMISSION);
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$file = $board_path . '/index.php';
$f = @fopen($file, 'w');
@fwrite($f, '');
@fclose($f);
@chmod($file, G5_FILE_PERMISSION);
$sql_common = " gr_id = '{$gr_id}',
bo_subject = '게시판_{$bo_table}',
bo_mobile_subject = '',
bo_device = 'both',
bo_admin = '',
bo_list_level = '1',
bo_read_level = '1',
bo_write_level = '1',
bo_reply_level = '1',
bo_comment_level = '1',
bo_html_level = '1',
bo_link_level = '1',
bo_count_modify = '1',
bo_count_delete = '1',
bo_upload_level = '1',
bo_download_level = '1',
bo_read_point = '0',
bo_write_point = '0',
bo_comment_point = '0',
bo_download_point = '0',
bo_use_category = '0',
bo_category_list = '',
bo_use_sideview = '0',
bo_use_file_content = '0',
bo_use_secret = '0',
bo_use_dhtml_editor = '0',
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_view = '0',
bo_use_list_file = '0',
bo_use_list_content = '0',
bo_use_email = '0',
bo_use_cert = '0',
bo_use_sns = '0',
bo_table_width = '100',
bo_subject_len = '60',
bo_mobile_subject_len = '30',
bo_page_rows = '15',
bo_mobile_page_rows = '15',
bo_new = '24',
bo_hot = '100',
bo_image_width = '600',
bo_skin = 'basic',
bo_mobile_skin = 'basic',
bo_include_head = '_head.php',
bo_include_tail = '_tail.php',
bo_content_head = '',
bo_content_tail = '',
bo_mobile_content_head = '',
bo_mobile_content_tail = '',
bo_insert_content = '',
bo_gallery_cols = '4',
bo_gallery_width = '174',
bo_gallery_height = '124',
bo_mobile_gallery_width = '125',
bo_mobile_gallery_height= '100',
bo_upload_count = '2',
bo_upload_size = '1048579',
bo_reply_order = '1',
bo_use_search = '1',
bo_order = '{$j}',
bo_write_min = '0',
bo_write_max = '0',
bo_comment_min = '0',
bo_comment_max = '0',
bo_sort_field = '',
bo_1_subj = '',
bo_2_subj = '',
bo_3_subj = '',
bo_4_subj = '',
bo_5_subj = '',
bo_6_subj = '',
bo_7_subj = '',
bo_8_subj = '',
bo_9_subj = '',
bo_10_subj = '',
bo_1 = '',
bo_2 = '',
bo_3 = '',
bo_4 = '',
bo_5 = '',
bo_6 = '',
bo_7 = '',
bo_8 = '',
bo_9 = '',
bo_10 = ''
";
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where bo_table = '{$bo_table}' ");
if (!$row['cnt']){
$sql = " insert into {$g5['board_table']}
set bo_table = '{$bo_table}',
bo_count_write = '0',
bo_count_comment = '0',
$sql_common ";
sql_query($sql);
// 게시판 테이블 생성
$file = file(G5_PATH.'/adm/sql_write.sql');
$sql = implode($file, "\n");
$create_table = $g5['write_prefix'] . $bo_table;
// sql_board.sql 파일의 테이블명을 변환
$source = array('/__TABLE_NAME__/', '/;/');
$target = array($create_table, '');
$sql = preg_replace($source, $target, $sql);
sql_query($sql, FALSE);
}
}
}
goto_url(G5_ADMIN_URL."/board_list.php");
?>
[/code]
사용법 : 첨부파일을 root에 업로드해서 실행 (주소창에 도메인/board_set.php)
그룹 갯수 수정
[code]
// make group
for($i=1; $i<=5; $i++){
[/code]
에서 $i<=5 를 원하는 그룹 갯수로 수정
그룹당 게시판 갯수 수정
[code]
//make board
for($j=1; $j<=5; $j++){
[/code]
에서 $j<=5 를 원하는 그룹 갯수로 수정
첨부파일 내용
[code]
<?php
include_once("./_common.php");
if ($is_admin != 'super') {
alert("관리자 로그인 후 사용");
die();
}
// make group
for($i=1; $i<=5; $i++){
$gr_id = sprintf("%02d",$i);
$sql_common = " gr_subject = '그룹_{$gr_id}',
gr_device = 'both',
gr_admin = '',
gr_1_subj = '',
gr_2_subj = '',
gr_3_subj = '',
gr_4_subj = '',
gr_5_subj = '',
gr_6_subj = '',
gr_7_subj = '',
gr_8_subj = '',
gr_9_subj = '',
gr_10_subj = '',
gr_1 = '',
gr_2 = '',
gr_3 = '',
gr_4 = '',
gr_5 = '',
gr_6 = '',
gr_7 = '',
gr_8 = '',
gr_9 = '',
gr_10 = '',
gr_use_access = '0',
gr_order = '{$i}'
";
$sql = " select count(*) as cnt from {$g5['group_table']} where gr_id = '{$_POST['gr_id']}' ";
$row = sql_fetch($sql);
if (!$row['cnt']) {
$sql = " insert into {$g5['group_table']}
set gr_id = '{$gr_id}',
{$sql_common}
";
sql_query($sql);
}
//make board
for($j=1; $j<=5; $j++){
$bo_table = $gr_id."_".sprintf("%02d",$j);
$board_path = G5_DATA_PATH.'/file/'.$bo_table;
// 게시판 디렉토리 생성
@mkdir($board_path, G5_DIR_PERMISSION);
@chmod($board_path, G5_DIR_PERMISSION);
// 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
$file = $board_path . '/index.php';
$f = @fopen($file, 'w');
@fwrite($f, '');
@fclose($f);
@chmod($file, G5_FILE_PERMISSION);
$sql_common = " gr_id = '{$gr_id}',
bo_subject = '게시판_{$bo_table}',
bo_mobile_subject = '',
bo_device = 'both',
bo_admin = '',
bo_list_level = '1',
bo_read_level = '1',
bo_write_level = '1',
bo_reply_level = '1',
bo_comment_level = '1',
bo_html_level = '1',
bo_link_level = '1',
bo_count_modify = '1',
bo_count_delete = '1',
bo_upload_level = '1',
bo_download_level = '1',
bo_read_point = '0',
bo_write_point = '0',
bo_comment_point = '0',
bo_download_point = '0',
bo_use_category = '0',
bo_category_list = '',
bo_use_sideview = '0',
bo_use_file_content = '0',
bo_use_secret = '0',
bo_use_dhtml_editor = '0',
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_view = '0',
bo_use_list_file = '0',
bo_use_list_content = '0',
bo_use_email = '0',
bo_use_cert = '0',
bo_use_sns = '0',
bo_table_width = '100',
bo_subject_len = '60',
bo_mobile_subject_len = '30',
bo_page_rows = '15',
bo_mobile_page_rows = '15',
bo_new = '24',
bo_hot = '100',
bo_image_width = '600',
bo_skin = 'basic',
bo_mobile_skin = 'basic',
bo_include_head = '_head.php',
bo_include_tail = '_tail.php',
bo_content_head = '',
bo_content_tail = '',
bo_mobile_content_head = '',
bo_mobile_content_tail = '',
bo_insert_content = '',
bo_gallery_cols = '4',
bo_gallery_width = '174',
bo_gallery_height = '124',
bo_mobile_gallery_width = '125',
bo_mobile_gallery_height= '100',
bo_upload_count = '2',
bo_upload_size = '1048579',
bo_reply_order = '1',
bo_use_search = '1',
bo_order = '{$j}',
bo_write_min = '0',
bo_write_max = '0',
bo_comment_min = '0',
bo_comment_max = '0',
bo_sort_field = '',
bo_1_subj = '',
bo_2_subj = '',
bo_3_subj = '',
bo_4_subj = '',
bo_5_subj = '',
bo_6_subj = '',
bo_7_subj = '',
bo_8_subj = '',
bo_9_subj = '',
bo_10_subj = '',
bo_1 = '',
bo_2 = '',
bo_3 = '',
bo_4 = '',
bo_5 = '',
bo_6 = '',
bo_7 = '',
bo_8 = '',
bo_9 = '',
bo_10 = ''
";
$row = sql_fetch(" select count(*) as cnt from {$g5['board_table']} where bo_table = '{$bo_table}' ");
if (!$row['cnt']){
$sql = " insert into {$g5['board_table']}
set bo_table = '{$bo_table}',
bo_count_write = '0',
bo_count_comment = '0',
$sql_common ";
sql_query($sql);
// 게시판 테이블 생성
$file = file(G5_PATH.'/adm/sql_write.sql');
$sql = implode($file, "\n");
$create_table = $g5['write_prefix'] . $bo_table;
// sql_board.sql 파일의 테이블명을 변환
$source = array('/__TABLE_NAME__/', '/;/');
$target = array($create_table, '');
$sql = preg_replace($source, $target, $sql);
sql_query($sql, FALSE);
}
}
}
goto_url(G5_ADMIN_URL."/board_list.php");
?>
[/code]
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 2604 | 8개월 전 | 673 | ||
| 2603 | 8개월 전 | 732 | ||
| 2602 | 8개월 전 | 647 | ||
| 2601 |
|
8개월 전 | 670 | |
| 2600 |
|
8개월 전 | 579 | |
| 2599 | 8개월 전 | 808 | ||
| 2598 | 8개월 전 | 602 | ||
| 2597 |
다케미카코
|
8개월 전 | 755 | |
| 2596 | 8개월 전 | 854 | ||
| 2595 |
|
8개월 전 | 445 | |
| 2594 | 8개월 전 | 608 | ||
| 2593 |
만두먹고또먹고
|
8개월 전 | 935 | |
| 2592 | 9개월 전 | 609 | ||
| 2591 | 9개월 전 | 620 | ||
| 2590 | 9개월 전 | 688 | ||
| 2589 |
|
9개월 전 | 757 | |
| 2588 | 9개월 전 | 476 | ||
| 2587 | 9개월 전 | 796 | ||
| 2586 | 9개월 전 | 642 | ||
| 2585 | 9개월 전 | 509 | ||
| 2584 | 9개월 전 | 576 | ||
| 2583 | 9개월 전 | 498 | ||
| 2582 | 9개월 전 | 640 | ||
| 2581 | 9개월 전 | 598 | ||
| 2580 |
만두먹고또먹고
|
9개월 전 | 517 | |
| 2579 |
|
9개월 전 | 664 | |
| 2578 | 9개월 전 | 646 | ||
| 2577 | 9개월 전 | 625 | ||
| 2576 | 9개월 전 | 561 | ||
| 2575 |
이슈DEV
|
9개월 전 | 993 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기