최근게시물 가로로..... 정보
최근게시물 가로로.....본문
안녕하세요?
아래 최근게시물인데 가로로 1개만 나옵니다.
이것을 가로로 2개씩나오게 하려고 합니다.
어디를 수정해야 하는지 알려주시면 대단히 감사하겠습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 673; // 큰 이미지 가로사이즈
$img_height = 101; // 큰 이미지 세로사이즈
$img_quality = 90;
$imgSpeed = 3000; // 이미지 변환 속도
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_01';
$ym = date("ym", $g4[server_time]);
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
//코멘트와 리플글은 제외
$sql = " select * from $tmp_write_table
where wr_comment = '' and wr_reply = ''
order by wr_id DESC LIMIT 0, 1 ";
$result = sql_query($sql);
$last_con = sql_fetch_array($result);
?>
<style>
#button1 {
width:<?=$img_width;?>;
position: relative;
display: none;
}
#button2{
position: absolute; bottom: 7px; right: 7px;
}
</style>
<SCRIPT type=text/javascript>
<!--
old_debate_F='1';
function ComeonF(objid_F){
document.getElementById("debate_F"+old_debate_F).style.display="none";
document.getElementById("debate_F"+old_debate_F+"#1").style.display="";
document.getElementById("debate_F"+objid_F+"#1").style.display="none";
document.getElementById("debate_F"+objid_F).style.display="";
document.getElementById("debate_content_F"+old_debate_F).style.display="none";
document.getElementById("debate_content_F"+objid_F).style.display="";
old_debate_F=objid_F;
}
var objid_F = 1;
var interval_best;
function best_changeF() {
if( objid_F == <?=count($list);?>) // 오버랩되는 갯수, 데이타 읽어올 수 만큼
objid_F = 1;
else
objid_F++;
ComeonF(objid_F);
}
function setInterval_best() {
interval_best = setInterval("best_changeF()",<?=$imgSpeed;?>);//속도조절
}
function clearInterval_best() {
clearInterval(interval_best);
}
setInterval_best();
//-->
</SCRIPT>
<div style="width: 470px; overflow: hidden;">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin: 2px 0 3px 7px;">
<tr><td>
<? for ($i=0; $i<count($list); $i++) {
$j = $i + 1;
if ($j == "1") {
echo "<DIV>";
echo "<DIV id=debate_content_F$j onmouseover=clearInterval_best() onmouseout=setInterval_best()>"; }
else { echo "<DIV id=debate_content_F$j onmouseover=clearInterval_best() onmouseout=setInterval_best() style='DISPLAY: none;'>\n"; }
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td>
<?
//썸네일 생성
$thumfile = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
//$thumb = $thumb_path.'/'; // 썸네일 이미지 다시 생성하게 함
// 썸네일 이미지가 존재하지 않는다면
//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
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
} else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4/{$ym}/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp)) { // data/geditor------
$file = './' . $tmp[0]; // 파일명
$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
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
//}
if (file_exists($thumb))
$thumfile = "<img src='$thumb' width='{$img_width}' height='{$img_height}' border='0'></a>";
else
//이미지가 없으면
$thumfile="<img src='$latest_skin_path/img/noimg.gif' width='{$img_width}' height='{$img_height}' style='border:0 #E7E7E7 solid'></a>";
//이미지가 아니네
if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
{ $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }
if ($list[$i][wr_link1]) {
$hrefLink = $list[$i][wr_link1];
} else {
if ($list[$i][wr_link2]) {
$hrefLink = $list[$i][wr_link2] . "target=_blank";
}
}
?><a href='<?=$hrefLink;?>'><?=$thumfile?></a>
</td>
</tr>
</table>
<?
echo "</DIV>";
}
?>
<div id="button1">
<div id="button2" style='text-align:right;'>
<? for ($i=0; $i<count($list); $i++) {
$k = $i + 1;
?>
<a href="javascript:ComeonF('<?=$k?>');" onmouseover="ComeonF('<?=$k?>')"><img src="<?=$latest_skin_path?>/img/<?=$k?>_on.gif" border="0" id="debate_F<?=$k?>" onmouseover="clearInterval_best()" onmouseout="setInterval_best()" <? if($k == "1") { echo ""; } else { echo "style='DISPLAY: none;' "; } ?>><img src="<?=$latest_skin_path?>/img/<?=$k?>.gif" border="0" id="debate_F<?=$k?>#1" <? if($k == "1") { echo "style='DISPLAY: none;'"; } else { echo ""; } ?>>
<?}?></div>
</div>
</td>
</tr></table></div>
아래 최근게시물인데 가로로 1개만 나옵니다.
이것을 가로로 2개씩나오게 하려고 합니다.
어디를 수정해야 하는지 알려주시면 대단히 감사하겠습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 673; // 큰 이미지 가로사이즈
$img_height = 101; // 큰 이미지 세로사이즈
$img_quality = 90;
$imgSpeed = 3000; // 이미지 변환 속도
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_01';
$ym = date("ym", $g4[server_time]);
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
//코멘트와 리플글은 제외
$sql = " select * from $tmp_write_table
where wr_comment = '' and wr_reply = ''
order by wr_id DESC LIMIT 0, 1 ";
$result = sql_query($sql);
$last_con = sql_fetch_array($result);
?>
<style>
#button1 {
width:<?=$img_width;?>;
position: relative;
display: none;
}
#button2{
position: absolute; bottom: 7px; right: 7px;
}
</style>
<SCRIPT type=text/javascript>
<!--
old_debate_F='1';
function ComeonF(objid_F){
document.getElementById("debate_F"+old_debate_F).style.display="none";
document.getElementById("debate_F"+old_debate_F+"#1").style.display="";
document.getElementById("debate_F"+objid_F+"#1").style.display="none";
document.getElementById("debate_F"+objid_F).style.display="";
document.getElementById("debate_content_F"+old_debate_F).style.display="none";
document.getElementById("debate_content_F"+objid_F).style.display="";
old_debate_F=objid_F;
}
var objid_F = 1;
var interval_best;
function best_changeF() {
if( objid_F == <?=count($list);?>) // 오버랩되는 갯수, 데이타 읽어올 수 만큼
objid_F = 1;
else
objid_F++;
ComeonF(objid_F);
}
function setInterval_best() {
interval_best = setInterval("best_changeF()",<?=$imgSpeed;?>);//속도조절
}
function clearInterval_best() {
clearInterval(interval_best);
}
setInterval_best();
//-->
</SCRIPT>
<div style="width: 470px; overflow: hidden;">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin: 2px 0 3px 7px;">
<tr><td>
<? for ($i=0; $i<count($list); $i++) {
$j = $i + 1;
if ($j == "1") {
echo "<DIV>";
echo "<DIV id=debate_content_F$j onmouseover=clearInterval_best() onmouseout=setInterval_best()>"; }
else { echo "<DIV id=debate_content_F$j onmouseover=clearInterval_best() onmouseout=setInterval_best() style='DISPLAY: none;'>\n"; }
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td>
<?
//썸네일 생성
$thumfile = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
//$thumb = $thumb_path.'/'; // 썸네일 이미지 다시 생성하게 함
// 썸네일 이미지가 존재하지 않는다면
//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
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
} else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4/{$ym}/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp)) { // data/geditor------
$file = './' . $tmp[0]; // 파일명
$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
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
//}
if (file_exists($thumb))
$thumfile = "<img src='$thumb' width='{$img_width}' height='{$img_height}' border='0'></a>";
else
//이미지가 없으면
$thumfile="<img src='$latest_skin_path/img/noimg.gif' width='{$img_width}' height='{$img_height}' style='border:0 #E7E7E7 solid'></a>";
//이미지가 아니네
if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
{ $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }
if ($list[$i][wr_link1]) {
$hrefLink = $list[$i][wr_link1];
} else {
if ($list[$i][wr_link2]) {
$hrefLink = $list[$i][wr_link2] . "target=_blank";
}
}
?><a href='<?=$hrefLink;?>'><?=$thumfile?></a>
</td>
</tr>
</table>
<?
echo "</DIV>";
}
?>
<div id="button1">
<div id="button2" style='text-align:right;'>
<? for ($i=0; $i<count($list); $i++) {
$k = $i + 1;
?>
<a href="javascript:ComeonF('<?=$k?>');" onmouseover="ComeonF('<?=$k?>')"><img src="<?=$latest_skin_path?>/img/<?=$k?>_on.gif" border="0" id="debate_F<?=$k?>" onmouseover="clearInterval_best()" onmouseout="setInterval_best()" <? if($k == "1") { echo ""; } else { echo "style='DISPLAY: none;' "; } ?>><img src="<?=$latest_skin_path?>/img/<?=$k?>.gif" border="0" id="debate_F<?=$k?>#1" <? if($k == "1") { echo "style='DISPLAY: none;'"; } else { echo ""; } ?>>
<?}?></div>
</div>
</td>
</tr></table></div>
댓글 전체
가로로 1줄만 나온는데 2줄로 나오게 하고 싶다는 건가요?
이렇게 해보세요.
<div id="button1">
<div id="button2" style='text-align:right;'>
<? for ($i=0; $i<count($list); $i++) {
$k = $i + 1;
$cell_cnt = 5;
if ( ($i%$cell_cnt) == 0) echo "<br>";
?>
<a href="javascript:ComeonF('<?=$k?>');" onmouseover="ComeonF('<?=$k?>')"><img src="<?=$latest_skin_path?>/img/<?=$k?>_on.gif" border="0" id="debate_F<?=$k?>" onmouseover="clearInterval_best()" onmouseout="setInterval_best()" <? if($k == "1") { echo ""; } else { echo "style='DISPLAY: none;' "; } ?>><img src="<?=$latest_skin_path?>/img/<?=$k?>.gif" border="0" id="debate_F<?=$k?>#1" <? if($k == "1") { echo "style='DISPLAY: none;'"; } else { echo ""; } ?>>
<?}?>
</div>
</div>
</td>
</tr></table></div>
이렇게 해보세요.
<div id="button1">
<div id="button2" style='text-align:right;'>
<? for ($i=0; $i<count($list); $i++) {
$k = $i + 1;
$cell_cnt = 5;
if ( ($i%$cell_cnt) == 0) echo "<br>";
?>
<a href="javascript:ComeonF('<?=$k?>');" onmouseover="ComeonF('<?=$k?>')"><img src="<?=$latest_skin_path?>/img/<?=$k?>_on.gif" border="0" id="debate_F<?=$k?>" onmouseover="clearInterval_best()" onmouseout="setInterval_best()" <? if($k == "1") { echo ""; } else { echo "style='DISPLAY: none;' "; } ?>><img src="<?=$latest_skin_path?>/img/<?=$k?>.gif" border="0" id="debate_F<?=$k?>#1" <? if($k == "1") { echo "style='DISPLAY: none;'"; } else { echo ""; } ?>>
<?}?>
</div>
</div>
</td>
</tr></table></div>
답변주셔서 대단히 감사합니다.
죄송합니다...제가 소스를 잘못올렸습니다.
죄송합니다...제가 소스를 잘못올렸습니다.