set_charset(DB_CHARSET); main::$con->query('SET NAMES '.DB_CHARSET); $pcm = main::mapper('page_core'); $domain = $pcm->getDomain(DOMAIN, $_REQUEST['path']); if (!empty($domain['datas']['fontFams'])) $GLOBALS['fontFamily'] = array_merge($domain['datas']['fontFams'],$GLOBALS['fontFamily']); login(); if (isset($_GET['order_name']) && isset($_GET['order_price']) && isset($_GET['order_md5']) && md5($_GET['order_name'].$_GET['order_price'].DB_PASS) == $_GET['order_md5']) { $_SESSION['order_name'] = $_GET['order_name']; $_SESSION['order_price'] = $_GET['order_price']; } if(isset($_GET['pr'])) { if (!isset($_COOKIE['prCode']) || $_COOKIE['prCode'] != $_GET['pr']) main::mapper('user_ACL')->setHistory($_GET['pr']); $_COOKIE['prCode'] = $_GET['pr']; setcookie("prCode", $_GET['pr'], time() + 1095*24*3600, BASE_DIR.'/', DOMAIN); } if (isset($_GET['utm_source']) || isset($_GET['utm_medium']) || isset($_GET['utm_campaign']) || isset($_GET['utm_term']) || isset($_GET['utm_content'])) { $_COOKIE['utm'] = ''; if (isset($_GET['utm_source'])) { $_COOKIE['utm'] .= 'utm_source = '.mb_convert_encoding($_GET['utm_source'], "UTF-8", detect_encoding($_GET['utm_source'])).'; '; unset($_GET['utm_source']); } if (isset($_GET['utm_medium'])) { $_COOKIE['utm'] .= 'utm_medium = '.mb_convert_encoding($_GET['utm_medium'], "UTF-8", detect_encoding($_GET['utm_medium'])).'; '; unset($_GET['utm_medium']); } if (isset($_GET['utm_campaign'])) { $_COOKIE['utm'] .= 'utm_campaign = '.mb_convert_encoding($_GET['utm_campaign'], "UTF-8", detect_encoding($_GET['utm_campaign'])).'; '; unset($_GET['utm_campaign']); } if (isset($_GET['utm_term'])) { $_COOKIE['utm'] .= 'utm_term = '.mb_convert_encoding($_GET['utm_term'], "UTF-8", detect_encoding($_GET['utm_term'])).'; '; unset($_GET['utm_term']); } if (isset($_GET['utm_content'])) { $_COOKIE['utm'] .= 'utm_content = '.mb_convert_encoding($_GET['utm_content'], "UTF-8", detect_encoding($_GET['utm_content'])).'; '; unset($_GET['utm_content']); } setcookie("utm", $_COOKIE['utm'], time() + 30*24*3600, BASE_DIR.'/', DOMAIN); } if (isset($_GET['order_md5'])) { unset($_GET['order_md5'],$_GET['order_name'],$_GET['order_price']); redirect(BASE_DIR.'/'.str_replace('%2F', '/', rawurlencode($_REQUEST['path'])).(!empty($_GET) ? '?'.http_build_query($_GET, '', '&') : '')); } $detect = new Mobile_Detect; define('isMobile', $detect->isMobile()); define('isTablet', $detect->isTablet()); define('isSkipVideoBG', (isMobile && ($detect->isOpera() || strpos($detect->getUserAgent(), 'MiuiBrowser')))); define('isSafari', $detect->isSafari()); $data = null; if ($domain) $data = $pcm->findBySimple($_REQUEST['path'], 0, $domain['domainId']); if ($data) $robots = $data['robots']; if ($data && $data['perm'] != 1) { if (main::$user['isGuest']) { if ($data['perm'] == 2) {formLogin();$robots = null;} elseif ($data['perm'] != 1 && $data['perm'] != 7) {formLogin();$robots = null;} } else if ($data['perm'] != 2 && !main::$user['isAdmin'] && !in_array($data['perm'], main::$user['groups'])) $data = false; } $err404 = false; if (!$data && Page404Id != 0) { $robots = null; $data = $pcm->findBySimple('',Page404Id); if ($domain['domainId'] != $data['domainId']) { $domain = main::mapper('page_core')->getDomainById($data['domainId']); if (!empty($domain['datas']['fontFams'])) $GLOBALS['fontFamily'] = array_merge($domain['datas']['fontFams'],$GLOBALS['fontFamily']); } header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404); header("Status: 404 Not Found"); $err404 = true; } if (!main::$user['isAdmin'] && isMobile && (!empty($data['mobileId']) || !empty($data['tabletId']))) { if ($data) $root = $data; $mob = false; if (isTablet) { if (!empty($data['tabletId'])) { $mob = $pcm->findById($data['tabletId']); } } elseif (!empty($data['mobileId'])) { $mob = $pcm->findById($data['mobileId']); } if ($mob) { $pcm->p[$mob['id']]['robots'] = $mob['robots'] = $data['robots']; $data = $mob; if ($data['parentId']) $GLOBALS['selectIds'][$data['parentId']] = 1; $pcm->p[$data['id']]['parentId'] = $data['parentId'] = $root['parentId']; $pcm->p[$data['id']]['path'] = $data['path'] = $root['path']; define('goalId', $root['id']); if (!defined('canPath')) { define('canPath', $root['path']); define('canId', $root['id']); } } } if ($data) { $data = $pcm->findById($data['id']); if (!empty($robots)) $pcm->p[$data['id']]['robots'] = $robots; } if (!$data) { if ($_REQUEST['path']) { header('location: '.BASE_DIR.'/');exit; } else { header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404); header("Status: 404 Not Found"); exit; } } if ($data['langId'] == DEFAULT_LANG_ID) { define('CUR_LANG_ID', DEFAULT_LANG_ID); define('CUR_LANG', DEFAULT_LANG); } elseif ($lang = getLangById($data['langId'])) { define('CUR_LANG_ID', $data['langId']); define('CUR_LANG', $lang); } else { define('CUR_LANG_ID', DEFAULT_LANG_ID); define('CUR_LANG', DEFAULT_LANG); } if (!main::$user['id']) main::$user['langId'] = CUR_LANG_ID; if (file_exists(ROOT_PATH.'constants/'.CUR_LANG.'.php')) include(ROOT_PATH.'constants/'.CUR_LANG.'.php'); else include(ROOT_PATH.'constants/en.php'); if (!empty($GLOBALS['errorLogin'])) main::setError('login', 'login', require_ACL, 'error'); $GLOBALS['selectIds'][$data['id']] = 1; if ($data['parentId']) { $GLOBALS['selectIds'][$data['parentId']] = 1; $pnode = $pcm->findNodeById($data['parentId']); if (!empty($pnode['parentId'])) $GLOBALS['selectIds'][$pnode['parentId']] = 1; } if (!defined('canPath')) { define('canPath', $data['path']); define('canId', $data['id']); } if (!defined('goalId')) define('goalId', $data['id']); $_REQUEST['id'] = $data['id']; define('realPagePath', $data['path']); $ifmod = ''; if (!empty($_ENV['HTTP_IF_MODIFIED_SINCE'])) $ifmod = $_ENV['HTTP_IF_MODIFIED_SINCE']; elseif (!empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])) $ifmod = $_SERVER['HTTP_IF_MODIFIED_SINCE']; $modified = substr(gmdate('r', $data['dateCustom']), 0, -6).' GMT'; header('Last-Modified: '.$modified, true); if ($ifmod == $modified && !$err404) { header($_SERVER['SERVER_PROTOCOL'].' 304 Not Modified'); exit; } $GLOBALS['goodsId'] = isset($_GET['goodsId']) ? (int) $_GET['goodsId'] : 0; if (!empty($_POST['goodsId'])) $GLOBALS['goodsId'] = (int) $_POST['goodsId']; $GLOBALS['uppodjs'] = $GLOBALS['heads'] = $GLOBALS['inits'] = ''; include(ROOT_PATH.'skinss/template/page.php'); function blocks($id, $templateId) { $invisArr = array('bounceIn'=>1,'bounceInDown'=>1,'bounceInLeft'=>1,'bounceInRight'=>1,'bounceInUp'=>1,'fadeIn'=>1,'fadeInDown'=>1,'fadeInDownBig'=>1,'fadeInLeft'=>1,'fadeInLeftBig'=>1,'fadeInRight'=>1,'fadeInRightBig'=>1,'fadeInUp'=>1,'fadeInUpBig'=>1,'lightSpeedIn'=>1,'rotateIn'=>1,'rotateInDownLeft'=>1,'rotateInDownRight'=>1,'rotateInUpLeft'=>1,'rotateInUpRight'=>1,'slideInUp'=>1,'slideInDown'=>1,'slideInLeft'=>1,'slideInRight'=>1,'zoomIn'=>1,'zoomInDown'=>1,'zoomInLeft'=>1,'zoomInRight'=>1,'zoomInUp'=>1,'jackInTheBox'=>1,'rollIn'=>1,'flipInX'=>1,'flipInY'=>1); main::mapper('block_core')->findByPageId($id, $templateId); $bofixjq = $pgfixjq = $blockClick = $html = ''; if (!empty(main::$contents['0'])) { foreach (main::$contents['0'] AS $ks => $section) { if ($section['service'] != 'content_core') continue; $allMark = $pgfix = $hidden = $fixbar = ''; $sectionTag = 'section'; if (isset($section['settings']['allMark'])) $allMark = ' allMark'; if (isset($section['settings']['hidden'])) $hidden = ' phidden'; if (isset($section['settings']['posFixed'])) $sectionTag = 'header'; elseif(isset($section['settings']['footFixed'])) $sectionTag = 'footer'; if (isset($section['settings']['posFixed'])) { if ($hidden) { $fixbar = ' fixbar'; if (!empty($section['settings']['effs'])) $section['settings']['effsof1'] = 0; } else $fixbar = ' statbar'; $pgfix = ' pgfix'; $GLOBALS['fixbars'] = 1; $pgfixjq .= ',#pgc_'.$ks; } elseif (isset($section['settings']['footFixed'])) { if (!empty($section['settings']['effs'])) $section['settings']['effsof1'] = 0; $bofixjq .= ',#pgc_'.$ks; $pgfix = ' bofix'; $fixbar = ' fixbott'; $GLOBALS['fixbars'] = 1; } $bgV = ''; if (!isSkipVideoBG) { if (!empty($section['files']['file'])) $bgV = FILES_W.'block/'.$section['files']['file']['fileName']; elseif(!empty($section['settings']['url']) && $section['settings']['fileType'] == 'YouTube') $bgV = $section['settings']['url']; if ($bgV) { if (isset($section['settings']['aload'])) $src = ' data-aload data-original="'.$bgV.'" data-root-id="'.$ks.'"'; else $src = ' src="'.$bgV.'"'; $bgV = ''; $GLOBALS['inits'] .= 'function b'.$ks.'init(){var videop = document.getElementById("vid'.$ks.'");'.(!isMobile && !empty($section['settings']['volume']) ? 'videop.volume = '.$section['settings']['volume'].';' : '').'videop.autoplay = true;var promise = videop.play();if (promise !== undefined) {promise["catch"](function(err) {videop.muted = true;videop.play();});}return true;}function b'.$ks.'play(){document.getElementById("vid'.$ks.'").play();}function b'.$ks.'stop(){document.getElementById("vid'.$ks.'").pause();return true;}'; $GLOBALS['bgV2'] = 1; } elseif (!isMobile && !empty($section['settings']['yId']) && $section['settings']['fileType'] == 'YouTube2') { $GLOBALS['ytAPIReady'] = ''; $bgV = '