Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/10/2006, 00:21
Yared
 
Fecha de Ingreso: mayo-2002
Mensajes: 132
Antigüedad: 22 años
Puntos: 0
Pregunta Php codigo, No se que hacer

Ando perdido en php, pues apenas estoy aprendiendo con codigos, sin embargo ya me perdi con esto, es facil, lo se, pero no se que hacer ya.
esta es la situacion
Código PHP:
$myts =& MyTextSanitizer::getInstance();
$sql "SELECT storyid, title, published, expired, topicid, counter FROM ".$datosDB->prefix("stories")." WHERE published < ".time()." AND published > 0 AND (expired = 0 OR expired > ".time().") ORDER BY created DESC";
$result $datosDB->query($sql,5,0);
while ( 
$myrow $datosDB->fetchArray($result) ) {
$noticias = array();
$title $myts->makeTboxData4Show($myrow["title"]);
if ( !
DATOS_USE_MULTIBYTES ) {
if (
strlen($myrow['title']) >= 100) {
$title $myts->makeTboxData4Show(substr($myrow['title'],0,(100 -1)))."...";
}
}
$datosTpl-> append('noticias', array(
'title' => $title,
'id' => $myrow['storyid'],
'date' => formatTimestamp($myrow['published'],"s")
));

con este codigo se hace una lista de noticias , las ultimas 5,
sin embargo quiero que se puedan ver por topic ,¿como se hace?
Osea que solo se vea supongamos las noticias del topic 1

Actualmente usa este codigo html
Código HTML:
<{foreach item=i from=$noticias}>
<a href="<{$datos_url}>/article.php?storyid=<{$i.id}>">
<{$i.title}></a>&nbsp;(<{$i.date}>)<br>
<{/foreach}> 
Y se ve asi:
noticia 7 (2006/10/28)
noticia 6 (2006/10/28)
noticia 5 (2006/10/28)
noticia 4 (2006/10/28)
noticia 3(2006/10/28)
Nota, se usa smarty.

Agradezco si alguien puede ayudarme, pues entre en un lapsus tremendus , y no salgo de ahi.