메인페이지 최신글이 업데이트가 안됩니다. > 그누4 질문답변

그누4 질문답변

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

메인페이지 최신글이 업데이트가 안됩니다. 정보

메인페이지 최신글이 업데이트가 안됩니다.

본문

약 7개월정도 된 사이트인데, 계속해서 잘 되던 메인페이지 업데이트가 어느순간부터 안됩니다.
그동안 사이트는 전혀 거드린게 없는데, 약 1주일째 이런현상이 일어나고 있습니다.
이럴때는 혹시 서버를 만져줘야 하는건지...
공용 호스팅 서비스를 이용하는 상태라 마음대로 reboot하기도 어려운데, 이럴때 어떻게 해야하는지 모르겠네요.

사실 내부사정상 휴면기에 들어간 사이트인데, 그래도 꾸준하게 들러서 글을 남겨주시는 몇분들이 있어서 기본적인 관리는 하고자 합니다.

게시판에서 검색을 해봤는데도 정확한 답변을 찾기가 어려웠습니다.
 도움말씀을 좀 부탁드립니다.

www.itoron.com

아래에 관련부분 코드를 첨부했습니다.


----- index.php -----

<?php
// skin, gr_id, num, subj_len, last_hours, cont_len
echo itoron_group('wcd_featured', 'T_i', 4, 100, $it['mainpage_last_hours'], 300);
echo itoron_group('wcd_featured', 'T_1', 4, 100, $it['mainpage_last_hours'], 300);
echo itoron_group('wcd_featured', 'T_0', 4, 100, $it['mainpage_last_hours'], 300);
echo itoron_group('wcd_featured', 'T_2', 2, 100, $it['mainpage_last_hours'], 300);
echo itoron_group('wcd_featured', 'T_3', 2, 100, $it['mainpage_last_hours'], 300);
echo itoron_group('wcd_featured', 'T_4', 2, 100, $it['mainpage_last_hours'], 300);
?>


----- itoron_group () -----

function itoron_group($skin_dir="", $gr_id, $rows=10, $subject_len=40, $last_hours=24, $options="")
{
    global $g4, $it, $group, $groups;

    if ($skin_dir)
        $GLOBALS['group_skin_path'] = $group_skin_path = "{$g4['path']}/skin/group/$skin_dir";
    else
        $GLOBALS['group_skin_path'] = $group_skin_path = "{$g4['path']}/skin/group/basic";

    $list = array();
    $idx = 0;

    $b_res = sql_query(" SELECT * FROM {$g4['board_table']} WHERE gr_id='$gr_id' ");
    while ($board = sql_fetch_array($b_res) ) {
    	$bo_table = $board['bo_table'];

		$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
		$sql = " SELECT * FROM $tmp_write_table 
					WHERE wr_is_comment = 0 
						AND {$it['wr_cnt_reviews']} >= ".($groups[$gr_id][$it['gr_min_reviews_valid_post']] + 0)."
						AND wr_datetime > '".date('Y-m-d H:i:s', strtotime("-".$last_hours." hours"))."'
					ORDER BY {$it['wr_avg_point']} DESC, {$it['wr_cnt_reviews']} DESC, wr_hit DESC
					LIMIT 0, $rows ";
		$result = sql_query($sql);
		while ($row = sql_fetch_array($result)) {
			$list[$idx] = get_list($row, $board, $group_skin_path, $subject_len);
			$list[$idx]['bo_table'] = $bo_table;
			$list[$idx]['bo_link'] = "{$g4['bbs_path']}/board.php?bo_table=$bo_table";
			$list[$idx]['bo_subject'] = $board['bo_subject'];
			$idx++;
		}
	}
	
	usort($list, 'cmp_wr_1_desc');
	$list = array_slice($list, 0, $rows);
	
    ob_start();
    include "$group_skin_path/group.skin.php";
    $content = ob_get_contents();
    ob_end_clean();

    return $content;
}


----- group.skin.php -----

<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<!-- 그룹게시물 : <?php echo $groups[$gr_id]['gr_subject']?> -->
<div class='title_<?php echo $groups[$gr_id]['theme']?> fl'>
	<h2 class='left_border_<?php echo $groups[$gr_id]['theme']?>'>
		<a style='text-decoration:none; color:white' href='<?php echo $g4['bbs_path']?>/group.php?gr_id=<?php echo $gr_id?>'><?php echo $groups[$gr_id]['gr_subject']?></a>
	</h2>
</div>
<div class='featured'>
<?php
for ($i=0; $i<count($list); $i++) {
?>
	<div class='half_width fl'>
		<h3><a href="<?php echo $list[$i]['href']?>"><?php echo $list[$i]['subject']?></a></h3>
		<span class='date'><?php echo substr($list[$i]['wr_datetime'], 5,11)?></span>
		<span class='num cnt_reviews' title='평가횟수'><?php echo number_format($list[$i][$it['wr_cnt_reviews']],0);?></span>
		<?php if ($list[$i][$it['wr_b_show_point']]) { ?>
			<span class='num avg_point' title='평점'><?php echo number_format($list[$i][$it['wr_avg_point']],$it['avg_point_precision'])?></span>
		<?php } ?>
		<span class='author'><?php echo $list[$i]['wr_name']?></span>
		<p><?php 
		$content = preg_replace('/<style[^<]*<\/style>/i', '', $list[$i]['wr_content']);
		echo cut_str(strip_tags($content), $options, "...");
		?></p>
	</div>
<?php } 
if (count($list)==0) {?>
	<div class='fl'><p style="height:50px">해당 내용이 없습니다.</p></div>
<?php } ?>
	<!--div class='clear'></div-->
</div>

댓글 전체

해당 쿼리가 아래처럼 평점 높은순 > 평가횟수 많은순 > 조회순 으로 정렬되고 있습니다.
 ORDER BY {$it['wr_avg_point']} DESC, {$it['wr_cnt_reviews']} DESC, wr_hit DESC

신규글이 들어온다고 해도 평점이 낮거나 평가횟수가 적으면 노출이 안될수 있구요.

또 확인해야할게


                  WHERE wr_is_comment = 0
                        AND {$it['wr_cnt_reviews']} >= ".($groups[$gr_id][$it['gr_min_reviews_valid_post']] + 0)."
                        AND wr_datetime > '".date('Y-m-d H:i:s', strtotime("-".$last_hours." hours"))."'


평가횟수가
$groups[$gr_id][$it['gr_min_reviews_valid_post'] << 이게 무슨값인지는 모르겠지만 이것보다 커야하고
등록일이
$it['mainpage_last_hours'] << 이것도 어디서 설정된건지 확인해야 겠지만 저기에 설정된 값보다 커야하네요.

db 에 설정된 값도 봐야할꺼 같고 $it 가 어디서 설정되어 있는건지 어떻게 설정되어 있는건지도 찾아봐야 할꺼 같습니다.
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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