엔

게시물 추출에서 특정기간이 지난 예전 글은 추출이 되지 않습니다.

· 2012-09-26 (수) 10:02:24 · 1334 · 4
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 : http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=71779&page=2&sca=%EC%B5%9C%EC%8B%A0%EA%B8%80&sfl=wr_subject%7C%7Cwr_content&stx=%ED%8A%B9%EC%A0%95+%EA%B2%8C%EC%8B%9C%ED%8C%90&spt=0&page=2&cwin=#c_134604





// 최신글 추출
function arr_new($skin_dir="", $board_arr=array(), $rows=10, $subject_len=40, $options="")
{
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();
$board_list = array();

//검색조건
if(count($board_arr)>0){
$qry_bo_search=" bo_table in(";
for($i=0; $i<count($board_arr); $i++) {
$bo_table=$board_arr[$i];
$qry_bo_search .= "'$bo_table'";
if($i<count($board_arr)-1) $qry_bo_search .= ", ";
}
$qry_bo_search .= ")";
} else {
$qry_bo_search="(1)";
}

//echo $qry_bo_search;

//new에서 해당되는 게시판의 최신글 뽑아오기
$sql = "select bo_table, wr_id from $g4[board_new_table]
where wr_id = wr_parent and $qry_bo_search order by bn_datetime desc LIMIT 0,$rows";

$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
$bo_table=$row[bo_table];
$write_table=$g4['write_prefix'].$bo_table;

$board_sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board_list[$i]=sql_fetch($board_sql);

$list[$i]=sql_fetch("select * from $write_table where wr_id='$row[wr_id]' ");

//기타 설정
if ($subject_len)
$list[$i]['subject'] = conv_subject($list[$i]['wr_subject'], $subject_len, "…");
else
$list[$i]['subject'] = conv_subject($list[$i]['wr_subject'], $board_list[$i]['bo_subject_len'], "…");

$list[$i][href]="$g4[bbs_path]/board.php?bo_table={$board_list[$i][bo_table]}&wr_id={$list[$i][wr_id]}".$qstr;

//$list[$i]['is_notice'] = preg_match("/[^0-9]{0,1}{$list[$i]['wr_id']}[\r]{0,1}/", $board_list[$i]['bo_notice']);
$list[$i]['is_notice']=false;
$arr_notice = split("\n", trim($board_list[$i]['bo_notice']));
if(in_array($list[$i]['wr_id'], $arr_notice)) $list[$i]['is_notice']=true;

echo "<!--".$board_list[$i]['bo_table']."/".$board_list[$i]['bo_notice']."-->";

$list[$i]['icon_new'] = "";
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", $g4['server_time'] - ($board_list[$i]['bo_new'] * 3600)))
$list[$i]['icon_new'] = "<img src='$latest_skin_path/img/icon_new.gif' align='absmiddle'>";

$list[$i]['comment_cnt'] = "";
if ($list[$i]['wr_comment'])
$list[$i]['comment_cnt'] = "({$list[$i][wr_comment]})";

if ($board_list[$i]['bo_use_comment'])
$list[$i]['comment_href'] = "javascript:win_comment('$g4[bbs_path]/board.php?bo_table=$board_list[$i][bo_table]&wr_id=$list[$i][wr_id]&cwin=1');";
else
$list[$i]['comment_href'] = $list[$i]['href'];

$list[$i]['icon_secret'] = "";
if (strstr($list[$i]['wr_option'], "secret"))
$list[$i]['icon_secret'] = "<img src='$latest_skin_path/img/icon_secret.gif' align='absmiddle'>";

$list[$i]['datetime'] = substr($list[$i]['wr_datetime'],0,10);
$list[$i]['datetime2'] = $list[$i]['wr_datetime'];

if ($list[$i]['datetime'] == $g4['time_ymd'])
$list[$i]['datetime2'] = substr($list[$i]['datetime2'],11,5);
else
$list[$i]['datetime2'] = substr($list[$i]['datetime2'],5,5);

}

ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();

return $content;



휴온님이 공개하신 최근글 추출 소스 입니다.


위와같은 lib 소스인되요

최신글은 추출이되는데 기간이 조금 지난 글들은 추출 되지 않습니다.

코드의 어떤 부분을 수정하여야 될까요?
|

댓글 4개

2012-09-26 (수) 10:50:21
관리자 페이지에서 기본환경설정 -> 최근게시물삭제 일수를 늘리시면 됩니다.
답변 감사합니다. 9999일까지 늘려보았으나 되질 않네요 ㅠㅠ
999일까지 늘린다고 오래된 게시물이 나오는 것은 아닙니다
왜냐하면 최신글 테이블에 이전에 설정되었던 일수 이전 게시물은 삭제되고 없을 수가 있으니까요
일수를 늘려잡아 놓으면 그 시점 부터 999일 동안의 게시물이 쌓이게 됩니다
아아 그렇군요 답변 감사드립니다. ~ ^^
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
12-09-26 조회 1,124
12-09-26 조회 1,660
12-09-26 조회 819
12-09-26 조회 884
12-09-26 조회 1,335
12-09-26 조회 846
12-09-26 조회 861
12-09-26 조회 851
12-09-26 조회 1,624
12-09-26 조회 1,427
12-09-26 조회 896
12-09-25 조회 2,680
12-09-25 조회 1,619
12-09-25 조회 835
12-09-25 조회 1,815
12-09-25 조회 824
12-09-25 조회 1,078
12-09-25 조회 2,392
12-09-25 조회 1,938
12-09-25 조회 1,673