그룹최신글인데.. 조회순으로 뽑고자 할때 어디를 수정해야 할지요? 정보
그룹최신글인데.. 조회순으로 뽑고자 할때 어디를 수정해야 할지요?본문
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$gr = get_group($gr_id);
$img_width = '95'; //썸네일 가로길이
$img_height = '70'; //썸네일 세로길이
$img_quality = '9'; //퀼리티 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);
?>
<table align="center" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="3" background="<?=$latest_skin_path?>/img/latest_t_1.gif"></td>
<td background="<?=$latest_skin_path?>/img/latest_t_bg.gif">
<!--타이틀 시작: 실선 색상을 바꾸려면 215, 215, 215를 고치세요.-->
<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0">
<tr height="30">
<td width="10"></td>
<td><a href='<?=$g4[bbs_path]?>/group.php?gr_id=<?=$gr_id?>'><font color="#57697c" ><b>[<?=$gr[gr_subject]?>] 전체 최신글</b></font></a></td>
<td width="40"><a href='<?=$g4[bbs_path]?>/group.php?gr_id=<?=$gr_id?>'><img src="<?=$latest_skin_path?>/img/more.gif" border="0"></a>
<td width="5"></td>
</tr>
</table>
<!--타이틀 끝-->
</td>
<td width="3" background="<?=$latest_skin_path?>/img/latest_t_2.gif"></td>
</tr>
<tr height="1"><td width="3" background="<?=$latest_skin_path?>/img/latest_m_1.gif"></td><td></td><td width="3" background="<?=$latest_skin_path?>/img/latest_m_2.gif"></td>
<tr>
<td width="3" background="<?=$latest_skin_path?>/img/latest_m_1.gif"></td>
<td>
<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<!--게시물 아래 점선 색상을 바꾸고 싶으시면 211,211,211부분을, 게시물 추출부분 세로 길이를 늘리시려면 25을 수정하세요-->
<td width="20%" height="25" valign=middle style="PADDING-LEFT: 2px; PADDING-BOTTOM: 0px; PADDING-TOP: 2px" style="border-bottom-width:0px; border-bottom-color:rgb(211,211,211); border-bottom-style:dotted;">
<?
// 게시물이 없으면 이미지 영역없음[2008-03-29]
if( count($list) ) {
$thumb = $thumb_path.'/'.$list[0][wr_id];
if (!file_exists($thumb)) {
$file = $list[0][file][0][path] .'/'. $list[0][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]);
imagepng($dst, $thumb_path.'/'.$list[0][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[0][wr_id], 0606);
}
}
if (file_exists($thumb)) $img_path = $thumb;
else {
// 최근게시물 본문 중 이미지태그를 검색하여 그 중 한개만 특정 사이즈로 크롭하여 보여준다.
// 뉴스웹진 스타일 [2008-03-28]
$data = $list[0]['wr_content'] ;
// 이미지 주소 찾기
preg_match('/img.*?src=(.*?) /i', $data, $url_img);
$img_path = $url_img[1]; // 그림 주소
$del_str_arr = array('"', "'");
$img_path = str_replace($del_str_arr, "", $img_path);
$img_path = trim($img_path);
}
// 이미지 경로가 없을 경우처리 [2008-03-28]
if( trim(strrchr($img_path, "/")) == '/' ) $img_path = '';
$img_path = $img_path ? $img_path : $latest_skin_path.'/img/noimg.gif';
?>
<a href='<?=$list[0][href]?>'><img src="<?=$img_path?>" width="<?=$img_width?>" height="<?=$img_height?>" border="0" /></a>
</div>
<? } ?>
</td>
<td width="96%" height="14" valign="middle" style="border-bottom-width:0px; border-bottom-color:rgb(211,211,211); border-bottom-style:dotted;">
<?
for ($i=0; $i<count($list); $i++) {
//날짜표시
$subject = $list[$i][subject];
$b_subject = "<strong>".$list[$i][subject]."<strong>";
?>
<table align="center" cellpadding="0" cellspacing="0" width="100%" height="20" border="0">
<tr>
<td width="5" align="center"></td>
<td><span style='color:#777777;font-weight:bold;'>ㆍ</span><a href='<?=$list[$i][href]?>'><span class="th6"><?if ($list[$i][is_notice])
echo $b_subject;
else
echo $subject;
?></span></a>
<span style="font-size:7pt;font-family:tahoma;color:#EE5A00;vertical-align:1px;"><?=$list[$i][comment_cnt]?> <?
echo " " . $list[$i][icon_new];
echo " " . $list[$i][icon_hot];
echo " " . $list[$i][icon_file];
echo " " . $list[$i][icon_link];
echo " " . $list[$i][icon_secret];
?>
</span>
</td>
</tr>
</table>
<!--게시물 추출 글자 설정 끝-->
<? } ?>
</td>
</tr>
<? if (count($list) == 0) { ?><tr height="100"><td align="center" colspan="2"><font color=#6A6A6A>현재 등록된 글이 없습니다.</a></td></tr><? } ?>
</table>
</td>
<td width="3" background="<?=$latest_skin_path?>/img/latest_m_2.gif"></td>
</tr>
<tr height="3">
<td width="3" background="<?=$latest_skin_path?>/img/latest_b_1.gif"></td>
<td background="<?=$latest_skin_path?>/img/latest_b_bg.gif"></td>
<td width="3" background="<?=$latest_skin_path?>/img/latest_b_2.gif"></td>
</tr>
<tr height="1"><td colspan="3"></td>
</table>
위의 소스가 그룹 최신글을 뽑아오는 소스 입니다..
어디를 어떻게 수정하면 이미지랑 제목을 조회순으로 추출이 가능 할까요?
고수님들께 조언을 부탁 드립니다..꾸벅
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$gr = get_group($gr_id);
$img_width = '95'; //썸네일 가로길이
$img_height = '70'; //썸네일 세로길이
$img_quality = '9'; //퀼리티 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);
?>
<table align="center" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="3" background="<?=$latest_skin_path?>/img/latest_t_1.gif"></td>
<td background="<?=$latest_skin_path?>/img/latest_t_bg.gif">
<!--타이틀 시작: 실선 색상을 바꾸려면 215, 215, 215를 고치세요.-->
<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0">
<tr height="30">
<td width="10"></td>
<td><a href='<?=$g4[bbs_path]?>/group.php?gr_id=<?=$gr_id?>'><font color="#57697c" ><b>[<?=$gr[gr_subject]?>] 전체 최신글</b></font></a></td>
<td width="40"><a href='<?=$g4[bbs_path]?>/group.php?gr_id=<?=$gr_id?>'><img src="<?=$latest_skin_path?>/img/more.gif" border="0"></a>
<td width="5"></td>
</tr>
</table>
<!--타이틀 끝-->
</td>
<td width="3" background="<?=$latest_skin_path?>/img/latest_t_2.gif"></td>
</tr>
<tr height="1"><td width="3" background="<?=$latest_skin_path?>/img/latest_m_1.gif"></td><td></td><td width="3" background="<?=$latest_skin_path?>/img/latest_m_2.gif"></td>
<tr>
<td width="3" background="<?=$latest_skin_path?>/img/latest_m_1.gif"></td>
<td>
<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<!--게시물 아래 점선 색상을 바꾸고 싶으시면 211,211,211부분을, 게시물 추출부분 세로 길이를 늘리시려면 25을 수정하세요-->
<td width="20%" height="25" valign=middle style="PADDING-LEFT: 2px; PADDING-BOTTOM: 0px; PADDING-TOP: 2px" style="border-bottom-width:0px; border-bottom-color:rgb(211,211,211); border-bottom-style:dotted;">
<?
// 게시물이 없으면 이미지 영역없음[2008-03-29]
if( count($list) ) {
$thumb = $thumb_path.'/'.$list[0][wr_id];
if (!file_exists($thumb)) {
$file = $list[0][file][0][path] .'/'. $list[0][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]);
imagepng($dst, $thumb_path.'/'.$list[0][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[0][wr_id], 0606);
}
}
if (file_exists($thumb)) $img_path = $thumb;
else {
// 최근게시물 본문 중 이미지태그를 검색하여 그 중 한개만 특정 사이즈로 크롭하여 보여준다.
// 뉴스웹진 스타일 [2008-03-28]
$data = $list[0]['wr_content'] ;
// 이미지 주소 찾기
preg_match('/img.*?src=(.*?) /i', $data, $url_img);
$img_path = $url_img[1]; // 그림 주소
$del_str_arr = array('"', "'");
$img_path = str_replace($del_str_arr, "", $img_path);
$img_path = trim($img_path);
}
// 이미지 경로가 없을 경우처리 [2008-03-28]
if( trim(strrchr($img_path, "/")) == '/' ) $img_path = '';
$img_path = $img_path ? $img_path : $latest_skin_path.'/img/noimg.gif';
?>
<a href='<?=$list[0][href]?>'><img src="<?=$img_path?>" width="<?=$img_width?>" height="<?=$img_height?>" border="0" /></a>
</div>
<? } ?>
</td>
<td width="96%" height="14" valign="middle" style="border-bottom-width:0px; border-bottom-color:rgb(211,211,211); border-bottom-style:dotted;">
<?
for ($i=0; $i<count($list); $i++) {
//날짜표시
$subject = $list[$i][subject];
$b_subject = "<strong>".$list[$i][subject]."<strong>";
?>
<table align="center" cellpadding="0" cellspacing="0" width="100%" height="20" border="0">
<tr>
<td width="5" align="center"></td>
<td><span style='color:#777777;font-weight:bold;'>ㆍ</span><a href='<?=$list[$i][href]?>'><span class="th6"><?if ($list[$i][is_notice])
echo $b_subject;
else
echo $subject;
?></span></a>
<span style="font-size:7pt;font-family:tahoma;color:#EE5A00;vertical-align:1px;"><?=$list[$i][comment_cnt]?> <?
echo " " . $list[$i][icon_new];
echo " " . $list[$i][icon_hot];
echo " " . $list[$i][icon_file];
echo " " . $list[$i][icon_link];
echo " " . $list[$i][icon_secret];
?>
</span>
</td>
</tr>
</table>
<!--게시물 추출 글자 설정 끝-->
<? } ?>
</td>
</tr>
<? if (count($list) == 0) { ?><tr height="100"><td align="center" colspan="2"><font color=#6A6A6A>현재 등록된 글이 없습니다.</a></td></tr><? } ?>
</table>
</td>
<td width="3" background="<?=$latest_skin_path?>/img/latest_m_2.gif"></td>
</tr>
<tr height="3">
<td width="3" background="<?=$latest_skin_path?>/img/latest_b_1.gif"></td>
<td background="<?=$latest_skin_path?>/img/latest_b_bg.gif"></td>
<td width="3" background="<?=$latest_skin_path?>/img/latest_b_2.gif"></td>
</tr>
<tr height="1"><td colspan="3"></td>
</table>
위의 소스가 그룹 최신글을 뽑아오는 소스 입니다..
어디를 어떻게 수정하면 이미지랑 제목을 조회순으로 추출이 가능 할까요?
고수님들께 조언을 부탁 드립니다..꾸벅
댓글 전체