"None"]); //none, lax, strict
//if(!stristr("213.252.203.113, 78.60.155.18", $_SERVER['REMOTE_ADDR'])) die();
session_start();
//header('Set-Cookie: PHPSESSID=' . session_id() . '; SameSite=None; Secure; HttpOnly ');
//if(!stristr("213.252.203.113, 78.60.155.18", $_SERVER['REMOTE_ADDR'])) return;
if(stristr("213.252.203.113, 78.60.155.18", $_SERVER['REMOTE_ADDR']) && 1==0) {
print_r($_POST);
echo session_id();
//phpinfo();
//exit;
}
if(stristr("213.252.203.113, 78.60.155.18", $_SERVER['REMOTE_ADDR']) && 1==0) {
//echo "111";
//echo phpinfo();
ini_set("display_errors", 1);
ini_set("track_errors", 1);
ini_set("html_errors", 1);
//error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
}
//if($_SERVER['REMOTE_ADDR']!="78.60.155.18") return;
//if($_SERVER['REMOTE_ADDR']!="213.252.203.113" && $_SERVER['REMOTE_ADDR']!="195.14.185.181") die("404 not found");
if($_SERVER['REMOTE_ADDR']=="213.252.203.113") $startScriptTime=microtime(TRUE);
header('Content-type: text/html; charset=utf-8');
require_once 'lib/class.templates.php';
// require_once 'lib/php_fast_cache.php';
include("pages/functions.php");
//if(!isadmin()) die("404 not found");
if(isadmin() && 1==0) {
?>
Justas Korsakas ar pats pabaigsi ar reiks kriminalistų pagalbos ?
return;
}
$current_url = trim($_SERVER["REQUEST_URI"]);
$article_cond = preg_match("/\.html$/", $current_url);
$home_cond = ($current_url=="/");
$search_cond = preg_match("/^\/paieska\/[^\/\?]+\/?(p\d+\/)?$/", $current_url);
$category_cond = ( $current_url!="/" && preg_match("/^\/(mano|admin|parsisiusti|parsisiusti-darba|parsisiuntimas|parsisiuntimass|slaptazodzio-priminimas|ivertinimas|ivertink-darbus|paieska|kontaktai|registracija|darbo-atsiuntimas|prisijungti|uzsakyti-naryste|\.html)\//", $current_url) );
if(1==0 && $_SESSION['uRight']==0 && $_GET['fb']!=1 && $_POST['regEmail']=="" && !preg_match("/\?/", $current_url) && $_POST['loginEmail']=="" && $_POST['regloginEmail']=="" &&
( ($article_cond && $_GET['m']!="1") || $search_cond || !$category_cond || $home_cond )
) {
$cid = md5($current_url);
$days = rand(3,8); //papildomi paikai kad cache baigtusi skirtingu metu atsitiktinai (reikalinga indeksacijai)
$hours = rand(0,24);
$mins = rand(0,60); // 60*60*24*1 + (60*60*$hours) + (60*$mins);
if($article_cond) { $cid = "a_".$cid; $cache_time = 60*60*24*$days + (60*60*$hours) + (60*$mins); }
elseif($home_cond) { $cid = "h_".$cid; $cache_time = 60*15; } //15 min
elseif($search_cond) { $cid = "s_".$cid; $cache_time = 60*60*24*$days + (60*60*$hours) + (60*$mins); }
elseif(!$category_cond) { $cid = "c_".$cid; $cache_time = 60*30; }
$chtml = phpFastCache::get($cid);
if($chtml != null) {
//if($_SERVER['REMOTE_ADDR']=="213.226.183.28") echo "is full cache ".$current_url;
print $chtml;
if($_SERVER['REMOTE_ADDR']=="213.226.183.28") {
$endScriptTime=microtime(TRUE);
$totalScriptTime=$endScriptTime-$startScriptTime;
echo "Load time: ".number_format($totalScriptTime, 5)." seconds ";
}
return;
}
}
global $config, $title;
$conn = connectDB();
include("pages/session.php");
loadLang($_SESSION['lang']);
loadCats();
loadLinks();
loadOptions();
$page = new Templater("pages/main.php"); // Loading the template file
$page->config = $config;
$page->url = strdb($_SERVER["REQUEST_URI"]);
$con = getContent($page->url);
//setmbcookie();
//print_r($con);
// if(!$GLOBALS['content_exist']) {
// }
if($con['movedto']!="") return;
$page->breadcrumb = breadcrumbHTML($con['breadcrumb']);
$page->metadesc = formatMetaDesc($con['metadesc']);
if($con['title']==$config['site_title'] || $con['title']=="")
$page->title = $config['site_title']." - ".$config['main_title'];
else
$page->title = $con['title']." - ".$config['site_title'];
$page->title2 = $con['title2'];
//$page->breadcrumb = breadCrumb($page->url);
//$GLOBALS['metadesc'] = getMetaDesc();
//$page->metadesc = substr(strip_tags($GLOBALS['metadesc']),0,300);
//$page->title = $title==''?$config['main_title']:$title;
$page->noindex = $con['noindex'];
$page->address = $con['address'];
$page->ogimage = $con['ogimage'];
$layout = $con['layout'];
if(empty($layout)) $layout = "rightbar";
$path = str_replace(basename($con['address']),"",$con['address']);
$alias = $path.$con['alias'];
$filename = $page->getBlockAlias("headerline",$alias);
$page->loadBlock("headerline","pages/".$filename);
$filename = $page->getBlockAlias("header",$alias);
$page->loadBlock("header","pages/".$filename);
if($_SESSION['uRight']>0 && 1==0) {
$page->headerline = phpFastCache::get("headerline");
if($page->headerline == null) {
$filename = $page->getBlockAlias("headerline",$alias);
$page->loadBlock("headerline","pages/".$filename);
phpFastCache::set("headerline",$page->headerline , 60*60*24*7);
}
$page->header = phpFastCache::get("header");
if($page->footer == null) {
$filename = $page->getBlockAlias("footer",$alias);
$page->loadBlock("footer","pages/".$filename);
phpFastCache::set("footer",$page->footer , 60*60*24*7);
}
$page->footer = phpFastCache::get("footer");
if($page->footer == null) {
$filename = $page->getBlockAlias("footer",$alias);
$page->loadBlock("footer","pages/".$filename);
phpFastCache::set("footer",$page->footer , 60*60*24*7);
}
} else {
//load blocks
$filename = $page->getBlockAlias("headerline",$alias);
//$page->loadBlock("headerline","pages/".$filename);
$page->headerline = $config['basedir']."pages/".$filename;
$filename = $page->getBlockAlias("header",$alias);
//$page->loadBlock("header","pages/".$filename);
$page->header = $config['basedir']."pages/".$filename;
$filename = $page->getBlockAlias("footer",$alias);
//$page->loadBlock("footer","pages/".$filename);
$page->footer = $config['basedir']."pages/".$filename;
}
if(!$layout) $layout = "rightbar";
//get content
if($_SESSION['uRight']>0 && $_GET['m']!="1" && $alias=="article" && 1==0) { //article jei ne mokejimas ir ne adminas
$aname = "article_".$GLOBALS['url_file'];
$page->content = phpFastCache::get($aname);
$page->right = phpFastCache::get($aname."_right");
if($page->content == null) {
$page->loadBlock("content","pages/".$con['address']);
phpFastCache::set($aname,$page->content , 60*60*24*7);
$filename = $page->getBlockAlias("right",$alias);
$page->loadBlock("right","pages/".$filename);
phpFastCache::set($aname."_right",$page->right , 60*60*24*7);
}
} else {
$page->content = $config['basedir_test']."pages/".$con['address'];
}
if($layout=="3col" || $layout=="leftbar") {
$filename = $page->getBlockAlias("left",$alias);
//$page->loadBlock("left","pages/".$filename);
$page->left = $config['basedir']."pages/".$filename;
}
if(($layout=="3col" || $layout=="rightbar") && $page->right == null) {
$filename = $page->getBlockAlias("right",$alias);
//$page->loadBlock("right","pages/".$filename);
$page->right = $config['basedir']."pages/".$filename;
}
$filename = $page->getBlockAlias("js",$alias);
$page->main_js = $config['basedir']."pages/main.js.php";
if(substr($filename,0,4)!="main") {
$page->js = $config['basedir']."pages/".$filename;
}
//parse layout
//$page->loadBlock("layout","layouts/layout.".$layout.".php");
$page->layout_file = $config['basedir_test']."layouts/layout.".$layout.".php";
$page->layout_title = $layout;
//load main page
$html = $page->publish();
//if($cid!="" && $_SESSION['uRight']==0 && $GLOBALS['content_exist']==1) phpFastCache::set($cid,$html , $cache_time);
/*if($_SERVER['REMOTE_ADDR']=='213.252.203.113') {
$endScriptTime=microtime(TRUE);
$totalScriptTime=$endScriptTime-$startScriptTime;
echo "Load time: ".number_format($totalScriptTime, 5)." seconds ";
}*/
disconnectDB($conn);
?>