새로쓴 최신글을 불러들이는데 몇주전꺼는 못불러들이고 게시글이 없다고 나오네요 정보
새로쓴 최신글을 불러들이는데 몇주전꺼는 못불러들이고 게시글이 없다고 나오네요
본문
휴온님의 스킨 중 여러게시판의 최신글을 불러들이는 스킨을 사용중인데요
새로쓴글은 잘 불러들이는데 대략 한달이상된 게시글은 '게시물이 없습니다.' 라고 나오고
게시물을 불러들이질 못하네요
해당파일을 눈빠지게 봐도 도저히 어느부분이 문제인지 알수가 없어 소스를 올려드립니다.
프로그램에 능통하신분 해결 방법 좀 부탁드립니다.
lib/arr_new_gallery.lib.php
<?
if (!defined('_GNUBOARD_')) exit;
/*------------------------------------------------------------------------------------------------
배열을 이용해 특정 게시판에서 최신글 뽑아오기 - 라이브러리
작성자 : 휴온 박성광
수정일 : 2008.10.02
http://www.huon.kr
------------------------------------------------------------------------------------------------*/
// 최신글 추출
function arr_new_gallery($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]' ");
//파일 뽑기
//$img_file_info = "select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' and bf_no = 0";
// 이미지 정보 가져오기
//$list[$i]['file'] =$img_file_info;
$list[$i]['file'] = get_file($board_list[$i][bo_table], $list[$i][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'>";
skin/latest/arr_new_gallery
<?
/* -----------------------------------------------------
배열을 이용해 특정 게시판에서 최신글 뽑아오기 - 갤러리 스킨
작성자 : 휴온 박성광 작성일 : 2008.09.27
----------------------------------------------------- */
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//한 줄에 출력할 이미지 개수
$arr_new_cols=7;
$data_path = $g4[path]."/data/file/";
$thumb_path = $data_path;
?>
<link rel="stylesheet" type="text/css" href="<?=$latest_skin_path?>/arr_new_gallery.css">
<style type="text/css">
a.tt:link, a.tt:visited, a.tt:active {
text-decoration:none;
color:#000000;
letter-spacing:-0.04em;
font-size: 12px; }
a.tt:hover {
text-decoration:none;
color:#F60;
font-size: 12px;}
.tabcom_area{}
.tabcom_area .title{height:30px; border-bottom:2px solid #b1b1b1; margin:5px 0 10px 0; padding:0; position:relative;}
.tabcom_area .title h3{display:inline; float:left; letter-spacing:-1px; margin:0 0 5px 0; padding-bottom:5px; font-weight:bold; font-size:20px; border-bottom:2px solid #353535; position:relative;}
.tabcom_area .title h3 a{color:#3F627D;}
.tabcom_area .title span{display:inline; float:left; font:10px tahoma; margin-top:2px;margin-right:5px;}
.tabcom_area .title span a{ color:#777; }
.tabcom_list {display:inline;border-bottom-width:1; border-bottom-color:#9999CC; border-bottom-style:dotted;margin-top:10px; margin-botton:10px;}
</style>
<!--table width="100%" border=0 cellspacing=0 cellpadding=0 >
<tr>
<td >
<div class="tabcom_area">
<div class="title">
<h3><font color="#0033FF" face="arial"> 최근 앨범 모음 </font><h3>
</div></div>
</td>
</td>
</tr>
</font>
</table-->
<table width="100%" cellpadding=0 cellspacing=0 style="margin-top:7px;">
<tr>
<?
for ($i=0; $i<count($list); $i++) {
if ($i >= 0)
$title = get_text($list[$i][subject]);
//한 줄에 $arr_new_cols 만큼 출력
if($i%$arr_new_cols == 0 && $i>0)
echo "</tr><tr>";
$content = cut_str(get_text($list[$i][wr_content]), 80);
$bo_table=$board_list[$i][bo_table];
$image = urlencode($list[$i][file][0][file]); //원본
$img=$data_path."/".$bo_table."/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path."/".$bo_table."/thumb".$list[$i][wr_id];
if (!file_exists($img)) {
$img = "$latest_skin_path/img/noimage.gif";
}
echo <<<HEREDOC
<td align='center' valign='middle' class='lt_td' width='{$imgwidth}' height='{$imgheight}'>
<a href='{$list[$i][href]}' >
<img src='$img' border='0' title='$title' class="img"><br/>
<span style='font-size:9pt; color:#FF0000;'>[{$board_list[$i][bo_subject]}]</span>
<div>{$subject} {$title} {$list[$i][icon_new]}</div>
</a>
</td>
HEREDOC;
}
/* end for */
?>
<? if (count($list) == 0) { ?><td align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td><? } ?>
</tr>
</table>
<br />
$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);
// 삭제할 코드
//$list[$i]['file'] = get_file($bo_table, $list[$i]['wr_id']);
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
새로쓴글은 잘 불러들이는데 대략 한달이상된 게시글은 '게시물이 없습니다.' 라고 나오고
게시물을 불러들이질 못하네요
해당파일을 눈빠지게 봐도 도저히 어느부분이 문제인지 알수가 없어 소스를 올려드립니다.
프로그램에 능통하신분 해결 방법 좀 부탁드립니다.
lib/arr_new_gallery.lib.php
<?
if (!defined('_GNUBOARD_')) exit;
/*------------------------------------------------------------------------------------------------
배열을 이용해 특정 게시판에서 최신글 뽑아오기 - 라이브러리
작성자 : 휴온 박성광
수정일 : 2008.10.02
http://www.huon.kr
------------------------------------------------------------------------------------------------*/
// 최신글 추출
function arr_new_gallery($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]' ");
//파일 뽑기
//$img_file_info = "select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$row[wr_id]' and bf_no = 0";
// 이미지 정보 가져오기
//$list[$i]['file'] =$img_file_info;
$list[$i]['file'] = get_file($board_list[$i][bo_table], $list[$i][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'>";
skin/latest/arr_new_gallery
<?
/* -----------------------------------------------------
배열을 이용해 특정 게시판에서 최신글 뽑아오기 - 갤러리 스킨
작성자 : 휴온 박성광 작성일 : 2008.09.27
----------------------------------------------------- */
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//한 줄에 출력할 이미지 개수
$arr_new_cols=7;
$data_path = $g4[path]."/data/file/";
$thumb_path = $data_path;
?>
<link rel="stylesheet" type="text/css" href="<?=$latest_skin_path?>/arr_new_gallery.css">
<style type="text/css">
a.tt:link, a.tt:visited, a.tt:active {
text-decoration:none;
color:#000000;
letter-spacing:-0.04em;
font-size: 12px; }
a.tt:hover {
text-decoration:none;
color:#F60;
font-size: 12px;}
.tabcom_area{}
.tabcom_area .title{height:30px; border-bottom:2px solid #b1b1b1; margin:5px 0 10px 0; padding:0; position:relative;}
.tabcom_area .title h3{display:inline; float:left; letter-spacing:-1px; margin:0 0 5px 0; padding-bottom:5px; font-weight:bold; font-size:20px; border-bottom:2px solid #353535; position:relative;}
.tabcom_area .title h3 a{color:#3F627D;}
.tabcom_area .title span{display:inline; float:left; font:10px tahoma; margin-top:2px;margin-right:5px;}
.tabcom_area .title span a{ color:#777; }
.tabcom_list {display:inline;border-bottom-width:1; border-bottom-color:#9999CC; border-bottom-style:dotted;margin-top:10px; margin-botton:10px;}
</style>
<!--table width="100%" border=0 cellspacing=0 cellpadding=0 >
<tr>
<td >
<div class="tabcom_area">
<div class="title">
<h3><font color="#0033FF" face="arial"> 최근 앨범 모음 </font><h3>
</div></div>
</td>
</td>
</tr>
</font>
</table-->
<table width="100%" cellpadding=0 cellspacing=0 style="margin-top:7px;">
<tr>
<?
for ($i=0; $i<count($list); $i++) {
if ($i >= 0)
$title = get_text($list[$i][subject]);
//한 줄에 $arr_new_cols 만큼 출력
if($i%$arr_new_cols == 0 && $i>0)
echo "</tr><tr>";
$content = cut_str(get_text($list[$i][wr_content]), 80);
$bo_table=$board_list[$i][bo_table];
$image = urlencode($list[$i][file][0][file]); //원본
$img=$data_path."/".$bo_table."/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path."/".$bo_table."/thumb".$list[$i][wr_id];
if (!file_exists($img)) {
$img = "$latest_skin_path/img/noimage.gif";
}
echo <<<HEREDOC
<td align='center' valign='middle' class='lt_td' width='{$imgwidth}' height='{$imgheight}'>
<a href='{$list[$i][href]}' >
<img src='$img' border='0' title='$title' class="img"><br/>
<span style='font-size:9pt; color:#FF0000;'>[{$board_list[$i][bo_subject]}]</span>
<div>{$subject} {$title} {$list[$i][icon_new]}</div>
</a>
</td>
HEREDOC;
}
/* end for */
?>
<? if (count($list) == 0) { ?><td align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td><? } ?>
</tr>
</table>
<br />
$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);
// 삭제할 코드
//$list[$i]['file'] = get_file($bo_table, $list[$i]['wr_id']);
}
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
댓글 전체

$g4[board_new_table] 테이블에서 가져오시고 계신듯 한데 맞나요?
최신글 테이블은 일정 기간이 지나면 삭제하도록 되어있을껍니다.
관리자에서 기본 환경설정에 "최근게시물 삭제"라는 기간 설정 기능이 있습니다.
최신글 테이블은 일정 기간이 지나면 삭제하도록 되어있을껍니다.
관리자에서 기본 환경설정에 "최근게시물 삭제"라는 기간 설정 기능이 있습니다.