제로보드에서 G4로 변환하기.. 게시판 일괄 생성하기.. > 유틸리티

본문 바로가기
 

제로보드에서 G4로 변환하기.. 게시판 일괄 생성하기..

페이지 정보

작성자 no_profile human 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 19,759회 작성일 07-05-11 13:14

본문

제로보드에서 G4로 변환하기.. 게시판 일괄 생성하기.. 
 
 
  글쓴이 : 시인의창 (210.♡.57.238)    날짜 : 05-09-03 06:24    조회 : 1477    추천 : 0     
 
백여개정도 되는 게시판들 일일이 G4에서 생성하려니... 힘들더군요.. -_-;;

간단하게 제로보드의 게시판 목록을 G4에서 생성되게 한 프로그램입니다.

convert 디렉토리에 넣고 한번 돌리시면 제로보드의 게시판 목록을 기준으로 G4로 생성시켜줍니다.

생성 후에 세부 조정은 해야 하겠지만.. 나름대로 쓸모 있으실껍니다...


ps. 저는 좀 변형된 제로보드를 사용해서 잘 안될 수도 있을지 모르겠습니다..
    대강 수정해서 사용하세요... (이런 무책임한... 쩝.. 죄송합니다..)

-------------------------- 여기서부텁니다...

<?
/*
    제로보드 4.1 pl7 -> G4 게시판 일괄 생성
    2005.9.4 일 작성
*/
include_once("./_common.php");


if ($is_admin != "super")
    alert("최고관리자만 변환 가능합니다", "$g4[bbs_path]/login.php?url=".urlencode($_SERVER[PHP_SELF]));
?>

<link rel="stylesheet" href="<?=$g4[path]?>/style.css" type="text/css">

<p><b>제로보드 변환 프로그램(테이블 일괄 생성)</b>
<p>

<?
    $sql = " select * from zetyx_admin_table order by name";
    $result = sql_query($sql);
    for ($i=0; $row=sql_fetch_array($result); $i++)
    {
        $bo_table = $row[name];
        $bo_upload_size = 512 * 1024;  // 업로드 제한 사이즈

        $board_path = "$g4[path]/data/file/$bo_table";

        // 게시판 디렉토리 생성
        @mkdir($board_path, 0707);
        @chmod($board_path, 0707);

        // 디렉토리에 있는 파일의 목록을 보이지 않게 한다.
        $file = $board_path . "/index.php";
        $f = @fopen($file, "w");
        @fwrite($f, "");
        @fclose($f);
        @chmod($file, 0606);

        if(!$row[title]) $row[title] = $bo_table;
        // 이 밑의 값들을 기본 세팅 값으로 해서 변경하세요.
        // 카테고리 값을 가져오는 부분은 없습니다. 변환 후에 직접 수정하세요.. ^^;;
        $sql_common = " gr_id              = 'board',
                bo_subject          = '$row[title]',
                bo_admin            = '',
                bo_list_level      = '3',
                bo_read_level      = '3',
                bo_write_level      = '3',
bo_reply_level      = '3',
                bo_comment_level    = '3',
                bo_html_level      = '3',
                bo_link_level      = '3',
                bo_trackback_level  = '10',
                bo_count_modify    = '3',
                bo_count_delete    = '3',
                bo_upload_level    = '3',
                bo_download_level  = '3',
                bo_read_point      = '0',
                bo_write_point      = '10',
                bo_comment_point    = '5',
                bo_download_point  = '0',
                bo_use_category    = '0',
                bo_category_list    = '',
                bo_disable_tags    = 'script|iframe',
                bo_use_sideview    = '1',
                bo_use_file_content = '0',
                bo_use_secret      = '0',
                bo_use_comment      = '1',
                bo_use_good        = '1',
                bo_use_nogood      = '1',
                bo_use_name        = '1',
                bo_use_signature    = '1',
                bo_use_ip_view      = '0',
                bo_use_trackback    = '0',
                bo_use_list_view    = '0',
                bo_use_list_content = '0',
                bo_table_width      = '97',
                bo_subject_len      = '60',
                bo_page_rows        = '15',
                bo_new              = '24',
                bo_hot              = '100',
                bo_image_width      = '600',
                bo_skin            = 'basic',
                bo_include_head    = '',
                bo_include_tail    = '',
                bo_content_head    = '',
                bo_content_tail    = '',
                bo_insert_content  = '',
                bo_gallery_cols    = '4',
                bo_upload_size      = '$bo_upload_size',
                bo_reply_order      = '1',
                bo_use_search      = '0',
                bo_order_search    = '0',
                bo_write_min        = '0',
                bo_write_max        = '0',
                bo_comment_min      = '0',
                bo_comment_max      = '0',
                bo_1                = '',
                bo_2                = '',
                bo_3                = '',
                bo_4                = '',
                bo_5                = '',
                bo_6                = '',
                bo_7                = '',
                bo_8                = '',
                bo_9                = '',
                bo_10              = '',
bo_image_head      = '',
bo_image_tail      = ''
        ";

            $row = sql_fetch(" select count(*) as cnt from $g4[board_table] where bo_table = '$bo_table' ");
            if ($row[cnt])
            {
                echo ("{$bo_table} 은(는) 이미 존재하는 TABLE 입니다.");
            }
            else
            {
                $sql = " insert into $g4[board_table]
                                set bo_table = '$bo_table',
                                bo_count_write = '0',
                                bo_count_comment = '0',
                                $sql_common ";
                sql_query($sql);

                // 게시판 테이블 생성
                $file = file("../adm/sql_write.sql");
                $sql = implode($file, "\n");

                $create_table = $g4[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);

                echo "{$bo_table} 생성<br>";
            }
        }
?>

<p>변환 완료</p>

댓글목록

등록된 댓글이 없습니다.

Total 153건 9 페이지
유틸리티 목록
번호 제목 글쓴이 조회 날짜
9 no_profile 휴먼 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 22064 07-15
8 no_profile 휴먼 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15209 06-27
7 no_profile 휴먼 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 28052 06-27
열람중 no_profile human 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 19760 05-11
5 no_profile human 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 23049 05-08
4 no_profile human 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15940 05-04
3 no_profile human 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 15839 05-04
2 no_profile human 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 21928 05-04
1 no_profile 휴먼 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 14242 04-27
게시물 검색