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

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

QA

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

답변 2

본문

 

회원가입시 회원아이디로 개인 게시판을 만들어야되는데

예전 자료는 그누보드4버전이라 그누보드5에서는 안되네요.

그누보드5 버전에서 회원가입시 아이디로 게시판 생성하려면 어찌해야하나요?

 

 

그누4팁자료에 NTYPE님께서 올려주신 소스입니다.

========================================================================= 

"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);
}
?>


  

이 질문에 댓글 쓰기 :

답변 2

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 1,543
© SIRSOFT
현재 페이지 제일 처음으로