latest.lib.php 파일에서요...
본문
latest.lib.php 파일은 최근글을 추출하는 파일로 알고 있습니다.
아래와 같이 변형하여 모든글을 추출하는 것이 아니라 아이디가 같은 것만을 선택 추출하려하거든요..
그래서 쿼리 부분에 and wr_12 = '$repo_id'을 추가했어요.. 그랫더니 안먹히네요..
분명히 alert로 찍어보면 아이디는 정확하게 추출이 되거든요..
그런데 wr_12 = '$repo_id' 이 부분에서는 아이디가 안나와요..ㅠㅠㅠ
또 추가해야할 것이 있다면 알려주시면 고맙겠습니다.
##################################################################
//아이디추출
$repo_add=sql_fetch("select wr_subject from g4_write_R_page where wr_4='$repo_address' ");
$repo_id = $repo_add[wr_subject];
//alert("$repo_id");
// 최신글 추출
function latest($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; // 게시판 테이블 전체이름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 and wr_12 = '$repo_id' 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_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>