|
- function getcurrentnav() {
- global $_G;
- if(!empty($_G['mnid'])) {
- return $_G['mnid'];
- }
- $mnid = '';
- $_G['basefilename'] = $_G['basefilename'] == $_G['basescript'] ? $_G['basefilename'] : $_G['basescript'].'.php';
- if(isset($_G['setting']['navmns'][$_G['basefilename']])) {
- if($_G['basefilename'] == 'home.php' && $_GET['mod'] == 'space' && (empty($_GET['do']) || in_array($_GET['do'], array('follow', 'view')))) {
- $_GET['mod'] = 'follow';
- }
- foreach($_G['setting']['navmns'][$_G['basefilename']] as $navmn) {
- if($navmn[0] == array_intersect_assoc($navmn[0], $_GET) || ($navmn[0]['mod'] == 'space' && $_GET['mod'] == 'spacecp' && ($navmn[0]['do'] == $_GET['ac'] || $navmn[0]['do'] == 'album' && $_GET['ac'] == 'upload'))) {
- $mnid = $navmn[1];
- }
- }
- }
- if(!$mnid && isset($_G['setting']['navdms'])) {
- foreach($_G['setting']['navdms'] as $navdm => $navid) {
- if(strpos(strtolower($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']), $navdm) !== false && strpos(strtolower($_SERVER['HTTP_HOST']), $navdm) === false) {
- $mnid = $navid;
- break;
- }
- }
- }
- if(!$mnid && isset($_G['setting']['navmn'][$_G['basefilename']])) {
- $mnid = $_G['setting']['navmn'][$_G['basefilename']];
- }
- return $mnid;
- }
复制代码 |
|