내맘대로 최신글
링크는 지방선거 페이지에서 뉴스게시판의 서브섹션이 선거인 게시물만 가져온거에요
아래 내용을 latest.lib.php에 추가하세요
// 내맘대로 게시물 추출
function latest_my($skin_dir="", $bo_table, $rows="", $subject_len="", $latest_title="", $options="", $target="", $same="")
{
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; // 게시판 테이블 전체이름
// 옵션-.-v
if ($options == 'r') {$options = "rand()";}// 랜덤
else if ($options == 'h') {$options = "wr_hit desc";}// 히트순
else if ($options == 'c') {$options = "wr_comment desc";}// 코멘트
else if ($options == 'g') {$options = "wr_good desc, wr_num";}// 추천
else if ($options == 'n') {$options = "wr_nogood desc";}// 비추천
else {$options = "wr_num";} // 기본
if ($target)
$sql = " select * from $tmp_write_table where $target = '$same' and wr_is_comment = 0 order by $options limit 0, $rows ";
else
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by $options 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;
}
내맘대로 사용하시려면 위의코드를 추가하시고 설명대로 불러오시면 되고
스킨폴더열어서 $latest_title만 수정후에 그냥 스킨으로 사용하셔도 됩니다.
아래 내용을 latest.lib.php에 추가하세요
// 내맘대로 게시물 추출
function latest_my($skin_dir="", $bo_table, $rows="", $subject_len="", $latest_title="", $options="", $target="", $same="")
{
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; // 게시판 테이블 전체이름
// 옵션-.-v
if ($options == 'r') {$options = "rand()";}// 랜덤
else if ($options == 'h') {$options = "wr_hit desc";}// 히트순
else if ($options == 'c') {$options = "wr_comment desc";}// 코멘트
else if ($options == 'g') {$options = "wr_good desc, wr_num";}// 추천
else if ($options == 'n') {$options = "wr_nogood desc";}// 비추천
else {$options = "wr_num";} // 기본
if ($target)
$sql = " select * from $tmp_write_table where $target = '$same' and wr_is_comment = 0 order by $options limit 0, $rows ";
else
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by $options 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;
}
내맘대로 사용하시려면 위의코드를 추가하시고 설명대로 불러오시면 되고
스킨폴더열어서 $latest_title만 수정후에 그냥 스킨으로 사용하셔도 됩니다.
첨부파일
|
댓글을 작성하시려면 로그인이 필요합니다.
그누4 스킨
5,847건스킨의 저작권은 해당 스킨 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다. 스킨 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y 그누보드와 관련이 있지만 스킨과 빌더가 아니면 플러그인 게시판에 올려주세요.
댓글 26개
고맙습니다.^^
저 같은 초보한테 감동입니다... ^^