지정하는 게시판들의 공지사항을 출력해주는 기능을 하는 최신글 입니다.
여러 게시판의 공지사항들을 모두 긁어 내는 것은 실효성이 있나 하는 생각이 들어 개발하지 않았습니다.
// 지정하는 게시판의 공지글 추출
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;
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";
$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);
$result = sql_fetch($sql);
$arr_notice = preg_split("/\n/i", trim($result[bo_notice]));
$arr_notice_count = count($arr_notice);
$arr_notice_count = count($arr_notice);
// $rows가 $arr_notice_count 보다 크면
if ($rows < $arr_notice_count)
$rows = $arr_notice_count;
if ($rows < $arr_notice_count)
$rows = $arr_notice_count;
// 랜덤이면 배열을 셔플링
if ($sod == "rand")
shuffle($arr_notice);
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();
$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);
}
$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();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
}
- opencode.co.kr -