rendered paste body if($limit>100) $limit=100;
$request = db_query("SELECT * FROM {$tp_prefix}shoutbox WHERE 1 ORDER BY value2 DESC LIMIT $limit", __FILE__, __LINE__);
if (mysql_num_rows($request) > 0)
{
$context['TPortal']['shoutbox'] = $txt['tp-last'].' '.$limit.' '.$txt['tp-shouts'].'<hr />';
// Clean stuff
$shouts = array();
$i = 0;
// Loop it into an array to reverse
while($row = mysql_fetch_assoc($request))
$shouts[$i++] = '<div style="margin: 4px;"><div style="border: dotted 1px; padding: 2px 4px 2px 4px;" class="windowbg2"><b>' . $row['value3'] . '</b></div><div style="padding: 2px;"> ' . timeformat($row['value2']) . '</div><div style="padding: 4px;">' . doUBBC($row['value1']) . '</div></div>';
// Freedom!!!
mysql_free_result($request);
// Now we reverse it!
$shouts = array_reverse($shouts);
// For each we divide and conquer.
foreach($shouts as $shout)
$context['TPortal']['shoutbox'] .= $shout;
}