2개의 게시판에 최근글 불러오기.. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

2개의 게시판에 최근글 불러오기.. 정보

2개의 게시판에 최근글 불러오기..

본문

http://www.sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=5792

현재 이 팁을 이용하여 두개의 게시판에서 최근글을 불러왔습니다

문제는 최근글이 너무 많이 보여져서

그림처럼 5개정도만 나오게 하고 앞에 글씨를 그림으로 대체하고 싶습니다

스킨 소스입니다

<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
    <td colspan=4 align=center>
        <table width=95%>
        <tr>
            <td height=10><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>  
            <?
            echo $list[$i]['icon_reply'] . " ";
                     $this_id=""; $this_id_name=""; $sub_before_cut="";
                     $sub_length=strlen($list[$i][subject]); 
                     $sub_before_cut=trim(substr($list[$i][subject],0,$sub_length-4));                     
                     $this_id=
                      @mysql_result(@mysql_query("select wr_id,wr_hit, wr_subject  from $tmp_write_table01 where "
                      ."(wr_subject like '$sub_before_cut%' and wr_id='{$list[$i][wr_id]}' and wr_hit='{$list[$i][wr_hit]}' "
                      ."and wr_is_comment=0)"),4,0);
                     
                      //두번째 테이블에 제목+조회수+글번호가 일치하지 않으면 링크는 첫번째테이블이다.
                     
                      if($this_id !="")$list[$i][href]=str_replace("$bo_table02","$bo_table01",$list[$i][href]);
                      //게시판:제목

                      $this_ql="select bo_subject,bo_table from g4_board where bo_table ";
                     
                      if($this_id !="") $bo_table="$bo_table01"; else $bo_table="$bo_table02";
                     
                      $this_id_name=@mysql_result(@mysql_query("$this_ql= '$bo_table'"),0,0);

         
             echo "[<a href='{$list[$i][href]}'><font color='green'>$this_id_name</font></a>]  <a href='{$list[$i][href]}'>";


            if ($list[$i]['is_notice'])
                echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
            else
                echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list[$i]['subject']}</font>";
            echo "</a>";

            if ($list[$i]['comment_cnt'])
                echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";

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

            echo " " . $list[$i]['icon_new'];
            echo " " . $list[$i]['icon_file'];
            echo " " . $list[$i]['icon_link'];
            echo " " . $list[$i]['icon_hot'];
            echo " " . $list[$i]['icon_secret'];
            ?></td></tr>

        </table></td>
</tr>
<? } ?>


index.php 에서 불러오는
<?=latest_union("union", "notice", "info_news", 116, 50, "wr_id"); ?>
이런식으로 하였습니다

어딜 더 고쳐야 될지 좀 부탁드리겠습니다





댓글 전체

죄송합니다....링크 팁 자료중에서 10개로 고정이...ㅠ.ㅠ

$sql = "select * from $tmp_write_table01 union all select * from $tmp_write_table02 order by wr_hit desc limit 0,10";



$sql = "select * from $tmp_write_table01 union all select * from $tmp_write_table02 order by wr_hit desc limit 0, $rows";

로 바꾸어 보세요....
감사합니다^^ 적용이 됩니다

그런데 왜 글을 뽑아 오는데 최근글이 안보이고 예전에 올렸던 글만 보입니다

정렬이 안되는거 같습니다 wr_id 때문인지...ㅜㅜ

그리고 앞에 그림은 어떻게 바꾸어야 되는지..ㅡㅡ

이거 질문이 너무 많아 죄송합니다
앞에 그림으로 들어가는부분은
<?if ($bo_table == notice) {?>
<img src='<?=$latest_skin_path?>/img/news_icon.jpg' align=absmiddle>
<?} else {?>
<img src='<?=$latest_skin_path?>/img/not_icon.jpg' align=absmiddle>
<?}?>

이런식으로 해결하였습니다

이제 정렬이 문제군요 글을 쓰고 최근글을 확인해보면 안나오고
예전글만 보입니다..ㅜㅜ
<?if ($bo_table == 'notice') {?>
<img src='<?=$latest_skin_path?>/img/not_icon.jpg' align=absmiddle>
<?} else{?>
<img src='<?=$latest_skin_path?>/img/news_icon.jpg' align=absmiddle>
<?}?>

이거 왜 이러죠?-_-
<?=latest_union("union", "notice", "info_news", 5, 50, ""); ?>

"notice", "info_news" 이렇게 두개 있는데 저게 안먹네요-_-;;
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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