최신글 질문입니다. 정보
최신글 질문입니다.
본문
일반적으로 게시판에 글쓰기 할때 공지사항이 있습니다.
공지사항으로 설정한것만 최신글에 나오게 할 수는 없나요?
특정게시판이 아니라 모든 게시판의 공지사항으로 설정된 것들은 최신글에 나오는거죠.
가능하다면 어떻게 처리를 해야될까요?
전문용어를 잘모르는 초보예용 ㅠ.ㅠ
공지사항으로 설정한것만 최신글에 나오게 할 수는 없나요?
특정게시판이 아니라 모든 게시판의 공지사항으로 설정된 것들은 최신글에 나오는거죠.
가능하다면 어떻게 처리를 해야될까요?
전문용어를 잘모르는 초보예용 ㅠ.ㅠ
댓글 전체


// 최신글 추출
function quoting(&$item1, $key) { $item1 = "'$item1'"; }
function latest_notice($skin_dir="", $bo_tables, $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";
if( !is_array( $bo_tables)) return 'A second parameter error:bo_tables should be an array.';
array_walk( $bo_tables , 'quoting');
$bo_tables_cond= implode(',', $bo_tables);
$notice_res= sql_query( "select bo_table, bo_notice from {$g4['board_table']} where bo_table in ( $bo_tables_cond ) " );
$notice_wr_id_cond=array();
$notice_bo_tables=array();
while( $row= sql_fetch_array( $notice_res)) {
$this_notice= trim($row['bo_notice']);
if( empty( $this_notice)) continue;
$notice_wr_id_cond[]= implode( ',', split("\n", $this_notice));
$notice_bo_tables[]= $row['bo_table'];
}
$sqls= array();
foreach( $notice_bo_tables as $idx => $notice_bo_table) {
$sqls[]= " select wr_id , wr_subject from {$g4['write_prefix']}$notice_bo_table where wr_id in ( {$notice_wr_id_cond[$idx]} )";
}
$list = array();
$result = sql_query( implode( ' union all ', $sqls));
for ($i=0; ($row = sql_fetch_array($result)) && $i < $rows; $i++)
$list[$i] = get_list($row, array( 'bo_table'=>$notice_bo_table), $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
function quoting(&$item1, $key) { $item1 = "'$item1'"; }
function latest_notice($skin_dir="", $bo_tables, $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";
if( !is_array( $bo_tables)) return 'A second parameter error:bo_tables should be an array.';
array_walk( $bo_tables , 'quoting');
$bo_tables_cond= implode(',', $bo_tables);
$notice_res= sql_query( "select bo_table, bo_notice from {$g4['board_table']} where bo_table in ( $bo_tables_cond ) " );
$notice_wr_id_cond=array();
$notice_bo_tables=array();
while( $row= sql_fetch_array( $notice_res)) {
$this_notice= trim($row['bo_notice']);
if( empty( $this_notice)) continue;
$notice_wr_id_cond[]= implode( ',', split("\n", $this_notice));
$notice_bo_tables[]= $row['bo_table'];
}
$sqls= array();
foreach( $notice_bo_tables as $idx => $notice_bo_table) {
$sqls[]= " select wr_id , wr_subject from {$g4['write_prefix']}$notice_bo_table where wr_id in ( {$notice_wr_id_cond[$idx]} )";
}
$list = array();
$result = sql_query( implode( ' union all ', $sqls));
for ($i=0; ($row = sql_fetch_array($result)) && $i < $rows; $i++)
$list[$i] = get_list($row, array( 'bo_table'=>$notice_bo_table), $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>

답변 정말 감사합니다.. 제가 너무 허접이다 보니 잘 정리된 내용을 보고도 어떻게 하는지는 모르겠네요 ㅠ.ㅠ