index 게시글 출력

index 게시글 출력

QA

index 게시글 출력

본문


                        <div class="pull-right">
                            <div class="main-top-box ml10">
                                <p class="tit"><i class="iconfont"></i>게시글</p>
                                <ul class="main-slide-box main-cashout-slide">
                                                                    <li>
                                        <span>테스트게시판</span>
                                        <strong><a href="/main/table_view.php?id=397974">테스트게시글1</a></strong>
                                    </li>
                                                                </ul>
                            </div>
                        </div>

 

이런식으로 게시글 출력 하고 싶은데 

 

<?php echo latest('theme/basic', $row['bo_table'], 5, 25); ?>

 

이와같이 코드를 넣으니까 오류가 뜨네요 무슨 문제일까요??

이 질문에 댓글 쓰기 :

답변 8


<?php
    $sql = " select bo_table
                from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)
                where a.bo_device <> 'mobile' ";
    if(!$is_admin)
    $sql .= " and a.bo_use_cert = '' ";
    $sql .= " and a.bo_count_write > 0 ";
    $sql .= " and a.bo_table not in ('notice', 'gallery') ";     //공지사항과 갤러리 게시판은 제외
    $sql .= " order by b.gr_order, a.bo_order ";
    $result = sql_query($sql);
?>

이런게 선행 되어야 합니다..

<?php echo latest('theme/basic', $row['bo_table'], 5, 25); ?>

이건 보통 루프 안에서 돌릴때 $row['bo_table'] 를 사용합니다.

특정 게시판을 불러올때는 게시판 테이블 아이디를 넣으셔야 합니다.

<?php echo latest('theme/basic', 게시판아이디, 5, 25); ?> 이런식으로요

 

1893228586_1665556368.2237.png

 

다들 답글 감사드립니다. 

 


<div class="pull-right clearfix">
                        <div class="pull-left">
                            <div class="main-top-box">
                                <p class="tit"><i class="iconfont"></i>자유게시판</p>
                                <ul class="main-slide-box main-cashin-slide">
                                                                    <li>
                                        <?php echo latest('theme/basic', bo_table, 5, 25); ?>
                                    </li>
                                                                </ul>
                            </div>
                        </div>

 

이런식으로 넣으니 게시글이 있음에도 게시글이 아무것도 안뜹니다.


<div class="pull-right clearfix">
                        <div class="pull-left">
                            <div class="main-top-box">
                                <p class="tit"><i class="iconfont"></i>자유게시판</p>
                                <ul class="main-slide-box main-cashin-slide">
                                                                    <li>
                                        <?php
    $sql = " select bo_table
                from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)
                where a.bo_device <> 'mobile' ";
    if(!$is_admin)
	$sql .= " and a.bo_use_cert = '' ";
	$sql .= " and a.bo_count_write > 0 ";
    $sql .= " and a.bo_table not in ('notice', 'gallery') ";     //공지사항과 갤러리 게시판은 제외
    $sql .= " order by b.gr_order, a.bo_order ";
    $result = sql_query($sql);
    for ($i=0; $row=sql_fetch_array($result); $i++) {
		$lt_style = '';
    	if ($i%2 !== 0 ) $lt_style = "margin-left:0%";
    ?>
    <div style="float:left;<?php echo $lt_style ?>" class="lt_wr">
        <?php
                                        echo latest('theme/basic', $row['bo_table'], 5, 25);
                                        ?>
                                    </li>
                                                                </ul>
                            </div>
                        </div>

include_once(G5_LIB_PATH.'/latest.lib.php');이게 로드 되었는지도 확인하세요.

자유게시판의 테이블 영문이름을 직접 넣어보세요.
<?php echo latest('theme/basic', '영문이름', 5, 25); ?>

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

회원로그인

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