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

	$msg = "";

}else if($gr_id =="02"){

	$msg = "";

}else if($gr_id =="03"){

	$msg = "";

}else if($gr_id =="04"){

	$msg = "";
	
}else if($gr_id =="05"){

	$msg = "";

}else if($gr_id =="06"){

	$msg = "";

}else if($gr_id =="07"){

	$msg = "";

}else if($gr_id =="08"){

	$msg = "";

}else if($gr_id =="09"){

	$msg = "";

}else if($gr_id =="10"){

	$msg = "";

}else{

	$msg = $g4[title];
}

if(!$msg) $msg = "메시지를 입력해 주세요.";
?>
<!-- 화면을 중앙 고정 시작 -->
<table width="100%" cellspacing="0" cellpadding="0" border="0">
	<tr>
		<td align="center" valign="top">
		<!-- 홈페이지 시작 -->
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td align="<?=$config[cf_home_sub_align]?>" valign="top">				
				<table width="<?=$config[cf_home_sub_width]?>" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td>						
						<table width='100%' cellpadding='0' cellspacing='0' border='0'>
							<tr><td height='25' colspan='3' bgcolor='#F6F6F6'>
								<table width='100%' cellpadding='0' cellspacing='0' border='0'>
									<tr>
										<td class='small'><span style='vertical-align:-5px;'>&nbsp;<b>ㆍ</b>접속자 : <?=connect('basic')?></span></td>
										<td width='10'></td>
										<td class='small' align='right'><span style='vertical-align:-5px;'>&nbsp;<?=visit('basic')?></span>&nbsp;</td>
									</tr>
								</table>
								</td></tr>
							<tr><td height='1' colspan='3' bgcolor='#DDDDDD'></td></tr>
							<tr height='50'>
								<td><a href='<?=$g4[path]?>'><img src='<?=$sub_skin_path?>/img/logo_sub.gif' alt='Onuri' border='0'></a></td>
								<td align='right'>
								<table cellspacing='0' cellpadding='0' border='0'>
								<form name='fsearchbox' method='get' action='javascript:fsearchbox_submit(document.fsearchbox);'>
								<script type='text/javascript'>
									function fsearchbox_submit(f)
									{
										if (f.stx.value == '')
										{
											alert('검색어를 입력하세요.');
											f.stx.select();
											f.stx.focus();
											return;
										}
											/*
										// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
										var cnt = 0;
										for (var i=0; i<f.stx.value.length; i++)
										{
											if (f.stx.value.charAt(i) == ' ')
											cnt++;
										}
										if (cnt > 1)
										{
											alert('빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.');
											f.stx.select();
											f.stx.focus();
											return;
										}
										*/
											f.action = '<?=$g4[bbs_path]?>/search.php';
											f.submit();
										}
									</script>
									<tr>
										<input type='hidden' name='sfl' value='wr_subject||wr_content'>
										<input type='hidden' name='sop' value='and'>
										<td>
											<select id='gr_id' name='gr_id' class=select>
											<option value=''>통합검색</option>
											<?
											if($config[cf_home_ex_search_use] == 1) $home_ex_search = $config[cf_home_ex_search];
											else $home_ex_search = "''";

											$excgr = "(".$home_ex_search.")";
											$sql = " SELECT a.gr_id, a.gr_subject, a.gr_use_access, a.gr_10, b.mb_id FROM $g4[group_table] AS a LEFT JOIN $g4[group_member_table] AS b ON a.gr_id = b.gr_id WHERE (b.mb_id = '$member[mb_id]' AND a.gr_use_access = '1' ) OR a.gr_use_access = '0' and a.gr_id not in " . $excgr . " ORDER BY a.gr_admin";
											$result = sql_query($sql);
											for ($i=0; $row=sql_fetch_array($result); $i++){
											?>
											<option value='<?=$row['gr_id']?>'><?=$row['gr_subject']?></option>
											<?}?>
											</select>
										</td>
										<td width='5'></td>
										<td><INPUT name='stx' maxlength='100' style='width:150px;height:21;' tabIndex=1 class=ed trim value='<?=$stx?>'></td>
										<td width='5'></td>
										<td width='28' align='right'><INPUT type=image src='<?=$sub_skin_path?>/img/btn_search.gif' border='0'></td></tr>
										<tr><td></td></tr></form>
								</table>
								</td>
							</tr>
						</table>
						<table width='100%'' cellpadding='0' cellspacing='0' border='0'>
							<tr height='32'>
								<td width='2'><img src='<?=$sub_skin_path?>/img/box_left.gif' alt=''></td>
								<td background='<?=$sub_skin_path?>/img/box_bg.gif' valign="bottom">
								<?if($gr_id||$bo_table){
											
									if($config[cf_home_ex_sub_use] == 1) $home_ex_sub = $config[cf_home_ex_sub];
									else $home_ex_sub = "''";
									
									$excgr = "(".$home_ex_sub.")";
									$sql = " SELECT a.gr_id, a.gr_subject, a.gr_use_access, a.gr_7, a.gr_8, a.gr_9, a.gr_10, b.mb_id FROM $g4[group_table] AS a LEFT JOIN $g4[group_member_table] AS b ON a.gr_id = b.gr_id WHERE (b.mb_id = '$member[mb_id]' AND a.gr_use_access = '1' ) OR a.gr_use_access = '0' and a.gr_id not in " . $excgr . " ORDER BY a.gr_1";

									$result = sql_query($sql);
									?>
									<table height='28' cellpadding='0' cellspacing='0' border='0'>
										<tr>
											<td width="10"></td>
										<?
										for ($i=0; $row=sql_fetch_array($result); $i++){
										$gLink = (!empty($row['gr_10']))?$row['gr_10']:$g4['bbs_path'].'/'.'group.php?gr_id=' .$row['gr_id'];//그룹링크
										
										if($row['gr_id'] == $gr_id){
										echo "<td width='2' background='$sub_skin_path/img/box_over_left.gif'></td><td background='$sub_skin_path/img/box_over_bg.gif' style='padding: 3 8 0 8;' style='cursor:pointer;' onclick=location.href='".$gLink."'><span class='text1'>".$row['gr_subject']."</span></td><td width='2' background='$sub_skin_path/img/box_over_right.gif'></td>";
										}else{
										echo "<td width='10'></td><td><a href='".$gLink."'><span class='text2'>".$row['gr_subject']."</span></a></td><td width='10'></td>";
										}
										if($i < count($row)+1) echo "<td style='padding: 0 3 0 3;'><img src='$sub_skin_path/img/box_bar.gif'></td>";
									}?>
									</tr></table>
									<?}else{echo "<table height='28' cellpadding='0' cellspacing='0' border='0'><tr><td width='10'></td><td width='2' background='$sub_skin_path/img/box_over_left.gif'></td><td background='$sub_skin_path/img/box_over_bg.gif' style='padding: 3 8 0 8;'><span class='text1'>$config[cf_home_name]</span></td><td width='2' background='$sub_skin_path/img/box_over_right.gif'></td></tr></table>";}?>
								</td>
								<td width='2'><img src='<?=$sub_skin_path?>/img/box_right.gif' alt=''></td>
							</tr>
						</table>
						<?
						if($config[cf_home_ex_board_use] == 1) $home_ex_board = $config[cf_home_ex_board];
						else $home_ex_board = "''";

						$excgr = "(".$home_ex_board.")";
						$sql = " select * from $g4[board_table] where gr_id = '$gr_id' and bo_list_level <= '$member[mb_level]' and bo_table not in " . $excgr . "order by bo_table "; 
						$result = sql_query($sql); 
						$sub_cnt = mysql_num_rows($result) - 1;
						?>
						<table width='100%'' cellpadding='0' cellspacing='0' border='0'>
							<tr height="5"><td colspan="3"></td></tr>
							<tr height="1"><td bgcolor="#eeeeee" colspan="3"></td></tr>
							<tr>
								<td width="1" bgcolor="#eeeeee"></td>
								<td style='padding: 10 6 6 6;' class='small'><?=$msg?></td>
								<td width="1" bgcolor="#eeeeee"></td>
							</tr>
							<tr height="1"><td bgcolor="#eeeeee" colspan="3"></td></tr>
						</table>
						<?if($gr_id||$bo_table){?>
						<!-- 메인 테이블 -->
						<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td>
								<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
									<tr height="<?=$config[cf_home_sub_margin]?>" colspan="4"><td></td></tr>
									<tr>									
										<td valign="top" width="<?=$config[cf_home_sub_left]?>">
										<?=outlogin("basic","bcyan")?>
										<?include_once("$g4[path]/include/sub_menu.php"); // 서브메뉴?>	
										</td>
										<td width="<?=$config[cf_home_sub_margin]?>"></td>
										<td valign="top">
						<?}?>