<?php
for ($i = 0; $i <= 2; $i++) {
if(!empty($_FILES['upfile']['name'][$i])) $_FILES['upfile']['name'][$i]=strtotime(date("Y-m-d H:i:s")).'.'.substr(strrchr($_FILES['upfile']['name'][$i], '.'), 1);	//重編檔名防止被防護模組阻擋	
}		
//-- 引入檔案 --//
include 'header.php'; //XOOPS檔頭
include_once "../function.php"; //引入自訂的共同函數檔
include_once "../class/themeset.php";
	

//上傳圖檔
include_once XOOPS_ROOT_PATH."/modules/neillibrary/class/imguploader.php";	





$op=(empty($_REQUEST['op']))?"":$_REQUEST['op'];
switch ($op) {
	case "save_news":  
	$returnvar=add_form($returnvar);
	insert_news($returnvar=$returnvar['variablesplit']);
	redirect_header($_SERVER['PHP_SELF'],0 , _MA_NEODWADMIN_SHBU);
	//設定已更新
	break;
	
	default:
	$returnvar=add_form($fieldsplit);
	$main = $returnvar['main'];
}


function add_form($fieldsplit=""){
 global $xoopsDB;	

$xoops_theme = $GLOBALS['xoopsConfig']['theme_set'];
//先建構class($themesetclass)
$themesetclass   = new  themesetclass;  
$topvsplit =$themesetclass-> themespublicb($variableok,$setting); 
list($variableok,$setting) = $topvsplit;

//切割$setting陣列內容
$setting=cuttingfunction($cutting=$setting,$sign=";"); 



//切割$variableok陣列內容
$variablesplit=cuttingfunction($cutting=$variableok,$sign=";"); 
$imgwh['1']=$variablesplit[2];                   //logo圖檔大小：; 
$imgwh['2']=$variablesplit[9];                   //logo2圖檔大小說明：; 	  
$imgwh['3']=$variablesplit[19];                   //社群分享網站代表圖檔大小說明：; 

//讀取neothemesconfig資料表
//引入模組DB函數-初始化設定
$configList=moduledb($dbneme="neothemesconfig",$where=" where `nsn` = '1'");
//字串轉陣列
$fieldsplit=phpconversion($conversion=$configList['field'],$type="unserialize"); 


//是否啟用LINE按鈕功能 
$add_form['0']=radioinline($class="",$name="field[0]",$text=array(_MA_NEODWADMIN_NO,_MA_NEODWADMIN_YSE),$checked=$fieldsplit[0],$id="linebtnny");  

$stylebox['0']['style']=empty($fieldsplit[0]) ? 'style="display: none;"' : 'style="display: block;"'; 
 
//輸入LINE帳號
$add_form['1']=inputtext($class="",$name="line",$value="".$configList['line']."",$placeholder=""._MA_NEODWADMIN_line."",$id=""); 

//是否啟用FB-messages按鈕功能
$add_form['2']=radioinline($class="",$name="field[1]",$text=array(_MA_NEODWADMIN_NO,_MA_NEODWADMIN_YSE),$checked=$fieldsplit[1],$id="fbmessagesbtnny");  

$stylebox['2']['style']=empty($fieldsplit[1]) ? 'style="display: none;"' : 'style="display: block;"'; 

//輸入FB網址 
$add_form['3']=inputtext($class="",$name="fburl",$value="".$configList['fburl']."",$placeholder=""._MA_NEODWADMIN_FBURL."",$id=""); 


//是否啟用FB粉絲團按鈕功能
$add_form['4']=radioinline($class="",$name="field[2]",$text=array(_MA_NEODWADMIN_NO,_MA_NEODWADMIN_YSE),$checked=$fieldsplit[2],$id="fbbtnny");  

$stylebox['4']['style']=empty($fieldsplit[2]) ? 'style="display: none;"' : 'style="display: block;"'; 

//輸入FB粉絲團網址
$add_form['5']=inputtext($class="",$name="fbfansurl",$value="".$configList['fbfansurl']."",$placeholder=""._MA_NEODWADMIN_FBFANSURL."",$id=""); 


//是否啟用聯絡我們按鈕功能
$add_form['6']=radioinline($class="",$name="field[3]",$text=array(_MA_NEODWADMIN_NO,_MA_NEODWADMIN_YSE),$checked=$fieldsplit[3],$id="contactusbtnny");  

$stylebox['6']['style']=empty($fieldsplit[3]) ? 'style="display: none;"' : 'style="display: block;"'; 


//輸入聯絡我們網址
$add_form['7']=inputtext($class="",$name="contactus",$value="".$configList['contactus']."",$placeholder=""._MA_NEODWADMIN_CONTACTUS."",$id=""); 


//是否啟用網站隨電腦解析度自動放大功能(解析度大於1440時會自動放大)
$add_form['8']=radioinline($class="",$name="field[4]",$text=array(_MA_NEODWADMIN_NO,_MA_NEODWADMIN_YSE),$checked=$fieldsplit[4],$id="");  


//是否啟用Xoops內建廣告功能
$add_form['9']=radioinline($class="",$name="field[5]",$text=array(_MA_NEODWADMIN_NO,_MA_NEODWADMIN_YSE),$checked=$fieldsplit[5],$id="");  


//JS圖片播放器設定顯示方式
$add_form['10']=radioinline($class="",$name="field[6]",$text=array(_MA_NEODWADMIN_JSPLAYSTYLE02,_MA_NEODWADMIN_JSPLAYSTYLE01),$checked=$fieldsplit[6],$id="");  


//選擇右上方網站選單按鈕顯示方式
$add_form['11']=radioinline($class="",$name="field[7]",$text=array(_MA_NEODWADMIN_SETTINGS02,_MA_NEODWADMIN_SETTINGS03,_MA_NEODWADMIN_SETTINGS04),$checked=$fieldsplit[7],$id="");  

//是否啟用新聞模組的內容顯示於跑馬燈功能
$add_form['12']=radioinline($class="",$name="field[8]",$text=array(_MA_NEODWADMIN_TRUETADNEWS,_MA_NEODWADMIN_FALSETADNEWS),$checked=$fieldsplit[8],$id="");  

//選擇跑馬燈速度
$marqueeArr = array(); //建構陣列

$i=0;
$marqueeArr[$i]['id']='10';  
$marqueeArr[$i]['title']=_MA_NEODWADMIN_SPEED1;
$i++;

$marqueeArr[$i]['id']='9';  
$marqueeArr[$i]['title']=_MA_NEODWADMIN_SPEED2;
$i++;

$marqueeArr[$i]['id']='8';  
$marqueeArr[$i]['title']=_MA_NEODWADMIN_SPEED3;
$i++;

$marqueeArr[$i]['id']='7';  
$marqueeArr[$i]['title']=_MA_NEODWADMIN_SPEED4;
$i++;

$marqueeArr[$i]['id']='6';  
$marqueeArr[$i]['title']=_MA_NEODWADMIN_SPEED5;
$i++;

$marqueeArr[$i]['id']='5';  
$marqueeArr[$i]['title']=_MA_NEODWADMIN_SPEED6;
$i++;

$marqueeArr[$i]['id']='4';  
$marqueeArr[$i]['title']=_MA_NEODWADMIN_SPEED7;
$i++;

$marqueeArr[$i]['id']='3';  
$marqueeArr[$i]['title']=_MA_NEODWADMIN_SPEED8;
$i++;

$marqueeArr[$i]['id']='2';  
$marqueeArr[$i]['title']=_MA_NEODWADMIN_SPEED9;
$i++;

$marqueeArr[$i]['id']='1';  
$marqueeArr[$i]['title']=_MA_NEODWADMIN_SPEED10;
$i++;

//下拉選單(呈現方式)
foreach($marqueeArr as $key=> $val){
$add_form['13'].=optionselect($dataid=$marqueeArr[$key]['id'],$optionname=$marqueeArr[$key]['title'],$oid="".$fieldsplit[9]."",$value=$marqueeArr[$key]['id']);
}


//設定跑馬燈顯示方式
$add_form['14']=radioinline($class="",$name="field[10]",$text=array(MARQUEETEYLE01,MARQUEETEYLE02),$checked=$fieldsplit[10],$id="");  



//圖檔樣式說明
$add_form['16']="<span>"._MA_NEODWADMIN_MAKEA."".$imgwh['1'].""._MA_NEODWADMIN_THESIZEOFTHE."</span>";    //<span>製作1張{$imgwh}大小的{$imgfileok}圖檔</span>



//圖檔樣式說明
$add_form['18']="<span>"._MA_NEODWADMIN_MAKEA."".$imgwh['2'].""._MA_NEODWADMIN_THESIZEOFTHE."</span>";





$img_date = date("H:i:s");

//顯示LOGO圖
if(file_exists(XOOPS_ROOT_PATH.'/uploads/'.$xoops_theme.'/logoimg.png')){
$add_form['19']="<img  src='".XOOPS_URL."/uploads/".$xoops_theme."/logoimg.png?state={$img_date}' ><br />"; 
}else{
$add_form['19']="<img  src='".XOOPS_URL."/themes/".$xoops_theme."/default/logoimg.png' ><br />"; 
}
//顯示ICON圖
if(file_exists(XOOPS_ROOT_PATH.'/uploads/'.$xoops_theme.'/icon.png')){
$add_form['20']="<img  src='".XOOPS_URL."/uploads/".$xoops_theme."/icon.png?state={$img_date}' ><br />"; 
}else{
$add_form['20']="<img  src='".XOOPS_URL."/themes/".$xoops_theme."/default/icon.png' ><br />"; 
}

//顯示社群分享網站代表圖
if(file_exists(XOOPS_ROOT_PATH.'/uploads/'.$xoops_theme.'/communityimg.png')){
$add_form['26']="<img  src='".XOOPS_URL."/uploads/".$xoops_theme."/communityimg.png?state={$img_date}' ><br />"; 
}else{
$add_form['26']="<img  src='".XOOPS_URL."/themes/".$xoops_theme."/default/communityimg.png' ><br />"; 
}


//是否啟用LOGO動畫
$add_form['21']=radioinline($class="",$name="field[11]",$text=array(_MS_SHARED04,_MS_SHARED03),$checked=$fieldsplit[11],$id="");  

//是否啟用首頁視差
$add_form['22']=radioinline($class="",$name="field[12]",$text=array(_MS_SHARED04,_MS_SHARED03),$checked=$fieldsplit[12],$id=""); 


//選擇版型配置-主層
$cArr = array(); //建構陣列

$i=0;
$cArr[$i]['id']='1';  
$cArr[$i]['title']=_MA_NEODWADMIN_SETTINGS07;
$i++;
$cArr[$i]['id']='2';  
$cArr[$i]['title']=_MA_NEODWADMIN_SETTINGS08;
$i++;
$cArr[$i]['id']='3';  
$cArr[$i]['title']=_MA_NEODWADMIN_SETTINGS12;

//下拉選單(呈現方式)
foreach($cArr as $key=> $val){
$add_form['23'].=optionselect($dataid=$cArr[$key]['id'],$optionname=$cArr[$key]['title'],$oid=($fieldsplit[13] > 3 ? '3' : $fieldsplit[13]),$value=$cArr[$key]['id']);
}





//圖檔樣式說明
$add_form['25']="<span>"._MA_NEODWADMIN_MAKEA."W".$imgwh['3'].""._MA_NEODWADMIN_SETTINGS11."</span>";    //<span>製作1張{$imgwh}大小的{$imgfileok}圖檔</span>


//是否啟用首頁視差
$add_form['27']=radioinline($class="",$name="field[14]",$text=array(_MS_SHARED04,_MS_SHARED03),$checked=$fieldsplit[14],$id=""); 



//主選單數量
$fieldsplit[15]=empty($fieldsplit[15]) ? $variablesplit[6] : $fieldsplit[15]; // get TRUE
$add_form['28']=inputtext($class="",$name="field[15]",$value="".$fieldsplit[15]."",$placeholder=""._MS_SHARED21._MA_NEODWADMIN_SETTINGS14."",$id=""); 


//底選單數量
$fieldsplit[16]=empty($fieldsplit[16]) ? $variablesplit[17] : $fieldsplit[16]; // get TRUE
$add_form['29']=inputtext($class="",$name="field[16]",$value="".$fieldsplit[16]."",$placeholder=""._MS_SHARED21._MA_NEODWADMIN_SETTINGS15."",$id=""); 


//輸入預設網站導覽模組ID
$add_form['30']=inputtext($class="",$name="field[17]",$value="".$fieldsplit[17]."",$placeholder=""._MA_NEODWADMIN_SETTINGS16."",$id=""); 

//輸入預設流量統計模組ID
$add_form['31']=inputtext($class="",$name="field[18]",$value="".$fieldsplit[18]."",$placeholder=""._MA_NEODWADMIN_SETTINGS17."",$id=""); 

//輸入Google行動瀏覽裝置測試結果網址欄位		
$add_form['32']=inputtext($class="",$name="field[19]",$value="".$fieldsplit[19]."",$placeholder=""._MA_NEODWADMIN_SETTINGS19."",$id=""); 

//主選單按鈕邊距位置
$add_form['33']=inputtext($class="",$name="field[20]",$value="".$fieldsplit[20]."",$placeholder=""._MA_NEODWADMIN_SETTINGS21."",$id=""); 

//圖片撥放器間格秒數
$add_form['34']=inputtext($class="",$name="field[21]",$value="".$fieldsplit[21]."",$placeholder=""._MA_NEODWADMIN_SETTINGS23."",$id=""); 


//頁腳輔助說明	
$add_form['35']=inputtextarea($class="",$name="field[22]",$id="",$rows="3",$cols="80",$value=$fieldsplit[22]);

//LINE按鈕功能格式 
$add_form['36']=radioinline($class="",$name="field[23]",$text=array(_MA_NEODWADMIN_SETTINGS26,_MA_NEODWADMIN_SETTINGS27),$checked=$fieldsplit[23],$id="linettpe");  


//field[23]
//$fieldsplit[22]
//$add_form['36']


$main="<div class='container'>

  <h2>"._MA_NEODWADMIN_STYLE."&nbsp;<label for='sel2'>themes function setting</label></h2>	   
   
   <form method='post'  action='{$_SERVER['PHP_SELF']}' enctype='multipart/form-data'>"; 
   
//是否啟用LINE按鈕功能 
if($setting[0]==1){ 
$main.="
	 <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_LINEBOTTON."</label>   
    <div class='col-sm-9'>
    ".$add_form['0']."
    <br /><br />   
    </div> </div>
    "; 
$main.=" 
    <div id='linebox' ".$stylebox['0']['style']." class='form-group'>	
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_line."</label>
    <div class='col-sm-9'> ".$add_form['1']."
    ".$add_form['36']."
    <br /><br /></div> 
 	</div> 	
 	";
}else{
$main.="<input type='hidden' name='field[0]' value='".$fieldsplit[0]."'>   ";
}

//是否啟用FB簡訊按鈕功能
if($setting[1]==1){ 
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_FBNY."</label>   
     <div class='col-sm-9'>
    ".$add_form['2']."
    <br /><br />   
           </div> </div>
 "; 
 
$main.=" <div id='fbmessagesbox' ".$stylebox['2']['style']."'  class='form-group'>	
<label class='col-sm-3 control-label'>"._MA_NEODWADMIN_FBURL."</label>
 		 <div class='col-sm-9'> ".$add_form['3']." 
 	  <span id='helpBlock' class='help-block'>"._MA_NEODWADMIN_FBURL01."</span>
 	   <br /></div> 
 		</div> 	
 	"; 
}else{
$main.="<input type='hidden' name='field[1]' value='".$fieldsplit[1]."'>   ";
}
 
//是否啟用FB連結按鈕功能
if($setting[2]==1){  
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_FBFANSURLNY."</label>   
     <div class='col-sm-9'>
    ".$add_form['4']."
    <br /><br />   
           </div> </div>
 "; 
 
 
$main.=" <div id='fburlbox' ".$stylebox['4']['style']." class='form-group'>	
<label class='col-sm-3 control-label'>"._MA_NEODWADMIN_FBURL02."</label>
 		 <div class='col-sm-9'> ".$add_form['5']." 
  	   <br /></div> 
 		</div> 	
 	"; 

}else{
$main.="<input type='hidden' name='field[2]' value='".$fieldsplit[2]."'>   ";
}

//是否啟用聯絡我們按鈕功能
if($setting[3]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_CONTACTUSNY."</label>   
     <div class='col-sm-9'>
    ".$add_form['6']."
    <br /><br />   
           </div> </div>
 "; 
 
 
$main.=" <div id='contactusbox' ".$stylebox['6']['style']."  class='form-group'>	
<label class='col-sm-3 control-label'>"._MA_NEODWADMIN_CONTACTUS."</label>
 		 <div class='col-sm-9'> ".$add_form['7']." 
 	 <span id='helpBlock' class='help-block'>"._MA_NEODWADMIN_CONTACTUS01."</span>
  	   <br /></div> 
 		</div> 	
 	"; 
}else{
$main.="<input type='hidden' name='field[3]' value='".$fieldsplit[3]."'>   ";
} 
 
//是否啟用網站隨電腦解析度自動放大功能
 if($setting[4]==1){  
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_WEBSITEZOOM."</label>   
     <div class='col-sm-9'>
    ".$add_form['8']."
     	 <span id='helpBlock' class='help-block'>"._MA_NEODWADMIN_WEBSITEZOOM01."</span>
               </div> </div>
 "; 
 }else{
$main.="<input type='hidden' name='field[4]' value='".$fieldsplit[4]."'>   ";
} 

//是否啟用Xoops內建廣告功能
 if($setting[5]==1){ 
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_XOOPSAD."</label>   
     <div class='col-sm-9'>
    ".$add_form['9']."
    <br /><br />   
           </div> </div>
 "; 
 }else{
$main.="<input type='hidden' name='field[5]' value='".$fieldsplit[5]."'>   ";
} 
//佈景圖片播放器樣式選擇
 if($setting[6]==1){ 
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_JSPLAYSTYLE."</label>   
     <div class='col-sm-9'>
    ".$add_form['10']."
    <br /><br />   
           </div> </div>
 "; 
 }else{
$main.="<input type='hidden' name='field[6]' value='".$fieldsplit[6]."'>   ";
} 

//圖片撥放器間隔秒數
 if($setting[24]==1){ 
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS23."</label>   
     <div class='col-sm-9'>
    ".$add_form['34']."
     	 <span id='helpBlock' class='help-block'>"._MA_NEODWADMIN_SETTINGS24."</span>    
    <br />
           </div> </div>
 "; 
 }else{
$main.="<input type='hidden' name='field[21]' value='".$fieldsplit[21]."'>   ";
} 

 
//選擇右上方網站選單按鈕顯示方式
 if($setting[7]==1){  
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS01."</label>   
     <div class='col-sm-9'>
    ".$add_form['11']."
    <br /><br />   
           </div> </div>
 "; 
 }else{
$main.="<input type='hidden' name='field[7]' value='".$fieldsplit[7]."'>   ";
} 

//跑馬燈功能顯示內容設定
 if($setting[8]==1){  
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_THENEWSMODULESHOWATTHEMARQUEE."</label>   
     <div class='col-sm-9'>
    ".$add_form['12']."
    <br /><br />   
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[8]' value='".$fieldsplit[8]."'>   ";
 }
 
 
//選擇跑馬燈速度
 if($setting[9]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_MARQUEESPEED."</label>   
     <div class='col-sm-9'>
  <select  class='form-control' name='field[9]' >   ".$add_form['13']."
  </select>	
    <br />
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[9]' value='".$fieldsplit[9]."'>   ";
 }
 
//選擇跑馬燈顯示方式 
 if($setting[10]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_MARQUEETEYLE."</label>   
     <div class='col-sm-9'>
    ".$add_form['14']."
    <br /><br />   
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[10]' value='".$fieldsplit[10]."'>   ";
 }

//是否啟用LOGO動畫
 if($setting[13]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS05."</label>   
     <div class='col-sm-9'>
    ".$add_form['21']."
    <br /><br />   
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[11]' value='".$fieldsplit[11]."'>   ";
 }


//是否啟用首頁視差
 if($setting[14]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS06."</label>   
     <div class='col-sm-9'>
    ".$add_form['22']."
    <br /><br />   
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[12]' value='".$fieldsplit[12]."'>   ";
 }
 
 
//是否啟用右浮動選單
 if($setting[17]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS13."</label>   
     <div class='col-sm-9'>
    ".$add_form['27']."
    <br /><br />   
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[14]' value='".$fieldsplit[14]."'>   ";
 } 
 
 
 
//佈景版型配置
 if($setting[15]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS09."</label>   
     <div class='col-sm-9'>
  <div class='row'>
  <div class='col-md-6'> <select id='deployselect' class='form-control' name='field[13]' > 
      ".$add_form['23']."
  </select></div>
  <div class='col-md-6'><div id='deploybox'></div></div>
</div>  	  
<br />
</div> </div>
<script>
	neothemesadmin_configuration(cval='".$fieldsplit[13]."');
    $('body').on('change', '#deployselect', function() {
	neothemesadmin_configuration(cval=$(this).find(':selected').attr('data-id'));
    })
</script>	
 ";  
 }else{
$main.="<input type='hidden' name='field[13]' value='".$fieldsplit[13]."'>   ";
 } 
 
 //佈景主選單數量
 if($setting[18]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS14."</label>   
     <div class='col-sm-9'>
    ".$add_form['28']."
    <br />
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[15]' value='".$fieldsplit[15]."'>   ";
 }  
 
 //佈景底選單數量
 if($setting[19]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS15."</label>   
     <div class='col-sm-9'>
    ".$add_form['29']."
    <br />
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[16]' value='".$fieldsplit[16]."'>   ";
 }  
 
 
 //輸入預設網站導覽模組ID
 if($setting[20]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS16."</label>   
     <div class='col-sm-9'>
    ".$add_form['30']."
    <br />
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[17]' value='".$fieldsplit[17]."'>   ";
 }  

 //輸入預設流量統計模組ID
 if($setting[21]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS17."</label>   
     <div class='col-sm-9'>
    ".$add_form['31']."
    <br />
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[18]' value='".$fieldsplit[18]."'>   ";
 }  
 
 //Google行動瀏覽裝置測試結果網址欄位		
 if($setting[22]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS19."</label>   
     <div class='col-sm-9'>
    ".$add_form['32']."
     	 <span id='helpBlock' class='help-block'>"._MA_NEODWADMIN_SETTINGS20."</span>
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[19]' value='".$fieldsplit[19]."'>   ";
 }  
 
 //輸入主選單按鈕間距數值
 if($setting[23]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS21."</label>   
     <div class='col-sm-9'>
    ".$add_form['33']."
     	 <span id='helpBlock' class='help-block'>"._MA_NEODWADMIN_SETTINGS22."</span>
           </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[20]' value='".$fieldsplit[20]."'>   ";
 }  
  
 

 
 //輸入頁腳輔助說明	
 if($setting[25]==1){   
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS25."</label>   
     <div class='col-sm-9'>
    ".$add_form['35']."<br />
                </div> </div>
 ";  
 }else{
$main.="<input type='hidden' name='field[22]' value='".$fieldsplit[22]."'>   ";
 }  
 

$p=0;
//上傳佈景LOGO圖檔
 if($setting[11]==1){   
//上傳佈景LOGO圖檔
$add_form['15']=typefile($multiple=false,$name="upfile[0]",$id="blockimg".$p."",$class="previeweach"); 
 	 
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_UPLOADLOGO."</label>   
     <div class='col-sm-9'>
    ".$add_form['15']." <span id='helpBlock' class='help-block'>".$add_form['16']."</span>
     <div class='preview".$p."'></div>  
  
           </div> </div>
 "; 


$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_UPLOADLOGO01."</label>   
     <div class='col-sm-9'>
     <div class='thumbnail'>   
    ".$add_form['19']."
     </div>  
           </div> </div>
 "; 
$p++;
 }
 
 

 

//上傳網站瀏覽器ICON
 if($setting[12]==1){  
//上傳網站icon.png小圖示
$add_form['17']=typefile($multiple=false,$name="upfile[1]",$id="blockimg".$p."",$class="previeweach"); 
  
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SECONDLOGO."</label>   
     <div class='col-sm-9'>
    ".$add_form['17']." <span id='helpBlock' class='help-block'>".$add_form['18']."</span>
     <div class='preview".$p."'></div>  
  
           </div> </div>
 "; 


$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_UPLOADLOGO01."</label>   
     <div class='col-sm-9'>
     <div class='thumbnail'>   
    ".$add_form['20']."
     </div>  
           </div> </div>
 "; 
$p++;
 }
 
  //上傳社群分享網站代表圖
 if($setting[16]==1){   
//上傳社群分享網站代表圖
$add_form['24']=typefile($multiple=false,$name="upfile[2]",$id="blockimg".$p."",$class="previeweach"); 
 	 
$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_SETTINGS10."</label>   
     <div class='col-sm-9'>
    ".$add_form['24']." <span id='helpBlock' class='help-block'>".$add_form['25']."</span>
     <div class='preview".$p."'></div>  
  
           </div> </div>
 "; 


$main.=" <div class='form-group'>
    <label class='col-sm-3 control-label'>"._MA_NEODWADMIN_UPLOADLOGO01."</label>   
     <div class='col-sm-9'>
     <div class='thumbnail'>   
    ".$add_form['26']."
     </div>  
           </div> </div>
 "; 
$p++;
 }
 

 
 $main.="    	  	  	  
 <input type='hidden' name='op' value='save_news'>   	  
  	
 <button  type='submit' class='btn btn-primary btn-lg btn-block button'>"._MS_SHARED01."</button>
  </form> </div>
<script>previeweachfunction();</script>

 "; 
 
if(!empty(modulesmidvar($modulesid="xLanguage",$var="isactive"))){
$main.="<script>neillibrary_llanguagetext(afterid='#buttonbar');</script>";
}
 
  $returnvar['variablesplit']=$variablesplit;
  $returnvar['main']=$main;
  return $returnvar;

}








function insert_news($returnvar=""){
  global $xoopsDB; 




$fburlanalyze=neothemesadmin_analyzefbid($fburl=$_POST['fburl']);




$fieldimplode=phpconversion($conversion=$_POST['field'],$type="serialize"); 

$setvar="set field='".$fieldimplode."' , line='".$_POST['line']."' , fburl='".$fburlanalyze."' , fbfansurl='".$_POST['fbfansurl']."' , contactus='".$_POST['contactus']."' where nsn='1'";
update($dbname="neothemesconfig",$set=$setvar);

$xoops_theme = $GLOBALS['xoopsConfig']['theme_set'];

//LOGO圖設定參數
$i=0;
$showimg[$i]='logoimg';
$width[$i]=$returnvar['15'];
$height[$i]=$returnvar['16'];
$convert[$i]='png';
$i++;



//ICON圖設定參數
$showimg[$i]='icon';
$width[$i]='16';
$height[$i]='16';
$convert[$i]='png';
$i++;

//社群分享網站代表圖設定參數
$showimg[$i]='communityimg';
$width[$i]=$returnvar['19'];
$height[$i]=0;
$convert[$i]='png';


save_pic($up_id=$showimg,$width=$width,$height=$height,$modules="".$xoops_theme."",$plural=true,$convert=$convert,$arr=true,$process=1,$crop=false);


	}






	
loadModuleAdminMenu(2);
echo $main;

include "footer.php"; //XOOPS檔尾
	
	
	?>