Total de visitas: 17640
|
Recados
// Cabeçalho
#################################################
require("biblioteca/fasttemplate.php");
require("config.php");
require("idiomas/${idioma}.php");
require("funcoes.php");
$mural = new FastTemplate("templates/".$template."/");
$mural->define(array("pagina" => "form.htm"));
$mural->assign("{Titulo}", $idioma_titulo);
$mural->assign("{Copyright}", $copyright);
// Faz a inserção dos dados no mural
#################################################
if($HTTP_POST_VARS["acao"] == "cadastrar"){
conecta();
$ip = getenv("REMOTE_ADDR");
$browser = getenv("HTTP_USER_AGENT");
$nome = $HTTP_POST_VARS["nome"];
$para = $HTTP_POST_VARS["para"];
$email = $HTTP_POST_VARS["email"];
$data = date("d/m/y H:i");
$msg = codifica_msg(strip_tags($HTTP_POST_VARS["comentario"]));
if(empty($nome)){
$erro = $idioma_nome_vazio; $err = 1;
}
if(empty($para)){
$erro = $idioma_para_vazio; $err = 1;
}
elseif(!eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*.[a-z]{2,3}$",$email)){
$erro = $idioma_email_errado; $err = 1;
}
elseif(empty($msg)){
$erro = $idioma_msg_vazia; $err = 1;
}
else{
@mysql_query("INSERT INTO mural (ip, browser, nome, para, email, data, mensagem) VALUES ("$ip","$browser","$nome","$para","$email","$data","$msg")")
or die("$idioma_inserir_dados");
setcookie("ip", $ip, time()+(60*$tempo_cookie), "/");
echo "n';
}
}
if($err == 1){
$mural->define_dynamic("Erro","pagina");
$mural->assign("{Erro}", $erro);
$mural->parse("ERRO",".Erro");
}
else{
$mural->define_dynamic("Erro","pagina");
$mural->clear_dynamic("Erro");
}
// Variáveis
#################################################
$mural->assign("{Nome}", $nome);
$mural->assign("{Para}", $para);
$mural->assign("{Email}", $email);
$mural->assign("{Mensagem}", decodifica_msg($msg));
$mural->assign("{IdiomaCaracteres}", $idioma_caracteres);
$mural->assign("{IdiomaCaracteres2}", $idioma_caracteres2);
$mural->assign("{IdiomaNome}", $idioma_nome);
$mural->assign("{IdiomaPara}", $idioma_para);
$mural->assign("{IdiomaEmail}", $idioma_email);
$mural->assign("{IdiomaMensagem}", $idioma_mensagem);
$mural->assign("{IdiomaEnviar}", $idioma_enviar);
$mural->assign("{IdiomaCodigo}", $idioma_codigo);
$mural->assign("{IdiomaAdmin}", $idioma_admin);
$mural->assign("{IdiomaAjuda}", $idioma_ajuda);
$mural->assign("{IdiomaVoltar}", $idioma_back_mural);
$mural->assign("{Css}","templates/".$template."/");
$mural->parse("OUTPUT","pagina");
$mural->FastPrint("OUTPUT");
mysql_close($conexao);
?>
// Cabeçalho
#################################################
require("biblioteca/fasttemplate.php");
require("biblioteca/paginacao.php");
require("config.php");
require("idiomas/${idioma}.php");
require("funcoes.php");
$mural = new FastTemplate("templates/".$template."/");
$nav = new Paginacao($total_reg,2);
$mural->define(array("pagina" => "mural.htm"));
$mural->assign("{Titulo}", $idioma_titulo);
$mural->assign("{Css}","templates/".$template."/");
$mural->assign("{Copyright}", $copyright);
$mural->assign("{IdiomaTotal}", $idioma_total);
$mural->assign("{IdiomaMostrando}", $idioma_mostrando);
$mural->assign("{IdiomaDe}", $idioma_de);
$mural->assign("{IdiomaPagina}", $idioma_pagina);
// Inicio
#################################################
conecta();
$nav->query("SELECT * FROM mural ORDER BY id DESC");
$sql2 = mysql_query("SELECT * FROM mural")or die("$idioma_selecio_dados");
$tr = mysql_num_rows($sql2);
// Cabeçalho
#################################################
if ($_COOKIE["ip"])
$mural->assign("{Menu1}","$idioma_post_mensagemn");
else
$mural->assign("{Menu1}","$idioma_post_mensagem");
$mural->assign("{Menu2}","$idioma_ajuda");
$mural->assign("{Menu3}","$idioma_admin");
// Sistema de Navegação
#################################################
$pagina=$nav->print_info();
$mural->assign("{Tr}", $pagina["total"]);
$mural->assign("{Nav}", $nav->print_link());
// Resultados na tela
#################################################
if($tr == 0){
$mural->define_dynamic("erro","pagina");
$mural->assign("{Erro}",$idioma_nao_encontrada);
$mural->parse("ERRO",".erro");
$mural->define_dynamic("tabela","pagina");
$mural->clear_dynamic("tabela");
}
else{
$mural->define_dynamic("erro","pagina");
$mural->clear_dynamic("erro");
$mural->define_dynamic("tabela","pagina");
while ($resultado=$nav->result_assoc()) {
$mural->assign("{Cor}", ($coralternada++ %2 ? $corFundoTabela01 : $corFundoTabela02));
$mural->assign("{Nome}", stripslashes(strip_tags($resultado["nome"], "")));
$mural->assign("{Para}", stripslashes(strip_tags($resultado["para"], "")));
$mural->assign("{Email}", stripslashes(strtolower(strip_tags ($resultado["email"]))));
$mural->assign("{Data}", $resultado["data"]);
$mural->assign("{Mensagem}", codifica_url(filtro(quebra_linha(stripslashes($resultado["mensagem"])))));
$mural->parse("TABELA",".tabela");
}
}
// Rodapé
#################################################
mysql_close($conexao);
if(!$_GET["pagina"])
$pc = "1';
else
$pc = $_GET["pagina"];
$mural->assign("{Nav4}", $pc);
$mural->assign("{Nav5}", $pagina["total"]/$total_reg);
$mural->parse("OUTPUT","pagina");
$mural->FastPrint("OUTPUT");
?>
|
|