$sqlPub = "SELECT * FROM (".$idioma."_publicidade) WHERE estado = 1 ORDER BY ordem ASC";
$qPub = mysql_query($sqlPub);
while($fPub = mysql_fetch_array($qPub))
{
if($fPub[imagem]>0) {
$sqlPubImg = "SELECT * FROM (pt_publicidade_imagem_imagens) WHERE id = $fPub[imagem]";
$qPubImg = mysql_query($sqlPubImg);
$fPubImg = mysql_fetch_array($qPubImg);
?>
}
}
?>
//echo "Site online";
/* ---------------------------------------------- KITCHEN SINK ---------------------------------------------- */
//como se deve fazer echo de HTML guardado na base de dados
//echo utf8_encode(html_entity_decode($qualquercoisa));
//como se deve fazer echo de outro conteúdo de texto guardado na base de dados
//echo utf8_encode($qualquercoisa);
//como se deve fazer uma query
/*
//query
$sqlBusca = "
SELECT * FROM (NOME DA TABELA) WHERE estado=1
AND (RESTO DAS CONDIÇÕES, OPCIONAL)
ORDER BY (NOME DO CAMPO QUE SE QUER ORDENADO) ASC";
//execução da query
$qBusca = mysql_query($sqlBusca);
//processamento dos dados devolvidos pela query
//opção 1 - se for para correr um array de registos
while($fBusca = mysql_fetch_array($qBusca))
{
//faz o que tens a fazer aqui
}
//opção 2 - se for para mostrar apenas um registo
$fBusca = mysql_fetch_array($qBusca)
//faz o que tens a fazer a seguir a isto
*/
//Base para formulário de pesquisa
/*?>
*/
//Base para formulário de definição de idioma
/*?>
*/
//ficheiro base para execução de pesquisa
//include("pesquisa.php");
/* ---------------------------------------------- KITCHEN SINK FIM ---------------------------------------------- */
}
else if($fConfigs[online] == 3) //site em manutenção
{
include("pag_manutencao.php");
}
else //site offline/página temporária
{
include("pag_temporaria.php");
}
?>
/* USER-AGENTS
================================================== */
function check_user_agent ( $type = NULL ) {
$user_agent = strtolower ( $_SERVER['HTTP_USER_AGENT'] );
if ( $type == 'bot' ) {
// matches popular bots
if ( preg_match ( "/googlebot|adsbot|yahooseeker|yahoobot|msnbot|watchmouse|pingdom\.com|feedfetcher-google/", $user_agent ) ) {
return true;
// watchmouse|pingdom\.com are "uptime services"
}
} else if ( $type == 'browser' ) {
// matches core browser types
if ( preg_match ( "/mozilla\/|opera\//", $user_agent ) ) {
return true;
}
} else if ( $type == 'mobile' ) {
// matches popular mobile devices that have small screens and/or touch inputs
// mobile devices have regional trends; some of these will have varying popularity in Europe, Asia, and America
// detailed demographics are unknown, and South America, the Pacific Islands, and Africa trends might not be represented, here
if ( preg_match ( "/phone|iphone|itouch|ipod|symbian|android|htc_|htc-|palmos|blackberry|opera mini|iemobile|windows ce|nokia|fennec|hiptop|kindle|mot |mot-|webos\/|samsung|sonyericsson|^sie-|nintendo/", $user_agent ) ) {
// these are the most common
return true;
} else if ( preg_match ( "/mobile|pda;|avantgo|eudoraweb|minimo|netfront|brew|teleca|lg;|lge |wap;| wap /", $user_agent ) ) {
// these are less common, and might not be worth checking
return true;
}
}
return false;
}
?>