최신글 갤러리 에서 이미지 목록을 [분류 내림차순] 으로 보이기 정보
최신글 갤러리 에서 이미지 목록을 [분류 내림차순] 으로 보이기본문
최신글 갤러리를 사용하다 보면 [입력순] 기본으로 이미지가 나옵니다.
일반 게시판의 경우는 게시판 관리자에서는 분류별 내림차순으로 정렬하면 됩니다.
최신글 갤러리에서 [입력순]이 아닌 [분류별 내림차순] - ca_name 으로 정렬하여
보이게 하는 방법을 알려주시면 고맙겠습니다.
아래는 사용하는 최신글 갤러리 소스 입니다.
또는 latest.lib.php 를 수정해서 사용해 하는지요?
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if(!$options) $options=4;
$cols = $options; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 12; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$thumb_path2 = $data_path.'/thumbnail';
?>
<link rel="stylesheet" href="<?=$latest_skin_path?>/style.css" type="text/css" />
<table width=100% border=0 align="center" cellpadding=0 cellspacing=0>
<tr>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_tl.gif" width="5" height="5"></td>
<td background="<?=$latest_skin_path?>/img/box01_top.gif"></td>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_tr.gif" width="5" height="5"></td>
</tr>
<tr>
<td background="<?=$latest_skin_path?>/img/box01_left.gif"></td>
<td valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" style="padding-bottom:20px"><table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<center><td><a href='http://bbs/board.php?bo_table=port3_3_9&cate_id=3020'> <img src="<?=$latest_skin_path?>/img/list.gif" width="980" border="0" align="center"></a></td></center>
</tr>
</table></td>
</tr>
<tr>
<td valign="top">
<table width=100% border=0 align="center" cellpadding=0 cellspacing=0>
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- 이미지보이는 부분 시작 -->
<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0">
<tr><td align='center'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height='2'></td></tr>
<tr>
<td align='center'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign='top'>
<?
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
$thumb2 = $thumb_path2. "/". $list[$i][file][0][file];
if ( file_exists($thumb) ) $img = $thumb;
if ( file_exists($thumb2) ) $img = $thumb2;
$style = "style='font-family:돋움; font-size:9pt; color:#686695;' ";
if ($list[$i][icon_new]) {
$style = "style='font-family:돋움; font-size:9pt; color:#134980;' "; }
$subject = "<span $style>".$list[$i][subject]."</span>"; //제목 글자수 자르기
$wr_hit = $list[$i]['wr_hit'];
$wr_id = $list[$i]['wr_id'];
$wr_link1 = $list[$i]['wr_link1'];
$wr_1 = $list[$i]['wr_1'];
$img_progress = "<img src=".$board_skin_path."/img/progress.gif>";
// if ($list[$i]['comment_cnt']) //코
// $cmt = "({$list[$i]['comment_cnt']})";
$bg = ""; //새글?
if ($list[$i][icon_new])
$bg="la_top_2.gif";
else
$bg="la_top_1.gif";
echo $list[$i][icon_reply] . " ";
echo "<table cellpadding='0' cellspacing='0' border='0'>";
//echo " <tr><td height='16' align='left'>.{$subject}</td></tr>";
echo " <tr><td background='{$latest_skin_path}/img/la_bg.gif' valign='top' align='center'>
<a href=$wr_link1 onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">
<img src='{$img}' width='230' border=0' style='border:1 solid #ff0099'>
</a></td></tr>";
//echo " <tr><td height='16' align='left'>{$subject}</td></tr>";
echo " <tr><td>";
echo " <table border='0' width='230' cellpadding='0' cellspacing='0'>";
echo " <tr>";
echo " <td width='100%' height='1'></td>";
echo " </tr>";
echo " <tr>";
//echo " <td width='100%' align='left'>신청중입니다. 사진을 클릭하세요. <font color='red'>{$wr_1}</font><font color='blue'></font></td>";
echo " </tr>";
echo " <tr>";
echo " <td width='100%' height='1'></td>";
echo " </tr>";
echo " <tr>";
//echo " <td width='100%' align='left'><img src='{$latest_skin_path}/img/graph.gif' width='{$wr_1}%' height='5'></td>";
echo " </tr>";
echo " <tr>";
echo " <td width='100%' height='1'></td>";
echo " </tr>";
echo " <tr>";
//echo " <td width='100%' align='left'><img src='{$latest_skin_path}/img/progress.gif' width=170></td>";
echo " </tr>";
echo " </table>";
echo " </td></tr>";
echo "</table>";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%> </td>";
}
?>
<? if ($i+1 < count($list)) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; } ?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
</table>
<!-- 이미지보이는 부분 끝 -->
</td>
</tr>
</table></td>
</tr>
</table></td>
<td background="<?=$latest_skin_path?>/img/box01_right.gif"></td>
</tr>
<tr>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_bl.gif" width="5" height="5"></td>
<td background="<?=$latest_skin_path?>/img/box01_bottom.gif"></td>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_br.gif" width="5" height="5"></td>
</tr>
</table>
일반 게시판의 경우는 게시판 관리자에서는 분류별 내림차순으로 정렬하면 됩니다.
최신글 갤러리에서 [입력순]이 아닌 [분류별 내림차순] - ca_name 으로 정렬하여
보이게 하는 방법을 알려주시면 고맙겠습니다.
아래는 사용하는 최신글 갤러리 소스 입니다.
또는 latest.lib.php 를 수정해서 사용해 하는지요?
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if(!$options) $options=4;
$cols = $options; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 12; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
$thumb_path2 = $data_path.'/thumbnail';
?>
<link rel="stylesheet" href="<?=$latest_skin_path?>/style.css" type="text/css" />
<table width=100% border=0 align="center" cellpadding=0 cellspacing=0>
<tr>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_tl.gif" width="5" height="5"></td>
<td background="<?=$latest_skin_path?>/img/box01_top.gif"></td>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_tr.gif" width="5" height="5"></td>
</tr>
<tr>
<td background="<?=$latest_skin_path?>/img/box01_left.gif"></td>
<td valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" style="padding-bottom:20px"><table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<center><td><a href='http://bbs/board.php?bo_table=port3_3_9&cate_id=3020'> <img src="<?=$latest_skin_path?>/img/list.gif" width="980" border="0" align="center"></a></td></center>
</tr>
</table></td>
</tr>
<tr>
<td valign="top">
<table width=100% border=0 align="center" cellpadding=0 cellspacing=0>
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- 이미지보이는 부분 시작 -->
<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0">
<tr><td align='center'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height='2'></td></tr>
<tr>
<td align='center'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign='top'>
<?
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
$thumb2 = $thumb_path2. "/". $list[$i][file][0][file];
if ( file_exists($thumb) ) $img = $thumb;
if ( file_exists($thumb2) ) $img = $thumb2;
$style = "style='font-family:돋움; font-size:9pt; color:#686695;' ";
if ($list[$i][icon_new]) {
$style = "style='font-family:돋움; font-size:9pt; color:#134980;' "; }
$subject = "<span $style>".$list[$i][subject]."</span>"; //제목 글자수 자르기
$wr_hit = $list[$i]['wr_hit'];
$wr_id = $list[$i]['wr_id'];
$wr_link1 = $list[$i]['wr_link1'];
$wr_1 = $list[$i]['wr_1'];
$img_progress = "<img src=".$board_skin_path."/img/progress.gif>";
// if ($list[$i]['comment_cnt']) //코
// $cmt = "({$list[$i]['comment_cnt']})";
$bg = ""; //새글?
if ($list[$i][icon_new])
$bg="la_top_2.gif";
else
$bg="la_top_1.gif";
echo $list[$i][icon_reply] . " ";
echo "<table cellpadding='0' cellspacing='0' border='0'>";
//echo " <tr><td height='16' align='left'>.{$subject}</td></tr>";
echo " <tr><td background='{$latest_skin_path}/img/la_bg.gif' valign='top' align='center'>
<a href=$wr_link1 onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\">
<img src='{$img}' width='230' border=0' style='border:1 solid #ff0099'>
</a></td></tr>";
//echo " <tr><td height='16' align='left'>{$subject}</td></tr>";
echo " <tr><td>";
echo " <table border='0' width='230' cellpadding='0' cellspacing='0'>";
echo " <tr>";
echo " <td width='100%' height='1'></td>";
echo " </tr>";
echo " <tr>";
//echo " <td width='100%' align='left'>신청중입니다. 사진을 클릭하세요. <font color='red'>{$wr_1}</font><font color='blue'></font></td>";
echo " </tr>";
echo " <tr>";
echo " <td width='100%' height='1'></td>";
echo " </tr>";
echo " <tr>";
//echo " <td width='100%' align='left'><img src='{$latest_skin_path}/img/graph.gif' width='{$wr_1}%' height='5'></td>";
echo " </tr>";
echo " <tr>";
echo " <td width='100%' height='1'></td>";
echo " </tr>";
echo " <tr>";
//echo " <td width='100%' align='left'><img src='{$latest_skin_path}/img/progress.gif' width=170></td>";
echo " </tr>";
echo " </table>";
echo " </td></tr>";
echo "</table>";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%> </td>";
}
?>
<? if ($i+1 < count($list)) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; } ?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
</table>
<!-- 이미지보이는 부분 끝 -->
</td>
</tr>
</table></td>
</tr>
</table></td>
<td background="<?=$latest_skin_path?>/img/box01_right.gif"></td>
</tr>
<tr>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_bl.gif" width="5" height="5"></td>
<td background="<?=$latest_skin_path?>/img/box01_bottom.gif"></td>
<td width="5" height="5"><img src="<?=$latest_skin_path?>/img/box01_br.gif" width="5" height="5"></td>
</tr>
</table>
댓글 전체
스킨보다는 최근게시물 출력 함수를 복사하셔서 수정하셔야될 문제입니다