채택완료

최신글 필요한것만??

메인 최신글 필요한 게시판만 가져오고 싶습니다

아래코드는 전체 게시판이 다 나와요^^

게시판 a. b. c. d. 가 있다면

a. d. 만 메인에 나오게 하고싶은데..

----------------------------------

<div class="latest">
<?php
$i = 1;
while ($latest_table = array_shift($list)) {
    $mw_skin_config = mw_skin_config($latest_table);
    if ($mw_skin_config['cf_attribute'] == "1:1") continue;

    echo "<div class=\"item\">".latest("theme/mw5", $latest_table, 5, 50, 0)."</div>";

    if (($i++)%2==0) echo "</div><div class=\"latest\">";
}
?>
</div>

----------------------------------------

 

 

|

답변 1개

채택된 답변
+20 포인트

오려놓으신 코딩으로 a,d만을 가지고 온다는 전제를 가정하에 조금 변형해봤습니다.

 

Copy
<div class="latest"><?php$i = 1;while ($latest_table = array_shift($list)) {    $mw_skin_config = mw_skin_config($latest_table);    if ($mw_skin_config['cf_attribute'] == "1:1") continue;
   
   if($latest_table =="a" || $latest_table =="d" )  {  
      // 여기서 결국 $latest_table이 테이블명이니 여기서 조건을 태우면 될듯 합니다.
      echo "<div class=\"item\">".latest("theme/mw5", $latest_table, 5, 50, 0)."</div>";
   }
 
    if (($i++)%2==0) echo "</div><div class=\"latest\">";}?></div>

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