바

latest.lib.php 최신글이 아닌 공지글만 모두 가져오기

· 2011-08-01 (월) 16:37:41 · 6234

// 공지로 체크된 글만 가져오기
function latest_notice($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
    global $g4;
    if ($skin_dir)
        $latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
    else
        $latest_skin_path = "$g4[path]/skin/latest/basic";
    $list = array();
   
    $sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
    $board = sql_fetch($sql);
    $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
 $data = split("\n", $board[bo_notice]);
 $sqlwhere = "";
 for ($i=0;$i < COUNT($data);$i++) {
  //echo "[" . $i . "]<br>";
  if ($data[$i]) {
   if ($sqlwhere) $sqlwhere .= " or ";
   $sqlwhere .= " wr_id = '" . $data[$i] . "' ";
  }
 }
 if (COUNT($data) < 1) {   // 공지사항으로 체크된 것이 없을때
  $sqlwhere = " 1 ";
 }
 
 // 공지시로 체크된 것 모두 가져오기
 $sql = " select * from $tmp_write_table where wr_is_comment = 0
                  and ( $sqlwhere )
                  order by wr_num";
 
    $result = sql_query($sql);
    for ($i=0; $row = sql_fetch_array($result); $i++)
        $list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
   
    ob_start();
    include "$latest_skin_path/latest.skin.php";
    $content = ob_get_contents();
    ob_end_clean();
    return $content;
}
|
댓글을 작성하시려면 로그인이 필요합니다.

그누4 팁자료실

3,309건

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
11-08-22 조회 5,633
11-08-22 조회 4,601
11-08-22 조회 6,413
11-08-20 조회 8,755
11-08-19 조회 9,632
11-08-18 조회 4,368
11-08-18 조회 5,730
11-08-16 조회 9,445
11-08-11 조회 8,318
11-08-10 조회 6,530
11-08-10 조회 6,632
11-08-09 조회 3,537
11-08-09 조회 7,015
11-08-08 조회 3,678
11-08-08 조회 5,141
11-08-08 조회 7,051
11-08-08 조회 7,263
11-08-05 조회 4,015
11-08-01 조회 6,235
11-07-28 조회 4,841