BLOG main image
분류 전체보기 (65)
JSP (6)
Android (1)
ASP.NET (0)
MSSQL (4)
PHP (18)
ASP (11)
오픈 API (1)
HTML (2)
JavaScript (0)
Windows Programming (8)
컴퓨터교양 (14)
객체 지향 (0)
리뷰 및 생각 (0)
Visitors up to today!
Today hit, Yesterday hit
daisy rss
tistory 티스토리 가입하기!
2014. 1. 7. 09:32

        <?
        $m_bo_table = 'news';
        $m_rows = "5";
        $m_subject_len = 20;
        $m_latest_skin_path = "$g4[path]/skin/latest/basic";
       
        $list = array();
       
        $sql = " select * from $g4[board_table] where bo_table = '$m_bo_table'";
        $board = sql_fetch($sql);
       
        //echo "$sql<br />";
       
        $tmp_write_table = $g4['write_prefix'] . $m_bo_table; // 게시판 테이블 전체이름
        //$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $m_rows ";
        // 위의 코드 보다 속도가 빠름
        $sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $m_rows ";
       
        //echo "$sql<br />";
       
        //explain($sql);
        $result = sql_query($sql);
        for ($i=0; $row = sql_fetch_array($result); $i++)
            $list[$i] = get_list($row, $board, $m_latest_skin_path, $m_subject_len);       
        ?>
       
        <? for ($i=0; $i<count($list); $i++) { ?>
                    <? echo "<img src='$m_latest_skin_path/img/latest_icon.gif' align=absmiddle>"; ?>
       
                   
                    <?
                    // 파일 출력
                    /*
                    for ($j=0; $j<=count($list[$i][file]); $j++) {
                        if ($list[$i][file][$j][view])
                            echo $list[$i][file][$j][view] . "<p>";
                    }
                    */
                    if ($list[$i][file][0][view])
                        echo "<img src='$g4[path]/data/file/$m_bo_table/{$list[$i][file][0][file]}' align='absmiddle' width='100' height='60' />";
                    ?>
                   
                    <?
                    echo $list[$i]['icon_reply'] . " ";
                    echo "<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'];
                   
                    echo "<br />";
                    ?>
                   
        <? } ?>
       
        <? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>