오름차순 내림차순질문합니다
본문
magnication이나 working distance는 정렬이잘되는데
새로추가하는값들은 정렬이 안되고있습니다.
혹시 list.sking.php 외에 더 수정해야하는 페이지가 따로 존재하나요 ?
소스입니다
아래 빨간부분을 소스 정렬하려고 추가했는데 저기부분은 정렬이안됩니다
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
include_once("$board_skin_path/lib/skin.lib.php");
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 6;
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);?>
<script type="text/javascript" src="<?php echo $board_skin_url?>/highslide/highslide.js"></script>
<script type="text/javascript">
hs.graphicsDir = '<?php echo $board_skin_url?>/highslide/graphics/';
// Identify a caption for all images. This can also be set inline for each image.
hs.captionId = 'the-caption';
hs.outlineType = 'rounded-white';
window.onload = function() {
hs.preloadImages(5);
}
</script>
<script src="<?=$board_skin_url?>/fancySelect.js"></script>
<?php
$kb_zoom = '1'; //pc확대기능 (1일 경우 zoom기능 사용.)
$mo_zoom = '1'; //mobile 확대기능 (1일 경우 zoom기능 사용.)
?>
<? if($member[mb_level] >= 5) { ?>
<!--
<div id="bo_list_total" onclick="window.open('<?=$board_skin_url;?>/category_repair.php?bo_table=<?=$bo_table?>','show','width=830, height=300, menubar=no, status=no, toolbar=no');" style="cursor:pointer;color:red;font-weight:bold;font-size:13pt;">
[카테고리 수정하기]
</div>
<div style="clear:both;"></div>
-->
<? } ?>
<!-- 게시판 카테고리 시작 { -->
<?php if ($is_category) { ?>
<nav id="bo_cate">
<h2><?php echo $board['bo_subject'] ?> 카테고리</h2>
<ul id="bo_cate_ul">
<?php echo $category_option ?>
</ul>
</nav>
<?php } ?>
<!-- } 게시판 카테고리 끝 -->
<!---직접입력------->
<script type="text/javascript">
function goReqreason( obj ) {
if (obj.value == "t" ){ //직접입력 선택시
OnOffDisplay.style.display = "inline";
$('#OnOffDisplay_1').focus();
$('#OnOffDisplay_1').keyup(function() {
$('#wr1').val($(this).val());
});
}
else{
$('#wr1').val( $("#wr_1a option:selected").val() ); //추가
$('#OnOffDisplay_1').val(''); //다른 select 선택시 값이 리셋됨.
OnOffDisplay.style.display = "none";
}
}
</script>
<!-- 게시판 목록 시작 { -->
<div id="bo_list" style="width:<?php echo $width; ?>">
<!-- 게시판 페이지 정보 { -->
<!-- 게시판 검색 시작 { -->
<!-- 검색 -->
<fieldset id="bo_sch" style="margin-bottom:10px; margin-top:30px;">
<div class="board_search" style="" >
<form name="fsearch" method="get">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sca" value="<?=$sca?>">
<input type="hidden" name="wr_1" value="" id='wr1'>
<div style="width:150px; float:left; margin-top:-20px;">
<label style="height:20px;font-size:1.1em; font-weight:bold; line-height:20px; text-indent:10px;">Magnification</label>
<!--<input type="text" style="height:26px;border:1px solid #dcdcdc;border-radius:5px;color:#000;line-height:2em" name="wr_1" value='<?=$_GET[wr_1]?>' >-->
<select id="wr_1a" name="wr_1a" onChange='goReqreason(this)' style="width:130px;cursor: pointer;border: 1px solid #dcdcdc; color: #8a8a8a; border-radius: 5px; text-indent: 5px; height: 28px;">
<option value="">ALL</option>
<option value="0~0.2">0.2x 이하</option>
<option value="0.2~0.5">0.2x~0.5x</option>
<option value="0.5~1">0.5x~1x</option>
<option value="1~5">1x~5x</option>
<option value="5~100000">5x 이상</option>
<option value="t">직접입력</option>
</select>
<span id='OnOffDisplay' style="display:none;">
<input type="text" id="OnOffDisplay_1" name="wr_1b" value="<?=$_GET[wr_1b]?>" style="float:left;margin-left:11px;margin-top:10px;height:26px;border:1px solid #dcdcdc;border-radius:5px;color:#000;line-height:2em" >
</span>
</div>
<div style="width:150px; float:left;margin-top:-20px;margin-left:20px;">
<label style="height:20px;font-size:1.1em; font-weight:bold; line-height:20px; text-indent:10px;">Working Distance</label>
<!--<input type="text" style="height:26px;border:1px solid #dcdcdc;border-radius:5px;color:#000;line-height:2em" name="wr_4" value='<?=$_GET[wr_4]?>'>-->
<select id="wr_4" name="wr_4"style="width:130px;cursor: pointer;border: 1px solid #dcdcdc; color: #8a8a8a; border-radius: 5px; text-indent: 5px; height: 28px;">
<option value="">ALL</option>
<option value="0~50">50mm 이하</option>
<option value="51~100">51~100mm</option>
<option value="101~150">101~150mm</option>
<option value="151~200">151~200mm</option>
<option value="201~300">201~300mm</option>
<option value="300~1000000">300mm 이상</option>
</select>
</div>
<div style="width:150px; float:left;margin-top:-20px;margin-left:20px;">
<label style="height:20px; margin-left:-15px;font-size:1.1em; font-weight:bold; line-height:20px; text-indent:10px;">image size</label>
<!--<input type="text" style="border:1px solid #dcdcdc;border-radius:5px;color:#000;line-height:2em" name="wr_14" value='<?=$_GET[wr_14]?>'> -->
<select id="wr_2" name="wr_2"style="width:130px;cursor: pointer;border: 1px solid #dcdcdc; color: #8a8a8a; border-radius: 5px; text-indent: 5px; height: 28px;">
<option value="">ALL</option>
<option value="6">6mm</option>
<option value="8">8mm</option>
<option value="11">11mm</option>
<option value="0~10">10mm 이하</option>
<option value="10~20">10~20mm</option>
<option value="20~40">20~40mm</option>
<option value="40~ 100000">40mm 이상</option>
</select>
</div>
<div style="width:150px; float:left;margin-top:-20px;margin-left:20px;">
<label style="float:left;height:20px;margin-left:30px;font-size:1.1em; font-weight:bold; line-height:20px; text-indent:10px;">전체 검색</label>
<input type="hidden" name="sfl" value="wr_subject||wr_1||wr_2||wr_3||wr_4||wr_5||wr_6||wr_7||wr_8||wr_9||wr_10||wr_11||wr_12||wr_13||wr_14||wr_15||wr_16">
<input type="hidden" name="sop" value="and">
<label for="sch_stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
<input type="text" name="stx" id="sch_stx" maxlength="20" value="<? if($_GET['stx']) { echo $_GET['stx']; }?>"style="float:left;margin-left:11px;matgin-top:50px;height:26px;border:1px solid #dcdcdc;border-radius:5px;color:#000;line-height:2em">
</div>
<div style="width:150px;float:left;margin-left:20px;">
<select name="sst" id="sst"name="sst" style="width:130px;cursor: pointer;border: 1px solid #dcdcdc; color: #8a8a8a; border-radius: 5px; text-indent: 5px; height: 28px;">
<option value="">정렬</option>
<? $s_arr = array("wr_1,asc"=>"magnification 오름차순",
"wr_1,desc"=>"magnification 내림차순",
"wr_4,asc"=>"working distance 오름차순",
"wr_4,desc"=>"working distance 내름차순",
"wr_2,asc"=>"image size 오름차순",
"wr_2,desc"=>"image size 내림차순",
"wr_3,asc"=>"FOV 오름차순",
"wr_3,desc"=>"FOV 내림차순"
);
foreach($s_arr as $key => $value) {
$sel = $_GET['sst'] == $key ? " selected" : "";
echo "<option value='".$key."'".$sel.">".$value."</option>";
}?>
</select>
</div>
<script type="text/javascript">
$("#wr_1a").val('<?if(strlen($_GET[wr_1]) == 0 && strlen($_GET[wr_1]) > 0){echo $_GET[wr_1];}else{echo $_GET[wr_1];}?>');
$("#wr_4").val('<?if(strlen($_GET[wr_4]) == 0 && strlen($_GET[wr_4]) > 0){echo $_GET[wr_4];}else{echo $_GET[wr_4];}?>');
$("#wr_2").val('<?if(strlen($_GET[wr_2]) == 0 && strlen($_GET[wr_2]) > 0){echo $_GET[wr_2];}else{echo $_GET[wr_2];}?>');
$("#wr_3").val('<?if(strlen($_GET[wr_3]) == 0 && strlen($_GET[wr_3]) > 0){echo $_GET[wr_3];}else{echo $_GET[wr_3];}?>');
$("#sfl2").val('<?if(strlen($_GET[sfl2]) == 0 && strlen($_GET[sfl2]) > 0){echo $_GET[sfl2];}else{echo $_GET[sfl2];}?>');
$('#sfl').fancySelect();
</script>
<input type="submit" value="검색" class="btn_submit" style="float:right;margin-top:-5px;">
</form>
</div>
</fieldset>
<script type="text/javascript">
$(function() {
var tbl = $("input[name='bo_table']").val();
var sfl = $("input[name='sfl']").val();
var stx = $("input[name='stx']").val();
var page = $("input[name='page']").val();
$("#sst").on("change", function() {
// $(location).attr("href", "?bo_table=" + tbl + "&sop=and&sst=" + $(this).val() + "&sod=desc&sfl=" + sfl + "&stx=" + stx + "&page=" + page);
var ssot = document.getElementById("sst");
var var_sor = ssot.options[ssot.selectedIndex].value;
var afterStr = var_sor.split(',');
$(location).attr("href", "?bo_table=" + tbl + "&sop=and&sst=" + afterStr[0] + "&sod="+ afterStr[1] +"&sfl=" + sfl + "&stx=" + stx + "&page=" + page);
});
});
</script>
<!-- } 게시판 검색 끝 -->
<script>
//<!--[[CDATA
$(document).ready(function(){
$(window).on("scroll", function(){
var wTop = $(window).scrollTop();
if(wTop> $("body").offset().top-700){
$(".header_top").addClass("tabsFixed",400);
$(".header_top").css("display","block");
}
if(wTop< $("html").offset().top+700){
$(".header_top").removeClass("tabsFixed");
$(".header_top").css("display","none");
}
});
});
//]]-->
</script>
<style>
.header_top {width:1190px; height:70px;position:absolute; top:570px; z-index:9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;display:none;}
.tabsFixed {position:fixed; top:0; z-index:9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;}
</style>
<!-- 페이지 -->
<div style="clear:both;"></div>
<div style="margin:20px 0;">
<?php echo $write_pages; ?>
</div>
<!-- 페이지 -->
<form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="sw" value="">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $board['bo_subject'] ?> 목록</caption>
<thead class="header_top">
<tr>
<th scope="col" style="width:13%;">Model</th>
<th scope="col">Mag<br>(x)</th>
<th scope="col">Image<br>circle<br>(mm)</th>
<th scope="col">FOV<br>diagonal<br>(mm)</th>
<th scope="col">WD<br>(mm)</th>
<th scope="col">Resolution<br>(um)</th>
<th scope="col">f/#</th>
<th scope="col">NAO</th>
<th scope="col">DOF<br>(mm)</th>
<th scope="col">Telecentricity<br>(<degree)</th>
<th scope="col">Distortion<br>(%)</th>
<th scope="col">coaxial illumination</th>
<th scope="col">iris</th>
<th scope="col">mount</th>
<th scope="col">camera</th>
<th scope="col">TTL<br>(mm)</th>
<th scope="col">비고</th>
<th scope="col" style="width:50px;">File</th>
</tr>
</thead>
<thead>
<tr>
<?php if ($is_checkbox) { ?>
<th scope="col" class="chch">
<label for="chkall" class="sound_only">현재 페이지 게시물 전체</label>
<input type="checkbox" id="chkall" onclick="if (this.checked) all_checked(true); else all_checked(false);">
</th>
<?php } ?>
<!-- <th scope="col">Photos</th>--><!--==========================================================================================================이미지 주석-->
<th scope="col" style="width:13%;">Model</th>
<th scope="col">Mag<br>(x)</th>
<th scope="col">Image<br>circle<br>(mm)</th>
<th scope="col">FOV<br>diagonal<br>(mm)</th>
<th scope="col">WD<br>(mm)</th>
<th scope="col">Resolution<br>(um)</th>
<th scope="col">f/#</th>
<th scope="col">NAO</th>
<th scope="col">DOF<br>(mm)</th>
<th scope="col">Telecentricity<br>(<degree)</th>
<th scope="col">Distortion<br>(%)</th>
<th scope="col">coaxial illumination</th>
<th scope="col">iris</th>
<th scope="col">mount</th>
<th scope="col">camera</th>
<th scope="col">TTL<br>(mm)</th>
<th scope="col">비고</th>
<th scope="col" style="width:50px;">File</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $i<count($list); $i++) {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" >';
} else {
$img_content = '';
}
$list[$i][file] =get_file($bo_table, $list[$i][wr_id]);
$imagepath = $list[$i][file][0][path]."/".$list[$i][file][0][file];
?>
<tr class="<?php if ($list[$i]['is_notice']) echo "bo_notice"; ?>">
<?php if ($is_checkbox) { ?>
<td class="td_chk">
<label for="chk_wr_id_<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['subject'] ?></label>
<input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>">
</td>
<!--
<td class="td_1">
<?php
$wrid = $list[$i][wr_id];
$sql_img = sql_fetch ("select* from g5_board_file where wr_id = '$wrid' and bo_table='$bo_table' and bf_no = '0'");
$zoomimg_style= 'cursor: url('.$board_skin_url.'/highslide/graphics/zoomin.cur), pointer;outline: none;position:absolute;right:5px;bottom:5px;';
if($sql_img['bf_file']){
$img_links = '/data/file/'.$bo_table.'/'.$sql_img[bf_file];
}else{
$matches = get_editor_image($list[$i]['wr_content']);
preg_match("/src=[\'\"]?([^>\'\"]+[^>\'\"]+)/i", $matches[1][0], $m);
// 이미지 path 구함
$p = parse_url($m[1]);
if(strpos($p['path'], '/'.G5_DATA_DIR.'/') != 0)
$data_path = preg_replace('/^\/.*\/'.G5_DATA_DIR.'/', '/'.G5_DATA_DIR, $p['path']);
else
$data_path = $p['path'];
$img_links = $data_path;
}
?>
<a href="<?php echo $img_links?>" class='highslide' onclick='return hs.expand(this)'>
<?
echo $img_content;
?>
</a>
</td>
-->
<?php } ?>
<!--
<td class="g5_img" <? if(!$thumb['src']) { ?>style="display:none;"<? } ?>>
<a href="<?=G5_URL;?>/bbs/board.php?bo_table=<?=$bo_table;?>&wr_id=<?=$list[$i]['wr_id'];?>">
<?php
echo "<div>";
echo $img_content;
echo "</div>";
?>
</td>
-->
<!--==========================================================================================================이미지 주석-->
<td class="td_subject">
<a href="<?php echo $list[$i]['href'] ?>">
<?php echo $list[$i]['wr_subject'] ?>
<? if($is_member){ ?>
</a>
<? } ?>
</td>
<td>
<!--
<? if($is_member){ ?>
<a href="<?php echo $list[$i]['href'] ?>">
<? } ?>
-->
<?php echo $list[$i]['wr_1'] ?>
<!--
<? if($is_member){ ?>
</a>
<? } ?>
<? if($is_member) { ?>
<span class="caption">
<a href="javascript:rank('up','<?=$list[$i][wr_id]?>')" style="font-size:11pt;" class="thumbnail text-center">▲</a> <a href="javascript:rank('down','<?=$list[$i][wr_id]?>')" style="font-size:11pt;text-decoration:none;" class="thumbnail text-center">▼</a>
</span>
<? } ?>
-->
</td>
<td>
<?php echo $list[$i]['wr_2'] ?>
</td>
<td>
<?php echo $list[$i]['wr_3'] ?>
</td>
<td>
<?php echo $list[$i]['wr_4'] ?>
</td>
<td>
<?php echo $list[$i]['wr_5'] ?>
</td>
<td>
<?php echo $list[$i]['wr_6'] ?>
</td>
<td>
<?php echo $list[$i]['wr_7'] ?>
</td>
<td>
<?php echo $list[$i]['wr_8'] ?>
</td>
<td>
<?php echo $list[$i]['wr_9'] ?>
</td>
<td>
<?php echo $list[$i]['wr_10'] ?>
</td>
<td>
<?php echo $list[$i]['wr_11'] ?>
</td>
<td>
<?php echo $list[$i]['wr_12'] ?>
</td>
<td>
<?php echo $list[$i]['wr_13'] ?>
</td>
<td>
<?php echo $list[$i]['wr_14'] ?>
</td>
<td>
<?php echo $list[$i]['wr_15'] ?>
</td>
<td>
<?php echo $list[$i]['wr_16'] ?>
</td>
<td>
<?php
$sql = " select * from $g5[board_file_table] where bo_table = '". $bo_table. "' and wr_id = '". $list[$i][wr_id] ."' order by bf_no ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
$down_link = "download.php?bo_table={$bo_table}&wr_id={$list[$i][wr_id]}&no={$row[bf_no]}";
$file_source = addslashes($row[bf_source]);
$file_type = preg_replace('/^.*\.([^.]+)$/D', '$1', $file_source);
$file_type = strtolower($file_type);
$file_size = get_filesize($row[bf_filesize]);
// if(!in_array($file_type, array( 'jpeg', 'gif', 'bmp', 'png'))){ //이미지는 제외
echo "<a href=\"".$down_link."\" title=\"".$file_source."\">";
// echo "<img src='". $board_skin_url ."/filetype/". $file_type .".gif' border=0 align='absmiddle' alt=\"".$file_source."\">({$file_size})";
echo "<img src='". $board_skin_url ."/filetype/". $file_type .".gif' border=0 align='absmiddle' alt=\"".$file_source."\">";
echo "</a> ";
// }
}
// $ss_name = "ss_view_{$bo_table}_{$list[ $i]['wr_id']}";
// if (!get_session($ss_name)); set_session($ss_name, TRUE);
//
// if( $list[ $i][ 'icon_file']) {
// echo "<a href=\"javascript:file_download('{$list[ $i][file][0][href]}', '{$list[ $i][file][0][source]}');\" title='{$list[ $i][file][0][content]}'>";
// echo $list[ $i][ 'icon_file'];
// echo '</a>';
// }
?>
<script language="JavaScript">
function file_download(link, file) {
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"'다운로드 하시겠습니까?"))<?}?>
document.location.href=link;
}
</script>
</td>
<!--
<td>
<?php
$ss_name = "ss_view_{$bo_table}_{$list[ $i]['wr_id']}";
if (!get_session($ss_name)); set_session($ss_name, TRUE);
if( $list[ $i][ 'icon_file']) {
echo "<a href=\"javascript:file_download('{$list[ $i][file][1][href]}', '{$list[ $i][file][1][source]}');\" title='{$list[ $i][file][1][content]}'>";
echo $list[ $i][ 'icon_file'];
echo '</a>';
}
?>
<script language="JavaScript">
function file_download(link, file) {
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"'다운로드 하시겠습니까?"))<?}?>
document.location.href=link;
}
</script>
</td>
-->
<!--
<td class="td_year">
<? if($list[$i][file][1]) { ?>
<a href="<?=G5_BBS_URL?>/view_image.php?bo_table=<?=$bo_table?>&fn=<?=urlencode($list[$i][file][1][file])?>" target="_blank" class="view_image">
<? } ?>
<? if($bo_table == "board_product07") { ?>
<img src="<?=G5_URL?>/img/price1_btn.jpg" />
<? } else { ?>
<img src="<?=G5_URL?>/img/price_btn.jpg" />
<? } ?>
<? if($list[$i][file][1]) { ?>
</a>
<? } ?>
</td>
-->
</tr>
답변 1
bbs/list.php에서 아래의 구문이 정렬을 담당하는 부분입니다. 해당 부분이 제대로 처리가 되었는지 확인해보세요
$sst = preg_match("/^(wr_datetime|wr_hit|wr_good|wr_nogood)$/i", $sst) ? $sst : "";