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 = '
'; $GLOBALS['inits'] .= 'window["vid'.$ks.'sec"]="'.(isset($section['settings']['start']) ? $section['settings']['start'] : 0).'";function b'.$ks.'init(){if(!initYoutubeF){initYoutube();}if("Player" in YT2) {ifCenter("bgv'.$ks.'");window["plvid'.$ks.'"] = new YT2.Player("vid'.$ks.'",{videoId:"'.$section['settings']['yId'].'",playerVars:{start:window["vid'.$ks.'sec"],'.(!empty($section['settings']['end']) ? 'end:"'.$section['settings']['end'].'",' : '').'playsinline:1,rel:0,hd:1,autoplay:1,disablekb:1,showinfo:0,iv_load_policy:3,loop:1,controls:0,modestbranding:1,playlist:"'.$section['settings']['yId'].'",html5:1},events:{"onStateChange": onYouTubeStateChange,"onReady":'.(isMobile || empty($section['settings']['volume']) ? 'onMuteReady' : 'function(e) {e.target.setVolume('.($section['settings']['volume']*100).');}').'}});return true;}return false;}function b'.$ks.'play(){window["plvid'.$ks.'"].playVideo();}function b'.$ks.'stop(){if("pauseVideo" in window["plvid'.$ks.'"]){window["plvid'.$ks.'"].pauseVideo();return true;}}'; $GLOBALS['ifCenter'] = 1; } } $bgFixs2 = $bgFixs = ''; if (isset($section['settings']['zoom3'])) { $bgFixs = '
'; $bgFixs2 = ''; } if ($bgV) $bgV = '
'.$bgV.'
'; $attr1 = $class2 = ''; if (!empty($section['settings']['effs'])) { $GLOBALS['animb'] = 1; $attr1.=' data-vp-add-class="'.$section['settings']['effs'].' animated" data-root-id="'.$ks.'"'; if (!empty($section['settings']['effsr'])) $attr1.=' data-vp-repeat="true"'; if (isset($section['settings']['effsof1'])) { if (!empty($section['settings']['effsof2'])) $section['settings']['effsof1'].'%'; $attr1.=' data-vp-offset="'.$section['settings']['effsof1'].'"'; } if (isset($invisArr[$section['settings']['effs']])) $class2 .= ' invisible'; $class2 .= ' effs'; } $html .= '<'.$sectionTag.' id="pgc_'.$ks.'" class="pgdiv'.$allMark.$hidden.$pgfix.'" tabindex="-1">
'.$bgFixs.'
'.(isset($section['settings']['virtualW']) ? $bgV : '').'
'.(!isset($section['settings']['virtualW']) ? $bgV : '').(!empty($section['ch_text1']) ? $section['text1'] : ''); if (isset(main::$contents[$ks])) $html .= bllist(main::$contents[$ks], $ks, $invisArr); $html .= '
'.$bgFixs2.''; } $anchors = array(); if (isset($GLOBALS['anchors'])) { $anchors = $GLOBALS['anchors']; unset($GLOBALS['anchors']); } foreach (main::$contents['0'] AS $ks => $section) { if ($section['service'] != 'content_core') continue; if (isset($anchors['ac_'.$ks]) || $section['link'] != 'c_'.$ks) { $GLOBALS['anchors']['ac_'.$ks] = $section['link']; } } } if (isset($_SESSION['BIT'])) { $html .= '
 
'.pleaseSend.' '.$_SESSION['BIT']['price'].' BTC '.$_SESSION['BIT']['address'].'
'; $GLOBALS['footer'] .= 'popupOpen("c_bit");'; unset($_SESSION['BIT']); } if (isScrollUp == 1 && !isMobile) { $html .= 'Up'; } if (!empty($pgfixjq) || !empty($bofixjq)) { $GLOBALS['dCnt'] = ''; if (!empty($pgfixjq)) $GLOBALS['dCnt'] .= 'pgfix = $("'.ltrim($pgfixjq, ',').'");'; if (!empty($bofixjq)) $GLOBALS['dCnt'] .= 'bofix = $("'.ltrim($bofixjq, ',').'");'; } return $html; } function bllist($bbl, $ks, $invisArr) { $html = ''; foreach($bbl AS $b) { $onclick = $target = $contextMenu = $sel = $link = $class2 = $attr1 = $attr2 = ''; if (!empty($b['class'])) { if (empty($b['classb'])) $class2 .= ' '.$b['class']; else $contextMenu .= ' '.$b['class']; } if (!empty($b['settings']['MakeLink'])) { if (!empty($b['settings']['onclick'])) $b['settings']['onclick'] = htmlspecialchars($b['settings']['onclick']); if (!isset($b['settings']['path'])) $b['settings']['path'] = ''; if ($b['settings']['type'] == 'anchor') $b = anchorSettings($b); if (isset($GLOBALS['selectIds'][$b['otherId']])) $sel .= ' msel'; if (!empty($b['selAnchors'])) $sel .= $b['selAnchors']; if (!empty($b['settings']['onclick'])) $onclick.=$b['settings']['onclick']; if (isset($b['ajs']) || empty($b['settings']['path']) || $b['settings']['path'] == '#') $onclick .= ' return false;'; if (!empty($onclick)) $onclick = ' onclick="'.$onclick.'"'; if (isset($b['settings']['newWindow'])) { $target = ' target="_blank" rel="noopener"'; } if ($b['service'] == 'link_core') { $attr1.=' href="'.$b['settings']['path'].'"'.$target.$onclick; } else { $link = ''; } } elseif (!empty($b['settings']['onclick'])) $attr1.=' onclick="'.htmlspecialchars($b['settings']['onclick']).'"'; if (!empty($b['settings']['onmouseover'])) $attr1.=' onmouseover="'.htmlspecialchars($b['settings']['onmouseover']).'"'; if (!empty($b['settings']['onmouseout'])) $attr1.=' onmouseout="'.htmlspecialchars($b['settings']['onmouseout']).'"'; if (!empty($b['title'])) $attr1.=' title="'.htmlspecialchars($b['title']).'"'; if (!empty($b['settings']['effs'])) { $GLOBALS['animb'] = 1; $attr1.=' data-vp-add-class="'.$b['settings']['effs'].' animated" data-root-id="'.$ks.'"'; if (!empty($b['settings']['effsr'])) $attr1.=' data-vp-repeat="true"'; if (isset($b['settings']['effsof1'])) { if (!empty($b['settings']['effsof2'])) $b['settings']['effsof1'].'%'; $attr1.=' data-vp-offset="'.$b['settings']['effsof1'].'"'; } if (isset($invisArr[$b['settings']['effs']])) $class2 .= ' invisible'; $class2 .= ' effs'; } if ($b['service'] == 'rectangle_core') { if (isset($b['settings']['aload'])) $attr1 .= ' data-aload data-root-id="'.$ks.'"'; $html.='
'.$link.'
'; if ($link) $html.='
'; $html.='
'; } elseif ($b['service'] == 'rectangle2_core') { $ll9 = ''; if (isset(main::$contents[$b['id']])) $ll9 = bllist(main::$contents[$b['id']], $ks, $invisArr); if (isset($b['settings']['aload'])) $attr1 .= ' data-aload data-root-id="'.$ks.'"'; $html.='
'.$link.'
'.$ll9.'
'; if ($link) $html.=''; $html.='
'; } elseif ($b['service'] == 'link_core') { $html.='
'.nl2br($b['baseName']).'
'; } elseif ($b['service'] == 'H1_core' || $b['service'] == 'H2_core' || $b['service'] == 'H3_core' || $b['service'] == 'H4_core') { $nnm = 'h1'; if ($b['service'] == 'H2_core') $nnm = 'h2'; elseif ($b['service'] == 'H3_core') $nnm = 'h3'; elseif ($b['service'] == 'H4_core') $nnm = 'h4'; if (isset($b['settings']['screenreader'])) { $html.='<'.$nnm.' class="screenreader">'.nl2br($b['baseName']).''; } else { $html.='
'.$link.'<'.$nnm.' id="b'.$b['id'].'" class="bi'.$class2.$sel.'"'.$attr1.'>'.nl2br($b['baseName']).''; if ($link) $html.=''; $html.='
'; } } elseif ($b['service'] == 'HTML_core' || $b['service'] == 'text_core' || $b['service'] == 'text1_core' || $b['service'] == 'PHP_core') { $html.='
'.$link.'
'; if (!empty($b['settings']['scroll'])) $html.='
'; if ($b['service'] != 'PHP_core') { if ($b['service'] == 'text1_core') $html.=nl2br($b['text1']); else $html.=$b['text1']; } else { ob_start(); phpBlockInclude($b); $html.=ob_get_contents(); ob_end_clean(); } if (!empty($b['settings']['scroll'])) $html.='
'; $html.='
'; if ($link) $html.=''; $html.='
'; } elseif ($b['service'] == 'line_core' || $b['service'] == 'lineV_core') { $nnm = ''; if ($b['service'] == 'lineV_core') $nnm = 'V'; $html.='
'; } elseif ($b['service'] == 'image_core') { $img = $l1 = $l2 = $l3 = $zoomcap = $itempropC = $imclass = ''; if (isset($b['settings']['graysi'])) $class2 .= ' graysi'; if (empty($b['settings']['tAlign'])) $b['settings']['tAlign'] = ''; if (isset($b['settings']['zoomcap'])) $zoomcap = 'caption '; $figcaption = $figure = 'div'; if (isset($b['settings']['coverImage']) && $b['settings']['coverImage'] == '2') { $itempropC .= ' itemprop="'.$zoomcap.'description"'; } else if (!empty($b['text1'])) { $figure = 'figure'; $figcaption = 'figcaption'; $itempropC .= ' itemprop="'.$zoomcap.'description"'; } if (isset($b['settings']['coverImage']) && $b['settings']['coverImage'] == '2') $l3 = '
'.$b['text1'].'
'; else if ($b['settings']['tAlign'] == 'top') $l1 = '<'.$figcaption.$itempropC.' class="imgcaption">'.$b['text1'].''; else if (!empty($b['text1']) || isset($b['settings']['coverImage'])) { if ($b['settings']['ifClick'] == 'zoomG' && (empty($b['settings']['tAlign']) || $b['settings']['tAlign'] == 'center')) $imclass = ' phswipet'; $l2 = '<'.$figcaption.$itempropC.' class="imgcaption'.$imclass.'" class="imgcaption'.$imclass.'">'.$b['text1'].''; } if (isset($b['settings']['aload'])) $src = 'data-aload data-original="'.FILES_W.'block/'.$b['files']['small']['fileName'].'" data-root-id="'.$ks.'" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="'; else $src = 'src="'.FILES_W.'block/'.$b['files']['small']['fileName'].'" '.($b['settings']['ifClick'] == 'zoomG' ? 'itemprop="thumbnail"' : 'itemprop="contentUrl"'); if($b['settings']['ifClick'] == 'zoomG') { $img = $l1.''.(isset($b['settings']['alt']) ? escapeMeta($b['settings']['alt']) : '').''; $l3 .= ''.(isset($b['settings']['aload']) ? '' : ''); $GLOBALS['phswipe'] = 1; } else { $img = $l1.''.(isset($b['settings']['alt']) ? escapeMeta($b['settings']['alt']) : '').''; $l3 .= ''.(isset($b['settings']['aload']) ? '' : ''); } if (!empty($b['baseName'])) $l3 .= ''; if (isset($b['settings']['coverImage'])) { if ($b['settings']['coverImage'] == '1' && (empty($b['text1']) || !empty($b['settings']['tAlign']))) unset($b['settings']['coverImage']); else $GLOBALS['coverImage'] = 1; } $html.='
'.$link.'<'.$figure.' id="b'.$b['id'].'" class="bi'.$class2.'"'.$attr1.'>'.$img.$l2.''.$l3; if ($link) $html.=''; $html.='
'; } elseif ($b['service'] == 'details_core') { if (isset($b['settings']['open'])) $attr1 .= ' open'; if (!empty($b['settings']['accord'])) { $class2 .= ' cpaccord'; $GLOBALS['cpaccord'] = 1; } $html.='
'; if (!empty($b['settings']['mkCheck']) && $b['settings']['mkType'] != 't') { $html.=''; } $html.=(!empty($b['settings']['h1uCheck']) || !empty($b['settings']['h1uaCheck']) ? ''.nl2br($b['baseName']).'' : nl2br($b['baseName'])).'
'.$b['text1'].'
'; } else { $m = explode('_', $b['service']); $blockClick = ''; include(ROOT_PATH.'skinss/template/'.$m[1].'/'.$m[0].'.php'); } } return $html; }