3번째 재질문...최신글 페이징 추가좀 도와주세요....

3번째 재질문...최신글 페이징 추가좀 도와주세요....

QA

3번째 재질문...최신글 페이징 추가좀 도와주세요....

본문

답변을 못받아서 3번째 재 질문합니다.
최신글을 갤러리로 뽑고 잇는데 페이징 기능이 필요합니다...
초보수라 페이징 최신글 스킨을 뜯어서 이리저리 붙여봐도 안되네요...
게시판이랑 연동을 해서 사용중이라 부득이하게 꼭 저 최신글을 사용해야하는데
저기에 페이징 기능을 넣는 방법좀 소스문으로 자세히 알려주시면 감사하겠습니다.
주말 잘 마무리하시고 활기찬 월요일되세요 ^-^
<? 
if (!defined('_GNUBOARD_')) exit; 
// 최신글 추출 
function latest_gallery($skin_dir="", $bo_table, $rows=10, $subject_len=40, $brch="") 
{ 
 global $g4; 
 if ($skin_dir) 
 $latest_skin_path = "$g4[path]/skin/latest/$skin_dir"; 
 else 
 $latest_skin_path = "$g4[path]/skin/latest/basic"; 
 $list = array(); 
 $sql = " select * from $g4[board_table] where bo_table = '$bo_table'"; 
 
 
 $board = sql_fetch($sql); 
 $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름 
 $sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows "; 
 //explain($sql); 
if ($brch == "sp") 
 $brch = "wr_31"; // 스페션순으로 쿼리 
elseif ($brch == "pe") 
 $brch ="wr_32"; // 프리미엄순으로 쿼리 
elseif ($brch == "be") 
 $brch ="wr_33"; // 베스트순으로 쿼리 
else 
 $brch = "wr_id"; // 일반 최근순으로 쿼리 
$sql = " select * from $tmp_write_table where $brch='y' order by wr_id desc limit 0, $rows "; 
 

 $result = sql_query($sql); 
 for ($i=0; $row = sql_fetch_array($result); $i++) 
 $list[$i] = get_list($row, $board, $latest_skin_path, $subject_len); 
 
 ob_start(); 
 include "$latest_skin_path/latest.skin.php"; 
 $content = ob_get_contents(); 
 ob_end_clean(); 
 return $content; 
} 
?>
위는 lib파일입니다.
 
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$mod = 5;
$img_width = 230;
$img_height = 150;
$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';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<table width="100%" cellpadding="0" cellspacing="0"><tr>
<? for ($i=0; $i<count($list); $i++) {
 $img = "<img src='$board_skin_path/img/noimage.gif' border=0 title='이미지 없음'>";
 $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
 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))
 $img = "<img src='$thumb' width=230 height=150>";
 else
 if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
 { $img = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>";
}
?>
<?
if ($i>0 && $i%$mod==0) { echo "</tr><tr>"; }
?>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
 <td height="90" align="center" valign="middle">
 
 <table cellpadding="2" cellspacing="1" bgcolor="e4e4e4">
 <tr>
 <td align="center" onMouseOver=this.style.backgroundColor='#ff6600' onMouseOut=this.style.backgroundColor=''><a href='<?=$list[$i][href]?>')>
 <? 
 echo "<a href='{$list[$i][href]}'>";
 echo $img;
 echo "</a>";
 ?></a></td>
 </tr>
 </table></td>
 </tr>
 <tr>
 <td height="45" align="center" valign="top">
 
 <table width="200" border="0" cellpadding="0" cellspacing="2" >
 <tr><td align="center" class="listsmall"><b><?=$list[$i][wr_1]?> <?=$list[$i][wr_2]?> <?=$list[$i][wr_3]?></b></td></tr>
 <tr><td align="center" class="listsmall"><?=$list[$i][wr_11]?>년 <?=$list[$i][wr_12]?>월식</td></tr>
 <tr><td align="center" class="listsmall"><font color=ff0000><b><?=number_format($list[$i][wr_5])?></b></font>만원<br><? if ($is_checkbox) { ?><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? } ?></td></tr>
 </table>
</td>
 </tr>
</table>
</td><? } ?>
<?
$nam = ($i%$mod);
for ($k=$nam; $k<$mod && $nam; $k++)
{ echo "<td> </td>";}
?>
<? if (count($list) == 0) { echo "<td colspan=$mod class=bbs>내용이 없습니다.</td>"; } ?>
</tr></table>
위는 출력소스 입니다.
 
 

이 질문에 댓글 쓰기 :

답변 3

페이징 최신글 스킨을 뜯어서<---이 스킨 소스라도 올려놓으면 수정해드릴수 있을텐데
페이징에 대해서 모르니 막상 필요한 사항은 없고 lib화일과 스킨만 올려놓으니 답변이 있을 수가 없습니다
페이징을 하려면 기본적으로 페이지당 목록수, 페이지번호를 나타낼 갯수가 있어야 합니다
또한 부분 수정이 아니라 전체코드를 만들어서 답변 할 수는 없지않겠습니까?



페이징 코드가 단순 설명만으로 하기 어렵기에.
아마 답변이 없을것입니다.

설명을 한다해도.
전체소스를 만들어 드리지 않는 한은 모를것이고요.
아마 의뢰를 하시는게 빠르실겁니다.
답변을 작성하시기 전에 로그인 해주세요.
전체 125,873 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT