고수님들의 도움이 필요합니다 ㅠㅠ

고수님들의 도움이 필요합니다 ㅠㅠ

QA

고수님들의 도움이 필요합니다 ㅠㅠ

본문

웹진 리스트 스킨에서 이미지를 대중소로 나오게 가능할까요...

 

2039845730_1695604916.824.jpg

 

 

지금 사용중인 스킨 소스입니다.

 

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

include_once(G5_LIB_PATH.'/thumbnail.lib.php');

$sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
$board = sql_fetch($sql);

if ($options)    list($width, $height, $wrap_width, $content_length) = explode(',', $options);
if (!$width) $width = 100;
if (!$height) $height = 65;
if (!$content_length) $content_length = 120;

add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
?>
  <a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>" class="lt_titl">
    <?php echo $bo_subject ?> </a>
<div class="latest-zinez"<?php if ($wrap_width) { echo ' style="width:'.$wrap_width.'px;"'; } ?>>
    <ul>
<?php
for ($i=0; $i<count($list); $i++) {
    if ($i < 3 ) {
        $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $width, $height);
        if($thumb['src']) {
            $img_content = '<a href="'.$list[$i]['href'].'"><img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" class="img"></a>';
        } else {
            $img_content = '<span class="img" style="width:'.$width.'px; height:'.$height.'px;">No image</span>';
        }
?>
        <li>
            <div class="title"><a href="<?php echo $list[$i]['href']; ?>"><?php echo $list[$i]['subject']; ?></a></div>
            <div class="thumb"><?php echo $img_content; ?></div>
            <div class="article" style="height:<?php echo $height; ?>px; margin-left:<?php echo $width+10; ?>px;">
            
                <p class="co"><a href="<?php echo $list[$i]['href']; ?>"><?php echo cut_str(preg_replace("/ /", "", strip_tags($list[$i]['wr_content'])), $content_length); ?></a></p>
            </div>
        </li>
<?php
    } else {
?>
        <li class="text_lin"><a href="<?php echo $list[$i]['href']; ?>"><?php echo $list[$i]['subject']; ?></a></li>
<?php
    }
}
if (count($list) == 0) { //게시물이 없을 때  ?>
        <li class="nodata">게시물이 없습니다.</li>
<?php }  ?>
    </ul>
</div>
 

이 질문에 댓글 쓰기 :

답변 2


for ($i=0; $i<count($list); $i++) {
    if ($i < 3 ) {
        $width2 = $width - ($i*($width/10));
        $height2 = $height - ($i*($height/10));
        $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $width2, $height2 );
        if($thumb['src']) {
            $img_content = '<a href="'.$list[$i]['href'].'"><img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" class="img"></a>';
        } else {
            $img_content = '<span class="img" style="width:'.$width2.'px; height:'.$height2.'px;">No image</span>';
        }
?>

 

대충 이런식?

네 등록할때 대중소를 선택해서 등록한후에 출력시 나눠서 출력할수도있고

그냥 출력할때 첫번째두번째세번째 느낌으로 구분해서할수도있구요.

sql 문 안손대고 하는건 두번째방법이겠네요

$i 를 %연산자 사용해서 3가지로 구분해서 썸네일부분 가로세로 높이 넣어주면되겠네요

답변을 작성하시기 전에 로그인 해주세요.
전체 222
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT