security->unlock(); if($NP->params->get('_controller')!='appv1') { print_r($_SERVER);//['HTTP_HOST']; $domain=$_SERVER['HTTP_HOST']; $url =$domain.str_replace('store/','',$_SERVER['REQUEST_URI']); header("HTTP/1.1 301 Moved Permanently"); header('location: http://'.$url); exit(); } /** * load the controller */ if($_SERVER['HTTP_HOST']=='nanocard.ir') { $NP->load('index_mod','index'); $result=$NP->index->get($NP->params->getArgs(0),$NP->params->get('_lang')); // print_r($result); // exit(); if($result['Domain']) { $domain=explode(',', $result['Domain']); $params=$NP->params->getArgs(); $values =explode("','",substr($params,1,-1)); unset($values[0]); if(is_array($values) && count($values)>0){ $params ='prm/'.implode('/', $values).'/'; $title =($NP->params->get('_title'))?$NP->params->get('_title').'.html':''; } else { $params=''; } $url =($NP->params->get('_controller')=='index' && $NP->params->get('_action')=='run')?'/store/'.$NP->params->get('_lang').'/':'/store/'.$NP->params->get('_lang').'/'.$NP->params->get('_controller').'/'.$NP->params->get('_action').'/'; header("HTTP/1.1 301 Moved Permanently"); header('location: http://'.$domain[0].$url.$params.$title); exit(); } } $NP->router->loader(); if($NP->params->get('id')){ if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; } if(!isset($_SESSION['statistics'])){ $_SESSION['statistics']=$NP->security->tokenGenerator(); } $NP->load('statistics_mod','statistics'); $NP->statistics->set($NP->params->get('id'),_LANG,$ip,$_SERVER['HTTP_USER_AGENT'],$_SESSION['statistics']); } /** * parse messages programme */ if ($NP->params->get( '_type' ) == 'main'){ if(!$NP->isLocal){ $NP->view->assign('GOOGLETAG',$NP->setting->googleTag()); $NP->view->assign('ANALYTICS',$NP->setting->analytics()); // if( !$NP->setting->dedicatedSitemap()){ // $NP->view->parse('main.canonical'); // } } $NP->view->parse('main.canonical'); $NP->view->parseAllMessage ( true ); } $NP->view_hpr->close($NP->params->get('_type'),_EXPIRE_CACHE); echo GTP(); ?>