e

블로그에 새로 올라온글 뽑기

· 2007-02-07 (수) 12:54:59 · 3597 · 1
Untitled-1.gif
메모로 문의 하시는 분이 많아서 무실력에 글 올립니다...
 
무실력인 관계로 도움말 주실분은 주세요 ~~~~
 
gblog.index.php에서
 
내용까지 뽑으면 넘 길어서 폼 안나시는분은 요렇게 수정 해서 사용 하세용~~~
 
<table width="100%" cellpadding=0 cellspacing=0>
<tr>
    <td valign=top>
        <table>
   <tr>
    <td background=<?=$g4[path]?>/img/la_titie.gif border=0 height=25>
             <a href='<?=$g4[path]?>/index_blog.php'><b>블로그에 새로 올라온 글</b></a>
    </td>
   </tr>
  </table>
        <table width=95% cellpadding=0 cellspacing=0 align=center>
        <?
        $sql = " select * from {$gb4['post_table']} where secret=1 order by id desc limit 11 ";
        $result = sql_query($sql);
        for($i=0;$row=sql_fetch_array($result);$i++) {
            if ($i>0) {
                echo "<tr><td height=5></td></tr>";
                echo "<tr><td height=1 bgcolor=#d2d2d2></td></tr>";
                echo "<tr><td height=5></td></tr>";
            }
            $sql2 = " select mb_id, writer from {$gb4['blog_table']} where id = '$row[blog_id]' ";
            $row2 = sql_fetch($sql2);
            $sql3 = " select category_name from {$gb4['category_table']} where id = '$row[category_id]' ";
            $row3 = sql_fetch($sql3);
            if( empty($row3[category_name]) ) $row3[category_name] = '전체';

            $mmdd = date("m-d", strtotime($row[post_date]));
            $title = $row[title];
            $title = strip_tags($title);
            $title = cut_str($title, 40);
            echo "<tr><td height=25><span style='font-size:9pt;font-weight:bold;letter-spacing:-1px;'>";
            echo "<a href='".get_post_url($row[id],$row2[mb_id])."'>$title</a></span> <span>$row2[writer]</span> <span class=cloudy>님</span> <span class='cloudy small'>($mmdd, $row3[category_name])</span></td></tr>";
        }
        if ($i==0) {
            echo "<tr><td height=100>새로 올라온 글이 아직 없습니다.</td></tr>";
        }
        ?>
        <tr><td height=5></td></tr>
        <tr><td height=1 bgcolor=#d2d2d2></td></tr>
        </table>
    </td>
</tr></table>
  <br>
 
보여질 위치에 넣으시면 됩니당~~~

첨부파일

Untitled-1.gif (48.3 KB)
0회 2007-02-07 12:54
|

댓글 1개

2007-02-07 (수) 13:28:21
타이틀 글 이 길경우를 대비해서 타이틀 글 줄이는걸루 수정해서 올렸습니다.

이전에 가져가신분 다시 가져 가세용~~~
댓글을 작성하시려면 로그인이 필요합니다.

팁

69건
+
제목 글쓴이 날짜 조회
07-02-07 조회 3,598
07-02-03 조회 4,236
07-02-01 조회 3,888
07-01-23 조회 3,409
07-01-14 조회 4,705
07-01-13 조회 4,739
07-01-12 조회 4,964
07-01-08 조회 4,338
07-01-05 조회 3,315
07-01-05 조회 3,610
07-01-04 조회 2,794
07-01-04 조회 3,051
07-01-04 조회 4,721
07-01-04 조회 3,290
07-01-04 조회 2,941
07-01-02 조회 2,702
07-01-02 조회 3,921
07-01-02 조회 3,658
07-01-02 조회 3,943
07-01-02 조회 2,904