여러 게시판의 게시물 메인화면에 뿌려주기 정보
여러 게시판의 게시물 메인화면에 뿌려주기본문
안녕하세요..문의드립니다.
메인한쪽에는 공지사항 게시판에 최신글뽑아오도록 구현되어있고
그 옆에는 다른 게시판의 사진을 자동으로 돌아가도록 되어있습니다
제가 문의드리고자하는 부분은 사진이 자동으로 돌아가는부분이
한 게시판에서만 아닌 두개이상의 사진첩 게시판의 게시물전부를 돌아가게끔
하고싶습니다
대략보니 latest.lib.php랑 latest.skin.php를 수정하면 되는것같은데
감이 오지않아 이렇게 문의드립니다
님들 도와주세영~ㅜㅜ
메인한쪽에는 공지사항 게시판에 최신글뽑아오도록 구현되어있고
그 옆에는 다른 게시판의 사진을 자동으로 돌아가도록 되어있습니다
제가 문의드리고자하는 부분은 사진이 자동으로 돌아가는부분이
한 게시판에서만 아닌 두개이상의 사진첩 게시판의 게시물전부를 돌아가게끔
하고싶습니다
대략보니 latest.lib.php랑 latest.skin.php를 수정하면 되는것같은데
감이 오지않아 이렇게 문의드립니다
님들 도와주세영~ㅜㅜ
댓글 전체
latest.lib.php 에 추가
// 최신글 추출 (다중 테이블)
function latest_multi($skin_dir="", $bo_table1,$bo_table2,$bo_table3,$bo_table4, $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_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4')
and a.wr_id = a.wr_parent
order by a.bn_id desc
limit $rows ";
$result = sql_query($sql);
for ($i=0; $board=sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix] . $board[bo_table];
$sql = "select * from $tmp_write_table where wr_id = '$board[wr_id]'";
$result2 = sql_query($sql);
$row2 = sql_fetch_array($result2);
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
$list[$i][bo_table] = $board[bo_table];
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
// 최신글 추출 (다중 테이블)
function latest_multi($skin_dir="", $bo_table1,$bo_table2,$bo_table3,$bo_table4, $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_new_table] a, $g4[board_table] b
where a.bo_table = b.bo_table
and a.bo_table in('$bo_table1', '$bo_table2', '$bo_table3', '$bo_table4')
and a.wr_id = a.wr_parent
order by a.bn_id desc
limit $rows ";
$result = sql_query($sql);
for ($i=0; $board=sql_fetch_array($result); $i++)
{
$tmp_write_table = $g4[write_prefix] . $board[bo_table];
$sql = "select * from $tmp_write_table where wr_id = '$board[wr_id]'";
$result2 = sql_query($sql);
$row2 = sql_fetch_array($result2);
$list[$i] = get_list($row2, $board, $latest_skin_path, $subject_len);
$list[$i][bo_table] = $board[bo_table];
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}