Ver Mensaje Individual
  #30 (permalink)  
Antiguo 10/09/2011, 05:06
lokor712
 
Fecha de Ingreso: septiembre-2011
Mensajes: 38
Antigüedad: 12 años, 8 meses
Puntos: 5
Respuesta: [APORTE] Sistema de noticias y comentarios

Se me olvidaba!! También hay que editar el index.php

index.php
Código 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-2" />
<title>Sistema de Noticias de KarlicOs :::.</title>
</head>

<body>
<?php
include ('includes/connect.php');
//hacemos las consultas 
$result=mysql_query("select * from noticias order by fecha Desc"$connect); 
$totalregistros=mysql_num_rows($result); 
$result2=mysql_query("select * from comentarios where id_comentario",$connect);
$totalcomentarios=mysql_num_rows($result2);
?> 
</head> 
<body> 

<?php
//Recogemos las consultas en un array y las mostramos 
while($row=mysql_fetch_array($result))
            {
$result2=mysql_query("select * from comentarios where id_comentario='".$row[id_noticia]."'",$connect);
$totalcomentarios=mysql_num_rows($result2);
echo 
'<h3>'.$row[titulo].'</h3>';
//echo '<br><br>';
//echo ' '.$row[noticia].' <br>';
echo substr($row['noticia'], 0550);
echo 
'&nbsp;<strong>...</strong><br><br>';
echo 
'<strong>Autor:&nbsp;'.$row[autor].'&nbsp; |&nbsp;Publicado en:&nbsp; '.$row[categoria].'&nbsp; |&nbsp;El:&nbsp; '.$row[fecha].'&nbsp;|&nbsp;Comentarios:&nbsp;('.$totalcomentarios.')&nbsp;|&nbsp;<a href="ver.php?id='.$row[id_noticia].'">Leer mas ...</a></strong>';
    }
mysql_free_result($result)
?>  
</body>
</html>
Un saludo!! Y aver cuando nos volvemos a ver que ahora no se si podré editar el CMS