Oppure potresti creare un file tipo questo:
Codice PHP:
<?php
//
// FUNZIONE CHE VISUALIZZA GLI ULTIMI POST
//
$topicnumber = 10;
$urlPath = "http://MIOSITO.altervista.org/phpBB2";
$phpbb_root_path = './phpBB2/';
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$table_text = $table_prefix. "posts_text";
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username, x.post_text
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u, $table_text x
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
p.post_id = x.post_id AND
t.topic_status <> 2 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysql_query($query) or die("Query failed");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "<hr />" .
"<a href=\"phpBB2/profile.php?mode=viewprofile&u=$row[user_id]\" target=_blank>" .
$row["username"] .
"</a>
ha scritto nel topic <a href=\"phpBB2/viewtopic.php?topic=$row[topic_id]&forum=$row[forum_id]\" target=_blank>" .
$row["topic_title"] .
"</a> : " .
"<br />" .
substr(stripQ($row['post_text']), 0, 100) .
"... ... "
;
}
mysql_free_result($result);
?>
Devi modificare
Codice PHP:
$topicnumber = numrto ultimi topic da visualizzare;
$urlPath = indirizzo assoluto del forum;
$phpbb_root_path = cartella del forum;
substr(stripQ($row['post_text']), 0, 100) intervallo dei caratteri del messaggio da visualizzare (in questo esempio, da 0 a 100)
Poi, puoi inserirlo nella pagina che ti interessa con un include(); (se è in php) oppure con un iframe se è in html.