게시물이 같은 제목으로 뜹니다. 도움을 주세요.. 정보
게시물이 같은 제목으로 뜹니다. 도움을 주세요..
본문
<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0 style="padding-left:25px;" >
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td valign="top">
<?
ob_start();
for ($i=0; $i<count($list); $i++) {
echo "<td width='58' height='40' align='left' valign='top'>";
if(!$member[mb_id]) {
$list[$i][href] = sql_fetch("select bf_file from $g4[board_file_table] where bo_table='$bo_table' and bf_no = '0' and wr_id='{$list[$i][wr_id]}'");
}
$latest_subject = cut_str($list[$i][subject], 12, '...'); // 제목
$list_file = sql_fetch("select bf_file from $g4[board_file_table] where bo_table='$bo_table' and bf_no = '0' and wr_id='{$list[$i][wr_id]}'");
if($list_file[bf_file]) {
$list_file_view[$i] = "<img src='./../data/file/$bo_table/$list_file[bf_file]' style='cursor:pointer' border=0 width=$small_width height=$small_height onmouseover=\"document.getElementById('large').src='./../data/file/$bo_table/$list_file[bf_file]'; document.getElementById('view').href='{$list[$i][href]}'\">";
$list_file_view[$i] = "<img src='./../data/file/$bo_table/$list_file[bf_file]' style='cursor:pointer' border=0 width=$small_width height=$small_height onmouseover=\"document.getElementById('large').src='./../data/file/$bo_table/$list_file[bf_file]'; document.getElementById('view').href='{$list[$i][href]}'\">";
$list_lfile_view[$i] = "
<div id='large_subject'>{$list[$i][subject]}</div>
<a id=view href='#'><img id=large src='./../data/file/$bo_table/$list_file[bf_file]' border=0 width=$large_width height=$large_height></a>
";
}else {
$list_file_view[$i] = "";
$list_lfile_view[$i] = "";
}
echo $list_file_view[$i];
// echo "<br>";
// echo $latest_subject;
echo "</td>";
if($i%2) {
echo "</tr><tr>";
}
}
$imglist_html = ob_get_contents();
ob_clean();
echo $list_lfile_view[0];
?>
</td>
<td style="padding-left:4px;padding-top:11px;" valign=top>
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td height=370 valign=top>
<table width="100%" cellpadding="4" cellspacing="0" valign="top">
<tr>
<?=$imglist_html?>
</td>
<? if (count($list) == 0) { echo "<td colspan='$colspan' height=50 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
<tr><td valign=bottom>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" height=100% valign="bottom"><? if ($prev_part_href) { echo "<a href='$prev_part_href'><img src='$board_skin_path/img/btn_search_prev.gif' border=0 align=absmiddle title='이전검색'></a>"; }
// 기본으로 넘어오는 페이지를 아래와 같이 변환하여 이미지로도 출력할 수 있습니다.
echo $write_pages;
$write_pages = str_replace("처음", "<img src='$board_skin_path/img/begin.gif' border='0' align='absmiddle' title='처음'>", $write_pages);
$write_pages = str_replace("이전", "<img src='$board_skin_path/img/prev.gif' border='0' align='absmiddle' title='이전'>", $write_pages);
$write_pages = str_replace("다음", "<img src='$board_skin_path/img/next.gif' border='0' align='absmiddle' title='다음'>", $write_pages);
$write_pages = str_replace("맨끝", "<img src='$board_skin_path/img/end.gif' border='0' align='absmiddle' title='맨끝'>", $write_pages);
$write_pages = preg_replace("/<span>([0-9]*)<\/span>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:#797979\">$1</font></b>", $write_pages);
$write_pages = preg_replace("/<b>([0-9]*)<\/b>/", "<b><font style=\"font-family:돋움; font-size:9pt; color:orange;\">$1</font></b>", $write_pages);
if ($next_part_href) { echo "<a href='$next_part_href'><img src='$board_skin_path/img/btn_search_next.gif' border=0 align=absmiddle title='다음검색'></a>"; } ?>
</td>
</tr>
</table>
</td></tr></table>
</td>
</tr>
</table>
<!-- 버튼 링크 -->
<form name=fsearch method=get style="margin:0px;">
<input type=hidden name=bo_table value="<?=$bo_table?>">
<input type=hidden name=sca value="<?=$sca?>">
<table width=<?=$width?> cellpadding=0 cellspacing=0 align=center>
<tr>
<td width="50%" height="40"><? if ($list_href) { ?>
<a href="<?=$list_href?>"><img src="<?=$board_skin_path?>/img/btn_list.gif" border="0"></a>
<? } ?>
<? if ($write_href) { ?>
<a href="<?=$write_href?>"><img src="<?=$board_skin_path?>/img/btn_write.gif" border="0"></a>
<? } ?>
<? if ($is_checkbox) { ?>
<a href="javascript:select_delete();"><img src="<?=$board_skin_path?>/img/btn_select_delete.gif" border="0"></a> <a href="javascript:select_copy('copy');"><img src="<?=$board_skin_path?>/img/btn_select_copy.gif" border="0"></a> <a href="javascript:select_copy('move');"><img src="<?=$board_skin_path?>/img/btn_select_move.gif" border="0"></a>
<? } ?>
</td>
<td width="50%" align="right"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<script>
function img_over(img, ttl){
document.getElementById('large').src = "./../data/file/<?=$bo_table?>/"+img;
document.getElementById('large_subject').innerText = ttl;
}
</script>
<script language="Javascript">
if ('<?=$sca?>') document.fcategory.sca.value = '<?=$sca?>';
</script>
<? if ($is_checkbox) { ?>
<script language="Javascript">
function all_checked(sw) {
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function check_confirm(str) {
var f = document.fboardlist;
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(str + "할 게시물을 하나 이상 선택하세요.");
return false;
}
return true;
}
// 선택한 게시물 삭제
function select_delete() {
var f = document.fboardlist;
str = "삭제";
if (!check_confirm(str))
return;
if (!confirm("선택한 게시물을 정말 "+str+" 하시겠습니까?\n\n한번 "+str+"한 자료는 복구할 수 없습니다"))
return;
f.action = "./delete_all.php";
f.submit();
}
// 선택한 게시물 복사 및 이동
function select_copy(sw) {
var f = document.fboardlist;
if (sw == "copy")
str = "복사";
else
str = "이동";
if (!check_confirm(str))
return;
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
위는 소스코드 입니다. 제가 해결이 안된 부분은
$latest_subject = cut_str($list[$i][subject], 12, '...'); // 제목
$list_file = sql_fetch("select bf_file from $g4[board_file_table] where bo_table='$bo_table' and bf_no = '0' and wr_id='{$list[$i][wr_id]}'");
위의 2줄입니다. 제목을 출력하는 sql 문인데, 제가 쿼리값을 잘못 날렸는지, 글들이 같은 페이지 상에서는 같은 제목으로 출력되고 있습니다.
어떤 방법으로 고쳐야 하는지 조언 부탁드립니다.
댓글 전체
대괄호 함 풀어보세요...