Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/02/2009, 12:35
cesaritoo
 
Fecha de Ingreso: febrero-2009
Mensajes: 16
Antigüedad: 15 años, 2 meses
Puntos: 0
mostrar imagen de la noticia mas reciente

Hola! tengo un pequeño sistema de noticias el cual quiero mejorar! hasta ahora, en el index solamente me muestra el Titulo de la noticia, y deseo que de la noticia mas reciente me muestre la foto que corresponde y el primer parrafo del contenido..

El codigo del index es este:

Código PHP:
<?php
require("./NewsSql.inc.php");
$db = new NewsSQL($DBName); 
$homecataresult $db->getchildcatalog(0);
$homelatestresult $db->getlatestonhome($front_latestonhomerecord);
?>
<html>
<head>
<title><?php print "$front_indextitle"?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php print "$front_charset"?>">
<link rel="stylesheet" href="./style/style.css" type="text/css">
<script language="JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
<style type="text/css">
<!--
.Estilo1 {
    color: #105090;
    font-weight: bold;
    font-size: 12px;
}
-->
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<table width="412" border="0" cellspacing="1" cellpadding="0" align="center" class="table_01">  
  <tr> 
    <td class="menu" bgcolor="#FFFFFF" valign="top" width="410"> 
    <table width="410" border="0" cellspacing="0" cellpadding="4">
          <tr> 
            <td bgcolor="#F2F2F2" class="menu_in Estilo1">Noticias en Natacionypf.com.ar </td>
          </tr>
          <tr>
            <td>
            <?php
          
if (!empty($homelatestresult)) {
          while ( list(
$key,$val)=each($homelatestresult) ) {
          
$title stripslashes($val["title"]);
          
$newsid stripslashes($val["newsid"]);          
          print 
"<a href=\"news.php?newsid=$newsid\" class=\"en_b\"><img src=\"./images/bullet_b.gif\" width=\"11\" height=\"9\" border=\"0\">$title</a><br>";
          print 
"<img src=\"$picturepath$picture\" alt=\"$title\">"
          
}
    }
      
?>
            <?php
    
if (!empty($homecataresult)) {
          while ( list(
$key,$val)=each($homecataresult) ) {
              
$catalogname stripslashes($val["catalogname"]);
              
$catalogid stripslashes($val["catalogid"]);
              
$result $db->getnewsbycatid(0,$front_catnewsonhomerecord,$catalogid);
    
?>
            <?php
    
}
    }
    
?></td>
          </tr>          
    </table>
    <table width="410" border="0" cellspacing="0" cellpadding="4">       
          <tr> 
           <td bgcolor="#0033FF">&nbsp;
           </td>
          </tr>   
    </table> 
    </td>
  </tr>
</table>
</body>
</html>
la imagen se guarda en el campo "picture" el contenido en "content" y la id de la noticia en "newsid". Espero me puedan ayudar ya que no soy novato en php

Saludos! y gracias de antemano!!!!