게시판 분류명으로 정렬 오름차순으로 관리자페이지에서 수정하였는데, 적용이 되지 않네요

게시판 분류명으로 정렬 오름차순으로 관리자페이지에서 수정하였는데, 적용이 되지 않네요

QA

게시판 분류명으로 정렬 오름차순으로 관리자페이지에서 수정하였는데, 적용이 되지 않네요

본문

게시판 분류명으로 정렬 오름차순으로 관리자페이지에서 수정하였는데, 적용이 되지 않네요 

 

board_form.php를 확인하여 보았더니,

 

리스트 정렬필드 부분이 ,

 


<tr>
            <th scope="row"><label for="bo_sort_field">리스트 정렬 필드</label></th>
            <td>
                <?php echo help('리스트에서 기본으로 정렬에 사용할 필드를 선택합니다. "기본"으로 사용하지 않으시는 경우 속도가 느려질 수 있습니다.') ?>
                <select id="bo_sort_field" name="bo_sort_field">
                    <?php foreach( get_board_sort_fields($board) as $v ){
                        
                        $option_value = $order_by_str = $v[0];
                        if( $v[0] === 'wr_num, wr_reply' ){
                            $selected = (! $board['bo_sort_field']) ? 'selected="selected"' : '';
                            $option_value = '';
                        } else {
                            $selected = ($board['bo_sort_field'] === $v[0]) ? 'selected="selected"' : '';
                        }
                        
                        if( $order_by_str !== 'wr_num, wr_reply' ){
                            $tmp = explode(',', $v[0]);
                            $order_by_str = $tmp[0];
                        }
                        echo '<option value="'.$option_value.'" '.$selected.' >'.$order_by_str.' : '.$v[1].'</option>';
                    } //end foreach ?>
                </select>
            </td>

 

이렇게 되어있는데 맞는건가요..? 

 

다른 분들꺼 참고하여보았더니 셀렉트나 그런게 있던데 없어서요 ㅠ

이 질문에 댓글 쓰기 :

답변 2

적용이 안 된다고 판단하신

상황을 설명해 주세요.

/bbs/list.php에서

    $sql .= " {$sql_order} limit {$from_record}, $page_rows ";
}

이쯤에서
echo $sql;
하시고 나온 query문을 알려 주세요.

// 페이지의 공지개수가 목록수 보다 작을 때만 실행
if($page_rows > 0) {
    $result =


if(@strlen($_GET[wr_id]) > 0){			// View
	
	$sql_search = "";
	// 검색이면
	if ($sca || $stx || $stx === '0' || count($arr_search) > 0) {

			$se_arr = array();
			$se_arr = $arr_search;

			// where 문을 얻음
			$sql_search = get_sql_search_all($sca, $sfl, $stx, $sop, $se_arr);
			$search_href = get_pretty_url($bo_table,'','&amp;page='.$page.$qstr);

			$list_href = get_pretty_url($bo_table);

	} else {
			$search_href = '';
			$list_href = get_pretty_url($bo_table,'',$qstr);
	}

	if (!$board['bo_use_list_view']) {
			if ($sql_search)
					$sql_search = " and " . $sql_search;

			// 윗글을 얻음
			$sql = " select wr_id, wr_subject, wr_hit from {$write_table} where wr_is_comment = 0 and wr_num = '{$write['wr_num']}' and wr_reply < '{$write['wr_reply']}' {$sql_search} order by wr_num desc, wr_reply desc limit 1 ";
			$prev = sql_fetch($sql);
			// 위의 쿼리문으로 값을 얻지 못했다면
			if (!$prev['wr_id'])     {
					$sql = " select wr_id, wr_subject, wr_hit from {$write_table} where wr_is_comment = 0 and wr_num < '{$write['wr_num']}' {$sql_search} order by wr_num desc, wr_reply desc limit 1 ";
					$prev = sql_fetch($sql);
			}

			// 아래글을 얻음
			$sql = " select wr_id, wr_subject, wr_hit from {$write_table} where wr_is_comment = 0 and wr_num = '{$write['wr_num']}' and wr_reply > '{$write['wr_reply']}' {$sql_search} order by wr_num, wr_reply limit 1 ";
			$next = sql_fetch($sql);
			// 위의 쿼리문으로 값을 얻지 못했다면
			if (!$next['wr_id']) {
					$sql = " select wr_id, wr_subject, wr_hit from {$write_table} where wr_is_comment = 0 and wr_num > '{$write['wr_num']}' {$sql_search} order by wr_num, wr_reply limit 1 ";
					$next = sql_fetch($sql);
			}
	}

	// 이전글 링크
	$prev_href = '';
	if (isset($prev['wr_id']) && $prev['wr_id']) {
			$prev_wr_subject = get_text(cut_str($prev['wr_subject'], 255));
			$prev_href = get_pretty_url($bo_table, $prev['wr_id'], $qstr);
			$prev_wr_date = $prev['wr_hit'];
	}

	// 다음글 링크
	$next_href = '';
	if (isset($next['wr_id']) && $next['wr_id']) {
			$next_wr_subject = get_text(cut_str($next['wr_subject'], 255));
			$next_href = get_pretty_url($bo_table, $next['wr_id'], $qstr);
			$next_wr_date = $next['wr_hit'];
	}

	// 쓰기 링크
	$write_href = '';
	if ($member['mb_level'] >= $board['bo_write_level']) {
			$write_href = short_url_clean(G5_BBS_URL.'/write.php?bo_table='.$bo_table);
	}

	// 답변 링크
	$reply_href = '';
	if ($member['mb_level'] >= $board['bo_reply_level']) {
			$reply_href = short_url_clean(G5_BBS_URL.'/write.php?w=r&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.$qstr);
	}

	// 수정, 삭제 링크
	$update_href = $delete_href = '';
	// 로그인중이고 자신의 글이라면 또는 관리자라면 비밀번호를 묻지 않고 바로 수정, 삭제 가능
	if (($member['mb_id'] && ($member['mb_id'] === $write['mb_id'])) || $is_admin) {
			$update_href = short_url_clean(G5_BBS_URL.'/write.php?w=u&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr);
			set_session('ss_delete_token', $token = uniqid(time()));
			$delete_href = G5_BBS_URL.'/delete.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;token='.$token.'&amp;page='.$page.urldecode($qstr);
	}
	else if (!$write['mb_id']) { // 회원이 쓴 글이 아니라면
			$update_href = G5_BBS_URL.'/password.php?w=u&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
			$delete_href = G5_BBS_URL.'/password.php?w=d&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
	}

	// 최고, 그룹관리자라면 글 복사, 이동 가능
	$copy_href = $move_href = '';
	if ($write['wr_reply'] == '' && ($is_admin == 'super' || $is_admin == 'group')) {
			$copy_href = G5_BBS_URL.'/move.php?sw=copy&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
			$move_href = G5_BBS_URL.'/move.php?sw=move&amp;bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;page='.$page.$qstr;
	}

	$scrap_href = '';
	$good_href = '';
	$nogood_href = '';
	if ($is_member) {
			// 스크랩 링크
			$scrap_href = G5_BBS_URL.'/scrap_popin.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id;

			// 추천 링크
			if ($board['bo_use_good'])
					$good_href = G5_BBS_URL.'/good.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;good=good';

			// 비추천 링크
			if ($board['bo_use_nogood'])
					$nogood_href = G5_BBS_URL.'/good.php?bo_table='.$bo_table.'&amp;wr_id='.$wr_id.'&amp;good=nogood';
	}

}


쿼리문을 이런식으로 다시 돌리고 있긴 하네요.... 근데 datetime부분을 hit으로 바꿨는데도 적용이 안되네요 ㅠ

올리신 소스는 bbs/view.php 같습니다.

 

해당 list.skin.php를 올려 보세요.


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once($board_skin_path."/skin.lib.php");
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 10;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);

add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/autoptimize_bbs.css">', 0);

add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/css/nice-select.css">', 0);
?>


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" />


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/brands.min.css" integrity="sha512-apX8rFN/KxJW8rniQbkvzrshQ3KvyEH+4szT3Sno5svdr6E/CP0QE862yEeLBMUnCqLko8QaugGkzvWS7uNfFQ==" crossorigin="anonymous" />


<?php
// 날짜 계산 함수
function passing_time($datetime) {
	$time_lag = time() - strtotime($datetime);
	
	if($time_lag < 60) {
		$posting_time = "방금";
	} elseif($time_lag >= 60 and $time_lag < 3600) {
		$posting_time = floor($time_lag/60)."분 전";
	} elseif($time_lag >= 3600 and $time_lag < 86400) {
		$posting_time = floor($time_lag/3600)."시간 전";
	} elseif($time_lag >= 86400 and $time_lag < 2419200) {
		$posting_time = floor($time_lag/86400)."일 전";
	} else {
		$posting_time = date("Y.m.d", strtotime($datetime));
	} 
	
	return $posting_time;
}
?>
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>



<?php if($is_checkbox) { ?>
<noscript>
<p>자바스크립트를 사용하지 않는 경우<br>별도의 확인 절차 없이 바로 선택삭제 처리하므로 주의하시기 바랍니다.</p>
</noscript>
<?php } ?>

<?php if ($is_checkbox) { ?>
<script>
function all_checked(sw) {
    var f = document.fboardlist;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]")
            f.elements[i].checked = sw;
    }
}

function fboardlist_submit(f) {
    var chk_count = 0;

    for (var i=0; i<f.length; i++) {
        if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
            chk_count++;
    }

    if (!chk_count) {
        alert(document.pressed + "할 게시물을 하나 이상 선택하세요.");
        return false;
    }

    if(document.pressed == "선택복사") {
        select_copy("copy");
        return;
    }

    if(document.pressed == "선택이동") {
        select_copy("move");
        return;
    }

    if(document.pressed == "선택삭제") {
        if (!confirm("선택한 게시물을 정말 삭제하시겠습니까?\n\n한번 삭제한 자료는 복구할 수 없습니다\n\n답변글이 있는 게시글을 선택하신 경우\n답변글도 선택하셔야 게시글이 삭제됩니다."))
            return false;

        f.removeAttribute("target");
        f.action = g5_bbs_url+"/board_list_update.php";
    }

    return true;
}

// 선택한 게시물 복사 및 이동
function select_copy(sw) {
    var f = document.fboardlist;

    if (sw == "copy")
        str = "복사";
    else
        str = "이동";

    var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");

    f.sw.value = sw;
    f.target = "move";
    f.action = g5_bbs_url+"/move.php";
    f.submit();
}
// 게시판 리스트 관리자 옵션
jQuery(function($){
    $(".btn_more_opt.is_list_btn").on("click", function(e) {
        e.stopPropagation();
        $(".more_opt.is_list_btn").toggle();
    });
    $(document).on("click", function (e) {
        if(!$(e.target).closest('.is_list_btn').length) {
            $(".more_opt.is_list_btn").hide();
        }
    });
});
</script>
<?php } ?>



본문이 너무 긴데,,, 어떻게 다 올려보여드리죠 ㅠㅠ? 일단 추려서 올려보았습니다.


// 페이지의 공지개수가 목록수 보다 작을 때만 실행
	if($page_rows > 0) {
			$result = sql_query($sql);

			$k = 0;

			while ($row = sql_fetch_array($result))
			{
					// 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다
					if ($is_search_bbs)
							$row = sql_fetch(" select * from {$write_table} where wr_id = '{$row['wr_parent']}' ");

					$list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
					if (strstr($sfl, 'subject')) {
							$list[$i]['subject'] = search_font($stx, $list[$i]['subject']);
					}
					$list[$i]['is_notice'] = false;
					$list_num = $total_count - ($page - 1) * $list_page_rows - $notice_count;
					$list[$i]['num'] = $list_num - $k;

					$i++;
					$k++;
			}
	}

	g5_latest_cache_data($board['bo_table'], $list);

	$write_pages = get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, get_pretty_url($bo_table, '', $qstr.'&amp;page='));

	$list_href = '';
	$prev_part_href = '';
	$next_part_href = '';
	if ($is_search_bbs) {
			$list_href = get_pretty_url($bo_table);

			$patterns = array('#&amp;page=[0-9]*#', '#&amp;spt=[0-9\-]*#');

			//if ($prev_spt >= $min_spt)
			$prev_spt = $spt - $config['cf_search_part'];
			if (isset($min_spt) && $prev_spt >= $min_spt) {
					$qstr1 = preg_replace($patterns, '', $qstr);
					$prev_part_href = get_pretty_url($bo_table,0,$qstr1.'&amp;spt='.$prev_spt.'&amp;page=1');
					$write_pages = page_insertbefore($write_pages, '<a href="'.$prev_part_href.'" class="pg_page pg_prev">이전검색</a>');
			}

			$next_spt = $spt + $config['cf_search_part'];
			if ($next_spt < 0) {
					$qstr1 = preg_replace($patterns, '', $qstr);
					$next_part_href = get_pretty_url($bo_table,0,$qstr1.'&amp;spt='.$next_spt.'&amp;page=1');
					$write_pages = page_insertafter($write_pages, '<a href="'.$next_part_href.'" class="pg_page pg_end">다음검색</a>');
			}
	}


	$write_href = '';
	if ($member['mb_level'] >= $board['bo_write_level']) {
			$write_href = short_url_clean(G5_BBS_URL.'/write.php?bo_table='.$bo_table);
	}

	$nobr_begin = $nobr_end = "";
	if (preg_match("/gecko|firefox/i", $_SERVER['HTTP_USER_AGENT'])) {
			$nobr_begin = '<nobr>';
			$nobr_end   = '</nobr>';
	}

	// RSS 보기 사용에 체크가 되어 있어야 RSS 보기 가능 061106
	$rss_href = '';
	if ($board['bo_use_rss_view']) {
			$rss_href = G5_BBS_URL.'/rss.php?bo_table='.$bo_table;
	}

	$stx = get_text(stripslashes($stx));
}



답변을 작성하시기 전에 로그인 해주세요.
전체 20
QA 내용 검색

회원로그인

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