prova così:
Codice PHP:
// *******************
// *messaggi in homepage *
// * By Makpaolo *
// * MyBBoard.it team *
// *******************
//parte che carica le impostazioni base di MyBB
$path="forum"; //immettere il nome della cartella contenente il forum
chdir("$path");
define("IN_MYBB", 1);
require "$path/global.php";
$n_mes=20; //numero di messaggi da visualizzare
//parte che crea la lista a seconda dei permessi del forum degli ultimi messaggi inseriti
echo"<ul>";
$unviewable = get_unviewable_forums();
if($unviewable)
{
$unviewwhere = " AND fid NOT IN ($unviewable)";
}
$threadlist = '';
$query = $db->query("
SELECT t.*, u.username
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.lastpost DESC
LIMIT 0,$n_mes "
);
while($thread = $db->fetch_array($query))
{
$lastpostdate = date($mybb->settings['dateformat'], $thread['lastpost']);
$lastposttime = date($mybb->settings['timeformat'], $thread['lastpost']);
if($thread['lastposteruid'] == 0)
{
$lastposterlink = $thread['lastposter'];
}
else
{
$lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
}
if(my_strlen($thread['subject']) > 25)
{
$thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
}
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
echo"
<li><a href=\"$path/showthread.php?tid=$thread[tid]\" title=\"$thread[subject]\">$thread[subject]</a></li>";
$altbg = alt_trow();
}
echo"</ul>";
?>