그룹 최신글에서 게시판명 나타나게 할려고 합니다.

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
그룹 최신글에서 게시판명 나타나게 할려고 합니다.

QA

그룹 최신글에서 게시판명 나타나게 할려고 합니다.

본문

그룹 최신글에서 게시판명 나타나게 할려고 합니다.

 

// $bo_tables 테이블들 사이 콤마(,) 단위로 구분해서 넣을 것, 콤마 사이에 공백 없이 (ex aaa,bbb,)
function latest_all($skin_dir='', $bo_tables, $rows=10, $subject_len=40, $cache_time=1, $options='')
{

    global $g5;

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

    if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
        if (G5_IS_MOBILE) {
            $latest_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];
            if(!is_dir($latest_skin_path))
                $latest_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];
            $latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);
        } else {
            $latest_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/latest/'.$match[1];
            $latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);
        }
        $skin_dir = $match[1];
    } else {
        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;
        }
    }

        $list = array();
        $sql_common = " from {$g5['board_new_table']} a  where find_in_set(a.bo_table, '{$bo_tables}')";
        $sql_common .= " and a.wr_id = a.wr_parent ";
        $sql_order = " order by a.bn_id desc ";
        $sql = " select a.* {$sql_common} {$sql_order} limit 0, {$rows}";
        $result = sql_query($sql);
        for ($i=0; $row=sql_fetch_array($result); $i++) {

            $sql = " select * from {$g5['board_table']} where bo_table = '{$row['bo_table']}' ";
            $board = sql_fetch($sql);
            $tmp_write_table = $g5['write_prefix'] . $row['bo_table'];
            $row2 = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
            $list[$i] = $row2;
            $list[$i] = get_list($row2, $board, $latest_skin_url, $subject_len);
            $list[$i]['bo_subject'] = $row['bo_subject'];
            $list[$i]['bo_table'] = $row['bo_table'];
        }

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

이 질문에 댓글 쓰기 :

답변 1

1. 게시물을 보니까...다음의 팁을 사용하신 것으로 보입니다.
* [최신글]원하는 게시판만 선택해서 하기 → https://sir.kr/g5_tip/4103 


2. 위의 1.항에서 사용하는 스킨의 latest.skin.php에서

약간 다를 수도 있겠지만,  <?php echo $list[$i]['subject'];?> 이런 식으로 나타내는 제목 앞에

다음처럼 넣어주면 최신글에서 게시판명이 나타나게 됩니다.
<?php echo $list[$i]['bo_subject']; ?> <?php echo $list[$i]['subject'];?>

 

<?php echo $list[$i]['bo_subject']; ?>에 대해서 링크를 거시려면 다음처럼 하면 됩니다.
<a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $list[$i]['bo_table'] ?>">[<?php echo $list[$i]['bo_subject']; ?>]</a>

답변을 작성하시기 전에 로그인 해주세요.
전체 310
QA 내용 검색

회원로그인

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