view 페이지에서 글쓴이의 다른 게시판 글목록을 뽑을때.. 정보
view 페이지에서 글쓴이의 다른 게시판 글목록을 뽑을때..본문
일단 view.skin 에서 다른 게시판의 글쓴이의 아이디를 비교해서 데이터를 뽑아오는데요..
$sql = " select * from g4_write_board13
where mb_id = '$view[mb_id]'
order by wr_id desc";
이걸 get_list 함수로 리스트 처리를 하고 있는데..
해당 첨부파일들을 못뽑아 옵니다...
해결 방법좀.... ㅠㅠ
$sql = " select * from g4_write_board13
where mb_id = '$view[mb_id]'
order by wr_id desc";
이걸 get_list 함수로 리스트 처리를 하고 있는데..
해당 첨부파일들을 못뽑아 옵니다...
해결 방법좀.... ㅠㅠ
댓글 전체
그렇게하면 되는 것인데요?
어떻게 한 건지 소스를 봐야 에러 원인을 알 수 있죠
어떻게 한 건지 소스를 봐야 에러 원인을 알 수 있죠
아.. 이게.. wr_id가 해당 뷰페이지의 wr_id와 겹쳐서 그런거 같아요...
그래서 해당 게시판의 wr_id와 겹치는 다른 보드들의 wr_id를 갖고있는 파일만 불러들여서 ...
만약 board8의 게시판의 4번 5번 6번 wr_id에 파일이 있으면 리스트 뽑아온 글중 해당 wr_id가 있는
리스트만 파일이 뜨는데... 어떻게 해결해야 될지...
소스 보여드리자면...
<?
$cnt = 0;
$sql = " select * from g4_write_board13
where mb_id = '$view[mb_id]'
order by wr_id desc";
$res = sql_query($sql);
$list = array();
$to_cnt= mysql_num_rows($res);
?>
<table width="721" border="0" cellpadding="0" cellspacing="5" bgcolor="#EFEFEF">
<tr>
<td bgcolor="#FFFFFF"><div align="right"><ul>부품<ul>총 : <?=$to_cnt?>건</ul></ul></div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" align="center">
<table width="721" border="0" cellpadding="0" cellspacing="0">
<tr>
<?
while($row=sql_fetch_array($res)){
$list[$i] = get_list($row, $board, $board_skin_path, $subject_len);
$cnt++;
$subj = cut_str(get_text($row[wr_subject]), 22);
########################
#########섬네일#########
########################
if($list[$i][file][0]){
$thum = "$g4[path]/data/file/board13/".urlencode($list[$i][file][0][file]);
}else if (!file_exists($thum)){
$thum = "$g4[path]/skin/board/car/img/noimg.gif";
}
?>
<td width='721' height="230" align="center" bgcolor="FFFFFF" style='letter-spacing: -1px;'>
<table height="223" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="112" colspan="2" bgcolor="ffffff"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=board13&wr_id=<?=$list[$i][wr_parent]?>'><img src='<?=$thum?>' width="150" height="110" border='0'></a></td>
</tr>
<tr>
<td width='50' height="23"><font color="#999999" size="-3">제조사</font> :</td>
<td width="70"><font color="#999999" size="-3"><?=$list[$i][ca_name]?></font></td>
</tr>
<tr>
<td width='50' height="20"><font color="#999999" size="-3">제품명</font> :</td>
<td width="70"><font color="#999999" size="-3"><?=$list[$i][wr_8]?><div><?=$list[$i][wr_9]?></div></font></td>
</tr>
<tr>
<td width='50' height="29"><font color="#999999" size="-3">모델명</font> :</td>
<td width="70"><font color="#999999" size="-2"><div><?=$list[$i][wr_10]?></div></font></td>
</tr>
<tr>
<td width='50'><font color="#999999" size="-3">가격</font> :</td>
<td width="70"><font color="#999999" size="-3"><?=$list[$i][wr_6]?> 만원</font> </td>
</tr>
</table>
</center>
</td>
<?
if(($cnt)%4==0) echo "</tr><tr>";
}
if (!$cnt) echo "<tr><td height='50' align='center'><font color='#EF2B5A'><b>등록된 매물이 없습니다.</b></font></td></tr>";
?>
</tr>
</table>
</td>
</tr>
</table>
그래서 해당 게시판의 wr_id와 겹치는 다른 보드들의 wr_id를 갖고있는 파일만 불러들여서 ...
만약 board8의 게시판의 4번 5번 6번 wr_id에 파일이 있으면 리스트 뽑아온 글중 해당 wr_id가 있는
리스트만 파일이 뜨는데... 어떻게 해결해야 될지...
소스 보여드리자면...
<?
$cnt = 0;
$sql = " select * from g4_write_board13
where mb_id = '$view[mb_id]'
order by wr_id desc";
$res = sql_query($sql);
$list = array();
$to_cnt= mysql_num_rows($res);
?>
<table width="721" border="0" cellpadding="0" cellspacing="5" bgcolor="#EFEFEF">
<tr>
<td bgcolor="#FFFFFF"><div align="right"><ul>부품<ul>총 : <?=$to_cnt?>건</ul></ul></div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" align="center">
<table width="721" border="0" cellpadding="0" cellspacing="0">
<tr>
<?
while($row=sql_fetch_array($res)){
$list[$i] = get_list($row, $board, $board_skin_path, $subject_len);
$cnt++;
$subj = cut_str(get_text($row[wr_subject]), 22);
########################
#########섬네일#########
########################
if($list[$i][file][0]){
$thum = "$g4[path]/data/file/board13/".urlencode($list[$i][file][0][file]);
}else if (!file_exists($thum)){
$thum = "$g4[path]/skin/board/car/img/noimg.gif";
}
?>
<td width='721' height="230" align="center" bgcolor="FFFFFF" style='letter-spacing: -1px;'>
<table height="223" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td height="112" colspan="2" bgcolor="ffffff"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=board13&wr_id=<?=$list[$i][wr_parent]?>'><img src='<?=$thum?>' width="150" height="110" border='0'></a></td>
</tr>
<tr>
<td width='50' height="23"><font color="#999999" size="-3">제조사</font> :</td>
<td width="70"><font color="#999999" size="-3"><?=$list[$i][ca_name]?></font></td>
</tr>
<tr>
<td width='50' height="20"><font color="#999999" size="-3">제품명</font> :</td>
<td width="70"><font color="#999999" size="-3"><?=$list[$i][wr_8]?><div><?=$list[$i][wr_9]?></div></font></td>
</tr>
<tr>
<td width='50' height="29"><font color="#999999" size="-3">모델명</font> :</td>
<td width="70"><font color="#999999" size="-2"><div><?=$list[$i][wr_10]?></div></font></td>
</tr>
<tr>
<td width='50'><font color="#999999" size="-3">가격</font> :</td>
<td width="70"><font color="#999999" size="-3"><?=$list[$i][wr_6]?> 만원</font> </td>
</tr>
</table>
</center>
</td>
<?
if(($cnt)%4==0) echo "</tr><tr>";
}
if (!$cnt) echo "<tr><td height='50' align='center'><font color='#EF2B5A'><b>등록된 매물이 없습니다.</b></font></td></tr>";
?>
</tr>
</table>
</td>
</tr>
</table>
$list[$i] = get_list($row, $board, $board_skin_path, $subject_len);
이렇게 하면 $board값이 맞지가 않죠($board 값은 현재게시판의 정보입니다)
불러올 게시판의 정보를 넘겨줘야죠
$board22222222 = sql_fetch(" select * from {$g4['board_table']} where bo_table = 'board133333' ");
을 페이지 맨 위에 넣고
$list[$i] = get_list($row, $board22222222, $board_skin_path, $subject_len);
로 수정
22222222, 3333333333은 수정할 부분을 알기 쉽도록 붙인값이니 이곳을 수정하면 됩니다
이렇게 하면 $board값이 맞지가 않죠($board 값은 현재게시판의 정보입니다)
불러올 게시판의 정보를 넘겨줘야죠
$board22222222 = sql_fetch(" select * from {$g4['board_table']} where bo_table = 'board133333' ");
을 페이지 맨 위에 넣고
$list[$i] = get_list($row, $board22222222, $board_skin_path, $subject_len);
로 수정
22222222, 3333333333은 수정할 부분을 알기 쉽도록 붙인값이니 이곳을 수정하면 됩니다
휴~~ 귀찮아서 걍 latest 함수 만들어서 $view[mb_id] 받아서 리스트 뽑게 만들어서 그 부분을 대체하는 방법을 썼네요 ㅎㅎ 다 만들어놓고 막히니 짜증나서 그냥 쉽게 돌려서 하니 편하더라고요.. 답변 감사합니다. 늦게봐서 지금 채택했습니다 균이님^^