template_dir = "../tpl/"; $smarty->compile_dir = "../tpl_c/"; $smarty->cache_dir = "../cache/"; $smarty->config_dir = "../conf/"; $info = explode("/", $_SERVER["REQUEST_URI"]); $ir = $info[1]; $id = $info[2]; if(is_numeric($info[count($info)-1])){ $p = $info[count($info)-1]; } if($_SESSION["mRetorno"]){ $mensagemRetorno = ""; } if ($ir == "alimentos-kinino") { $ir = "produtos"; } if((!$ir) || ($ir == "principal")){ //usei o principal == index include("principal.php"); } elseif($ir == 'video'){ include("video.php"); return false; } else{ if (file_exists(dirname(__FILE__)."/".$ir.".php")) include(dirname(__FILE__)."/".$ir.".php"); else{ echo file_get_contents("../html/404.html"); return false; } } if(!$pagTitle) $pagTitle = ""; if(!$pagDescription) $pagDescription = ""; if(!$pagKeywords) $pagKeywords = ""; $pagCanonical = getCanonical(); if(ANALYTICS <> ''){ $analytics .= ""; } $j=0; $Sql01 = "SELECT Banner_Id, Banner_Nome, Banner_Arquivo, Banner_Target, Banner_Link FROM tabbanners WHERE Banner_Tipo = 1 AND Banner_Status = 1 ORDER BY rand()"; $Query01 = mysql_query($Sql01, $Conn); while($Rs01 = mysql_fetch_array($Query01)) { $listaBannerTopo[$j]['banner'] = retornaBanner($Rs01['Banner_Arquivo'], "/img/Banners", $Rs01['Banner_Target'], "998", "398", "/clickBanner/".$Rs01["Banner_Id"], $Rs01["Banner_Nome"]); $j++; } $Sql01 = "SELECT tabcategorias.Categoria_Id, tabcategorias.Categoria_Nome, tabcategorias.Categoria_Link FROM tabcategorias ORDER BY CASE WHEN tabcategorias.Categoria_Ordem IS NULL THEN 1 ELSE 0 END, tabcategorias.Categoria_Ordem ASC, tabcategorias.Categoria_Nome ASC"; $Query01 = mysql_query($Sql01, $Conn); while($Rs01 = mysql_fetch_array($Query01)){ $listaCategoriasTopo[] = $Rs01; } $smarty->assign("listaCategoriasTopo", $listaCategoriasTopo); if(!$seo){ $seo = array('title' => 'Titulo', 'description' => 'descriptions', 'keywords' => 'keywords aasdf', 'canonical' => 'http://'.$_SERVER['HTTP_HOST'].'/'); $smarty->assign('seo', $seo); } $tags = array( "MRETORNO" => $mensagemRetorno, "LISTABANNERTOPO" => $listaBannerTopo, "IR" => $ir, "ANALYTICS" => $analytics ); $smarty->assign($tags); //if(COMBINE) $smarty->loadFilter('output', 'group_css'); //if(COMBINE) $smarty->loadFilter('output', 'group_js'); $smarty->display('index.tpl'); $_SESSION["mRetorno"] = false; ?>