g4용 소스를 g5에서 사용하려고 합니다.
본문
G4에서 사용하던 소스를 G5에서 사용하려고 하는데 며칠째 삽질을 해도 답이 안나옵니다.
고수님들의 도움을 청합니다.
================================== g4 ==============================================
<?
$sql = "select gr_id, gr_subject, gr_1 from $g4[group_table] where gr_id not in ($home_ex_main) order by gr_1";
$rst1 = sql_query($sql);
for ($i=0; $row=sql_fetch_array($rst1); $i++){
$sqlp2 = "select * from $g4[board_table] where gr_id = '$row[gr_id]' and bo_table not in ($home_ex_board) order by bo_order_search asc";
$qryp2 = sql_query($sqlp2);
for ($j=0; $rowp2=sql_fetch_array($qryp2); $j++) {
$tmp_write_table = $g4['write_prefix'] . $rowp2[bo_table];
$tmp_row = sql_fetch(" select count(wr_id) as cnt from $tmp_write_table where wr_is_comment = 0 and wr_datetime > (now() - INTERVAL $day DAY) ");
$trdwos = array ("0" => "");
$dwos=strtr($tmp_row[cnt], $trdwos);
//$n_img='<img style="position: absolute; top: -9px; display: block; right: -50px;z-index:99999;" src="'.$g4[path].'/xtx_topmenu/hot2.gif" />';
if($dwos > 0){echo $n_img;}
}
?>
<li class="m<?=$i+1?>"><a href="<?=$g4[path]?>/scuba.php"><span>SCUBA</span></a>
<div class="sub"><ul>
<?
//$sql2 = "select bo_table, bo_subject, bo_category_list from $g4[board_table] where gr_id = '$row[gr_id]' and bo_table not in ($home_ex_board) order by bo_order_search ";
$sql2 = "select bo_table, bo_subject, bo_category_list from $g4[board_table] where gr_id = 'scuba' and bo_table not in ($home_ex_board) order by bo_order_search ";
$rst2 = sql_query($sql2);
for ($j=0; $row2=sql_fetch_array($rst2); $j++){
?>
<li><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$row2[bo_table]?>"><span><img src="<?=$g4[path]?>/xtx_topmenu/icon_0<? $ran_s=mt_rand(1,6);echo "$ran_s";?>.gif" width="11" height="11" alt=""> ‥ <?=$row2[bo_subject]?></span></a></li>
<?}?>
</ul></div></li>
<?}?>
========================================================================================
이걸 아래와 같이 수정했습니다.
======================================================================================
<?
$sql = "select gr_id, gr_subject, gr_1 from $g5[group_table] where gr_id not in ($home_ex_main) order by gr_1";
$rst1 = sql_query($sql);
for ($i=0; $row=sql_fetch_array($rst1); $i++){
$sqlp2 = "select * from {$g5['board_table']} where gr_id = '$row[gr_id]' and bo_table not in ($home_ex_board) order by bo_order_search asc";
$qryp2 = sql_query($sqlp2);
for ($j=0; $rowp2=sql_fetch_array($qryp2); $j++) {
$tmp_write_table = $g5['write_prefix'] . $rowp2[bo_table];
$tmp_row = sql_fetch(" select count(wr_id) as cnt from $tmp_write_table where wr_is_comment = 0 and wr_datetime > (now() - INTERVAL $day DAY) ");
$trdwos = array ("0" => "");
$dwos=strtr($tmp_row[cnt], $trdwos);
//$n_img='<img style="position: absolute; top: -9px; display: block; right: -50px;z-index:99999;" src="'.$g4[path].'/xtx_topmenu/hot2.gif" />';
if($dwos > 0){echo $n_img;}
}
?>
<li class="m<?=$i+1?>"><a href="<?php echo G5_URL ?>/scuba.php"><span>SCUBA</span></a>
<div class="sub"><ul>
<?
//$sql2 = "select bo_table, bo_subject, bo_category_list from $g4[board_table] where gr_id = '$row[gr_id]' and bo_table not in ($home_ex_board) order by bo_order_search ";
$sql2 = "select bo_table, bo_subject, bo_category_list
from {$g5['board_table']}
where gr_id = 'scuba'
and bo_table not in ($home_ex_board) order by bo_order_search ";
$rst2 = sql_query($sql2);
for ($j=0; $row2=sql_fetch_array($rst2); $j++){
?>
<li><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?=$row2[bo_table]?>"><span><img src="<?php echo G5_URL ?>/xtx_topmenu/icon_0<? $ran_s=mt_rand(1,6);echo "$ran_s";?>.gif" width="11" height="11" alt=""> ‥ <?=$row2[bo_subject]?></span></a></li>
<?}?>
</ul></div></li>
<?}?>
!-->!-->
답변 1
전체검색순서인 bo_order_search 해당 필드가 G5에는 없습니다.
대신 아래 필드가 추가되었습니다. 정렬을 원하시면 bo_order_search 대신 bo_order 로..
출력순서 bo_order
전체검색 사용 bo_use_search
답변을 작성하시기 전에 로그인 해주세요.