그누보드 스킨 list 출력 채택완료

그누보드 스킨 

www/board/new_gallery/list.skin.php 에서

skin 디자인만 가져와서 list를 출력하려고 하는데요

Copy
<?php
include_once('./_common.php');

if (G5_IS_MOBILE) {
    include_once(G5_MSHOP_PATH.'../index.php');
    return;
}

define("_INDEX_", TRUE);

include_once(G5_SHOP_PATH.'/shop.head.php');
?>

<?php
$row = sql_fetch(" select * from reservation where cp_idx= '$cp_idx' ");

?>
<div class="advance">
<div class="container">
<div class="gallery-list">
                <ul class="row">
                <?php 
                
                for ($i=0; $i<count($row); $i++) {

             ?>
                    <div class="thumb"><img src="/data/main/<?php echo $row[$i]['main_img'] ?>" alt=""></div>
                        <div class="tit"><?php echo $row[$i]['title'] ?></div>
                        <div class="info">
                            </div>
                        </a>                            
                    </li>
                </ul>
            </div>
            </div>
        <?php } ?>

</div>
    

<?php
include_once(G5_SHOP_PATH.'/shop.tail.php');
?>

이미지랑 제목정도만 출력해보려고 했는데

출력이 안됩니다..

기존 그누보드 스킨 list.php 소스는 sql문이나 query 문이 없더라구요

다른곳에 include 되있는건지 못 찾고 있습니다.

도와주세요 ㅠㅠ

답변 4개

채택된 답변
+20 포인트

Copy
<?php
include_once('./_common.php');
if (G5_IS_MOBILE) {
    include_once(G5_MSHOP_PATH.'../index.php');
    return;
}
define("_INDEX_", TRUE);
include_once(G5_SHOP_PATH.'/shop.head.php');
?>
<?php
$result = sql_query(" select * from reservation where cp_idx= '$cp_idx' ");
?>
<div class="advance">
<div class="container">
<div class="gallery-list">
                <ul class="row">
                <?php 
                
                for ($i=0; $row = sql_fetch_array($result); $i++) {
             ?>
                    <div class="thumb"><img src="/data/main/<?php echo $row['main_img'] ?>" alt=""></div>
                        <div class="tit"><?php echo $row['title'] ?></div>
                        <div class="info">
                            </div>
                        </a>                            
                    </li>
                </ul>
            </div>
            </div>
        <?php } ?>
</div>
    
<?php
include_once(G5_SHOP_PATH.'/shop.tail.php');
?>

위 처럼 변경해주시면 됩니다.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

답변 정말 감사합니다.
답변해주신 소스로 변경했는데 리스트가 출력되지 않습니당..

댓글을 작성하려면 로그인이 필요합니다.

lib/common.php에
// 게시물 정보($write_row)를 출력하기 위하여 $list로 가공된 정보를 복사 및 가공
function get_list() 함수를 참고하세요.
사용법은

bbs/list.php에

        $list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
 

이런 부분 참고 하시면 됩니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

데이터 필드가 

main_img, title 로 되어 있나 확인바랍니다.
루프는 위와 같습니다.
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

sql문은 /bbs/list.php 에 있으니 거길 참고해보시면 될거 같습니다.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

담변 감사합니다.
근데 제가 초보자라서 말씀하신 경로의 파일을 봐도 어떻게 해야 리스트가 출력되는지 잘 모르겠네요..
혹시 제 소스에 문제가 되는 부분이 보이시나요?

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고