<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

// 자신만의 코드를 넣어주세요.
$latest_skin_path  =  $g4[path]."/include";


	$mct    = " where po_poll9 = 'gr_id' ";
    $mct  .=  " and    po_cnt16  != 1 ";  
	$result = sql_query( "select * from $g4[site_bill] $mct order by po_cnt7");
    $g_count = mysql_num_rows($result);




?>
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">

  <tr>
    <td width='10' height='10'><img src='<?=$latest_skin_path?>/img/m_neto1.gif' width='10' height='10' border='0'></td>
    <td background='<?=$latest_skin_path?>/img/m_neto2.gif' height='10'>    </td>
    <td><img src='<?=$latest_skin_path?>/img/m_neto3.gif' width='10' height='10' border='0'></td>
  </tr>
  <tr>
    <td background='<?=$latest_skin_path?>/img/m_neto4.gif' width="10"></td>
    <td align='center' valign='top' bgcolor='#FFFFFF'>
   <table border="0" cellspacing="0" cellpadding="0" width="820" align="center">
   <tr height="22"><td colspan="3">&nbsp;&nbsp;&nbsp;<b><?=$config[cf_title]?></b> 바로가기</td></tr>
<?
while ($g_row = sql_fetch_array($result)) 
{

  //$g_row[po_poll1]  그릅명
   $b_mct   = " where po_poll3  = '$g_row[po_poll1]' ";
   $b_mct  .= " and po_poll9  = 'bo_table' ";


   $b_sql   = " select * from $g4[site_bill]  $b_mct order by po_cnt9 desc  ";
   $b_result = sql_query($b_sql);







  ?>

   <tr><td width="16" height="25"></td><td width="110" ><span style='font-family:Tahoma;font-size:9pt;color:#717171;'><b><?=$g_row[po_subject]?><b></span></td>
       <td>
       <?
     while ($b_row = sql_fetch_array($b_result)) 
     {


       $b_href = "{$g4[bbs_path]}/board.php?bo_table={$b_row[po_poll1]}";


       //해당페이지에 새로운글이 있을경우 new를 표시한다.
       //기간별 조건검색이 없는경우
         //검색 시작일
         $s_turn   = 0.0001; 
	       $s_day    = 24;
	       $s_time   = $s_day*$s_turn; //정수값을 1일로 환산처리.
         $now_time = $g4[time_ymdhis];  //현재시간기준,  삭제해도 됨.
         $s_start  = date("Y-m-d H:i:s", time()-3600 * $s_time); 
         
         //검색 마지막일
         $e_turn   = 2; 
	       $e_day    = 24;
	       $e_time   = $e_day*$e_turn; //정수값을 1일로 환산처리.
         $now_time = $g4[time_ymdhis];  //현재시간기준,  삭제해도 됨.
         $e_end  = date("Y-m-d H:i:s", time()-3600 * $e_time); 
         
	       $s_mct  =  "wr_is_comment = 0 ";
	       $s_mct .=  " and wr_datetime <= '$s_start'";
	       $s_mct .=  " and wr_datetime >= '$e_end'";
       
       $s_table  = $b_row[po_poll1];
       $sr_table = "g4_write_$s_table";

       $s_sql    = " select * from $sr_table where $s_mct  ";
       $s_result = sql_query($s_sql);
       $s_count = mysql_num_rows($s_result);
       
       if($s_count > 0){
         $new_name = "<SPAN class=tj><font color='#FF6699'>new</font></SPAN>";
		 $new_name = "<img src='{$g4[path]}/images/map_new.gif'  border='0'>";
         }
         else{
         $new_name = "";
           }
         
					   

        if($s_table == 'yeyak' || $s_table == 'top13' ){
        $p_p    =  "<b>";
		$p_q    =  "</b>";
          }
          else{
        $p_p = "";
		$p_q    =  "";
            }

        if($s_table == 'top12' || $s_table == 'um_05'){
        $hot_menu    =  "<img src='{$g4[path]}/images/map_hot.gif' border='0'>";
          }
          else{
        $hot_menu = "";
            }



        //수동 추가시

		{?><?=$p_p?><a href="<?=$b_href?>"  border="0"><?=$b_row[po_subject]?></a><?=$$p_q?>&nbsp;<?=$hot_menu?><?=$new_name?>&nbsp;<?}


 
       ?>
       




     <?}
     ?>
       </td>
   </tr>

<?}
?>
<?if(!$g_count){echo "<tr><td height='100' align='center'>사이트맵, 그릅페이지에서 출력지정하시기 바랍니다.</td></tr>";}?>
</table>
  </td>
    <td background='<?=$latest_skin_path?>/img/m_neto5.gif' width="10"></td>
  </tr>
  <!----
  <tr>
    <td height='10'><img src='<?=$latest_skin_path?>/img/m_neto6.gif' width='10' height='10' border='0'></td>
    <td background='<?=$latest_skin_path?>/img/m_neto7.gif'></td>
    <td><img src='<?=$latest_skin_path?>/img/m_neto8.gif' width='10' height='10' border='0'></td>
  </tr>
  ---->
</table>
