$host=$_SERVER['HTTP_HOST']; $host=str_replace('www.','',$host); //echo $host; //echo $id; include"adm/public/inc_conex.php"; include"adm/public/inc_funcoes.php"; #### DADOS DO SITE ######### $s = "select * from config where url='".$host."'"; $config=mysql_fetch_array(mysql_query($s))or die(mysql_error()); //print_r($config); exit; $idcliente=$config['id']; if($idcliente < 1) die('Site não encontrado'); if($config[tipo]==0) { $template=mysql_fetch_array(mysql_query("select * from template where id='".$config[template]."'"))or die(mysql_error()); $thumb=explode('x',$config[thumb]); $altura_thumb=$thumb[1]; $largura_thumb=$thumb[0]; //echo $idcliente; #### pasta do template ########## $pasta="template/".$template[nomepasta].'/'; $html=$pasta."index.html"; require("Template.class.php"); $tpl = new Template($html); if($tpl->exists("RAIZ")){ $tpl->RAIZ = 'index.php'; } // pasta do template if($tpl->exists("DIR_TEMPLATE")){ $tpl->DIR_TEMPLATE = $pasta; } //cabeçalho do HTML if($tpl->exists("TITULO")){ $tpl->TITULO = $config[titulo]; } if($tpl->exists("CSS")){ $tpl->CSS = $pasta; } if($tpl->exists("PALAVRAS_CHAVES")){ $tpl->PALAVRAS_CHAVES = $config[palavras]; } if($tpl->exists("DESCRIPTION")) $tpl->DESCRIPTION = $config[descricao]; if($tpl->exists("JAVASCRIPT")) $tpl->JAVASCRIPT = $config[java]; if($tpl->exists("css")) $tpl->css = $config[css]; $player='







'.$config[whatsapp_msg].'
';
}
// slydeshow ----------------------------------------------------------------
$reshome = mysql_query("select * from banner where local ='home' and cliente= $idcliente order by rand() limit 6 ",$conn);
if(mysql_num_rows($reshome) > 0)
{
$tt=0;
while($slyde=mysql_fetch_array($reshome))
{ if($tt==0)$active="active"; else $active='';
$tpl->SRC_SLYDE =viewSlyde($slyde[link],'cliente/'.$config[id]."/banner/".$slyde[src],$slyde[target],$slyde[texto],$config[largura_slyde],$config[altura_slyde],$active);
$tpl->block("BLOCK_SLYDE_IMG");
$tt++;
}
if( ($config[slyde]==0 and !isset($_GET[url]) ) or $config[slyde]==1 )
{
$tpl->block("BLOCK_SLYDE");
}
}
$pagina=mysql_query("select * from post where tipo ='pg' and cliente='".$idcliente."' order by ordem asc") or die( mysql_error());
if(mysql_num_rows($pagina)>0)
{
// montar o menu horizontal //mostrar Home para index ou não
if($config[noindex]!=1 and $config[tipo]==0) $menuItensh[0][1] = array('link' => 'index.php','name' =>'Home');
if($config[noindex]!=1 and $config[tipo]==1) $menuItensh[0][1] = array('link' => 'radio.php','name' =>'Home');
while($p=mysql_fetch_object($pagina))
{
if($p->destaque==1){// se a pagina só serve para ser menu vide formulario de cadastro...
$menuItensh[$p->pai][$p->id] = array('link' => '#','name' => $p->nome);
}
else
{
$menuItensh[$p->pai][$p->id] = array('link' => '?url=post&cat='.$p->id,'name' => $p->nome);
}
}
$tpl->MENU = imprimeMenuInfinitoh($menuItensh);
if($tpl->exists("MENURESPONSIVO")) $tpl->MENURESPONSIVO ='';
}
else
{
$tpl->MENU ='';
}
##################################CONTEUDO################################
$url=$_GET[url].'.html';//if existir o em html e o em php eu incluo os arquivos
if( (file_exists($pasta.$url)) )
{
$tpl->addFile("CONTEUDO", $pasta.$url);
include("php/".$_GET[url].'.php');
}
else
{
$url="home.html";
//$tpl->addFile("CONTEUDO", $pasta.$url);
if( (file_exists($pasta.$url)) ) // se o template tem o home dele
{
$tpl->addFile("CONTEUDO", $pasta.$url);
}
else
{
$tpl->addFile("CONTEUDO", "template/".$url);
}
include('php/home.php');
}
$col=0;
/* lado esquerdo*/
if($tpl->exists("ESQUERDA") and $config[colunaesquerda]>0)
{
$tpl->addFile("ESQUERDA", $pasta.'esquerda.html');
include("php/esquerda.php");
$col=$config[colunaesquerda];
if($tpl->exists("ESQUERDACLASS")) $tpl->ESQUERDACLASS ='col-sm-'.$config[colunaesquerda].' col-sm-pull-'.(12-$config[colunaesquerda]-$config[colunadireita]);
$tpl->block("BLOCK_ESQUERDA");
$push1=' col-sm-push-'.$config[colunaesquerda];
}
/* lado direito*/
if($tpl->exists("DIREITA") and $config[colunadireita]>0 )
{
$tpl->addFile("DIREITA", $pasta.'direita.html');
include("php/direita.php");
$col=$col+$config[colunadireita];
if($tpl->exists("DIREITACLASS")) $tpl->DIREITACLASS ='col-sm-'.$config[colunadireita];
$tpl->block("BLOCK_DIREITA");
}
$co=12-$col; // numero de col do bootstrap da pagina com ou sem as colunas
if($tpl->exists("CONTEUDOCLASS")) $tpl->CONTEUDOCLASS ='col-sm-'.$co.$push1;
// enviar emails caso necessite:
if( $_SERVER['REQUEST_METHOD']=='POST' )
{
foreach($_POST as $nome_campo => $valor){
$campo=str_replace('_',' ',$nome_campo);
if($c==0)$chave=$valor;// 1º campo para nao ter 2 cadastros iguais
$texto .= "".$campo ."". "=" . $valor . "