그룹명 최신글에서 이미지 나오게 하고 싶어요...

그룹명 최신글에서 이미지 나오게 하고 싶어요...

QA

그룹명 최신글에서 이미지 나오게 하고 싶어요...

답변 1

본문

아래의 소스를 찾아서 그룹명의 리스트를 메인페이지에서 사용하려고 합니다. 

그런데 이미지가 나오지 않는데요.. 도움을 주시면 감사하겠습니다. 

아래의 소스는 그룹이 나오는 최신글 리스트입니다. 

 

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
//add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
$thumb_width = 370;
$thumb_height = 260;
?>
                            <?php
                            for ($i=0; $i<count($list); $i++) {
                            $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);
                        
                            if($thumb['src']) {
                                $img = $thumb['src'];
                            } else {
                                $img = G5_THEME_URL.'/images/Home-1/our-1.jpg';
                                $thumb['alt'] = '이미지가 없습니다.';
                            }
                            $img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" class="img-responsive">';
                            ?>
                            <div class="col-lg-4 col-md-4 col-sm-6 col-xs-6 ">
                                <div class="wrap-box">
                                    <div class="box-img">
                                       <?php echo $img_content; ?>
                                    </div>
                                    <div class="rooms-content">
                                        <h4 class="">
                                        
                                        [<?php echo $list[$i]['bo_subject']; ?>]
                                        </h4>
                                        <h4 class="">
                                        <?php
                                        //echo $list[$i]['icon_reply']." ";
                                        echo "<a href=\"".$list[$i]['href']."\">";
                                        echo $list[$i]['subject'];
                            
                                        if ($list[$i]['comment_cnt'])
                                            echo $list[$i]['comment_cnt'];
                            
                                        echo "</a>";
                            
                                        //if (isset($list[$i]['icon_new'])) echo " " . $list[$i]['icon_new'];
                                        //if (isset($list[$i]['icon_hot'])) echo " " . $list[$i]['icon_hot'];
                                        //if (isset($list[$i]['icon_file'])) echo " " . $list[$i]['icon_file'];
                                        //if (isset($list[$i]['icon_link'])) echo " " . $list[$i]['icon_link'];
                                        //if (isset($list[$i]['icon_secret'])) echo " " . $list[$i]['icon_secret'];
                                        ?></h4>
                                        <p class="price">$<?php echo $list[$i]['wr_5']; ?> / From, Per Night</p>
                                    </div>
                                </div>
                            </div>
                            <?php }  ?>
                            <?php if (count($list) == 0) { //게시물이 없을 때  ?>
                            <li>게시물이 없습니다.</li>
                            <?php }  ?>

이 질문에 댓글 쓰기 :

답변 1


  $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height);
  if($thumb['src']) {
   $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$thumb_width.'" height="'.$thumb_height.'">';
  } else {
   if($thumb['ori']) {
    $img_content = '<img src="'.$thumb['ori'].'" alt="'.$thumb['alt'].'" width="'.$thumb_width.'" height="'.$thumb_height.'">';
   } else {
    $img_content = '';
   }
  }
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 123,528
© SIRSOFT
현재 페이지 제일 처음으로