정열 문제인데, 막히네요 정보
정열 문제인데, 막히네요
본문
수정하다가 여기서 막혔습니다.
도움을 주시면 감사하게 사용하겠습니다.
<?
$sql = " select gr_id, gr_subject from $g4[group_table] where gr_id = '$gr_id'";//해당그룹 $gr_id를 해당그룹명으로 대체가능
$result = sql_query($sql);
while ($row=mysql_fetch_array($result)) {
$sql2 = " select bo_subject, bo_table from $g4[board_table] where (bo_list_level <= $member[mb_level]) and (gr_id = '$row[gr_id]') and bo_use_search = '1' order by bo_order_search";
$result2 = sql_query($sql2);
while ($row2=mysql_fetch_array($result2)) {
$new_time = date("Y-m-d H:i:s", time()-3600*$row2[bo_new]);
$sql3 = " select count(*) as cnt from $g4[write_prefix]$row2[bo_table] where wr_datetime >= '$new_time' ";
$row3 = sql_fetch($sql3);
if ($row2[bo_table] == $bo_table)
echo "<tr><td background=$g4[path]/images/rightmenu_bg.gif width=154 height=25 style=padding-left:29;padding-top:3><a href='$g4[bbs_path]/board.php?bo_table=$row2[bo_table]' onfocus='this.blur()'><font color=#616B71><b>$row2[bo_subject]<b></font></a></td></tr>";
else
echo "<tr><td background=$g4[path]/images/rightmenu_bg.gif width=154 height=25 style=padding-left:29;padding-top:3><a href='$g4[bbs_path]/board.php?bo_table=$row2[bo_table]' onfocus='this.blur()'>$row2[bo_subject]</a></td></tr>"; //네모 뷸릿 + 테이블명 + new 아이콘
}
}
?>
$sql = " select gr_id, gr_subject from $g4[group_table] where gr_id = '$gr_id'";//해당그룹 $gr_id를 해당그룹명으로 대체가능
$result = sql_query($sql);
while ($row=mysql_fetch_array($result)) {
$sql2 = " select bo_subject, bo_table from $g4[board_table] where (bo_list_level <= $member[mb_level]) and (gr_id = '$row[gr_id]') and bo_use_search = '1' order by bo_order_search";
$result2 = sql_query($sql2);
while ($row2=mysql_fetch_array($result2)) {
$new_time = date("Y-m-d H:i:s", time()-3600*$row2[bo_new]);
$sql3 = " select count(*) as cnt from $g4[write_prefix]$row2[bo_table] where wr_datetime >= '$new_time' ";
$row3 = sql_fetch($sql3);
if ($row2[bo_table] == $bo_table)
echo "<tr><td background=$g4[path]/images/rightmenu_bg.gif width=154 height=25 style=padding-left:29;padding-top:3><a href='$g4[bbs_path]/board.php?bo_table=$row2[bo_table]' onfocus='this.blur()'><font color=#616B71><b>$row2[bo_subject]<b></font></a></td></tr>";
else
echo "<tr><td background=$g4[path]/images/rightmenu_bg.gif width=154 height=25 style=padding-left:29;padding-top:3><a href='$g4[bbs_path]/board.php?bo_table=$row2[bo_table]' onfocus='this.blur()'>$row2[bo_subject]</a></td></tr>"; //네모 뷸릿 + 테이블명 + new 아이콘
}
}
?>
자동으로 서브메뉴를 구성하는 소스중 일부분인데, 게시판이 3개있다고 가정하여 말씀드리면,
위 소스그대로 적용하면
03
02
01
순으로 게시판메뉴가 생성이됩니다. 근데 이것을 역순으로 하려면 어떻게 하는지 모르겠습니다.
제 짥막한 지식으로 알고 있는것은, sql쿼리문에서 desc, asc이런걸 바꿔주는 것이 한계인지라,
제지식으론 해결할 수 가없네요.
게시판이
01
02
03
순으로 배열하게 하려면 어떻게 하는지 궁금합니다.
댓글 전체
order by bo_order_search 로 정렬이 되므로 각 게시판 설정에서 전체검색 순서에서 게시판마다
전체검색시 정렬되는 순서(번호) 를 지정한후 아래처럼 순서를 바꾸면 될성 싶습니다.
order by bo_order_search desc
order by bo_order_search asc
전체검색시 정렬되는 순서(번호) 를 지정한후 아래처럼 순서를 바꾸면 될성 싶습니다.
order by bo_order_search desc
order by bo_order_search asc
답변감사합니다.
저도 이 스킨 사용 합니다.
게시판 생성 시간 순으로 표시 됩니다.
이것 정령 방법은 간단 합니다.
각 게시판 수정에 들어가면 전체검색 순서의 기본값이 0 입니다.
이 순서를 조정 하시면 됩니다.
-2 <---가장 위에 위치
-1 <--- 2번째 위치
0 <---- 기본값인데 게시판 생성 순서대로 표시됨
1 <--- 4번째 위치
2 <--- 5번째 위치
-10 부터 위로부터 시작하시면 될듯 합니다. ^^
아참..그리고...
온누리 엑박 계급장 스킨 잘 사용하고 있습니다.
조금 수정해서 사용하고 있지만요. 이 자리를 빌어서 감사 드립니다. ^^
게시판 생성 시간 순으로 표시 됩니다.
이것 정령 방법은 간단 합니다.
각 게시판 수정에 들어가면 전체검색 순서의 기본값이 0 입니다.
이 순서를 조정 하시면 됩니다.
-2 <---가장 위에 위치
-1 <--- 2번째 위치
0 <---- 기본값인데 게시판 생성 순서대로 표시됨
1 <--- 4번째 위치
2 <--- 5번째 위치
-10 부터 위로부터 시작하시면 될듯 합니다. ^^
아참..그리고...
온누리 엑박 계급장 스킨 잘 사용하고 있습니다.
조금 수정해서 사용하고 있지만요. 이 자리를 빌어서 감사 드립니다. ^^
답변 감사합니다.