<?php
$consulta = "SELECT mybb_posts.username, mybb_threads.subject, mybb_posts.message, mybb_forums.name, mybb_posts.tid, mybb_threads.views, mybb_forums.fid, mybb_posts.fid
FROM mybb_posts, mybb_threads, mybb_forums
WHERE mybb_threads.tid = mybb_posts.tid AND mybb_threads.fid != 122 ORDER BY mybb_threads.tid DESC limit 0, 5
";
$resultado = mysql_query($consulta);
$num_resultados = mysql_num_rows($resultado);
for ($i=0; $i <$num_resultados; $i++)
{
$row = mysql_fetch_array($resultado);
echo "<p><strong>".($i+1).". Título: ";
echo "<a href=/showthread.php?tid=";
echo ($row["tid"]);
echo ">";
echo stripslashes($row["subject"]);
echo "</a>";
echo "</strong>";
echo "<br>Autor: ";
echo stripslashes($row["username"]);
echo "</strong><br>Foro: ";
echo stripslashes($row["name"]);
echo "</strong><br>Visitas: ";
echo stripslashes($row["views"]);
echo "</p>";
}