<?php
$sub_menu = "777400";
include_once('./_common.php');

include_once(AMINA_PATH.'/lib/admin.lib.php');

$g5['title'] = $g4['title'] = '여분필드관리';

include_once(G5_ADMIN_PATH.'/admin.head.php');

if(AMINA) echo '<br /><br />'."\n";

?>

<link rel="stylesheet" href="<?php echo AMINA_URL; ?>/css/admin.css" />
<script>
	var amina_url = "<?php echo AMINA_URL; ?>";
	var gnu_url = "<?php echo AMINA_URL; ?>";
	var bo_table  = "<?php echo $bo_table; ?>";
</script>
<script src="<?php echo AMINA_URL; ?>/js/admin.js"></script>

<div style="padding:10px; background:#333; color:#fff;">
	<b>※ 여분필드관리</b>
</div>
<div style="border:1px solid #ddd; line-height:20px; background#fafafa;">
	<ol>
	<li>그누보드 기본(cf_)/그룹(gr_)/게시판(bo_) 여분필드 설정입니다.</li>
	<li>일반페이지에 대한 타이틀 및 설명 설정은 amina.skin.php 파일에서 직접 해주셔야 합니다.</li>
	<li>인기검색어는 테마에 따라 적용안 될 수 있으며, 각 검색어는 콤마(,)로 구분해서 입력해 주세요.</li>
	<li>최고/그룹/보드 복수관리자, 관리자 제외 표시, 특별회원, 글등록회원은 회원아이디를 콤마(,)로 구분해서 입력해 주세요.</li>
	<li>복수관리자 설정을 위해서는 그누보드 원본수정이 필요하며, 수정방법은 매뉴얼을 참고해 주세요.</li>
	</ol>
</div>
<form id="amina_setup" name="fboardform" method="post" action="<?php echo AMINA_URL; ?>/admin.extra.update.php" enctype="multipart/form-data">
<input type="hidden" name="mode" value="cf">

<table border=0 class="admin_tbl">
<tr class="head_gray">
<td align="center">구분</td>
<td>아이디</td>
<td align="center" width="80">항목</td>
<td>여분필드 입력하기</td>
</tr>

<tr>
<td align="center" rowspan="4"><b>기본</b></td>
<td rowspan="4">
	<input type="hidden" name="m_type[]" value="cf">
	<input type="hidden" name="m_id[]" value="1">
	<input type="hidden" name="m_title[]" value="1">
	<input type="hidden" name="m_desc[]" value="1">
	<b>-</b>
</td>
<td align="center" bgcolor="#fafafa"><b>인기검색어</b></td>
<td>
	<input type="text" name="m_popular[]" size="80" value="<?php echo $config['cf_3'];?>">
</td>
</tr>
<tr>
<td align="center" bgcolor="#fafafa">최고관리자</td>
<td>
	<input type="text" name="m_admin[]" size="80" value="<?php echo $config['cf_1'];?>">
</td>
<tr>
<td align="center" bgcolor="#fafafa">관리자제외</td>
<td>
	<input type="text" name="m_admin_display[]" size="80" value="<?php echo $config['cf_1_subj'];?>">
</td>
</tr>
<tr>
<td align="center" bgcolor="#fafafa">스페셜회원</td>
<td>
	<input type="text" name="m_writer[]" size="80" value="<?php echo $config['cf_2'];?>">
</td>
</tr>
<?php
	if(AMINA) {
		$gr_order = 'gr_order';
		$bo_order = 'bo_order';
	} else {
		$gr_order = 'gr_10';
		$bo_order = 'bo_order_search';
	}

	$sql = " select * from {$g5['group_table']} order by $gr_order ";
	$result = sql_query($sql);
	for ($i=0; $row=sql_fetch_array($result); $i++) {
?>
	<tr bgcolor="#f5f5f5">
	<td align="center" rowspan="2"><b>그룹</b></td>
	<td rowspan="2">
		<input type="hidden" name="m_type[]" value="gr">
		<input type="hidden" name="m_id[]" value="<?php echo $row['gr_id'];?>">
		<input type="hidden" name="m_popular[]" value="1">
		<input type="hidden" name="m_admin_display[]" value="1">
		<input type="hidden" name="m_writer[]" value="1">
		<b><?php echo $row['gr_id'];?></b>
	</td>
	<td align="center"><b>타이틀표시</b></td>
	<td>
		<input type="text" name="m_title[]" size="30" value="<?php echo $row['gr_1_subj'];?>">
		설명 <input type="text" name="m_desc[]" size="42" value="<?php echo $row['gr_1'];?>">
	</td>
	</tr>
	<tr bgcolor="#f5f5f5">
	<td align="center">그룹관리자</td>
	<td>
		<input type="text" name="m_admin[]" size="80" value="<?php echo $row['gr_3'];?>">
	</td>
	</tr>
	<?php
		$sql2 = " select * from {$g5['board_table']} where gr_id = '{$row['gr_id']}' order by $bo_order ";
		$result2 = sql_query($sql2);
		$ressult2_cnt = mysql_num_rows($result2);
		for ($k=0; $row2=sql_fetch_array($result2); $k++) {
	?>
		<tr>
		<td align="center" rowspan="3">보드</td>
		<td rowspan="3">
			<input type="hidden" name="m_type[]" value="bo">
			<input type="hidden" name="m_id[]" value="<?php echo $row2['bo_table'];?>">
			<input type="hidden" name="m_popular[]" value="1">
			<input type="hidden" name="m_admin_display[]" value="1">
			<b><?php echo $row2['bo_table'];?></b>
		</td>
		<td align="center" bgcolor="#fafafa"><b>타이틀표시</b></td>
		<td>
			<input type="text" name="m_title[]" size="30" value="<?php echo $row2['bo_1_subj'];?>">
			설명 <input type="text" name="m_desc[]" size="42" value="<?php echo $row2['bo_1'];?>">
		</td>
		</tr>
		<tr>
		<td align="center" bgcolor="#fafafa">보드관리자</td>
		<td>
			<input type="text" name="m_admin[]" size="80" value="<?php echo $row2['bo_3'];?>">
		</td>
		</tr>
		<tr>
		<td align="center" bgcolor="#fafafa">글등록회원</td>
		<td>
			<input type="text" name="m_writer[]" size="80" value="<?php echo $row2['bo_4'];?>">
		</td>
		</tr>
	<?php } ?>
<?php } ?>
</table>
<br>
<p align="center"><input type="submit" accesskey="s" value=" 저장하기 " class="btn_red"></p>
</form>

<?php include_once (G5_ADMIN_PATH.'/admin.tail.php'); ?>