최신글 노이미지게시물은 제외하는방법좀?
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_widthW = 182;
$img_widthG = 182;
$img_heightG = 158;
$img_quality = 100;
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
//$data_path = $g4[path]."/data/file/$bo_table";
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$cols=5; // 이미지 가로갯수
?>
<style>
/* ####썸네일 리스트 ####*/
.mainline { width:999px; border:0px #ddd solid; }
ul#thumbs, ul#thumbs li{margin:0;padding:0;list-style:none;}
ul#thumbs li{text-align:center; width:182px;}
ul#thumbs a{display:block;width:182px;height:158px; line-height:100px;overflow:hidden;position:relative;z-index:1;}
ul#thumbs a img{position:absolute;}
/*마우스 오버*/
ul#thumbs a:hover{overflow:visible;z-index:1000;border:none;}
ul#thumbs a:hover img{border:0px solid #999;background:#fff;}
/* float 해제 */
ul#thumbs:after, li#thumbs:after{content:"."; display:block; height:0; clear:both; visibility:hidden;}
ul#thumbs, li#thumbs{display:block;}/* \*/
ul#thumbs, li#thumbs{min-height:1%;}
* html ul#thumbs, * html li#thumbs{height:1%;}
/* ####썸네일 리스트 ####*/
</style>
<? include_once("$g4[path]/lib/thumb.lib.php")?>
<div align=center>
<div class="project-content1"><!-- 갤러리 위젯 -->
<!-- 게시물 리스트 시작 -->
<table width="" border="0" cellspacing="0" cellpadding="0" align=center>
<? for ($i=0; $i<count($list); $i++) { ?>
<? if($i % $cols == 0 || $i==0){?>
<? } ?>
<td align=center valign=top>
<div class="left showcase">
<div style="overflow:hidden;"><div style="*zoom:1;padding:0px 0px 0px 0px !important; padding:none !important;"><div class="widgetContainer">
<ul class="project-view cfix"> <li class="pv-item sulli1">
<div class="pv-cover css3pie" style="width:182px;">
<div class="cover-img" style="width:182px; height:158px">
<table width="<?=$img_widthW?>" border="0" cellspacing="0" cellpadding="0" align=center>
<tr><td align=center>
<ul id="">
<li>
<?
$image = $list[$i][file][0][file]; //원본.$image, $img_widthG, $img_heightG, 0, 1
//$img=thumbnail($data_path. "/".$image, $img_widthG, $img_heightG, 0, 1); //썸네일이 없을경우 원본출력
$img = "$g4[path]/data/file/$bo_table/thumb/{$list[$i][wr_id]}";
if (!@file_exists($img)) $img = "$g4[path]/data/file/$bo_table/thumbnail/{$list[$i][wr_id]}";
if (!@file_exists($img)) $img = "{$list[$i][file][0][path]}/{$list[$i][file][0][file]}";
if (!@file_exists($img)) $img = "$latest_skin_path/img/noimage.gif";
if (!$list[$i][wr_id]) $img = "$latest_skin_path/img/noimage.gif";
if (@is_dir($img)) $img = "$latest_skin_path/img/noimage.gif";
echo "<a href='{$list[$i][wr_link1]}'><img src='{$img}' class='cover-img-el' style='width:182px; height:158px; border:0px #000 solid;'></a>";
?>
</li>
</ul>
</td></tr></table>
</div><!-- .cover-img -->
<div class="cover-info">
<div class="cover-name">
<a href="<?=$list[$i][wr_link1]?>" class="cover-name-link"><?=cut_str(strip_tags($list[$i][wr_content]), 70);?> <?=$list[$i][icon_new]?></a>
</div>
<div class="cover-by-wrap">
<div class="cover-by">by </div>
<div class="cover-by-link"><div class="single-owner">
<a class="cover-link" href="" title="testya"><?=$list[$i][name]?></a> </div></div>
</div><!-- .cover-by-wrap -->
<div class="cover-fields">
<a href="<?=$list[$i][wr_link1]?>" title="<?=$board[bo_subject]?>"><?=cut_str(strip_tags($list[$i][subject]), 20)?></a> ,
<a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$board[bo_table]?>" title="Girls Generation"><?=$board[bo_subject]?></a>
</div><!-- .cover-fields -->
</div>
<div class="cover-stat-wrap css3pie">
<span class="cover-stat">
<span class="stat-up"></span>
<span class="stat-value"><?//=$list[$i][wr_link1_hit]?><?=$list[$i][wr_hit]?></span>
</span>
<span class="cover-stat">
<span class="stat-view"></span>
<span class="stat-value">
<?
$sWriteTime = strtotime($list[$i][wr_datetime]);
$sNowTime = time();
$sTimeGap = $sNowTime - $sWriteTime;
$sWriteTime = "";
if($sTimeGap < 60*60)
$sWriteTime = round($sTimeGap/60)."분전";
else if($sTimeGap < 60*60*24)
$sWriteTime = floor($sTimeGap/(60*60))."시간 전";
else
$sWriteTime = floor($sTimeGap/(60*60*24))."일 전";
echo $sWriteTime;
?></span>
<?//=$list[$i][datetime2]?></span>
</span>
<div class="featured">
<span class="be-font-inline"></span>
</div> <!-- .featured -->
</div>
</div><!-- .pv-cover --> </li><!-- .pv-item -->
</ul> </div>
</div></div>
</div>
</td>
<?
if($i%$cols == ($cols-1)&& $i>0){ echo "</tr>";}
?>
<? }
if($i % $cols != ($cols-1) ){
echo "</tr>";
}
?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table>
</div><!-- .project-content --></div>
이소스로 사용하고 싶은데 답변좀 부탁드리겠습니다.
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_widthW = 182;
$img_widthG = 182;
$img_heightG = 158;
$img_quality = 100;
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
//$data_path = $g4[path]."/data/file/$bo_table";
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$cols=5; // 이미지 가로갯수
?>
<style>
/* ####썸네일 리스트 ####*/
.mainline { width:999px; border:0px #ddd solid; }
ul#thumbs, ul#thumbs li{margin:0;padding:0;list-style:none;}
ul#thumbs li{text-align:center; width:182px;}
ul#thumbs a{display:block;width:182px;height:158px; line-height:100px;overflow:hidden;position:relative;z-index:1;}
ul#thumbs a img{position:absolute;}
/*마우스 오버*/
ul#thumbs a:hover{overflow:visible;z-index:1000;border:none;}
ul#thumbs a:hover img{border:0px solid #999;background:#fff;}
/* float 해제 */
ul#thumbs:after, li#thumbs:after{content:"."; display:block; height:0; clear:both; visibility:hidden;}
ul#thumbs, li#thumbs{display:block;}/* \*/
ul#thumbs, li#thumbs{min-height:1%;}
* html ul#thumbs, * html li#thumbs{height:1%;}
/* ####썸네일 리스트 ####*/
</style>
<? include_once("$g4[path]/lib/thumb.lib.php")?>
<div align=center>
<div class="project-content1"><!-- 갤러리 위젯 -->
<!-- 게시물 리스트 시작 -->
<table width="" border="0" cellspacing="0" cellpadding="0" align=center>
<? for ($i=0; $i<count($list); $i++) { ?>
<? if($i % $cols == 0 || $i==0){?>
<? } ?>
<td align=center valign=top>
<div class="left showcase">
<div style="overflow:hidden;"><div style="*zoom:1;padding:0px 0px 0px 0px !important; padding:none !important;"><div class="widgetContainer">
<ul class="project-view cfix"> <li class="pv-item sulli1">
<div class="pv-cover css3pie" style="width:182px;">
<div class="cover-img" style="width:182px; height:158px">
<table width="<?=$img_widthW?>" border="0" cellspacing="0" cellpadding="0" align=center>
<tr><td align=center>
<ul id="">
<li>
<?
$image = $list[$i][file][0][file]; //원본.$image, $img_widthG, $img_heightG, 0, 1
//$img=thumbnail($data_path. "/".$image, $img_widthG, $img_heightG, 0, 1); //썸네일이 없을경우 원본출력
$img = "$g4[path]/data/file/$bo_table/thumb/{$list[$i][wr_id]}";
if (!@file_exists($img)) $img = "$g4[path]/data/file/$bo_table/thumbnail/{$list[$i][wr_id]}";
if (!@file_exists($img)) $img = "{$list[$i][file][0][path]}/{$list[$i][file][0][file]}";
if (!@file_exists($img)) $img = "$latest_skin_path/img/noimage.gif";
if (!$list[$i][wr_id]) $img = "$latest_skin_path/img/noimage.gif";
if (@is_dir($img)) $img = "$latest_skin_path/img/noimage.gif";
echo "<a href='{$list[$i][wr_link1]}'><img src='{$img}' class='cover-img-el' style='width:182px; height:158px; border:0px #000 solid;'></a>";
?>
</li>
</ul>
</td></tr></table>
</div><!-- .cover-img -->
<div class="cover-info">
<div class="cover-name">
<a href="<?=$list[$i][wr_link1]?>" class="cover-name-link"><?=cut_str(strip_tags($list[$i][wr_content]), 70);?> <?=$list[$i][icon_new]?></a>
</div>
<div class="cover-by-wrap">
<div class="cover-by">by </div>
<div class="cover-by-link"><div class="single-owner">
<a class="cover-link" href="" title="testya"><?=$list[$i][name]?></a> </div></div>
</div><!-- .cover-by-wrap -->
<div class="cover-fields">
<a href="<?=$list[$i][wr_link1]?>" title="<?=$board[bo_subject]?>"><?=cut_str(strip_tags($list[$i][subject]), 20)?></a> ,
<a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$board[bo_table]?>" title="Girls Generation"><?=$board[bo_subject]?></a>
</div><!-- .cover-fields -->
</div>
<div class="cover-stat-wrap css3pie">
<span class="cover-stat">
<span class="stat-up"></span>
<span class="stat-value"><?//=$list[$i][wr_link1_hit]?><?=$list[$i][wr_hit]?></span>
</span>
<span class="cover-stat">
<span class="stat-view"></span>
<span class="stat-value">
<?
$sWriteTime = strtotime($list[$i][wr_datetime]);
$sNowTime = time();
$sTimeGap = $sNowTime - $sWriteTime;
$sWriteTime = "";
if($sTimeGap < 60*60)
$sWriteTime = round($sTimeGap/60)."분전";
else if($sTimeGap < 60*60*24)
$sWriteTime = floor($sTimeGap/(60*60))."시간 전";
else
$sWriteTime = floor($sTimeGap/(60*60*24))."일 전";
echo $sWriteTime;
?></span>
<?//=$list[$i][datetime2]?></span>
</span>
<div class="featured">
<span class="be-font-inline"></span>
</div> <!-- .featured -->
</div>
</div><!-- .pv-cover --> </li><!-- .pv-item -->
</ul> </div>
</div></div>
</div>
</td>
<?
if($i%$cols == ($cols-1)&& $i>0){ echo "</tr>";}
?>
<? }
if($i % $cols != ($cols-1) ){
echo "</tr>";
}
?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table>
</div><!-- .project-content --></div>
이소스로 사용하고 싶은데 답변좀 부탁드리겠습니다.
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 3개
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_widthW = 182;
$img_widthG = 182;
$img_heightG = 158;
$img_quality = 100;
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
//$data_path = $g4[path]."/data/file/$bo_table";
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$cols=5; // 이미지 가로갯수
?>
<style>
/* ####썸네일 리스트 ####*/
.mainline { width:999px; border:0px #ddd solid; }
ul#thumbs, ul#thumbs li{margin:0;padding:0;list-style:none;}
ul#thumbs li{text-align:center; width:182px;}
ul#thumbs a{display:block;width:182px;height:158px; line-height:100px;overflow:hidden;position:relative;z-index:1;}
ul#thumbs a img{position:absolute;}
/*마우스 오버*/
ul#thumbs a:hover{overflow:visible;z-index:1000;border:none;}
ul#thumbs a:hover img{border:0px solid #999;background:#fff;}
/* float 해제 */
ul#thumbs:after, li#thumbs:after{content:"."; display:block; height:0; clear:both; visibility:hidden;}
ul#thumbs, li#thumbs{display:block;}/* \*/
ul#thumbs, li#thumbs{min-height:1%;}
* html ul#thumbs, * html li#thumbs{height:1%;}
/* ####썸네일 리스트 ####*/
</style>
<? include_once("$g4[path]/lib/thumb.lib.php")?>
<div align=center>
<div class="project-content1"><!-- 갤러리 위젯 -->
<!-- 게시물 리스트 시작 -->
<table width="" border="0" cellspacing="0" cellpadding="0" align=center>
<?
//카운터 변경
for ($i=0 , $k=0; $i<count($list); $k++)
{
//----------------------------
//위치이동
$image = $list[$i][file][0][file]; //원본.$image, $img_widthG, $img_heightG, 0, 1
//$img=thumbnail($data_path. "/".$image, $img_widthG, $img_heightG, 0, 1); //썸네일이 없을경우 원본출력
$img = "$g4[path]/data/file/$bo_table/thumb/{$list[$i][wr_id]}";
if (!@file_exists($img)) $img = "$g4[path]/data/file/$bo_table/thumbnail/{$list[$i][wr_id]}";
if (!@file_exists($img)) $img = "{$list[$i][file][0][path]}/{$list[$i][file][0][file]}";
if (!@file_exists($img)) $img = "$latest_skin_path/img/noimage.gif";
if (!$list[$i][wr_id]) $img = "$latest_skin_path/img/noimage.gif";
if (@is_dir($img)) $img = "$latest_skin_path/img/noimage.gif";
if($img=="$latest_skin_path/img/noimage.gif"){
continue;
}
//---------------------------------
?>
<? if($i % $cols == 0 || $i==0){?>
<? } ?>
<td align=center valign=top>
<div class="left showcase">
<div style="overflow:hidden;"><div style="*zoom:1;padding:0px 0px 0px 0px !important; padding:none !important;"><div class="widgetContainer">
<ul class="project-view cfix"> <li class="pv-item sulli1">
<div class="pv-cover css3pie" style="width:182px;">
<div class="cover-img" style="width:182px; height:158px">
<table width="<?=$img_widthW?>" border="0" cellspacing="0" cellpadding="0" align=center>
<tr><td align=center>
<ul id="">
<li>
<?
echo "<a href='{$list[$i][wr_link1]}'><img src='{$img}' class='cover-img-el' style='width:182px; height:158px; border:0px #000 solid;'></a>";
?>
</li>
</ul>
</td></tr></table>
</div><!-- .cover-img -->
<div class="cover-info">
<div class="cover-name">
<a href="<?=$list[$i][wr_link1]?>" class="cover-name-link"><?=cut_str(strip_tags($list[$i][wr_content]), 70);?> <?=$list[$i][icon_new]?></a>
</div>
<div class="cover-by-wrap">
<div class="cover-by">by </div>
<div class="cover-by-link"><div class="single-owner">
<a class="cover-link" href="" title="testya"><?=$list[$i][name]?></a> </div></div>
</div><!-- .cover-by-wrap -->
<div class="cover-fields">
<a href="<?=$list[$i][wr_link1]?>" title="<?=$board[bo_subject]?>"><?=cut_str(strip_tags($list[$i][subject]), 20)?></a> ,
<a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$board[bo_table]?>" title="Girls Generation"><?=$board[bo_subject]?></a>
</div><!-- .cover-fields -->
</div>
<div class="cover-stat-wrap css3pie">
<span class="cover-stat">
<span class="stat-up"></span>
<span class="stat-value"><?//=$list[$i][wr_link1_hit]?><?=$list[$i][wr_hit]?></span>
</span>
<span class="cover-stat">
<span class="stat-view"></span>
<span class="stat-value">
<?
$sWriteTime = strtotime($list[$i][wr_datetime]);
$sNowTime = time();
$sTimeGap = $sNowTime - $sWriteTime;
$sWriteTime = "";
if($sTimeGap < 60*60)
$sWriteTime = round($sTimeGap/60)."분전";
else if($sTimeGap < 60*60*24)
$sWriteTime = floor($sTimeGap/(60*60))."시간 전";
else
$sWriteTime = floor($sTimeGap/(60*60*24))."일 전";
echo $sWriteTime;
?></span>
<?//=$list[$i][datetime2]?></span>
</span>
<div class="featured">
<span class="be-font-inline"></span>
</div> <!-- .featured -->
</div>
</div><!-- .pv-cover --> </li><!-- .pv-item -->
</ul> </div>
</div></div>
</div>
</td>
<?
if($i%$cols == ($cols-1)&& $i>0){ echo "</tr>";}
?>
<?
$i++;//실제 카운터 변경
}
if($i % $cols != ($cols-1) ){
echo "</tr>";
}
?>
<? if (count($list) == 0) { echo "<tr><td height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table>
</div><!-- .project-content --></div>
latest.lib.php 에서 만약 5개 정도 나타나는 것이면 10개 정도 검색후 필터링 하시는것이 좋을듯 합니다