소스좀 봐 주세요 정보
소스좀 봐 주세요본문
최근켈러리스킨 자료실에 적용하기 좋은것이 있어 적용 했는데
작은이미지가 한줄에 3개까지 나오고 그 이상은 아래로 두줄로 나오는데
한줄로 8개까지 나오게 하고 싶은데 어디를 수정해야 할지 ...
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 900; //큰 썸네일 가로
$img_height = 400; //큰 썸네일 세로
$img_quality = 100; //썸네일 퀄리티
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_ch05';
$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);
?>
<SCRIPT type=text/javascript>
<!--
old_debate_P='1';
function ComeonP(objid_P){
document.getElementById("debate_P"+old_debate_P).style.display="none";
document.getElementById("debate_P"+old_debate_P+"#1").style.display="";
document.getElementById("debate_P"+objid_P+"#1").style.display="none";
document.getElementById("debate_P"+objid_P).style.display="";
document.getElementById("debate_content_P"+old_debate_P).style.display="none";
document.getElementById("debate_content_P"+objid_P).style.display="";
old_debate_P=objid_P;
}
var objid_P = 1;
var interval_best;
function best_changeP()
{
if( objid_P == <?=count($list)?> ) // 오버랩되는 갯수
objid_P = 1;
else
objid_P++;
ComeonP(objid_P);
}
function setInterval_best()
{
interval_best = setInterval("best_changeP()",3000);//속도조절
}
function clearInterval_best()
{
clearInterval(interval_best);
}
setInterval_best();
//-->
</SCRIPT>
<style type="text/css">
ul, li { list-style:none; margin:0; padding:0;}
#ifocusP { width:900px; height:400px; margin:0px; border:0px }
#ifocusP_img { display:inline; position:relative; float:left; width:900px; height:400px; border:0px; overflow:hidden; }
#ifocusP_imglist { position:absolute; }
#ifocusP_imglist li { width:900px; height:400px; overflow:hidden; }
#ifocusP_imglist img { width:900px; height:400px;}
#ifocusP_ico { display:inline; float:center; width:1px;}
#ifocusP_ico li { width:10px; height:46px; cursor:pointer; opacity:0.5; -moz-opacity:0.5; filter:alpha(opacity=40); }
#ifocusP_ico img { width:900px; height:400px; }
#ifocusP_ico .current { background: url('<?=$latest_skin_path?>/image/ifocus_ico_bg.gif') no-repeat; opacity:1; -moz-opacity:1; filter:alpha(opacity=40); }
#ifocusP_subjbar { position:absolute; left:0; bottom:0; width:294px; height:46px; background:#000; opacity:0.4; -moz-opacity:0.5; filter:alpha(opacity=40); }
#ifocusP_subject { position:absolute; left:8px; bottom:5px; color:#FFFFFF;}
#ifocusP_subject .normal { display:none; }
.date {font-family:Tahoma; font-size:9px; color:#e3c191; padding-bottom:3px;}
</style>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td>
<? for ($i=0; $i<count($list); $i++) {
$j = $i + 1;
if ($j == "1") {
echo "<DIV>";
echo "<DIV id=debate_content_P$j onmouseover=clearInterval_best() onmouseout=setInterval_best()>"; }
else { echo "<DIV id=debate_content_P$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];
// 썸네일 이미지가 존재하지 않는다면
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 if ($size[5] == 4)
// $src = imagecreatefromjpeg($file);
// else if ($size[5] == 5)
// $src = imagecreatefrompng($file);
// else if ($size[5] == 6)
// $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' style='border:0px #ccc solid'></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>"; }
?>
<div id="ifocusP">
<div id="ifocusP_img">
<div id="ifocusP_imglist">
<div id="ifocusP_subjbar"></div>
<div id="ifocusP_subject">
<?//=$list[$i]['subject']?><br>
<span class='date'>
<?//=$list[$i]['datetime']?><!-- By.--><?//=$list[$i]['wr_name']?></span>
</div>
<div id="ifocusP_ico">
<a href='<?=$list[$i][href]?>'><?=$thumfile?></a>
</div></div></div></div>
</td>
</tr>
</table>
<?
echo "</DIV>";
}
?>
</table>
<div style="width:294px;padding:2px 0 0 0;">
<? for ($i=0; $i<count($list); $i++) {
$k = $i + 1;
$img_width_s = 96; //작은 썸네일 가로
$img_height_s = 43; //작은 썸네일 세로
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
?>
<a href="<?=$list[$i][href]?>" onmouseover="javascript:ComeonP('<?=$k?>')"><img src="<?=$file?>" width="<?=$img_width_s?>" height="<?=$img_height_s?>" hspace="0" id="debate_P<?=$k?>" onmouseover="clearInterval_best()" onmouseout="setInterval_best()" <? if($k == "1") { echo "style='border:1px solid #CC0000;' ";} else { echo "style='DISPLAY: none; border:1px solid #CC0000;' ";} ?>><img src="<?=$file?>" width="<?=$img_width_s?>" height="<?=$img_height_s?>" hspace="0" border="0" id="debate_P<?=$k?>#1" <? if($k == "1") { echo "style='DISPLAY: none; border:1px solid #FFFFFF;'"; } else { echo "style='border:1px solid #FFFFFF;'";} ?>></a><? } ?>
</div>
</td>
</tr></table>
작은이미지가 한줄에 3개까지 나오고 그 이상은 아래로 두줄로 나오는데
한줄로 8개까지 나오게 하고 싶은데 어디를 수정해야 할지 ...
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 900; //큰 썸네일 가로
$img_height = 400; //큰 썸네일 세로
$img_quality = 100; //썸네일 퀄리티
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_ch05';
$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);
?>
<SCRIPT type=text/javascript>
<!--
old_debate_P='1';
function ComeonP(objid_P){
document.getElementById("debate_P"+old_debate_P).style.display="none";
document.getElementById("debate_P"+old_debate_P+"#1").style.display="";
document.getElementById("debate_P"+objid_P+"#1").style.display="none";
document.getElementById("debate_P"+objid_P).style.display="";
document.getElementById("debate_content_P"+old_debate_P).style.display="none";
document.getElementById("debate_content_P"+objid_P).style.display="";
old_debate_P=objid_P;
}
var objid_P = 1;
var interval_best;
function best_changeP()
{
if( objid_P == <?=count($list)?> ) // 오버랩되는 갯수
objid_P = 1;
else
objid_P++;
ComeonP(objid_P);
}
function setInterval_best()
{
interval_best = setInterval("best_changeP()",3000);//속도조절
}
function clearInterval_best()
{
clearInterval(interval_best);
}
setInterval_best();
//-->
</SCRIPT>
<style type="text/css">
ul, li { list-style:none; margin:0; padding:0;}
#ifocusP { width:900px; height:400px; margin:0px; border:0px }
#ifocusP_img { display:inline; position:relative; float:left; width:900px; height:400px; border:0px; overflow:hidden; }
#ifocusP_imglist { position:absolute; }
#ifocusP_imglist li { width:900px; height:400px; overflow:hidden; }
#ifocusP_imglist img { width:900px; height:400px;}
#ifocusP_ico { display:inline; float:center; width:1px;}
#ifocusP_ico li { width:10px; height:46px; cursor:pointer; opacity:0.5; -moz-opacity:0.5; filter:alpha(opacity=40); }
#ifocusP_ico img { width:900px; height:400px; }
#ifocusP_ico .current { background: url('<?=$latest_skin_path?>/image/ifocus_ico_bg.gif') no-repeat; opacity:1; -moz-opacity:1; filter:alpha(opacity=40); }
#ifocusP_subjbar { position:absolute; left:0; bottom:0; width:294px; height:46px; background:#000; opacity:0.4; -moz-opacity:0.5; filter:alpha(opacity=40); }
#ifocusP_subject { position:absolute; left:8px; bottom:5px; color:#FFFFFF;}
#ifocusP_subject .normal { display:none; }
.date {font-family:Tahoma; font-size:9px; color:#e3c191; padding-bottom:3px;}
</style>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td>
<? for ($i=0; $i<count($list); $i++) {
$j = $i + 1;
if ($j == "1") {
echo "<DIV>";
echo "<DIV id=debate_content_P$j onmouseover=clearInterval_best() onmouseout=setInterval_best()>"; }
else { echo "<DIV id=debate_content_P$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];
// 썸네일 이미지가 존재하지 않는다면
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 if ($size[5] == 4)
// $src = imagecreatefromjpeg($file);
// else if ($size[5] == 5)
// $src = imagecreatefrompng($file);
// else if ($size[5] == 6)
// $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' style='border:0px #ccc solid'></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>"; }
?>
<div id="ifocusP">
<div id="ifocusP_img">
<div id="ifocusP_imglist">
<div id="ifocusP_subjbar"></div>
<div id="ifocusP_subject">
<?//=$list[$i]['subject']?><br>
<span class='date'>
<?//=$list[$i]['datetime']?><!-- By.--><?//=$list[$i]['wr_name']?></span>
</div>
<div id="ifocusP_ico">
<a href='<?=$list[$i][href]?>'><?=$thumfile?></a>
</div></div></div></div>
</td>
</tr>
</table>
<?
echo "</DIV>";
}
?>
</table>
<div style="width:294px;padding:2px 0 0 0;">
<? for ($i=0; $i<count($list); $i++) {
$k = $i + 1;
$img_width_s = 96; //작은 썸네일 가로
$img_height_s = 43; //작은 썸네일 세로
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
?>
<a href="<?=$list[$i][href]?>" onmouseover="javascript:ComeonP('<?=$k?>')"><img src="<?=$file?>" width="<?=$img_width_s?>" height="<?=$img_height_s?>" hspace="0" id="debate_P<?=$k?>" onmouseover="clearInterval_best()" onmouseout="setInterval_best()" <? if($k == "1") { echo "style='border:1px solid #CC0000;' ";} else { echo "style='DISPLAY: none; border:1px solid #CC0000;' ";} ?>><img src="<?=$file?>" width="<?=$img_width_s?>" height="<?=$img_height_s?>" hspace="0" border="0" id="debate_P<?=$k?>#1" <? if($k == "1") { echo "style='DISPLAY: none; border:1px solid #FFFFFF;'"; } else { echo "style='border:1px solid #FFFFFF;'";} ?>></a><? } ?>
</div>
</td>
</tr></table>
댓글 전체
테스트 해봐야알겠지만 이 부분을 수정해보세요
width:294px --> 800정도?? 여러번 변경해가며 테스트 해보면 될 것 같군요
<div style="width:294px;padding:2px 0 0 0;">
width:294px --> 800정도?? 여러번 변경해가며 테스트 해보면 될 것 같군요
<div style="width:294px;padding:2px 0 0 0;">