ϴ Խ ϱ

Ҵ   
   ȸ 11074   õ 0     õ 0    

지정하는 게시판들의 공지사항을 출력해주는 기능을 하는 최신글 입니다.
여러 게시판의 공지사항들을 모두 긁어 내는 것은 실효성이 있나 하는 생각이 들어 개발하지 않았습니다.
 
// 지정하는 게시판의 공지글 추출
function latest_bo_notice($skin_dir="", $bo_table, $rows=10, $subject_len=40, $gallery_view=0, $sod="rand", $skin_title="", $skin_title_link="", $options="")
{
    global $g4;
    if ($skin_dir)
        $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
    else
        $latest_skin_path = "$g4[path]/skin/latest/basic";
    $sql = " select bo_notice from $g4[board_table] where bo_table = '$bo_table' ";
    $result = sql_fetch($sql);
    $arr_notice = preg_split("/\n/i", trim($result[bo_notice]));
    $arr_notice_count = count($arr_notice);
    // $rows가 $arr_notice_count 보다 크면
    if ($rows < $arr_notice_count)
        $rows = $arr_notice_count;
    // 랜덤이면 배열을 셔플링
    if ($sod == "rand")
        shuffle($arr_notice);
    $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
    $board = get_board($bo_table);
    $sql_select = " wr_id, wr_subject, wr_option, wr_content, wr_comment, wr_parent, wr_datetime, wr_last, wr_homepage, wr_name, wr_reply, wr_link1, wr_link2, ca_name, wr_hit, wr_file_count, wr_1, wr_2, wr_3, wr_4, wr_5, wr_6, wr_7, wr_8, wr_9, wr_10 ";
    $list = array();
    for ($i=0; $i<$rows; $i++) {
        $wr_id = $arr_notice[$i];
        $sql = " select $sql_select from $tmp_write_table where wr_id = '$wr_id' ";
        $wr = sql_fetch($sql);
        $list[$i] = get_list($wr, $board, $latest_skin_path, $subject_len, $gallery_view);
    }
    ob_start();
    include "$latest_skin_path/latest.skin.php";
    $content = ob_get_contents();
    ob_end_clean();
    return $content;
}
 
 
- opencode.co.kr -


Page 10/28
2011-11   15349   Ҵ
2011-10   14219   Ҵ
2011-10   14094   Ҵ
2011-10   14405   Ҵ
2011-10   15249   Ҵ
2011-10   13196   Ҵ
2011-10   14275   Ҵ
2011-10   14363   Ҵ
2011-10   18199   Ҵ
2011-10   14843   Ҵ
2011-10   14071   Ҵ
2011-10   14170   Ҵ
2011-10   13156   Ҵ
2011-10   15293   Ҵ
2011-10   11075   Ҵ
2011-10   12921   Ҵ
2011-10   10459   Ҵ
2011-10   11585   Ҵ
2011-10   11524   Ҵ
2011-10   19467   Ҵ