테스트 사이트 - 개발 중인 베타 버전입니다

이용후기 홈에 노출 할러고 합니다. 채택완료

pcpc 9년 전 조회 2,335

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

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

아래 소스에서

 

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

 

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

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

</p><p><?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가</p><p>// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);
?></p><p><script src="<?php echo G5_JS_URL; ?>/viewimageresize.js"></script></p><p><style></p><p>/* 사용후기 모음 */</p><p>#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:""}</p><p>
#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} </p><p>.sps_main_section {float:left;width:630px}
.sps_main_section p {padding:0;width:100%} </p><p></style></p><p><!-- 전체 상품 사용후기 목록 시작 { --></p><p>
<div id="sps_main"></p><p>    <!-- <p><?php echo $config['cf_title']; ?> 전체 사용후기 목록입니다.</p> --></p><p>    <?php
    $thumbnail_width = 500;</p><p>    for ($i=0; $row=sql_fetch_array($result); $i++)
    {
        $num = $total_count - ($page - 1) * $rows - $i;
        $star = get_star($row['is_score']);</p><p>        $is_content = get_view_thumbnail(conv_content($row['is_content'], 1), $thumbnail_width);</p><p>        $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']}";</p><p>        if ($i == 0) echo '<ol>';
    ?>
    <li></p><p>       
        <section class="sps_main_section">
         </p><p>            <dl class="sps_main_dl">
                
                <dt>• <?php echo $row['is_name']; ?> : </dt>
                <dd><?php echo get_text($row['is_subject']); ?></dd>
              
            </dl></p><p>           
          
        </section></p><p>    </li>
    <?php }
    if ($i > 0) echo '</ol>';
    if ($i == 0) echo '<p id="sps_empty">자료가 없습니다.</p>';
    ?>
</div></p><p>
<!-- } 전체 상품 사용후기 목록 끝 --></p><p>
 

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

답변 3개

채택된 답변
+20 포인트
그누위즈

$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 "); 

 

 

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

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

p
9년 전

감사합니다.^* 

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

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

p
9년 전

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

<?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);
?> 

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

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

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

로그인