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

최신글 갤러리 썸네일이 출력이 됐다 안됐다 합니다. 채택완료

배꾸이 8년 전 조회 2,980

<?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  = isset($options['thumb_width']) ? $options['thumb_width'] : $board['bo_gallery_width'];

$thumb_height = isset($options['thumb_height']) ? $options['thumb_height'] : $board['bo_gallery_height'];

$content_length = isset($options['content_length']) ? $options['content_length'] : 30;

?>

 

<!-- <?php echo $bo_subject; ?> 최신글 시작 { -->

<div class="lt_gal">

    <strong class="lt_title"><a href="<?php echo G5_BBS_URL; ?>/board.php?bo_table=<?php echo $bo_table; ?>"><?php echo $bo_subject; ?></a></strong>

    <div class="lt_gal_Box">

        <ul>

            <?php

            for ($i=0; $i<count($list); $i++) {

                $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 {

                    $img_content = '<span style="width:'.$thumb_width.'px;height:'.$thumb_height.'px" class="no_img">no image</span>';

                }

            ?>

                <li>

                    <a href="<?php echo $list[$i]['href']; ?>" class="lt_image"><?php echo $img_content; ?></a>

                    <?php

                    echo "<a href=\"".$list[$i]['href']."\" class=\"lt_tit\">";

                    if ($list[$i]['is_notice'])

                        echo "<strong>".$list[$i]['subject']."</strong>";

                    else

                        echo $list[$i]['subject'];

                    echo "</a>";

                     ?>

                     <p class="lt_detail"><?php echo get_text(cut_str(strip_tags($list[$i]['wr_content']), $content_length), 1); ?></p>

                </li>

            <?php }  ?>

        

            <?php if ($i == 0) { //게시물이 없을 때  ?>

                <li class="no_bd">게시물이 없습니다.</li>

            <?php }  ?>

        </ul>

    </div>

    <div class="lt_gal_more"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>"><span class="sound_only"><?php echo $bo_subject ?></span>더보기</a></div>

</div>

<!-- } <?php echo $bo_subject; ?> 최신글 끝 -->

 

이 소스인데요

커뮤니티 테마를 이용중입니다 (https://sir.kr/g5_theme/249?page=3)">https://sir.kr/g5_theme/249?page=3)

처음에는 가끔 출력이 되기도 하는데 새로고침을 하면 노이미지가 뜹니다.

어떤 부분이 잘못된 걸까요?

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

답변 2개

채택된 답변
+20 포인트
8년 전

여기를 

 

$thumb_width  = isset($options['thumb_width']) ? $options['thumb_width'] : $board['bo_gallery_width'];

$thumb_height = isset($options['thumb_height']) ? $options['thumb_height'] : $board['bo_gallery_height'];

$content_length = isset($options['content_length']) ? $options['content_length'] : 30;

 

이렇게 해보세요.

 

$thumb_width  = 170;

$thumb_height = 149;

$content_length = 30;

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

답변에 대한 댓글 2개

배꾸이
8년 전
대단히 감사합니다!
배꾸이
8년 전
혹시 첫번째 출력되는 썸네일은 더 크게 하고 싶은데 할수 있는 방법이 있을까요??

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

그누위즈

해당 썸네일 넓이와 높이에 작은별님과 같이

강제적으로 원하시는 사이즈를 입력하시면 됩니다.

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

답변에 대한 댓글 1개

배꾸이
8년 전
감사합니다~

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

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

로그인