Ciao a tutti!
Ho creato uno script ke mostra gli ultimi post scritti nel forum phpbb del mio sito.. ecco come l'ho fatto:
codice:
$query = 'SELECT post_id, post_subject FROM phpbb_posts_text ORDER BY post_id DESC LIMIT 0,10';
$dati = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array ($dati)) {
$id = $row["post_id"];
$oggetto = $row["post_subject"];
$nuovo_oggetto = substr( $oggetto, 0, 40 );
echo "<img src=\"blocks/immagini/post.gif\" alt=\"\"><span class=\"blocchi\">[<a href=\"http://supernovaita.altervista.org/forum/viewtopic.php?t=$id\">$nuovo_oggetto</a>...]</span>
";
}
Funziona tutto perfettamente, ma mi sono accorto ke se una persona risponde ad un post già esistente e non scrive di nuovo il soggetto (come in genere fanno tutti), questo non compare nel database e quindi neppure nel blocco.. qualke idea su come fare?
Grazie ciauz