답이 없어 다시 질문드립니다. 정보
답이 없어 다시 질문드립니다.본문
첨부 이미지와 같이 리스트에서 첫번째 사진이 크게 나오게 했습니다.
그런데 큰 이미지를 누르면 본문으로 이동하게 해야 하는데 그게 잘 안되네요..
방법 아시는 분들 조언 부탁드립니다.
list.skin.php 입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 제목길이 잘 맞추세요.
$thu_width = '150'; //썸네일 폭
$thu_height = '110'; //썸네일 높이
$thu_quality = '100'; //썸네일 퀄리티_100 이하
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$mod = $board[bo_gallery_cols];
$td_width = (int)(100 / $mod);
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
$slideRes = sql_query("SELECT * FROM $write_table AS a LEFT JOIN g4_board_file AS b ON a.wr_id=b.wr_id WHERE b.bo_table='$bo_table' ORDER BY a.wr_id DESC LIMIT 1");
while($slideRow = mysql_fetch_array($slideRes)){
$slideTag .= "<img src='../data/file/".$bo_table."/".$slideRow[bf_file]."'>";
}
// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<!-- 갤러리스킨 스타일시트 지정 -->
<? include "_style_gallery_option.php"; ?>
<style type="text/css">
<!--
.bo_ti { font-family:Tahoma,굴림,굴림체; font-size:9pt; color:#555555; }
.data { font-family:Tahoma,굴림,굴림체; font-size:8pt; color:#999999; }
-->
</style>
<div id="main" align=center><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>&wr_id=<?=$row[wr_id]?>">
<?=$slideTag?></a></div>
<!-- 게시판 목록 시작 -->
<br>
<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0><tr><td>
<!-- //--------------------------- 게시판목록 {관리자만 보기} -----------------// -->
<? if($is_admin == 'super') { ?>
<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->
<table width="100%" cellspacing="0" border='0' cellpadding="4" style='border-top:0px solid #C5CED8;border-bottom:1px solid #C5CED8;'>
<tr height="26" class="b_bg">
<? if ($is_category) { ?>
<form name="fcategory" method="get">
<td width="70">
<select name=sca onchange="location='<?=$category_location?>'+this.value;">
<option value=''>전체</option><?=$category_option?></select>
</td></form>
<? } ?>
<? if ($is_checkbox) { ?><td width=20><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><?}?>
<td>
<? if($board[bo_1] == '2') { echo "<font color='#0066CC'>+ 2개이상의 이미지 or <font color='red'>화면보다 큰 이미지</font>를 보시려면 '제목글'을 클릭하세요</font>";} ?></td>
<td width='' align="right">
게시물 <?=number_format($total_count)?>건
<? if ($admin_href) { ?><a href="<?=$admin_href?>"><img src="<?=$board_skin_path?>/img/admin_button.gif" title="관리자" border="0" align="absmiddle"></a><? } ?>
</td>
</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td height="5" background='<?=$board_skin_path?>/img/head_bgline.gif'></td></tr>
<tr><td height=5></td></tr></table>
<? } ?>
<!-- //------------------------------------ 게시판 목록 끝 ----------------------// -->
<form name="fboardlist" method="post" style="margin:0px;">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw" value="">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<?
for ($i=1; $i<count($list); $i++) {
if ($i && $i%$mod==1)
echo "</tr><tr><td colspan='{$mod}' height=5></td></tr><tr>";
/* -- 이미지수 정정표시 해결 (97~108) --
첫번째 이미지 없거나 삭제시, 두번째 이미지가 있는데도 불구하고 '노이미지 나오는 문제'는 해결안됨 */
$img_cnt = array() ;
for ($k=0,$img_num=0; $k<$list[$i][file][count]; $k++) {
if($list[$i][file][$k][file]) { //break;
$img_cnt[$img_num]=$list[$i][file][$k][file] ;
$img_num ++;
}
}
$max_img_cnt = count($img_cnt);
$image = $img_cnt[0];
//$image = $list[$i][file][0][file]; -- 위의것으로 대체
$thumbnail_img = "<img src='$board_skin_path/img/no_image.jpg' border=0 width='$thu_width' title='이미지 없음' style='border:1px solid #cccccc'>";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb))
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
{
$size = @getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
continue;
$rate = $thu_width / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $thu_height)
$dst = imagecreatetruecolor($thu_width, $height);
else
$dst = imagecreatetruecolor($thu_width, $thu_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thu_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thu_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$thumbnail_img = "<img src='$thumb' width='$thu_width' border=0 style='border:1px solid #999999;'>";
/* ---------------------- 옵션 ----------------------------------- */
$title = "이미지크게보기";
$file_cnt = $list[$i][file][count]; // 게시물당 등록된 파일갯수
if($file_cnt >=2) {$fcolor='#FF0000';}else{$fcolor='#888888';} // 등록파일이 두개이상인경우, 글자색상
//$content = cut_str(get_text($list[$i][wr_content]), 80); // 내용보기시 글자수
//$subject = cut_str(get_text($list[$i][subject]), 20, '...'); // 제목글 글자수
$subject = $list[$i][subject];
//---- 이미지 새창보기 여부 설정
if($board[bo_3] == '1') { // 뷰화면에서 이미지보기
$view_img = "<a href='{$g4[bbs_path]}/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&page=$page'>";
$view_href = "<a class='bl' href='{$g4[bbs_path]}/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&page=$page'>";
}
if($board[bo_3] == '2') { // 리스트이미지:새창, 제목글:뷰화면
echo "<script language='javascript' src='{$board_skin_path}/image_window.js'></script>";
$view_img = "<a href=\"javascript:;\" OnClick=\"image_window2('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\">";
$view_href = "<a class='bl' href='{$g4[bbs_path]}/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&page=$page'>";
}
if($board[bo_3] == '3') { // 모두 새창으로 보기
echo "<script language='javascript' src='{$board_skin_path}/image_window.js'></script>";
$view_img = "<a href=\"javascript:;\" OnClick=\"image_window2('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\">";
$view_href = "<a class='bl' href=\"javascript:;\" OnClick=\"image_window2('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\">";
}
$checkbox = "";
if ($is_checkbox)
$checkbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";
$comment = " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:8pt;'>{$list[$i][comment_cnt]}</span></a>";
/* ---------------------- 옵션 ----------------------------------- */
$style = "";
if ($list[$i][icon_new])
$style = " style='font-weight:bold;' ";
$subject = "<span $style>".cut_str($list[$i][subject],20)."</span>";
$comment_cnt = "";
if ($list[$i][comment_cnt])
$comment_cnt = " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:8pt;color:#888888'>{$list[$i][comment_cnt]}</span></a>";
echo "<td width='{$td_width}%' align='center' valign=top style='word-break:break-all;'>\n";
/* ------ 이미지 정보출력 --- */
echo "<table border='0' cellpadding='1' cellspacing='0' style='border:0px solid #cccccc'>";
echo "<tr>";
echo "<td align=center width='{$board[bo_4]}' height='{$board[bo_5]}' style='width:{$board[bo_4]}px; height:{$board[bo_5]}px; border:1px solid #CCCCCC; padding:3px'><div style='width:{$board[bo_4]}px; height:{$board[bo_5]}px; position: relative; overflow:hidden;' align=center>
";
echo "{$view_img}";
echo $thumbnail_img;
echo "</a>";
echo "</td></tr>";
echo "<tr>";
echo "<td height=18 align='center'>";
echo "{$view_href}";
echo "{$subject}</a> {$checkbox}";
echo $comment_cnt;
echo "</td></tr>";
echo "<tr>";
echo "<td height=22 align='center' style='word-break:break-all;'><span style='font-family:돋움,돋움체,Tahoma; font-size:9pt;letter-spacing:-1px;'><font color='{$fcolor}'>이미지수 : {$max_img_cnt}</font> <font color='#888888'>조회 : {$list[$i][wr_hit]}</font></span></td></tr>";
echo "</table>";
/* ------ 이미지 정보출력 --- */
echo "</td>\n";
}
// 나머지 td
$cnt = $i%$mod;
if ($cnt)
for ($i=$cnt; $i<$mod; $i++)
echo "<td width='{$td_width}%'> </td>";
?>
</tr>
<? if (count($list) == 0) { echo "<tr><td colspan='$mod' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table>
</form>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" height=30 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);
?>
<?=$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>
<!-- 버튼 링크 -->
<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=100% cellpadding=0 cellspacing=0>
<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><? } ?>
<a href="<?=$g4['bbs_path']?>/write.php?bo_table=<?=$bo_table?>"><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">
<select name=sfl>
<option value='wr_subject||wr_content'>제목+내용</option>
<option value='wr_subject'>제목</option>
<option value='wr_content'>내용</option>
<option value='mb_id'>회원아이디</option>
<option value='wr_name'>이름</option>
</select><input name=stx maxlength=15 size=10 itemname="검색어" required value="<?=$stx?>"><select name=sop>
<option value=and>and</option>
<option value=or>or</option>
</select>
<input type=image src="<?=$board_skin_path?>/img/search_btn.gif" border=0 align=absmiddle></td>
</tr>
</table>
</form>
</td></tr></table>
<!-- 리스트에서 새창보기시에 사용 -->
<script language="javascript">
function image_window2(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=0,height=0,top=0,left=0");
imageHandle.document.write("<title><?=$title?></title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<meta http-equiv=\"imagetoolbar\" content=\"no\">");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+1,this.height+1);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\" oncontextmenu=\"return false\">");
}
</script>
<!-- 리스트 새창보기 -->
<script language="JavaScript">
// if ("<?=$sca?>") document.fcategory.sca.value = "<?=$sca?>";
if ("<?=$stx?>") {
document.fsearch.sfl.value = "<?=$sfl?>";
document.fsearch.sop.value = "<?=$sop?>";
}
</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=396, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->
그런데 큰 이미지를 누르면 본문으로 이동하게 해야 하는데 그게 잘 안되네요..
방법 아시는 분들 조언 부탁드립니다.
list.skin.php 입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 제목길이 잘 맞추세요.
$thu_width = '150'; //썸네일 폭
$thu_height = '110'; //썸네일 높이
$thu_quality = '100'; //썸네일 퀄리티_100 이하
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$mod = $board[bo_gallery_cols];
$td_width = (int)(100 / $mod);
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
$slideRes = sql_query("SELECT * FROM $write_table AS a LEFT JOIN g4_board_file AS b ON a.wr_id=b.wr_id WHERE b.bo_table='$bo_table' ORDER BY a.wr_id DESC LIMIT 1");
while($slideRow = mysql_fetch_array($slideRes)){
$slideTag .= "<img src='../data/file/".$bo_table."/".$slideRow[bf_file]."'>";
}
// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<!-- 갤러리스킨 스타일시트 지정 -->
<? include "_style_gallery_option.php"; ?>
<style type="text/css">
<!--
.bo_ti { font-family:Tahoma,굴림,굴림체; font-size:9pt; color:#555555; }
.data { font-family:Tahoma,굴림,굴림체; font-size:8pt; color:#999999; }
-->
</style>
<div id="main" align=center><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>&wr_id=<?=$row[wr_id]?>">
<?=$slideTag?></a></div>
<!-- 게시판 목록 시작 -->
<br>
<table width="<?=$width?>" align=center cellpadding=0 cellspacing=0><tr><td>
<!-- //--------------------------- 게시판목록 {관리자만 보기} -----------------// -->
<? if($is_admin == 'super') { ?>
<!-- 분류 셀렉트 박스, 게시물 몇건, 관리자화면 링크 -->
<table width="100%" cellspacing="0" border='0' cellpadding="4" style='border-top:0px solid #C5CED8;border-bottom:1px solid #C5CED8;'>
<tr height="26" class="b_bg">
<? if ($is_category) { ?>
<form name="fcategory" method="get">
<td width="70">
<select name=sca onchange="location='<?=$category_location?>'+this.value;">
<option value=''>전체</option><?=$category_option?></select>
</td></form>
<? } ?>
<? if ($is_checkbox) { ?><td width=20><INPUT onclick="if (this.checked) all_checked(true); else all_checked(false);" type=checkbox></td><?}?>
<td>
<? if($board[bo_1] == '2') { echo "<font color='#0066CC'>+ 2개이상의 이미지 or <font color='red'>화면보다 큰 이미지</font>를 보시려면 '제목글'을 클릭하세요</font>";} ?></td>
<td width='' align="right">
게시물 <?=number_format($total_count)?>건
<? if ($admin_href) { ?><a href="<?=$admin_href?>"><img src="<?=$board_skin_path?>/img/admin_button.gif" title="관리자" border="0" align="absmiddle"></a><? } ?>
</td>
</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td height="5" background='<?=$board_skin_path?>/img/head_bgline.gif'></td></tr>
<tr><td height=5></td></tr></table>
<? } ?>
<!-- //------------------------------------ 게시판 목록 끝 ----------------------// -->
<form name="fboardlist" method="post" style="margin:0px;">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw" value="">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<?
for ($i=1; $i<count($list); $i++) {
if ($i && $i%$mod==1)
echo "</tr><tr><td colspan='{$mod}' height=5></td></tr><tr>";
/* -- 이미지수 정정표시 해결 (97~108) --
첫번째 이미지 없거나 삭제시, 두번째 이미지가 있는데도 불구하고 '노이미지 나오는 문제'는 해결안됨 */
$img_cnt = array() ;
for ($k=0,$img_num=0; $k<$list[$i][file][count]; $k++) {
if($list[$i][file][$k][file]) { //break;
$img_cnt[$img_num]=$list[$i][file][$k][file] ;
$img_num ++;
}
}
$max_img_cnt = count($img_cnt);
$image = $img_cnt[0];
//$image = $list[$i][file][0][file]; -- 위의것으로 대체
$thumbnail_img = "<img src='$board_skin_path/img/no_image.jpg' border=0 width='$thu_width' title='이미지 없음' style='border:1px solid #cccccc'>";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb))
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
{
$size = @getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
continue;
$rate = $thu_width / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $thu_height)
$dst = imagecreatetruecolor($thu_width, $height);
else
$dst = imagecreatetruecolor($thu_width, $thu_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thu_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thu_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$thumbnail_img = "<img src='$thumb' width='$thu_width' border=0 style='border:1px solid #999999;'>";
/* ---------------------- 옵션 ----------------------------------- */
$title = "이미지크게보기";
$file_cnt = $list[$i][file][count]; // 게시물당 등록된 파일갯수
if($file_cnt >=2) {$fcolor='#FF0000';}else{$fcolor='#888888';} // 등록파일이 두개이상인경우, 글자색상
//$content = cut_str(get_text($list[$i][wr_content]), 80); // 내용보기시 글자수
//$subject = cut_str(get_text($list[$i][subject]), 20, '...'); // 제목글 글자수
$subject = $list[$i][subject];
//---- 이미지 새창보기 여부 설정
if($board[bo_3] == '1') { // 뷰화면에서 이미지보기
$view_img = "<a href='{$g4[bbs_path]}/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&page=$page'>";
$view_href = "<a class='bl' href='{$g4[bbs_path]}/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&page=$page'>";
}
if($board[bo_3] == '2') { // 리스트이미지:새창, 제목글:뷰화면
echo "<script language='javascript' src='{$board_skin_path}/image_window.js'></script>";
$view_img = "<a href=\"javascript:;\" OnClick=\"image_window2('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\">";
$view_href = "<a class='bl' href='{$g4[bbs_path]}/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}&page=$page'>";
}
if($board[bo_3] == '3') { // 모두 새창으로 보기
echo "<script language='javascript' src='{$board_skin_path}/image_window.js'></script>";
$view_img = "<a href=\"javascript:;\" OnClick=\"image_window2('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\">";
$view_href = "<a class='bl' href=\"javascript:;\" OnClick=\"image_window2('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\">";
}
$checkbox = "";
if ($is_checkbox)
$checkbox = "<input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'>";
$comment = " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:8pt;'>{$list[$i][comment_cnt]}</span></a>";
/* ---------------------- 옵션 ----------------------------------- */
$style = "";
if ($list[$i][icon_new])
$style = " style='font-weight:bold;' ";
$subject = "<span $style>".cut_str($list[$i][subject],20)."</span>";
$comment_cnt = "";
if ($list[$i][comment_cnt])
$comment_cnt = " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:8pt;color:#888888'>{$list[$i][comment_cnt]}</span></a>";
echo "<td width='{$td_width}%' align='center' valign=top style='word-break:break-all;'>\n";
/* ------ 이미지 정보출력 --- */
echo "<table border='0' cellpadding='1' cellspacing='0' style='border:0px solid #cccccc'>";
echo "<tr>";
echo "<td align=center width='{$board[bo_4]}' height='{$board[bo_5]}' style='width:{$board[bo_4]}px; height:{$board[bo_5]}px; border:1px solid #CCCCCC; padding:3px'><div style='width:{$board[bo_4]}px; height:{$board[bo_5]}px; position: relative; overflow:hidden;' align=center>
";
echo "{$view_img}";
echo $thumbnail_img;
echo "</a>";
echo "</td></tr>";
echo "<tr>";
echo "<td height=18 align='center'>";
echo "{$view_href}";
echo "{$subject}</a> {$checkbox}";
echo $comment_cnt;
echo "</td></tr>";
echo "<tr>";
echo "<td height=22 align='center' style='word-break:break-all;'><span style='font-family:돋움,돋움체,Tahoma; font-size:9pt;letter-spacing:-1px;'><font color='{$fcolor}'>이미지수 : {$max_img_cnt}</font> <font color='#888888'>조회 : {$list[$i][wr_hit]}</font></span></td></tr>";
echo "</table>";
/* ------ 이미지 정보출력 --- */
echo "</td>\n";
}
// 나머지 td
$cnt = $i%$mod;
if ($cnt)
for ($i=$cnt; $i<$mod; $i++)
echo "<td width='{$td_width}%'> </td>";
?>
</tr>
<? if (count($list) == 0) { echo "<tr><td colspan='$mod' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table>
</form>
<!-- 페이지 -->
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center" height=30 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);
?>
<?=$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>
<!-- 버튼 링크 -->
<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=100% cellpadding=0 cellspacing=0>
<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><? } ?>
<a href="<?=$g4['bbs_path']?>/write.php?bo_table=<?=$bo_table?>"><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">
<select name=sfl>
<option value='wr_subject||wr_content'>제목+내용</option>
<option value='wr_subject'>제목</option>
<option value='wr_content'>내용</option>
<option value='mb_id'>회원아이디</option>
<option value='wr_name'>이름</option>
</select><input name=stx maxlength=15 size=10 itemname="검색어" required value="<?=$stx?>"><select name=sop>
<option value=and>and</option>
<option value=or>or</option>
</select>
<input type=image src="<?=$board_skin_path?>/img/search_btn.gif" border=0 align=absmiddle></td>
</tr>
</table>
</form>
</td></tr></table>
<!-- 리스트에서 새창보기시에 사용 -->
<script language="javascript">
function image_window2(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=0,height=0,top=0,left=0");
imageHandle.document.write("<title><?=$title?></title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<meta http-equiv=\"imagetoolbar\" content=\"no\">");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+1,this.height+1);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\" oncontextmenu=\"return false\">");
}
</script>
<!-- 리스트 새창보기 -->
<script language="JavaScript">
// if ("<?=$sca?>") document.fcategory.sca.value = "<?=$sca?>";
if ("<?=$stx?>") {
document.fsearch.sfl.value = "<?=$sfl?>";
document.fsearch.sop.value = "<?=$sop?>";
}
</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=396, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<? } ?>
<!-- 게시판 목록 끝 -->
댓글 전체
<div id="main" align=center><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>&wr_id=<?=$row[wr_id]?>">
<?=$slideTag?></a></div>
이부분이 큰이미지 부분인가요?
$row -> $list 로 해보시는게 어떠신가요?
<?=$slideTag?></a></div>
이부분이 큰이미지 부분인가요?
$row -> $list 로 해보시는게 어떠신가요?
네 그렇게 해 보았지만 안됩니다.