최근게시물 문의드립니다.

최근게시물 문의드립니다.

QA

최근게시물 문의드립니다.

답변 5

본문

예를들어 A게시판(기본갤러리)과 B게시판(기본갤러리)이 있는데

A게시판과 B게시판에 있는 공지글들만

메인화면에 최신갤러리로 뽑아오고 싶은데

어떻게 해야하나요?

이 질문에 댓글 쓰기 :

답변 5

list.skin.php 부분은 아무 상관 없습니다..latest 스킨은 별도입니다.

그리고 질문하신 부분에 대해서 조건문도 들어가야되는데, latest 함수를 재구성해서 latest2 함수를 만들어서 조건문을 들어가게 해서 만드셔야 합니다.

그누보드 팁 게시판에 가셔서 최신글 검색해서 다른 분들이 올리신거 참고하면서 해보세요

/lib/lastest.lib.php 를 보시고 lastest 함수 써서 가지고 오세요~

갤러리 게시판 A,B의 list 페이지부분이구요.


<ul id="gall_ul">
        <?php for ($i=0; $i<count($list); $i++) {
            if($i>0 && ($i % $bo_gallery_cols == 0))
                $style = 'clear:both;';
            else
                $style = '';
            if ($i == 0) $k = 0;
            $k += 1;
            if ($k % $bo_gallery_cols == 0) $style .= "margin:0 !important;";
         ?>
        <li class="gall_li <?php if ($wr_id == $list[$i]['wr_id']) { ?>gall_now<?php } ?>" style="<?php echo $style ?>width:<?php echo $board['bo_gallery_width'] ?>px">
            <?php if ($is_checkbox) { ?>
            <label for="chk_wr_id_<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['subject'] ?></label>
            <input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>">
            <?php } ?>
            <span class="sound_only">
                <?php
                if ($wr_id == $list[$i]['wr_id'])
                    echo "<span class=\"bo_current\">열람중</span>";
                else
                    echo $list[$i]['num'];
                 ?>
            </span>
            <ul class="gall_con">
              
                <li class="gall_href">
                    <a href="<?php echo $list[$i]['href'] ?>">
                    <?php
                    if ($list[$i]['is_notice']) { // 공지사항 
      
      $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], 338, $board['bo_gallery_height']);
                        if($thumb['src']) {
                            $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="338" height="'.$board['bo_gallery_height'].'">';
                        } else {
                            $img_content = '<span style="width:338px;height:'.$board['bo_gallery_height'].'px"><img src="/images/sub3/noimages.jpg"></span>';
                        }
                        echo $img_content;
      ?>
                       
                    <?php } else {
                        $thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], 338, $board['bo_gallery_height']);
                        if($thumb['src']) {
                            $img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="338" height="'.$board['bo_gallery_height'].'">';
                        } else {
                            $img_content = '<span style="width:338px;height:'.$board['bo_gallery_height'].'px"><img src="/images/sub3/noimages.jpg"></span>';
                        }
                        echo $img_content;
                    }
                     ?>
                    </a>
                </li>
                <li class="gall_text_href" style="width:<?php echo $board['bo_gallery_width'] ?>px">
                    <?php
                    // echo $list[$i]['icon_reply']; 갤러리는 reply 를 사용 안 할 것 같습니다. - 지운아빠 2013-03-04
                    if ($is_category && $list[$i]['ca_name']) {
                     ?>
                   <!-- <a href="<?php echo $list[$i]['ca_name_href'] ?>" class="bo_cate_link"><?php echo $list[$i]['ca_name'] ?></a>-->
                    <?php } ?>
                    <a href="<?php echo $list[$i]['href'] ?>">
                        <?php echo $list[$i]['subject'] ?>
                        <?php if ($list[$i]['comment_cnt']) { ?><span class="sound_only">댓글</span><?php echo $list[$i]['comment_cnt']; ?><span class="sound_only">개</span><?php } ?>
                    </a>
                  
                </li>
                <li><span class="gall_subject">위치 </span><?php echo $list[$i]['wr_1'] ?></li>
                <li><span class="gall_subject">규모 </span><?php echo $list[$i]['wr_3'] ?></li>
                <li><span class="gall_subject">시행사 </span><?php echo $list[$i]['wr_5'] ?></li>
                <li><span class="gall_subject">시공사 </span><?php echo $list[$i]['wr_6'] ?></li>
                <li><span class="gall_subject"><a href="<?php echo $list[$i]['href'] ?>"><img src="/images/sub3/arrow.png"></a></span></li>
                <?php if ($is_good) { ?><li><span class="gall_subject">추천</span><strong><?php echo $list[$i]['wr_good'] ?></strong></li><?php } ?>
                <?php if ($is_nogood) { ?><li><span class="gall_subject">비추천</span><strong><?php echo $list[$i]['wr_nogood'] ?></strong></li><?php } ?>
            </ul>
   <!--<ul class="gall_con2"> <a href="<?php echo $list[$i]['href'] ?>">자세히보기</a></ul>-->
        </li>
        <?php } ?>
        <?php if (count($list) == 0) { echo "<li class=\"empty_list\">게시물이 없습니다.</li>"; } ?>
    </ul>

 

 

아래 소스가 최신갤러리 소스인데요


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$imgwidth = 258; //표시할 이미지의 가로사이즈
$imgheight = 178; //표시할 이미지의 세로사이즈
?>
<style type="text/css">
#oneshot { position:relative; width:1100px; height:250px; margin:0; padding:0 }
#oneshot .img_set{width:<?php echo $imgwidth ?>px; height:<?php echo $imgheight ?>px; margin:0; padding:0;}
#oneshot .subject_set{width:<?php echo $imgwidth ?>px;  margin:0; height: 120px; }
#oneshot .subject_set .stitle{ color:#444;  margin:0; padding:20px 0 15px 12px; word-spacing:-2px; text-align:left; font-size: 16px;font-family:'Nanum Gothic';}
#oneshot .subject_set .stitle2{ color:#999; margin:0; padding:0 0 8px 12px; word-spacing:-2px; text-align:left; font-size: 13px;font-family:'Nanum Gothic'; }
#oneshot .subject_set .stitle3{ color:#999; margin:0; padding:0 0 16px 12px; word-spacing:-2px; text-align:left; font-size: 13px;font-family:'Nanum Gothic'; }

#oneshot ul { margin:0; padding:0 }
#oneshot li{ float:left; list-style:none; margin:0; margin:0 15px 0 0; border:1px solid #e5e5e5; }
.subject_set  a:link, a:visited { color:#333  }
.subject_set  a:hover, a:focus, a:active { color:#333 }
</style>
<div id="oneshot">
 <ul>
 <?php for ($i=0; $i<count($list); $i++) { ?> 
  <li>
   <div class="img_set">
    <a href="<?php echo $list[$i]['href'] ?>">
     <?php               
     $thumb = get_list_thumbnail($list[$i]['bo_table'], $list[$i]['wr_id'], $imgwidth, $imgheight);                    
     if($thumb['src']) {
     $img_content = '<img class="img_left" src="'.$thumb['src'].'" alt="'.$list[$i]['subject'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';
     } else {
     $img_content = '<img src="/images/sub3/noimages2.jpg">';
     }               
     echo $img_content;                          
     ?>
    </a>
   </div>
   <div class="subject_set">
    <div class="stitle"><a href="<?php echo $list[$i]['href'] ?>"><?php echo cut_str($list[$i]['subject'], 23, "...") ?></a></div>
    <div class="stitle2"><?php echo cut_str($list[$i]['wr_1'], 23, "...") ?></div>
    <div class="stitle3"><?php echo $list[$i]['wr_3'] ?></div>    
   </div>
   
  </li>
 <?php } ?>
 </ul>
</div>
<div style="clear:both;"></div>

 

A,B게시판의 공지를 최신갤러리로 뽑아오고 싶은데 어떻게 해야하나요?

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 56
© SIRSOFT
현재 페이지 제일 처음으로