전체 최신글
latest.lib.php 하단에 아래 함수를 추가하세요
[code]
function latest_all($skin_dir="", $rows=10, $subject_len=40, $contents_len=200, $category="", $orderby="") {
global $config;
global $g5;
$list = array();
$limitrows = $rows;
$sqlgroup = " select bo_table, bo_subject from $g5[board_table] where bo_use_search=1 order by bo_use_search";
$rsgroup = sql_query($sqlgroup);
//echo $sqlgroup;
if ($skin_dir)
$latest_skin_path = G5_PATH."/skin/latest/$skin_dir";
else
$latest_skin_path = G5_PATH."/skin/latest/$config[cf_latest_skin]";
for ($j=0, $k=0; $rowgroup=sql_fetch_array($rsgroup); $j++) {
$bo_table = $rowgroup[bo_table];
// 테이블 이름구함
$sql = " select * from {$g5[board_table]} where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g5[write_prefix] . $bo_table; // 게시판 테이블 실제이름
// 옵션에 따라 정렬
$sql = "select * from $tmp_write_table where wr_is_comment = 0 ";
$sql .= (!$category) ? "" : " and ca_name = '$category' ";
$sql .= (!$orderby) ? " order by wr_id desc " : " order by $orderby desc, wr_id desc ";
$sql .= " limit $limitrows";
//echo $sql;
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++, $k++) {
if(!$orderby) $op_list[$k] = $row[wr_datetime];
else {
$op_list[$k] = is_string($row[$orderby]) ? sprintf("%-256s", $row[$orderby]) : sprintf("%016d", $row[$orderby]);
$op_list[$k] .= $row[wr_datetime];
$op_list[$k] .= $row[wr_name];
$op_list[$k] .= $row[wr_10];
}
$list[$k] = get_list($row, $board, $latest_skin_path, $subject_len, $wr_name, $wr_10);
$list[$k][bo_table] = $board[bo_table];
$list[$k][bo_subject] = $board[bo_subject];
$list[$k][wr_name] = $board[wr_name];
$list[$k][wr_10] = $board[wr_10];
$list[$k][bo_wr_subject] = cut_str($board[bo_subject] . $list[$k][wr_subject], $subject_len, $wr_name, $wr_10);
}
}
if($k>0) array_multisort($op_list, SORT_DESC, $list);
if($k>$rows) array_splice($list, $rows);
ob_start();
include $latest_skin_path.'/latest.skin.php';
$content = ob_get_contents();
ob_end_clean();
return $content;
}
[/code]
불러올 땐
<?php echo latest_all("스킨명",갯수,제목길이);?>
[code]
function latest_all($skin_dir="", $rows=10, $subject_len=40, $contents_len=200, $category="", $orderby="") {
global $config;
global $g5;
$list = array();
$limitrows = $rows;
$sqlgroup = " select bo_table, bo_subject from $g5[board_table] where bo_use_search=1 order by bo_use_search";
$rsgroup = sql_query($sqlgroup);
//echo $sqlgroup;
if ($skin_dir)
$latest_skin_path = G5_PATH."/skin/latest/$skin_dir";
else
$latest_skin_path = G5_PATH."/skin/latest/$config[cf_latest_skin]";
for ($j=0, $k=0; $rowgroup=sql_fetch_array($rsgroup); $j++) {
$bo_table = $rowgroup[bo_table];
// 테이블 이름구함
$sql = " select * from {$g5[board_table]} where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g5[write_prefix] . $bo_table; // 게시판 테이블 실제이름
// 옵션에 따라 정렬
$sql = "select * from $tmp_write_table where wr_is_comment = 0 ";
$sql .= (!$category) ? "" : " and ca_name = '$category' ";
$sql .= (!$orderby) ? " order by wr_id desc " : " order by $orderby desc, wr_id desc ";
$sql .= " limit $limitrows";
//echo $sql;
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++, $k++) {
if(!$orderby) $op_list[$k] = $row[wr_datetime];
else {
$op_list[$k] = is_string($row[$orderby]) ? sprintf("%-256s", $row[$orderby]) : sprintf("%016d", $row[$orderby]);
$op_list[$k] .= $row[wr_datetime];
$op_list[$k] .= $row[wr_name];
$op_list[$k] .= $row[wr_10];
}
$list[$k] = get_list($row, $board, $latest_skin_path, $subject_len, $wr_name, $wr_10);
$list[$k][bo_table] = $board[bo_table];
$list[$k][bo_subject] = $board[bo_subject];
$list[$k][wr_name] = $board[wr_name];
$list[$k][wr_10] = $board[wr_10];
$list[$k][bo_wr_subject] = cut_str($board[bo_subject] . $list[$k][wr_subject], $subject_len, $wr_name, $wr_10);
}
}
if($k>0) array_multisort($op_list, SORT_DESC, $list);
if($k>$rows) array_splice($list, $rows);
ob_start();
include $latest_skin_path.'/latest.skin.php';
$content = ob_get_contents();
ob_end_clean();
return $content;
}
[/code]
불러올 땐
<?php echo latest_all("스킨명",갯수,제목길이);?>
댓글 3개
10년 전
좋은정보 감사해요~^^
10년 전
꼭 필요한 자료였어요~ 감사합니다^^
10년 전
감사합니다
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4426 | ||
| 504 | 10년 전 | 8214 | ||
| 503 | 10년 전 | 5959 | ||
| 502 | 10년 전 | 13129 | ||
| 501 | 10년 전 | 8967 | ||
| 500 | 10년 전 | 8110 | ||
| 499 | 10년 전 | 24083 | ||
| 498 | 10년 전 | 7361 | ||
| 497 | 10년 전 | 9318 | ||
| 496 | 10년 전 | 12534 | ||
| 495 | 10년 전 | 6834 | ||
| 494 |
|
10년 전 | 6619 | |
| 493 | 10년 전 | 12655 | ||
| 492 | 10년 전 | 11279 | ||
| 491 |
고등동물고등어
|
10년 전 | 10618 | |
| 490 | 10년 전 | 9497 | ||
| 489 | 10년 전 | 16207 | ||
| 488 |
saesini
|
10년 전 | 8632 | |
| 487 | 10년 전 | 14357 | ||
| 486 | 10년 전 | 8061 | ||
| 485 | 10년 전 | 9634 | ||
| 484 |
|
10년 전 | 6703 | |
| 483 |
untitled
|
10년 전 | 9984 | |
| 482 | 10년 전 | 8279 | ||
| 481 | 10년 전 | 16277 | ||
| 480 | 10년 전 | 10373 | ||
| 479 |
|
10년 전 | 8105 | |
| 478 | 10년 전 | 12752 | ||
| 477 | 10년 전 | 6362 | ||
| 476 | 10년 전 | 8344 | ||
| 475 |
wonilone
|
10년 전 | 7320 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기