<?php	
//讀取neothemesconfig資料表
//引入模組DB函數-初始化設定
$dbneme="neothemesconfig";
$where=" where `nsn` = '1'";
$configList=moduledb($dbneme,$where);
//字串轉陣列
$fieldsplit=phpconversion($conversion=$configList['field'],$type="unserialize");
global $xoopsDB;
switch ($fieldsplit[7]) {
	case "0":  //網站預設選單	
	$fieldsplit[7]="0";
	break;
	case "1":  //自訂選單內容
	$dbneme="neorightmenu";
	$where=" where `enable` = '1' order by  snid  ASC";
	$neorightmenuArr=databasetablewhile($dbneme,$where);
	foreach($neorightmenuArr as $key=> $val) {
		//頁面開啟方式
		$target['target']=pagemethod($types=$neorightmenuArr[$key]['target']);
		$neorightmenuArr[$key]['target']=$target['target']['way'];
	}
	$xoopsTpl->assign("rmenua", $neorightmenuArr);
	break;
	case "2":  //主選單內容
	$sql = "select mid,name,dirname  from " . $xoopsDB->prefix('modules')   . " where `hasmain` = '1' and `weight` != '0'";
	$result = $xoopsDB -> query($sql) or die($sql);
	while(list($mid,$name,$dirname) = $xoopsDB -> fetchRow($result)) {
		$rmenub[$mid]['name']=$name;
		$rmenub[$mid]['dirname']=$dirname;
	}
	$xoopsTpl->assign("rmenub", $rmenub);
	break;
	default:
}
//右上方按鈕顯示方式
$xoopsTpl->assign("switching", $fieldsplit[7]);
?>