Ir para conteúdo
Fórum Script Brasil

joelmir scheleski

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

1 Seguidor

Sobre joelmir scheleski

joelmir scheleski's Achievements

0

Reputação

  1. Amigo aonde devo editar essas info que me passou ????
  2. Olá caros amigos, desenvolvi uma page para um amigo e estou encontrando dificuldades no problema que aparece.... " Fatal error: Cannot redeclare conectabancodados() (previously declared in /home/capinade/public_html/novo/funcoes.php:10) in /home/capinade/public_html/novo/funcoes.php on line 19 " O sistema do site esta legal, perfeito, porém quando dei um include no sistema de noticias à direita esse lindo erro acima predomina, e eu apenas quero que as noticias abram no meio juntamente como os outros arquivos, não sei em que parte estou errando e gostaria de que me ajudassem se for possível. ABAIXO TODOS CODIGOS... ( SE EU ESTOU ERRANDO ALGO NESSE tópico ME CORRIJAM E ME AJUDEM A FAZER O CERTO ) [ INDEX.PHP ] <body onload=MM_preloadImages('img/menu/menu_2_r1_c3.png','img/menu/menu_2_r1_c4.png','img/menu/menu_2_r1_c2.png','img/menu/menu_2_r1_c3.jpg','img/menu/menu_2_r1_c6.png','img/menu/menu_2_r1_c5.png')"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="#000000"><div align="center"></div></td> </tr> <td background="linha_menu.jpg"><table width="800" border="0" align="center" cellpadding="0" cellspacing="0"> <!-- fwtable fwsrc="Untitled" fwbase="menu.png" fwstyle="Dreamweaver" fwdocid = "1043897915" fwnested="0" --> <tr> <td width="87" height="35"> </td> <td width="85"><a href="index.php?site=home" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','img/menu/menu_2_r1_c2.png',1)"><img src="img/menu/menu_r1_c2.png" name="home" width="85" height="35" border="0" id="home" /></a></td> <td width="92"><a href="index.php?site=empresa" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('empresa','','img/menu/menu_2_r1_c3.png',1)"><img src="img/menu/menu_r1_c3.png" name="empresa" width="92" height="35" border="0" id="empresa" /></a></td> <td width="108"><a href="index.php?site=fotos" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('fotos','','img/menu/menu_2_r1_c2.jpg',0)"><img src="img/menu/menu_2_r1_c211.jpg" name="fotos" width="108" height="35" border="0" id="fotos" /></a></td> <td width="125"><a href="index.php?site=vantagens" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('vantagens','','img/menu/menu_2_r1_c3.jpg',1)"><img src="img/menu/menu_2_r1_c113.jpg" name="vantagens" width="125" height="35" border="0" id="vantagens" /></a></td> <td width="102"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('vantagens','','img/menu/menu_2_r1_c3.jpg',1)"></a><a href="index.php?site=servicos" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('servicos','','img/menu/menu_2_r1_c5.png',1)"><img src="img/menu/menu_r1_c5.png" name="servicos" width="102" height="35" border="0" id="servicos" /></a></td> <td width="99"><a href="index.php?site=contato" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contato','','img/menu/menu_2_r1_c6.png',1)"><img src="img/menu/menu_r1_c6.png" name="contato" width="99" height="35" border="0" id="contato" /></a></td> <td width="102"> </td> </tr> </table></td> </tr> </table> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"> <?if ($set==''){ $set='home'; } $filename = $set.'.php'; if (file_exists($filename)) { include($filename); } ?> </div></td> </tr> <tr> <td><table align="left" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> </tr> </table></td> </tr> <tr> <td> </td> </tr> </table> ============================================================== [ HOME.PHP ] <body> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <th width="17%" height="64" valign="top" scope="col"><table width="81%" border="0"> <tr> <td height="120" valign="top" background="bg_menuesqe.gif"><img src="icon_rodapemenuesq1.gif" width="171" height="14" /> <table width="100%" border="0"> <tr> <td><table width="88%" border="0" align="center"> <tr> <td background="linha_menu.jpg"><div align="center" class="style2">Noticias</div></td> </tr> </table></td> </tr> </table> <table width="88%" border="0" align="center"> <tr> <td height="68"><p align="center"><a href="index.php?not=todasnoticias"> <? include "noticias.php";?><br /> </a></p></td> </tr> </table> <img src="icon_rodapemenuesq.gif" width="171" height="14" /></td> </tr> </table> <table width="81%" border="0"> <tr> <td height="120" valign="top" background="bg_menuesqe.gif"><img src="icon_rodapemenuesq1.gif" width="171" height="14" /> <table width="100%" border="0"> <tr> <td><table width="88%" border="0" align="center"> <tr> <td background="linha_menu.jpg"><div align="center" class="style2">Adminstração</div></td> </tr> </table></td> </tr> </table> <table width="88%" border="0" align="center"> <tr> <td height="68"><p align="center"><span class="style2"><a href="login.php" target="_blank">Acesso restrito<br /> Clique para logar ! </a></span><a href="index.php?not=todasnoticias"> <br /> </a></p></td> </tr> </table> <img src="icon_rodapemenuesq.gif" width="171" height="14" /></td> </tr> </table> <div align="center"><img src="mr-webmail.png" alt="Clique para acessar os e-mail da Capinadeira a Fogo !" width="150" height="37" border="0" /></div></th> <th width="64%" valign="top" scope="col"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="26"><?if ($site==''){ $site='destaques'; } $filename = $site.'.php'; if (file_exists($filename)) { include($filename); } ?></td> </tr> <tr> <td><div align="center"></div></td> </tr> </table></th> <th width="19%" valign="top" scope="col"><table width="80%" border="0" cellspacing="0" cellpadding="0"> <tr> </tr> <tr> <td><table width="81%" border="0"> <tr> <td height="120" valign="top" background="bg_menuesqe.gif"><img src="icon_rodapemenuesq1.gif" width="171" height="14" /> <table width="100%" border="0"> <tr> <td><table width="88%" border="0" align="center"> <tr> <td background="linha_menu.jpg"><div align="center" class="style2">MANUAIS</div></td> </tr> </table></td> </tr> </table> <table width="88%" border="0" align="center"> <tr> <td height="68"><div align="left" class="style3">- <a href="index.php?site=apresentacao">Apresentação</a><br /> - <a href="index.php?site=entrevista_globo">Reportagem TV GLOBO</a><br /> - <a href="index.php?site=videos">Operações Capinadeira<br /> </a> <br /> <center> <a href="index.php?site=video_01">- VIDEO 01</a><br /> <a href="index.php?site=video_02">- VIDEO 02</a><br /> <a href="index.php?site=video_03">- VIDEO 03</a><span class="style3"><br /> </span> </center> </div></td> </tr> </table> <img src="icon_rodapemenuesq.gif" width="171" height="14" /></td> </tr> </table> <table width="100%" border="0"> <tr> <td height="120" valign="top" "><table width="81%" border="0"> <tr> <td height="120" valign="top" background="bg_menuesqe.gif"><img src="icon_rodapemenuesq1.gif" width="171" height="14" /> <table width="100%" border="0"> <tr> <td><table width="88%" border="0" align="center"> <tr> <td background="linha_menu.jpg"><div align="center" class="style2">MANUAIS</div></td> </tr> </table></td> </tr> </table> <table width="88%" border="0" align="center"> <tr> <td height="68"><div align="left">- <span class="style2"><a href="logar.php" target="_blank">CF 6000</a> <br /> - <a href="logar.php" target="_blank">CF 7000 </a><br /> - <a href="logar.php" target="_blank">COMPACTA</a><br /> - <a href="logar.php" target="_blank">PAINEL </a></span></div></td> </tr> </table> <img src="icon_rodapemenuesq.gif" width="171" height="14" /></td> </tr> </table> </td> </tr> </table></td> </tr> </table></th> </tr> </table> </body> ======================================================== [ FUNCOES.PHP ] <?php // Sistema de Notícias - Desenvolvido por Joelmir Scheleski // Funçao para conectar-se com o Banco de Dados. Retorno = O sucesso da operacao (V ou F) function conectaBancoDados() { include("config.php"); // Inclui o arquivo de configuraçao do Banco de Dados. $resultado = false; // Retorno da Funçao (default = falso). Indica o sucesso da conexao. // Tenta conectar-se ao Banco de Dados. if (@mysql_connect($servidor, $usuarioBd, $senhaBd)) { $resultado = true; } return $resultado; } // Fim da funçao conectaBancoDados. // Funcao para adicionar uma noticia ao Sistema. Retorno = nenhum // Parâmetro 1 - A notícia que será adicionada. // Parâmetro 2 - O link da notícia. function adicionaNoticia($noticia, $imagem, $titulo) { include("config.php"); // Inclui o arquivo de configuraçao do Banco de Dados. // Tenta conectar-se ao Banco de Dados mostrando uma mensagem de erro caso contrário. if(!conectaBancoDados()) { print("<center><strong>não foi possível estabelecer conexao com o Banco de Dados!</strong></center>"); } else { // Comando que será executado no Banco de Dados. $comandoSql = "INSERT INTO $tabela(data, noticia, titulo, imagem) VALUES(now(), '$noticia', '$titulo', '$imagem')"; // Executa o Comando no Banco de Dados mostrando uma mensagem de erro em caso de falha. if (mysql_db_query($bancoDados, $comandoSql)) { print("<center><strong>Notícia inserida com sucesso!</strong></center>"); } else print("<center><strong>Notícia não inserida!</strong></center>"); mysql_close(); // não obrigatoria, porém recomendado. } } // Fim da funçao adicionaNoticia. // Funcao para apagar uma notícia. Retorno = nenhum. // Parâmetro único - O id da notícia que será deletada. function apagarNoticia($idNoticia) { include("config.php"); // Inclui o arquivo de configuraçao do Banco de Dados. // Tenta conectar-se ao Banco de Dados mostrando uma mensagem de erro caso contrário. if(!conectaBancoDados()) { print("<center><strong>não foi possível estabelecer conexao com o Banco de Dados!</strong></center>"); } else { // Comando que será executado no Banco de Dados. $comandoSql = "DELETE FROM $tabela WHERE id = '$idNoticia'"; // Executa o Comando no Banco de Dados mostrando uma mensagem de erro em caso de falha. if (mysql_db_query($bancoDados, $comandoSql)) { print ("<center><strong>Notícia deletada com sucesso!</strong></center>"); } else print("<center><strong>Notícia não deletada!</strong></center>"); mysql_close(); } } // Fim da funçao apagarNoticia. // Funcao para mostrar as noticias cadastradas no sistema com opcao de exclusao. Versao administrativa. function mostraNoticiasAdmin() { include("config.php"); // Inclui o arquivo de configuraçao do Banco de Dados. if (!conectaBancoDados()) { print("<center><strong>não foi possível estabelecer conexao com o Banco de Dados!</strong></center>"); } else { // Comando que será executado no Banco de Dados. $comandoSql = "SELECT id, date_format(data, '%d/%m/%Y') as data_formatada, titulo FROM $tabela ORDER by data"; // Joga todos os dados da pesquisa para a variavel dados. $dados = mysql_db_query($bancoDados, $comandoSql); // Mostra todos as noticias do sistema mostrando uma mensagem de erro em caso de falha. if ($dados) { // Cria uma tabela com os resultados. print("<table width = '50%' align = 'center' border = '1'>"); print("<tr><td><strong>DATA</strong></td><td><strong>NOTÍCIA</strong></td></tr>"); while ($linha = mysql_fetch_array($dados)) { print("<tr><td>$linha[data_formatada]</td><td>$linha[titulo]</td><td><a href='admin.php?remover=1&id=$linha[id]'><strong>Remover</strong></a></td></tr>"); } print("</table>"); } else print("<center><strong>Erro na exibiçao das notícias!</strong></center>"); } } // Fim da funçao mostraNoticiasAdmin. // Funcao para mostrar as noticias cadastradas no sistema. Versao do usuário. // Parâmetro Único - Quantidade de notícias que será exibida. function mostraNoticias($quantidadeNoticias) { include("config.php"); // Inclui o arquivo de configuraçao do Banco de Dados. if (!conectaBancoDados()) { print("<center><strong>não foi possível estabelecer conexao com o Banco de Dados!</strong></center>"); } else { // Comando que será executado no Banco de Dados. $comandoSql = "SELECT id, date_format(data, '%d/%m/%Y') as data_formatada, titulo, noticia, imagem FROM $tabela ORDER BY id DESC"; // Joga todos os dados da pesquisa para a variavel dados. $dados = mysql_db_query($bancoDados, $comandoSql); // Mostra todos as noticias do sistema mostrando uma mensagem de erro em caso de falha. if ($dados) { $i = 0; // Variável de controle da quantidade de notícias que será exibida // Cria uma tabela com os resultados. print("<table width = '100%' align = 'center' border = '0'>"); while (($linha = mysql_fetch_array($dados)) && ($i < $quantidadeNoticias)) { // Formata a notícia para que apareçam apenas os 250 primeiros caracteres. @$noticia_formatada = substr($linha[noticia], 0, 70)."..."; print("<tr><td colspan=' 2'><div align='left'><strong>$linha[data_formatada] - $linha[titulo]</strong></div></td></tr>"); print("<tr><td width='100%' valign='top'><div align='left'><img src='img_noticias/$linha[imagem]' alt='' width='70' height='55'></div></td><td width='95%' valign='top'><div align='left'><a href='?set=mostrar_noticia&id=$linha[id]'>$noticia_formatada</a></div></td></tr>"); print("<tr><td colspan=' 2'><div align='left'><hr></div></td></tr>"); $i++; } print("</table>"); } else print("<center><strong>Erro na exibiçao das notícias!</strong></center>"); } } // Fim da funçao mostraNoticias. // Funçao para mostrar as notícias individualmente. // Parâmetro único - O Id da notícia que será exibida. function mostraNoticiaId($id) { include("config.php"); // Inclui o arquivo de configuraçao do Banco de Dados. if (!conectaBancoDados()) { print("<center><strong>não foi possível estabelecer conexao com o Banco de Dados!</strong></center>"); } else { // Comando que será executado no Banco de Dados. $comandoSql = "SELECT id, date_format(data, '%d/%m/%Y') as data_formatada, titulo, noticia, imagem FROM $tabela WHERE id = '$id'"; // Joga todos os dados da pesquisa para a variavel dados. $dados = mysql_db_query($bancoDados, $comandoSql); // Mostra todos as noticias do sistema mostrando uma mensagem de erro em caso de falha. if ($dados) { // Cria uma tabela com a notícia. print("<table width = '100%' align = 'center' border = '0'>"); $linha = mysql_fetch_array($dados); print("<tr><td colspan=' 2'><div align='center'><strong>$linha[data_formatada] - $linha[titulo]</strong></div><br></td></tr>"); print("<tr><td width='100%' valign='top'><div align='justify'>$linha[noticia]</div></td></tr>"); print("<tr><td colspan=' 2'><div align='left'><hr></div></td></tr>"); print("</table>"); } else print("<center><strong>Erro na exibiçao da notícia!</strong></center>"); } } // Fim da funçao mostraNoticiaId. // Funçao para fazer o upload da imagem da notícia. function uploadImagem() { // Pega a imagem enviada através do formulário. Nome temporário e verdadeiro. @$imagem_temp= $_FILES['imagem]['tmp_name']; @$imagem_real= $_FILES['imagem']['name']; $extPermitidas = array('jpg', 'png', 'gif'); //extensoes permitidas para envio $extArquivo = strtolower(end(explode('.', $imagem_real))); //obtem a extensao do arquivo enviado //verifica se a extensao do arquivo enviado esta na lista das extensoes permitidas if (in_array($extArquivo, $extPermitidas) == true) { // Move a imagem para a pasta de imagens. Mostra mensagem de erro em caso de falha. if (move_uploaded_file($imagem_temp, "img_noticias/$imagem_real")) { print("<center><strong>Imagem enviada com sucesso!</strong></center>"); } else print("<center><strong>Erro no upload!</strong></center>"); } else { print("<center><strong>A imagem não é do tipo jpg ou gif!</strong></center>"); } } // Fim da funçao uploadImagem. ?> ====================================================================== [ NOTICIAS.PHP ] <!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" /> <title>Destaques</title> <style type="text/css"> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; } a:link { color: #333333; text-decoration: none; } a:visited { text-decoration: none; color: #333333; } a:hover { text-decoration: underline; color: #333333; } a:active { text-decoration: none; color: #333333; } a { font-size: 10px; } --> </style></head> <body> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tbody> <tr> <td width="99" valign="top"><?php include("funcoes.php"); mostraNoticias(6); // Aqui você deve colocar o número de notícias que deverão ser exibidas. ?> <p align="center"><a href="index.php?set=todasnoticias">Veja mais notícias</a> </p></td> </tr> </tbody> </table> </body> </html> FICAREI GRATO SE alguém ME AJUDAR ! OBRIGADO !
×
×
  • Criar Novo...