<?php
global  $xoopsConfig,$xoopsModule,$xoopsDB;
include_once XOOPS_ROOT_PATH.'/modules/neothemesadmin/language/'.$xoopsConfig['language'].'/blocks.php';	
$configvar=configvar($modulesid="neothemesadmin");	
//UID
$uid=!empty($xoopsUser) ? $xoopsUser->getVar('uid') : ''; // get TRUE

//(empty($fieldsplit[23]) ? 'line://ti/p/'.$configList['line'] : $configList['line']) 

//line
//是否顯示line按鈕
$xoopsTpl->assign("lineYN", $fieldsplit[0]);
$xoopsTpl->assign("line", empty($configList['line']) ? '' : (empty($fieldsplit[23]) ? 'line://ti/p/'.$configList['line'] : $configList['line']));


//是否顯示FB-messages按鈕
$xoopsTpl->assign("fbYN", $fieldsplit[1]);
//FB會員ID
$xoopsTpl->assign("fbuID", empty($configList['fburl']) ? '' : $configList['fburl']);


//是否顯示FB連結按鈕
$xoopsTpl->assign("fbfansurlYN", $fieldsplit[2]);
//FB按鈕
$xoopsTpl->assign("fbfansurl", empty($configList['fbfansurl']) ? '' : $configList['fbfansurl']);


//是否顯示聯絡我們按鈕
$xoopsTpl->assign("contactusYN", $fieldsplit[3]);

//聯絡我們按鈕
$contactusurl=XOOPS_URL.'/modules/neothemesadmin/contactusform.php';


$contactus=empty($configList['contactus']) ? $contactusurl : $configList['contactus']; 
if(strpos($contactus,'@')){
$mailto='https://mail.google.com/mail/u/0/?view=cm&fs=1&tf=1&to=';
}
$xoopsTpl->assign("mailto", $mailto);
$xoopsTpl->assign("contactus", $contactus);



//抓取未讀取的聯絡我們
$nonumber = is_array(databasetablewhile($dbneme="neocontactusform",$wheree=" where `readtrue` = '0'")) ? count(databasetablewhile($dbneme="neocontactusform",$wheree=" where `readtrue` = '0'")) : 0 ;
$xoopsTpl->assign("nonumber", $nonumber);


//抓取未讀取的商品諮詢
/*if(!empty(modulesmidvar($modulesid="neilproduct",$var="isactive"))){
$productnonumber = is_array(databasetablewhile($dbneme="productinquiry",$where=" where `readtrue` = '0'")) ? count(databasetablewhile($dbneme="productinquiry",$where=" where `readtrue` = '0'")) : 0 ;
$xoopsTpl->assign("productnonumber", $productnonumber);
}*/

//內容管理-內容回覆-尚未回覆通知
if(!empty(modulesmidvar($modulesid="neilmfdcms",$var="isactive"))){
$typesArr=databasetablewhile($dbnemeuser="neilmfdcmstypes",$where="   where  `types` = '4'  && `enable` = '1' order by  typesid  DESC");
foreach($typesArr as $key=> $val){		
$centerArr[$key]=databasetablewhile($dbnemeuser="neilmfdcmscenter",$where="   where  `typesid` = '".$typesArr[$key]['typesid']."'  &&   FIND_IN_SET('".$uid."',noreply)     && `enable` = '1' order by  centerid  DESC");
if(!empty($centerArr[$key])) $notice[$key]['notice']=sprintf(_MA_NEIL_THEMES_CONTENTREPLY01,$typesArr[$key]['title'],(is_array($centerArr[$key]) ? count($centerArr[$key]) : 0),''.XOOPS_URL.'/modules/neilmfdcms/index.php?noreply='.$uid.'&typesid='.$typesArr[$key]['typesid'].'');
}
$xoopsTpl->assign("nellnotice", $notice);
}



//商品諮詢浮動按鈕&&未讀取的商品諮詢
if(!empty(modulesmidvar($modulesid="neilproduct",$var="isactive"))){
include_once XOOPS_ROOT_PATH."/modules/neilproduct/function.php";
$tplvar['consultbtn']=true;
$tplvar['conscount']=neilproduct_consultationcount($action="1");
//管理員權限
if(!empty($isAdmin)){
//諮詢資料總計	
$show=neilproduct_statisticsbar($uid,$show);	
if(!empty($show['statistics'][0])) $tplvar['productnotify']=sprintf(_MA_NEILPRODUCTNOTICE01,$show['statistics'][0],''.XOOPS_URL.'/modules/neilproduct/shopwcase.php?op=consultrecord&readtrue=0');	
}
}




//跑馬燈速度
$xoopsTpl->assign("alsspeed", $fieldsplit[9].'0');



//跑馬燈顯示方式
$xoopsTpl->assign("marqueestyle", $fieldsplit[10]);

if($fieldsplit[10]==0){
$marqueesdirection='up';
}
if($fieldsplit[10]==1){
$marqueesdirection='left';
}
$xoopsTpl->assign("marqueesdirection", $marqueesdirection);



//開啟或關閉網站自動放大功能
if(!isset($fieldsplit[4])){
$fieldsplit[4]=1;
}

$xoopsTpl->assign("zoomswitch", $fieldsplit[4]);

//JS播放器樣式
$xoopsTpl->assign("jsplaystyle", $fieldsplit[6]);




//判斷模組版本是否比現在的版本新
$xoopsTpl->assign("modulesversion", neillibrary_modulesversion($modulesid="neothemesadmin"));



//開啟或關閉XOOPS內建廣告
if(!isset($fieldsplit[5])){
$fieldsplit[5]=0;
}
$xoopsTpl->assign("xoopsad", $fieldsplit[5]);

//彈出廣告
$tplvar['popupadsbox']=neothemesadmin_popupads($configvar,$fieldsplit);

//右下浮動廣告
$tplvar['lowerrightadox']=neothemesadmin_lowerrightad($configvar);


$xoopsTpl->assign("tplvar", $tplvar);

?>