A ver, no entendi muy bien todos los problemas, pero t muestro el que si entendi con claridad: cuando le das a ver una noticia t sale primero las cuatro recientes y luego la noticia ke señalaste. ok, esto se debe sencillamente a que tienes un poco desordenado el código, intenta colocandolo asi (primero ve el código, despues te explico que hize...):
Código PHP:
<?php
include("conexion.php");
/*********************************
PRIMERO TIENES QUE FIJARTE SI EL USUARIO HA PEDIDO VER UNA NOTICIA,
SABIENDO SI LA VARIABLE $VER == "N".
*********************************/
if($ver=="n") {
$result = mysql_query("SELECT * FROM noticias WHERE id='$id'");
$row = mysql_fetch_array($result); // aqui colocaste un if que no usabas :S
// Aqui acomodas y ejecutas todas las consultas previas.
$id=$row["id"];
$lec=$row["lec"];
$lec++;
$update = "UPDATE noticias SET lec='$lec' WHERE id='$id' LIMIT 1";
$updatesql = mysql_query($update);
/***************************************
Habias cortado el if ($ver=="n") aqui, pero aqui no lo puedes cortar, porque
lo que viene tambien forma parte del condicional, es decir, no vale la pena
que muestres la tabla si el usuario no ha pedido ver una noticia
****************************************/
echo "<table width='500' border='0' cellspacing='2' cellpadding='1' align='center'>
<tr valign='top'>
<td><b><font color='#999900' face='tahoma, Arial, verdana' size='2'>".$row["titulo"]."</font></b></td>
<td width='150'><font color='#000000' face='tahoma, Arial, verdana' size='1'>Fecha:
<b>".$row["fecha"]."</b></font></td>
</tr>
</table>
<table width='500' border='0' cellspacing='2' cellpadding='1' align='center'>
<tr>
<td><font color='#000000' face='tahoma, Arial, verdana' size='1'>
".$row["noticia2"]."</font></td>
</tr>
</table>";
} // Aqui si es donde tiene que terminar el if($ver=="n")
/***************************************
LUEGO AQUI VIENE UN ELSE, QUE QUIERE DECIR QUE SI EL USUARIO NO HA
PEDIDO VER UNA NOTICIA (ES DECIR $VER=="n" ES FALSE) ENTONCES SE LE
MUESTRAN LAS MÁS RECIENTES
****************************************/
else {
$sql = "SELECT * FROM noticias ORDER BY id DESC LIMIT 0,4";
$conectar = mysql_query($sql);
while ($row = mysql_fetch_array($conectar)) {
echo"<table cellspacing=\"0\" cellpadding=\"0\" width=\"460\" border=\"0\" align=\"center\">
<tr valign=\"top\">
<td valign=\"top\" align=\"left\">
<table align=\"left\">
<tr>
<td width=\"78\"> <img height=\"61\" src='".$row["imagen"]."' width=\"78\" border=\"0\" alt=\"noticias\" />
</td>
</tr>
</table>
<a href='$PHP_SELF?ver=n&id=".$row["id"]."'><font face=\"tahoma, Arial, verdana\" size=\"2\" color=\"#000000\"><b>".$row["titulo"]."</b></font><font color=\"#000000\"></font></a>
<font face=\"tahoma, Arial, verdana\" size=\"2\" color=\"#000000\">Leido: <b>".$row["lec"]."</b></font><br />
<font face=\"tahoma, Arial, verdana\" size=\"2\" color=\"#000000\">
".$row["noticia"]."
</font>
</td>
</tr>
</table>";
echo"<br />";
}
}
?>
Bien, pues las explicaciones estan bien sencillas en el código. lo unico es ordenar un poco mas las ideas...
Salu2x.