회원가입시 회원아이디로 게시판 생성하기 > 그누4 팁자료실

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

회원가입시 회원아이디로 게시판 생성하기 정보

회원가입시 회원아이디로 게시판 생성하기

본문

"member" 라는 그룹이 생성되어 있어야 합니다.

skin/member/basic/register_update.skin.php [소스추가]

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
$sql_common = " gr_id               = 'member',
                bo_subject          = '$mb_id',
                bo_admin            = '',
                bo_list_level       = '2',
                bo_read_level       = '2',
                bo_write_level      = '2',
                bo_reply_level      = '2',
                bo_comment_level    = '2',
                bo_html_level       = '1',
                bo_link_level       = '1',
                bo_trackback_level  = '1',
                bo_count_modify     = '1',
                bo_count_delete     = '1',
                bo_upload_level     = '1',
                bo_download_level   = '1',
                bo_read_point       = '',
                bo_write_point      = '',
                bo_comment_point    = '',
                bo_download_point   = '',
                bo_use_category     = '',
                bo_category_list    = '',
                bo_disable_tags     = '1',
                bo_use_sideview     = '0',
                bo_use_file_content = '',
                bo_use_secret       = '',
                bo_use_dhtml_editor = '',
                bo_use_rss_view     = '',
                bo_use_comment      = '',
                bo_use_good         = '',
                bo_use_nogood       = '',
                bo_use_name         = '',
                bo_use_signature    = '',
                bo_use_ip_view      = '',
                bo_use_trackback    = '',
                bo_use_list_view    = '',
                bo_use_list_content = '',
                bo_use_email        = '1',
                bo_table_width      = '97',
                bo_subject_len      = '50',
                bo_page_rows        = '10',
                bo_new              = '14',
                bo_hot              = '14',
                bo_image_width      = '300',
                bo_skin             = 'basic',
                bo_include_head     = '../member_head.php',
                bo_include_tail     = '../member_head.php',
                bo_content_head     = '',
                bo_content_tail     = '',
                bo_insert_content   = '',
                bo_gallery_cols     = '3',
                bo_upload_count     = '0',
                bo_upload_size      = '1048576',
                bo_reply_order      = '1',
                bo_use_search       = '1',
                bo_order_search     = '0',
                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               = ''";
if ($bo_image_head_del) {
    @unlink("$board_path/$bo_image_head_del");
    $sql_common .= " , bo_image_head = '' ";
}
if ($bo_image_tail_del) {
    @unlink("$board_path/$bo_image_tail_del");
    $sql_common .= " , bo_image_tail = '' ";
}
if ($_FILES[bo_image_head][name]) {
    //$bo_image_head_urlencode = urlencode($_FILES[bo_image_head][name]);
    $bo_image_head_urlencode = $bo_table."_head_".time();
    $sql_common .= " , bo_image_head = '$bo_image_head_urlencode' ";
}
if ($_FILES[bo_image_tail][name]) {
    //$bo_image_tail_urlencode = urlencode($_FILES[bo_image_tail][name]);
    $bo_image_tail_urlencode = $bo_table."_tail_".time();
    $sql_common .= " , bo_image_tail = '$bo_image_tail_urlencode' ";
}
if ($w == "") {
    $row = sql_fetch(" select count(*) as cnt from $g4[board_table] where bo_table = '$bo_table' ");
    if ($row[cnt])
        alert("{$bo_table} 은(는) 이미 존재하는 TABLE 입니다.");
    $sql = " insert into $g4[board_table]
                set bo_table = '$mb_id',
                    bo_count_write = '0',
                    bo_count_comment = '0',
                    $sql_common ";
    sql_query($sql);
    // 게시판 테이블 생성
    $file = file("./sql_write.sql");
    $sql = implode($file, "\n");
    $create_table = $g4[write_prefix] . $mb_id;
    // sql_board.sql 파일의 테이블명을 변환
    $source = array("/__TABLE_NAME__/", "/;/");
    $target = array($create_table, "");
    $sql = preg_replace($source, $target, $sql);
    sql_query($sql, FALSE);
}
?>


 

추천
10

댓글 13개

특정 레벨을 체크하는 방법으로 반드시 필요한 경우에만 생성하고 회원 가입시 무조건 생성하는
방식은 불필요한 테이블이 늘어나는 등 관리적인 면에서는 비효율적 이라 보여지는데요.
게시판은 생성되는데 .. 게시판 클릭하면
아래 메시지 창이뜹니다..

select * from g4_write_psm7676 where wr_is_comment = 0 order by wr_num, wr_reply limit 0, 10

1146 : Table 'sk1004.g4_write_psm7676' doesn't exist

error file : /gnuboard4/bbs/board.php
전체 3,313 |RSS
그누4 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT