자신이 추천한 글의 작성자가 쓴 모든글을 추출할수 있을까요..?
본문
현재 비추천 기능은 사용중이지 않고.
board_good 테이블을 통해서 자신이 추천을 누른 글의 작성자가 쓴 모든 글을 최신글 식으로
추출하고자해요..
if(!G5_USE_CACHE || $cache_fwrite) {
$list = array();
$sql = " select * from {$g5['board_table']} where bo_table = '{$bo_table}' ";
$board = sql_fetch($sql);
$bo_subject = get_text($board['bo_subject']);
$member = get_text($mb['mb_id']);
$tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 order by wr_num limit 0, {$rows} ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
$list[$i] = get_list($row, $board, $latest_skin_url, $subject_len);
}
if($cache_fwrite) {
$handle = fopen($cache_file, 'w');
$cache_content = "<?php\nif (!defined('_GNUBOARD_')) exit;\n\$bo_subject='".$bo_subject."';\n\$list=".var_export($list, true)."?>";
fwrite($handle, $cache_content);
fclose($handle);
}
}
ob_start();
include $latest_skin_path.'/latest.skin.php';
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
위에는 따로 최신글 php를 새로 만든것이구
$sql = " select wr_id, mb_id from g5_board_good_table where mb_id = '$member[mb_id]' ";
$row = sql_fetch($sql);
g5_board_good_table 의 wr_id 와 $tmp_write_table 의 wr_id를 일치시키면 될것같은데.. 잘모르겠네요 ㅠㅠ
도저히 감이 안잡히네요..ㅠㅠ 도움부탁드릴게요..
!-->답변 1
우선 그누보드를 안쓰는 입장에서 말로 풀어써봅니다.
1. board_good 에서 자신이 추천을 누른 글의 리스트에 select 정보로 해당 글의 글쓴이를 가져옵니다.
2. board_good 에서 가져온 글쓴이들을 where in 조건으로 검색합니다. order by 조건은 최신순 DESC 로 합니다.
이런식으로 풀어가면 되지 않을까요?
답변을 작성하시기 전에 로그인 해주세요.