<?php
$restriction=new_restriction($restriction,'text_max_150','string',1,150,0,0,'');
$restriction=new_restriction($restriction,'text_max_250','string',0,250,0,0,'');
$restriction=new_restriction($restriction,'text_max_16384','string',0,16384,0,0,'');
$enumeration =new_enumeration($enumeration,0,$lang['root_class']);
if ($_GET['action']=='edit'){
$query=$db->query('select boardid,boardtype,parentstr,parentid,depth from '.$dv.'board where boardid <> '.intval($_GET['editid']).' and parentid <> '.intval($_GET['editid']).' order by rootid,orders');
while($forum_1 = $db->fetch_array($query)) {
if (!strpos(','.$forum_1['parentstr'].',',','.intval($_GET['editid']).',')){
	if($forum_1['depth']==0){
		$str1=$lang['board.form.str1'];
		}else{
		$str1='';
		for ($j=0;$j<$forum_1['depth'];$j++)
					{
						if ($j>0){
							$str1.="&nbsp;|";
							}
						$str1.="&nbsp;";
					}
					$str1.=$lang['board.form.str2'];
	}
$enumeration =new_enumeration($enumeration,$forum_1['boardid'],'&nbsp;'.$str1.replacehtml($forum_1['boardtype']));
}
}
}else{
$query=$db->query('select boardid,boardtype,parentstr,parentid,depth from '.$dv.'board order by rootid,orders');
while($forum_1 = $db->fetch_array($query)) {
	if($forum_1['depth']==0){
		$str1=$lang['board.form.str1'];
		}else{
		$str1='';
		for ($j=0;$j<$forum_1['depth'];$j++)
					{
						if ($j>0){
							$str1.="&nbsp;|";
							}
						$str1.="&nbsp;";
					}
					$str1.=$lang['board.form.str2'];
	}
$enumeration =new_enumeration($enumeration,$forum_1['boardid'],'&nbsp;'.$str1.replacehtml($forum_1['boardtype']));
	
	}
}
$restriction=new_restriction($restriction,'board_list_1','numeric',0,0,0,0,'',$enumeration);
unset($enumeration);
$enumeration =new_enumeration($enumeration,1,$lang['board.form.str3']);
$enumeration =new_enumeration($enumeration,2,$lang['board.form.str4']);
$restriction=new_restriction($restriction,'skin_list','numeric',0,0,0,0,'',$enumeration);
unset($enumeration);
$enumeration =new_enumeration($enumeration,1,$lang['board.form.str5']);
$enumeration =new_enumeration($enumeration,2,$lang['board.form.str6']);
$restriction=new_restriction($restriction,'css_list','numeric',0,0,0,0,'',$enumeration);
unset($enumeration);
$query=$db->query('select c_orders,type from '.$dv.'fsettings where s_class=1 order by c_orders');
while($setting = $db->fetch_array($query)) {
	$enumeration =new_enumeration($enumeration,$setting['c_orders'],$setting['type']);
}
$restriction=new_restriction($restriction,'setting_list','numeric',0,0,0,0,'',$enumeration);
unset($enumeration);
$query=$db->query('select c_orders,type from '.$dv.'fsettings where s_class=2 order by c_orders');
while($ads = $db->fetch_array($query)) {
	$enumeration =new_enumeration($enumeration,$ads['c_orders'],$ads['type']);
}
$restriction=new_restriction($restriction,'ads_list','numeric',0,0,0,0,'',$enumeration);
unset($enumeration);
$enumeration =new_enumeration($enumeration,0,$lang['unset_master1']);
$enumeration =new_enumeration($enumeration,1,$lang['unset_master2']);
$restriction=new_restriction($restriction,'unset_master','numeric',0,0,0,0,'',$enumeration);
unset($enumeration);
$form=Array('items','name'=>'dv_board','action'=>$action,'method'=>'post','attribute_str'=>'');
$form['items'] = new_form_item(
$form['items']
,'text'
,'boardtype'
,$boardtype
,'text_max_150'
,$lang['item_type_1']
,$lang['item_description_1']
,'width:300px;margin-left:5px;margin-top:1px;'
,''
,''
,$form_tit1
);
$form['items'] = new_form_item(
$form['items']
,'textarea'
,'readme'
,$readme
,'text_max_16384'
,$lang['item_type_2']
,$lang['item_description_2']
,'margin-left:10px;width:90%;height:50px;'
,''
,''
,''
);
$form['items'] = new_form_item(
$form['items']
,'select'
,'parentid'
,$parentid
,'board_list_1'
,$lang['item_type_4']
,$lang['item_description_4']
,'margin:3px;;width:200px;'
,''
,''
,''
);
$form['items'] = new_form_item(
$form['items']
,'text'
,'boardmaster'
,$boardmaster
,'text_max_250'
,$lang['item_type_7']
,$lang['item_description_7']
,'width:300px;margin-left:5px;margin-top:1px;'
,''
,''
,''
);
$form['items'] = new_form_item(
$form['items']
,$unset_master_type
,'unset_master'
,0
,'unset_master'
,$lang['item_type_8']
,$lang['item_description_8']
,'margin:3px;'
,''
,''
,''
);
$form['items'] = new_form_item(
$form['items']
,'select'
,'setting_id'
,$setting_id
,'setting_list'
,$lang['item_type_10']
,$lang['item_description_10']
,'margin:3px;width:200px;'
,''
,''
,''
);
$form['items'] = new_form_item(
$form['items']
,'select'
,'ads_id'
,$ads_id
,'ads_list'
,$lang['item_type_11']
,$lang['item_description_11']
,'margin:3px;width:200px;'
,''
,''
,''
);
$form['items'] = new_form_item(
$form['items']
,'text'
,'indeximg'
,$indeximg
,'text_max_250'
,$lang['item_type_9']
,$lang['item_description_9']
,'width:300px;margin-left:5px;margin-top:1px;'
,''
,''
,''
);
$form['items'] = new_form_item(
$form['items']
,'select'
,'sid'
,$sid
,'skin_list'
,$lang['item_type_5']
,$lang['item_description_5']
,'margin:3px;width:200px;'
,''
,''
,''
);
$form['items'] = new_form_item(
$form['items']
,'select'
,'cid'
,$cid
,'css_list'
,$lang['item_type_6']
,$lang['item_description_6']
,'margin:3px;width:200px;'
,''
,''
,''
);
$form['items'] = new_form_item(
$form['items']
,'textarea'
,'rules'
,$rules
,'text_max_16384'
,$lang['item_type_3']
,$lang['item_description_3']
,'margin-left:10px;width:90%;height:100px;'
,''
,''
,''
);
$form['items'] = new_form_item(
$form['items']
,'submit'
,'submit'
,$submit
,'text_max_16384'
,''
,''
,'margin-top:4px;'
,''
,''
,''
);
?>