German Larraguibel 0 Denunciar post Postado Março 13, 2013 É o seguinte, criei este site aqui www.diariodospoliticos.com ele é dinâmico, leio as informações a partir de 1 bancop de dados, tenho 3 setores de notícia: 1-post principal; RsPrincipal 2-post secundário com 2 matérias; RsDest 3-post com 7 matérias sem foto. O Site funciona normalmente no chrome e no firefox, já no IE apenas as imagens do post secundário aparecem a do principal não consigo fazer aparecer !!!!! Resumindo o problema está no 'mat_imagem' do RsPrincipal agora não consigo imaginar onde possa estar o problema, aqui vai o código: <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $maxRows_RsHome = 7; $pageNum_RsHome = 0; if (isset($_GET['pageNum_RsHome'])) { $pageNum_RsHome = $_GET['pageNum_RsHome']; } $startRow_RsHome = $pageNum_RsHome * $maxRows_RsHome; mysql_select_db($database_bd_diariodospolit, $bd_diariodospolit); $query_RsHome = "SELECT * FROM pag_noticias ORDER BY mat_id DESC"; $query_limit_RsHome = sprintf("%s LIMIT %d, %d", $query_RsHome, $startRow_RsHome, $maxRows_RsHome); $RsHome = mysql_query($query_limit_RsHome, $bd_diariodospolit) or die(mysql_error()); $row_RsHome = mysql_fetch_assoc($RsHome); if (isset($_GET['totalRows_RsHome'])) { $totalRows_RsHome = $_GET['totalRows_RsHome']; } else { $all_RsHome = mysql_query($query_RsHome); $totalRows_RsHome = mysql_num_rows($all_RsHome); } $totalPages_RsHome = ceil($totalRows_RsHome/$maxRows_RsHome)-1; //******************************************* $sqlvermax = "select max(mat_id) as xxx from pag_noticias"; //echo $sqlvermax; $resultado = mysql_query($sqlvermax)or die ("erro na query buscar curriculo por nid"); $count=mysql_num_rows($resultado); if($count==1){ }else{ //echo " <BR> ID VAGA N�O CONFERE!! "." - ".$numIDvaga; exit; } while ($row = mysql_fetch_array($resultado, MYSQL_BOTH)) { $maxnoticia = $row['xxx']; } //******************************************** $maxRows_RsDest = 2; $pageNum_RsDest = 0; if (isset($_GET['pageNum_RsDest'])) { $pageNum_RsDest = $_GET['pageNum_RsDest']; } $startRow_RsDest = $pageNum_RsDest * $maxRows_RsDest; mysql_select_db($database_bd_diariodospolit, $bd_diariodospolit); $query_RsDest = "SELECT * FROM pag_noticias where mat_id < ".$maxnoticia. " ORDER BY mat_data DESC"; $query_limit_RsDest = sprintf("%s LIMIT %d, %d", $query_RsDest, $startRow_RsDest, $maxRows_RsDest); $RsDest = mysql_query($query_limit_RsDest, $bd_diariodospolit) or die(mysql_error()); $row_RsDest = mysql_fetch_assoc($RsDest); if (isset($_GET['totalRows_RsDest'])) { $totalRows_RsDest = $_GET['totalRows_RsDest']; } else { $all_RsDest = mysql_query($query_RsDest); $totalRows_RsDest = mysql_num_rows($all_RsDest); } $totalPages_RsDest = ceil($totalRows_RsDest/$maxRows_RsDest)-1; $maxRows_RsPrincipal = 1; $pageNum_RsPrincipal = 0; if (isset($_GET['pageNum_RsPrincipal'])) { $pageNum_RsPrincipal = $_GET['pageNum_RsPrincipal']; } $startRow_RsPrincipal = $pageNum_RsPrincipal * $maxRows_RsPrincipal; mysql_select_db($database_bd_diariodospolit, $bd_diariodospolit); $query_RsPrincipal = "SELECT * FROM pag_noticias ORDER BY mat_data DESC"; $query_limit_RsPrincipal = sprintf("%s LIMIT %d, %d", $query_RsPrincipal, $startRow_RsPrincipal, $maxRows_RsPrincipal); $RsPrincipal = mysql_query($query_limit_RsPrincipal, $bd_diariodospolit) or die(mysql_error()); $row_RsPrincipal = mysql_fetch_assoc($RsPrincipal); if (isset($_GET['totalRows_RsPrincipal'])) { $totalRows_RsPrincipal = $_GET['totalRows_RsPrincipal']; } else { $all_RsPrincipal = mysql_query($query_RsPrincipal); $totalRows_RsPrincipal = mysql_num_rows($all_RsPrincipal); } $totalPages_RsPrincipal = ceil($totalRows_RsPrincipal/$maxRows_RsPrincipal)-1; ?> <!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=utf-8" /> <title>DIÁRIO DOS POLÍTICOS</title> <link href="zestilo.css" rel="stylesheet" type="text/css" /> <link href="zestilo-txt.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="container"> <div id="logo"><img src="imagens/logo.png" width="306" height="119" /></div><div id="topo"><?php require_once('include_header.php'); ?></div> <div class="linktit" id="menu"><a href="index.php" class="linktit">HOME</a><span class="fontbranca"> <strong>| </strong></span><a href="contato.php" class="linktit">CONTATO</a></div> <div id="principal"> <div id="post-home"> <?php do { ?> <div style="overflow:hidden; width:370px; height:240px; float:left"><a href="noticia.php?mat_id=<?php echo $row_RsPrincipal['mat_id']; ?>"><img src="img_bd/<?php echo $row_RsPrincipal['mat_imagem']; ?>" alt="" name="img_mat001" width="370" height="auto" class="img-esquerda" style="width:370px; margin-top:-40px;" /></a></div> <div style="margin-left:385px;"> <table border="0"> <tr> <td><h1><?php echo $row_RsPrincipal['mat_tema']; ?> | <?php echo $row_RsPrincipal['mat_data']; ?></h1></td> </tr> <tr> <td><a href="noticia.php?mat_id=<?php echo $row_RsPrincipal['mat_id']; ?>"><h2 style="font-size:18px"><?php echo $row_RsPrincipal['mat_titulo']; ?></h2></a></td> </tr> <tr> <td><a href="noticia.php?mat_id=<?php echo $row_RsPrincipal['mat_id']; ?>"><p><?php $texto_noticia=$row_RsPrincipal['mat_texto']; $parcial_noticia = substr($texto_noticia,0,230)."...<br /><strong>...(continuar lendo)</strong>"; echo $parcial_noticia; ?></p></a></td> </tr> <?php } while ($row_RsPrincipal = mysql_fetch_assoc($RsPrincipal)); ?> </table> </h1> </div> </div> <div id="post-1"> <h2>:: DESTAQUES<br /> </h2> <table border="0"> <?php do { ?> <tr> <td width="315"><h1 style="margin-top:7px"><?php echo $row_RsDest['mat_tema']; ?> | <?php echo $row_RsDest['mat_data']; ?></h1></td> </tr> <tr> <td><a href="noticia.php?mat_id=<?php echo $row_RsDest['mat_id']; ?>"><h2><?php echo $row_RsDest['mat_titulo']; ?></h2></a></td> </tr> <tr> <td><div style="overflow:hidden; width:320px; height:140px;"><img src="img_bd/<?php echo $row_RsDest['mat_imagem']; ?>" alt="" name="img_mat2" class="img-esquerda" id="img_mat2" style="width:320px; margin-top:-60px;" /></div> </td> </tr> <tr> <td><p><a href="noticia.php?mat_id=<?php echo $row_RsDest['mat_id']; ?>"><?php $texto_noticia=$row_RsDest['mat_texto']; $parcial_noticia = substr($texto_noticia,0,245)."…(continuar lendo)"; echo $parcial_noticia; ?></a></p></td> </tr> <tr> <td> <p>..............................................................</p></td> </tr> <?php } while ($row_RsDest = mysql_fetch_assoc($RsDest)); ?> </table> </div> <div id="post-2"> <h2>:: MAIS NOTÍCIAS</h2> <table border="0"> <?php do { ?> <tr> <td width="315"><h1 style="margin-top:5px"><?php echo $row_RsHome['mat_tema']; ?> | <?php echo $row_RsHome['mat_data']; ?></h1></td> </tr> <tr> <td><p style="margin-top:-2px"><a href="noticia.php?mat_id=<?php echo $row_RsHome['mat_id']; ?>">> <?php echo $row_RsHome['mat_titulo']; ?></a></p> <p style="padding-bottom:10px">........................................................</p></td> </tr> <?php } while ($row_RsHome = mysql_fetch_assoc($RsHome)); ?> </table> <p> </p> <p> <a href="todasnoticia.php">>> TODAS AS NOTÍCIAS</a></p> <p> </p> <p> </p> </div> <div id="post-lista"> </div> </div> <div id="lateral-direita"> <?php require_once('include_camaras.php'); ?> </div> </div> <div id="rodape"><?php require_once('include_rodape.php'); ?> </div> </body> </html> <?php mysql_free_result($RsHome); mysql_free_result($RsDest); mysql_free_result($RsPrincipal); ?> Aqui também vai o código CSS: @charset "utf-8"; /* CSS Document */ * { margin: 0 auto;} html {background:url(imagens/bg-fundo-total.png) repeat-x; background-color: #393939;} body { background-image: url(imagens/bg-total.png); background-position:top; background-repeat: no-repeat; background-position: center -30px; background-position: center 0 \9; } .img-esquerda { float: left; padding-right: 10px; border:#FFF; border-width: 5px; } img { border:none; } #container { width: 1100px; width: 1105px \9; margin-left:auto; margin-right:auto; margin-top: 30px; height:100%; text-align:center; display: table; min-height:100%; overflow:hidden; background:#FFF; } #bglateral-esq { width: 10px; background-color:#069; height: 400px; float:right; } #bglateral-dir { width: 10px; background-color:#069; height: 400px; } #logo { background: #FFF; height: 130px; margin-top: 15px; width: 350px; float:left; } #topo { background: #FFF; height: 130px; width: 750px; float:left; } #login { height: 30px; width: 640px; text-align: right; float:right; margin-right: 20px; margin-top: 30px; } #menu { background:#903; height: 30px; width: 1080px; float:left; padding-top: 10px; text-align:left; padding-left: 30px; margin-left:-5px; } #principal { background: #FFF; height: auto; padding-top: 15px; padding-left: 25px; width: 750px; float:left; } #lateral-direita { background: #FFF; height: auto; padding-left: 25px; width: 300px; float:left; position:relative; text-align: left; } #post-home { height: 280px; padding: 15px 20px 0px 15px; width: 685px; float:left; background: url(imagens/bg_post1.jpg) no-repeat; text-align: left; } #post-1 { padding-left: 15px; padding-right: 15px; width: 355px; float:left; text-align: left; } #post-2 { padding-left: 15px; padding-right: 15px; width: 315px; float:left; text-align: left; } #post-lista { padding-left: 15px; padding-right: 15px; width: 690px; float:left; text-align: left; } #noticia_pg { padding: 15px 20px 0px 15px; width: 655px; float:left; text-align: left; } #rodape { width: 1140px; height:100px; margin: 0 auto; text-align:center; background:url(imagens/bg_rodape.png) top no-repeat; } .clear {clear:both;} #cadastro1 { background: #FFF; height: 650px; padding-top: 15px; padding-left: 25px; width: 300px; float:left; text-align: left; } Sei que o código está uma bagunça só e sem comentários mas é que devido a pressa para fazer tudo e botar no ar (2dias!!!) foi assim mesmo, assim que estiver tudo ok começo a faxina !!! hehehe !!! Obrigado a quem puder me dar uma luz !!! Compartilhar este post Link para o post Compartilhar em outros sites
Gerciley 14 Denunciar post Postado Março 14, 2013 Seu problema não está no PHP nem no CSS, e sim no HTML, o seguinte código: <img src="http://www.diariodospoliticos.com/img_bd/0d11b67df4317578e24d933635b0d187.jpg" alt="" name="img_mat001" width="370" height="auto" class="img-esquerda" style="width:370px; margin-top:-40px;"> o atributo height="auto" é desnecessário, sendo assim alguns motores de renderização entendem e mostram a imagem já outros como é o caso do IE não mostra, por padronização exclua os atributos width e height da tag img deixe isso para o css. Compartilhar este post Link para o post Compartilhar em outros sites