Full screen (Tela inteira)
Bom dia amigos!
Tenho um site onde costumo divulgar eventos em fullscreen antes de acessar a página inicial propriamente dita... já me bati e venho me batendo a um bom tempo pra tentar automatizar essa parte... hoje estou tendo q inserir manualmente os anúncios...
A ideia é exibir os anúncios (cada um em uma página) com link para o próximo anuncio (se houver), baseado pela data informada na tabela do banco de dados... e se não houver nenhum, ou todos já tenham sido exibidos, o último linkar para home.php...
Tentei com o código abaixo, mas não obtive mto sucesso... alguém se habilita a me dar uma mão por gentileza? Muito obrigado!
<?php
require_once("includes/connect.inc.php");
$mes = date("m");
$dia = date("d",time());
$ano = date("Y",time());
$data_hoje = $ano.$mes.$dia;
$id = $_REQUEST["id"];
$pl = $_REQUEST["id"];
if ($id==""){
$sql_pop = mysql_query("SELECT * FROM telacheia WHERE dataval>='$data_hoje' ORDER BY dataval ASC LIMIT 1");
while($l_pop = @mysql_fetch_array($sql_pop))
{
$id = $l_pop['id'];
$evento = $l_pop['evento'];
$corfundo = $l_pop['corfundo'];
$corfonte = $l_pop['corfonte'];
$tags = $l_pop['tags'];
$imagem = $l_pop['imagem'];
$largura = $l_pop['largura'];
$altura = $l_pop['altura'];
$mapa = $l_pop['mapa'];
$link = $l_pop['link'];
$dataval = $l_pop['dataval']; //20110815
$dateval = $l_pop['dataval']; //20110815
$dia = substr($dataval,6,2);
$mes = substr($dataval,4,2);
$ano = substr($dataval,2,2);
$dataval = $dia.'/'.$mes.'/'.$ano;
$sql_a = mysql_query("SELECT * FROM telacheia WHERE dataval > $dateval ORDER BY dataval ASC LIMIT 1");
$l_a = @mysql_fetch_array($sql_a);
$uid = $l_a['id'];
$cur =& $conn->Execute("SELECT MAX(id) AS MAX FROM telacheia");
$last = $cur->fields["MAX"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Pragma" content="no-cache">
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="robots" content="index,follow" />
<meta name="robots" content="noarchive" />
<meta http-equiv="content-language" content="pt" />
<meta name="author" content="" />
<meta name="reply-to" content="" />
<? if($last==$pl){ ?>
<meta http-equiv= "Refresh" content="30;URL=home.php">
<? } else {?>
<meta http-equiv= "Refresh" content="30;URL=index.php?id=<? echo $uid ?>">
<? } ?>
<link href="mx/estilos.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="mx/js/funcoes.js"></script>
<title><? echo $dataval ?> - <? echo $evento ?></title>
</head>
<body style="background-color:<? echo $corfundo?>;">
<div id="table">
<div id="cell">
<div id="conteudo">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><? if ($link!=""){ ?><a href="<? echo $link ?>" title="Confira!"><? } ?><img src="flyers/<? echo $imagem ?>" alt="" width="<? echo $largura ?>" height="<? echo $altura ?>" border="0" title="" usemap="#Map" /><? if ($link!=""){ ?></a><? } ?></td>
</tr>
<tr>
<td height="22" align="center">
<? if($last==$pl){ ?>
<a href="home.php" class="textopadrao" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:<? echo $corfonte?>;">Clique <strong>AQUI</strong> para acessar o site...</a>
<? } else {?>
<a href="index.php?id=<? echo $uid ?>" class="textopadrao" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:<? echo $corfonte?>;">Clique <strong>AQUI</strong> para prosseguir...</a>
<? } ?>
</td>
</tr>
</table>
</div>
</div>
</div>
<? echo $mapa; ?>
</body>
</html>
<? } } else {
$sql_pop = mysql_query("SELECT * FROM telacheia WHERE id = $id");
while($l_pop = @mysql_fetch_array($sql_pop))
{
$id = $l_pop['id'];
$evento = $l_pop['evento'];
$corfundo = $l_pop['corfundo'];
$corfonte = $l_pop['corfonte'];
$tags = $l_pop['tags'];
$imagem = $l_pop['imagem'];
$largura = $l_pop['largura'];
$altura = $l_pop['altura'];
$mapa = $l_pop['mapa'];
$link = $l_pop['link'];
$dataval = $l_pop['dataval']; //20110815
$dia = substr($dataval,6,2);
$mes = substr($dataval,4,2);
$ano = substr($dataval,2,2);
$dataval = $dia.'/'.$mes.'/'.$ano;
$sql_j = mysql_query("SELECT * FROM telacheia WHERE id > $id ORDER BY dataval ASC LIMIT 1");
$l_j = @mysql_fetch_array($sql_j);
$uid = $l_j['id'];
$cur =& $conn->Execute("SELECT MAX(id) AS MAX FROM telacheia");
$last = $cur->fields["MAX"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Pragma" content="no-cache">
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="robots" content="index,follow" />
<meta name="robots" content="noarchive" />
<meta http-equiv="content-language" content="pt" />
<meta name="author" content="" />
<meta name="reply-to" content="" />
<? if($last==$pl){ ?>
<meta http-equiv= "Refresh" content="30;URL=home.php">
<? } else {?>
<meta http-equiv= "Refresh" content="30;URL=index.php?id=<? echo $uid ?>">
<? } ?>
<link href="mx/estilos.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="mx/js/funcoes.js"></script>
<title><? echo $dataval ?> - <? echo $evento ?></title>
</head>
<body style="background-color:<? echo $corfundo?>;">
<div id="table">
<div id="cell">
<div id="conteudo">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><? if ($link!=""){ ?><a href="<? echo $link ?>" title="Confira!"><? } ?><img src="flyers/<? echo $imagem ?>" alt="" width="<? echo $largura ?>" height="<? echo $altura ?>" border="0" title="" usemap="#Map" /><? if ($link!=""){ ?></a><? } ?></td>
</tr>
<tr>
<td height="22" align="center">
<? if($last==$id){ ?>
<a href="home.php" class="textopadrao" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:<? echo $corfonte?>;">Clique <strong>AQUI</strong> para acessar o site...</a>
<? } else {?>
<a href="index.php?id=<? echo $uid ?>" class="textopadrao" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:<? echo $corfonte?>;">Clique <strong>AQUI</strong> para prosseguir...</a>
<? } ?>
</td>
</tr>
</table>
</div>
</div>
</div>
<? echo $mapa; ?>
</body>
</html>
<?php
}
}
$conn->Close();
?>
Não sei se a ideia eh mais ou menos por ai... tb não consegui dar jeito de fazer funcionar...
Valeu! Mto obrigado!!
Discussão (1)
Carregando comentários...