setArticleExtension('.htm'); $navigation->setCatalogueExtension('.html'); $stats->createTable(); //$stats->logAccess(); /********* spusteni cache ************ // data z cache povolime pouze neprihlasenym uzivatelum, pripadne stanovime dalsi podminky if (empty($_SESSION['userinfo']['id']) AND ($_GET['pg']=='katalog' OR $_GET['pg']=='clanky')){ $cache = new Cache(); $cache->setCacheDir($conf['dir']['cache']); //zivotnost 1 den $cache->setMinuteLifeTime(1440); $cache->setGroup($_GET['pg']); $cache->CacheIt(); $cache->start(); $cache_zapnuto = 1; } /********* spusteni cache ************/ // zavede hlavni sablonu $tpl = new TemplatePower( "templates/main.html" ); // sablona pro strankovani $tpl->assignInclude('vlozeny_clanek','templates/vlozeny_clanek.html'); $tpl->assignInclude('antispam','templates/antispam.html'); //$tpl->assignInclude('anketa','templates/anketa.html'); $tpl->assignInclude('razeni','templates/razeni.html'); $tpl->assignInclude('strankovani','templates/paging.html'); $tpl->assignInclude('navigation','templates/navigation.html'); $tpl->assignInclude('navigation_back','templates/navigation_back.html'); $tpl->assignInclude('message','templates/message.html'); $tpl->assignInclude('kontaktni_formular','templates/kontaktni_formular.html'); $tpl->assignInclude('aktuality','templates/aktuality.html'); //zavedeme potrebny layout, menu $tpl->assignInclude("menu","templates/menu.html"); // parsovani sablon $tpl->prepare(); if ($_GET['pg']=='processdata') include 'scripts/processdata.php'; if ($_GET['intoCart']){ $cart->putIntoCart($_GET['intoCart'],$_POST['pocet']); header("location: ".$_SERVER['HTTP_REFERER'].""); } $tpl->assignGlobal("ANTISPAM_QUESTION",$conf['antispam']['question']); $tpl->assignGlobal("ANTISPAM_ANSWER",$conf['antispam']['answer']); $tpl->assignGlobal("GLOBAL_BACKURL",$_SERVER['REQUEST_URI']); $tpl->assignGlobal("URI",'http://'.$_SERVER['SERVER_NAME']); // zpracujeme data pro informace o nakupnim kosiku. Predpokladame, ze budou tyto informace stale viditelne $tpl->assignGlobal("CENA_OBJEDNAVKY",$cart->getTotalPriceFormated()); $tpl->assignGlobal("CENA_OBJEDNAVKY_S_DPH",$cart->getTotalPriceDphFormated()); $tpl->assignGlobal("CART_TOTAL_PRICE",$cart->getTotalPrice()); $tpl->assignGlobal("CART_POCET_KS",COUNT($_SESSION['cart'])); //do retezce vlozime spravne hodnoty. Text je definovan v editoru textu $info_souhrn_kosiku = preg_replace('/x_pocet_ks_x/',$cart->getEntriesCount(),$str['INFO_SOUHRN_KOSIKU']); $info_souhrn_kosiku = preg_replace('/x_cart_total_price_x/',$cart->getTotalPriceFormated(),$info_souhrn_kosiku); // zpracujeme url pro RSS $tpl->assignGlobal("RSS_URL",$strings->replaceText(array('url'=>'http://'.$_SERVER['SERVER_NAME'].$navigation->getCatalogueRssUrl()),$str['CATALOGUE_RSS'],'x_ _x')); $strings->fillTemplates(); if ($cart->getTotalPrice()>0) $tpl->assignGlobal("INFO_SOUHRN_KOSIKU",$info_souhrn_kosiku); else $tpl->assignGlobal("INFO_SOUHRN_KOSIKU",$str['KOSIK_JE_PRAZDNY']); if ($_GET['pg']){ //zavede sablonu pro hlavni ramec $tpl->assignInclude("hlavni","templates/".basename($_GET['pg']).".html"); $tpl->prepare(); include 'scripts/menu.php'; include 'scripts/navigation.php'; include 'scripts/'.basename($_GET['pg']).'.php'; } else{ //zavede sablonu pro hlavni ramec $tpl->assignInclude("hlavni","templates/titulka.html"); $tpl->prepare(); include 'scripts/menu.php'; include 'scripts/navigation.php'; include 'scripts/titulka.php'; } //include 'scripts/marquee.php'; //include 'scripts/vlozeny_clanek.php'; tento radek vkladat pouze do scriptu, do kterych je treba vlozit clanek //include 'scripts/anketa.php'; include 'scripts/navigation_back.php'; include 'scripts/kontaktni_formular.php'; include 'scripts/message.php'; include 'scripts/razeni.php'; include 'scripts/banner.php'; include 'scripts/aktuality.php'; //vypiseme vysledek $tpl->printToScreen(); //********* ulozeni cache ************ if ($cache_zapnuto ==1 ) { echo ' '; $cache->finish(); } /********* ulozeni cache ************/ $time_end = microtime(true); $time = $time_end - $time_start; echo ""; ob_end_flush(); ?>