이용후기 홈에 노출 할러고 합니다.

이용후기 홈에 노출 할러고 합니다.

QA

이용후기 홈에 노출 할러고 합니다.

답변 3

본문

이용후기를 홈에 노출 할러고 itemuselist.skin.php 파일을 수정하여

홈에 인크루드까지는 되었습니다.

아래 소스에서

 

1) 리스트가 5개까지만 보여지게 하러면?

 

어느 부분을 어떻게 하는지 한번 봐 주시면 감사 하겠습니다.

===================<소스>======================================


<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);
?>
<script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script>
<style>
/* 사용후기 모음 */
#sps_main {zoom:1}
#sps_main ol {margin:0;padding:0;border-top:1px solid #e9e9e9;list-style:none}
#sps_main li {position:relative;padding:1px;border-bottom:0px solid #e9e9e9}
#sps_main li:after {display:block;visibility:hidden;clear:both;content:""}

#sps_main dl {margin:7px 0 5px;zoom:1}
#sps_main dl:after {display:block;visibility:hidden;clear:both;content:""}
#sps_main dt {float:left}
#sps_main dd {float:left;margin:0 20px 0 5px} 
.sps_main_section {float:left;width:630px}
.sps_main_section p {padding:0;width:100%} 
</style>
<!-- 전체 상품 사용후기 목록 시작 { -->

<div id="sps_main">
    <!-- <p><?php echo $config['cf_title']; ?> 전체 사용후기 목록입니다.</p> -->
    <?php
    $thumbnail_width = 500;
    for ($i=0; $row=sql_fetch_array($result); $i++)
    {
        $num = $total_count - ($page - 1) * $rows - $i;
        $star = get_star($row['is_score']);
        $is_content = get_view_thumbnail(conv_content($row['is_content'], 1), $thumbnail_width);
        $row2 = sql_fetch(" select it_name from {$g5['g5_shop_item_table']} where it_id = '{$row['it_id']}' ");
        $it_href = G5_SHOP_URL."/item.php?it_id={$row['it_id']}";
        if ($i == 0) echo '<ol>';
    ?>
    <li>
       
        <section class="sps_main_section">
         
            <dl class="sps_main_dl">
                
                <dt>• <?php echo $row['is_name']; ?> : </dt>
                <dd><?php echo get_text($row['is_subject']); ?></dd>
              
            </dl>
           
          
        </section>
    </li>
    <?php }
    if ($i > 0) echo '</ol>';
    if ($i == 0) echo '<p id="sps_empty">자료가 없습니다.</p>';
    ?>
</div>

<!-- } 전체 상품 사용후기 목록 끝 -->
 

이 질문에 댓글 쓰기 :

답변 3

$row2 = sql_fetch(" select it_name from {$g5['g5_shop_item_table']} where it_id = '{$row['it_id']}' "); 

여기 해당쿼리문안에

limit 0, 4 라고 하면

0,1,2,3,4 5개의 게시물?만 받아오겠네요


$row2 = sql_fetch(" select it_name from {$g5['g5_shop_item_table']} where it_id = '{$row['it_id']}' limit 0, 4 "); 

 

 

답변주신 내용을 힌트로 아래와 같이 하니 되네요.

<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);

$sql = "  select * from `{$g5['g5_shop_item_use_table']}` a join `{$g5['g5_shop_item_table']}` b on (a.it_id=b.it_id) where a.is_confirm = '1' order by a.is_id desc limit 0, 4 ";
$result = sql_query($sql);
?> 

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