그누보드5, 메인화면 최신게시물 변경하려고 합니다.

그누보드5, 메인화면 최신게시물 변경하려고 합니다.

QA

그누보드5, 메인화면 최신게시물 변경하려고 합니다.

답변 2

본문

안녕하세요,

사이트를 직접 만든게 아니고 업체에서 만들었던 사이트를 사장님께서 앞으로 저더러 관리하라고 하셔서요...

FTP서버 아이디와 비밀번호를 받고서 주요 파일들을 다운 받아서 드림위버로 열어봤는데...

index.php화면에는 별도로 최신글이 묘목 및 조경수와 야생화 및 포트묘 뿐이구요..

제가 변경하고 싶은 부분은 스크롤을 중간 쯤 내리면 특수목 갤러리 밑에 또 특수목이라는 게시판이 있어요.

 

90c180673e7e64b2873ef0943623d0c8_1423530959_296.jpg 

 

이 게시판을 다른 게시판으로 변경하고 싶은데 아무리 찾아봐도 이 부분의 메인최신글을 어디서 뽑아오는지

찾을 수가 없어서 혹시나 하고 문의드립니다.

 

index.php 소스는

<?php
include_once('./_common.php');
// 초기화면 파일 경로 지정 : 이 코드는 가능한 삭제하지 마십시오.
if ($config['cf_include_index']) {
    if (!@include_once($config['cf_include_index'])) {
        die('기본환경 설정에서 초기화면 파일 경로가 잘못 설정되어 있습니다.');
    }
    return; // 이 코드의 아래는 실행을 하지 않습니다.
}
// 루트 index를 쇼핑몰 index 설정했을 때
if(isset($default['de_root_index_use']) && $default['de_root_index_use']) {
    require_once(G5_SHOP_PATH.'/index.php');
    return;
}
if (G5_IS_MOBILE) {
    include_once(G5_MOBILE_PATH.'/index.php');
    return;
}
include_once('./_head.php');
?>

<h2 class="sound_only">묘목 및 조경수보기</h2>
    <div>
        <?php
        // 이 함수가 바로 최신글을 추출하는 역할을 합니다.
        // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
        echo latest("basic_main", sale_seedlings, 10, 42);
        ?>
    </div>
<!-- } 최신글 끝 -->
<h2 class="sound_only">야생화 및 포트묘보기</h2>
    <div class="str_MT10">
        <?php
        // 이 함수가 바로 최신글을 추출하는 역할을 합니다.
        // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
        echo latest("basic_main", sale_wildflowers, 10, 42);
        ?>
    </div>
<!-- } 최신글 끝 -->
<?php
include_once('./_tail.php');
?>

 

이렇게 되어 있구요, 별도로 파일들은

90c180673e7e64b2873ef0943623d0c8_1423530761_2669.jpg

이런식으로 FTP에 업로드 되어 있습니다.

 

그누보드5와 영카트4를 사용하는 것 같은데... 그누보드는 처음 만져봐서 난감하네요.

평소 알고 있던 방식으로 최근게시물을 뽑아내는 소스가 야생화 및 포트묘 이후로는 찾아보기 힘들어서요..ㅠㅠ

이 질문에 댓글 쓰기 :

답변 2

메인페이지 화면이랑 주소창에서 도메인/shop/  으로 들어갔을 때 화면이 같은지 살펴보세요.

화면이 같으면 /shop/index.php 파일에서 수정해야 됩니다.

 

22<h2 class="sound_only">묘목 및 조경수보기</h2>
23    <div>
24        <?php
25        // 이 함수가 바로 최신글을 추출하는 역할을 합니다.
26        // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
27        echo latest("basic_main", sale_seedlings, 10, 42);
28        ?>
29    </div>

 

 

위 부분에서 sale_seedlings 부분을 다른 게시판명으로 변경하시면 될 것 같구요.

이미지가 나오는 최근게시물은 아마도 head.php에 존재하지 않을까 예상이 됩니다.

혹시몰라서 latest.lib.php 코드도 올려봅니다.

제가 변경하고 싶은 것은 특수목갤러리 밑에 '특수목'게시판을 다른 게시판으로 변경하고 싶은 것입니다.

 



<?php 

// 최신글 추출
// $cache_time 캐시 갱신시간
function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=1, $options='')
{
    global $g5;
    //static $css = array();

    if (!$skin_dir) $skin_dir = 'basic';

    if(G5_IS_MOBILE) {
        $latest_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
        $latest_skin_url  = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
    } else {
        $latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir;
        $latest_skin_url  = G5_SKIN_URL.'/latest/'.$skin_dir;
    }

    $cache_fwrite = false;
    if(G5_USE_CACHE) {
        $cache_file = G5_DATA_PATH."/cache/latest-{$bo_table}-{$skin_dir}-{$rows}-{$subject_len}.php";

        if(!file_exists($cache_file)) {
            $cache_fwrite = true;
        } else {
            if($cache_time > 0) {
                $filetime = filemtime($cache_file);
                if($filetime && $filetime < (G5_SERVER_TIME - 3600 * $cache_time)) {
                    @unlink($cache_file);
                    $cache_fwrite = true;
                }
            }

            if(!$cache_fwrite)
                include($cache_file);
        }
    }

    if(!G5_USE_CACHE || $cache_fwrite) {
        $list = array();

        $sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
        $board = sql_fetch($sql);
        $bo_subject = get_text($board['bo_subject']);

        $tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
        $sql = " select * from {$tmp_write_table} where wr_is_comment = 0 order by wr_num limit 0, {$rows} ";
        $result = sql_query($sql);
        for ($i=0; $row = sql_fetch_array($result); $i++) {
            $list[$i] = get_list($row, $board, $latest_skin_url, $subject_len);
        }

        if($cache_fwrite) {
            $handle = fopen($cache_file, 'w');
            $cache_content = "<?php\nif (!defined('_GNUBOARD_')) exit;\n\$bo_subject='".$bo_subject."';\n\$list=".var_export($list, true)."?>";
            fwrite($handle, $cache_content);
            fclose($handle);
        }
    }

    /*
    // 같은 스킨은 .css 를 한번만 호출한다.
    if (!in_array($skin_dir, $css) && is_file($latest_skin_path.'/style.css')) {
        echo '<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">';
        $css[] = $skin_dir;
    }
    */

    ob_start();
    include $latest_skin_path.'/latest.skin.php';
    $content = ob_get_contents();
    ob_end_clean();

    return $content;
}
?>
​


 

별도로 index.php에는 가장 상단에 나오는 게시판 2개밖에 없구요..

그 아래에 농장, 특수목(갤러리), 특수목(게시판), 나무삽니다 등 순으로 나오는데

저는 특수목(게시판)을 특수목팝니다 라는 새로운 게시판으로 변경하고 싶습니다.

그러니까 제가 위에 말씀드린것처럼 이미지 갤러리는 head.php파일에 있을거라고 생각하는 것이구요.
index.php파일의 27번에 나오는
echo latest("basic_main", sale_seedlings, 10, 42); 부분에서
sale_seedlings 부분을 "특수목팝니다" 게시판아이디로 변경하시면 되고요.
최근게시물 타이틀은 게시판 제목을 따라 가게 되므로, 게시판 제목을 "특수목팝니다"로 지정하시면 되겠죠.

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