latest 6줄로 늘리기

latest 6줄로 늘리기

QA

latest 6줄로 늘리기

본문

말그대로 인덱스에 잇는  갤러리 게시판의 6줄 수로 보이고 게시물이 다보이게 하고싶은데 방법을 모르겟네요 ㅠㅠ

 

index



<div class="latest_wr">

    <!-- 사진 최신글2 { -->
    <?php
    // 이 함수가 바로 최신글을 추출하는 역할을 합니다.
    // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
    // 테마의 스킨을 사용하려면 theme/basic 과 같이 지정
    echo latest('theme/pic_block', 'gallery', 12, 23);    // 최소설치시 자동생성되는 갤러리게시판
    ?>
    <!-- } 사진 최신글2 끝 -->
</div>

 

latest skin



<?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 = 210;
$thumb_height = 150;
$list_count = (is_array($list) && $list) ? count($list) : 0;
?>

<div class="pic_lt">
    <h2 class="lat_title"><a href="<?php echo get_pretty_url($bo_table); ?>"><?php echo $bo_subject ?></a></h2>
    <ul>
    <?php
    for ($i=0; $i<$list_count; $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_IMG_URL.'/no_img.png';
        $thumb['alt'] = '이미지가 없습니다.';
    }
    $img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';
    $wr_href = get_pretty_url($bo_table, $list[$i]['wr_id']);
    ?>
        <li class="galley_li">
            <a href="<?php echo $wr_href; ?>" class="lt_img"><?php echo run_replace('thumb_image_tag', $img_content, $thumb); ?></a>
            <?php
            if ($list[$i]['icon_secret']) echo "<i class=\"fa fa-lock\" aria-hidden=\"true\"></i><span class=\"sound_only\">비밀글</span> ";

            echo "<a href=\"".$wr_href."\"> ";
            if ($list[$i]['is_notice'])
                echo "<strong>".$list[$i]['subject']."</strong>";
            else
                echo $list[$i]['subject'];
            echo "</a>";
         
         if ($list[$i]['icon_new']) echo "<span class=\"new_icon\">N<span class=\"sound_only\">새글</span></span>";
            if ($list[$i]['icon_hot']) echo "<span class=\"hot_icon\">H<span class=\"sound_only\">인기글</span></span>";

            // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
            // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }

         // echo $list[$i]['icon_reply']." ";
         // if ($list[$i]['icon_file']) echo " <i class=\"fa fa-download\" aria-hidden=\"true\"></i>" ;
            // if ($list[$i]['icon_link']) echo " <i class=\"fa fa-link\" aria-hidden=\"true\"></i>" ;

            if ($list[$i]['comment_cnt'])  echo "
            <span class=\"lt_cmt\">".$list[$i]['wr_comment']."</span>";

            ?>

            <div class="lt_info">
            <span class="lt_nick"><?php echo $list[$i]['name'] ?></span>
               <span class="lt_date"><?php echo $list[$i]['datetime2'] ?></span>              
            </div>
        </li>
    <?php }  ?>
    <?php if ($list_count == 0) { //게시물이 없을 때  ?>
    <li class="empty_li">게시물이 없습니다.</li>
    <?php }  ?>
    </ul>
    <a href="<?php echo get_pretty_url($bo_table); ?>" class="lt_more"><span class="sound_only"><?php echo $bo_subject ?></span>더보기</a>

</div>

 

 

3718050134_1653032890.086.png

이 질문에 댓글 쓰기 :

답변 3

6칸으로 만드는건 css를 수정을 해야합니다.

1. 6줄로 보이게 하기

해당 skin/latest/pic_block/style.css에서 

.pic_lt li {float:left;width:16.66%;padding:0 10px}
.pic_lt li.gallery_li:nth-child(6n+1) {clear: both!important}

로 변경 하고

extend/version.extend.php 에서 define('G5_CSS_VER', '210705'); 

뒤에 숫자 바꿔주기

 

2. 전체글 보이기



    <?php
    // 이 함수가 바로 최신글을 추출하는 역할을 합니다.
    // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
    // 테마의 스킨을 사용하려면 theme/basic 과 같이 지정
    echo latest('theme/pic_block', 'gallery', 12, 23);    // 최소설치시 자동생성되는 갤러리게시판
    ?>
    <!-- } 사진 최신글2 끝 -->
 

 

 

    $gal_cnt = sql_fetch("select count(*) as cnt from g5_write_gallery where wr_is_comment=0 "); 
    echo latest('theme/pic_block', 'gallery', $gal_cnt['cnt'] 23);    // 최소설치시 자동생성되는 갤러리게시판

 

이렇게 수정해보세요.

 

 

$tmp_write_table 이 latest 내부 함수일거에요.

echo latest('theme/pic_block', 'gallery', 12, 23);

여기서 gallery 를

g5_write_gallery로 만들어서 게시글을 가져오는 역할을 할겁니다.

전체글을 구하는 함수와는 별개라서 안될수도 있어요.

그리고  echo latest('theme/pic_block', 'gallery', $gal_cnt['cnt'], 23);

$gal_cnt['cnt'] 뒤에 쉼표가 빠졌네요. 참고해주세요.

https://sir.kr/g5_skin/47873?sca=%EC%B5%9C%EC%8B%A0%EA%B8%80&page=2

 

이런 최신글 latest skin을 적용해보시는 건 어떠세요?

그냥 CSS로 li 요소와 이미지들의 width 너비 줄이면 되지 않을까요?

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

회원로그인

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