here's a quickie. this should get you real close..

PHP Code

<?php
/* PHP CODE HERE */
# by SD
#
# Okie dokie, i figure some peeps might think that a 'Hot Topic' is more 'hot'
# by fact that it has more Replies vs Views, so there is an option here
#
# Simply change to 'Views' for using topic views or 'Replies' if you think replies count more ;)
#
# Also, since this puppy is a cached dealio, you might want to limit which forums are part of
# the query. ie: you prolly don't want to include that super secret "Gizmo can't see this forum"
# in your returned list

$whichHot = 'Views';
$notIn = '9';											// if you want more, just seperate by commas. ie: '4,5,9,10'
$limit = 10;											// Set to 10 topics, but you can change to whatever

$orderBy = ($whichHot == 'Views') ? ' t.TOPIC_REPLIES' : ' t.TOPIC_VIEWS';
$notIn = ($notIn) ? 'WHERE f.FORUM_ID NOT IN ('.$notIn.') ' : 'WHERE 1 ';
$timeFrame = $html->get_date() - 86400;
$timeFrame = "AND t.TOPIC_LAST_REPLY_TIME > $timeFrame";

// First, let's get an HTML table started.. m'kay ?
$stuff  = '<table cellspacing="0" cellpadding="0" border="0" class="t_standard">';
$stuff .= '<tr><td class="tdheader" width="80%">Topic subject</td><td class="tdheader" width="20%" align="center">'.$whichHot.'</td></tr>';

// Set up the query
$query = "
SELECT p.POST_SUBJECT, t.TOPIC_VIEWS, t.TOPIC_REPLIES, t.POST_ID
FROM {$config['TABLE_PREFIX']}TOPICS t,
{$config['TABLE_PREFIX']}POSTS p,
{$config['TABLE_PREFIX']}FORUMS f,
{$config['TABLE_PREFIX']}USERS u
$notIn
$timeFrame
AND t.FORUM_ID = f.FORUM_ID
AND t.TOPIC_IS_APPROVED = 1
AND t.TOPIC_LAST_POST_ID = p.POST_ID
AND t.TOPIC_LAST_POSTER_ID = u.USER_ID
ORDER BY $orderBy DESC, t.TOPIC_LAST_REPLY_TIME DESC
LIMIT $limit
";
$sth = $dbh->do_query($query,__LINE__,__FILE__);
$innerds = '';
$rowNum = 0;
while(list($pSubj,$tViews,$tReplies,$tPostID) = $dbh->fetch_array($sth)) {
$count = ($whichHot == 'Views') ? $tViews : $tReplies;
$lineColor = ($rowNum&1) ? 'alt-topicsubject' : 'topicsubject';
$innerds  .= '<tr><td class="'.$lineColor.'"><a href="'.$config['FULL_URL'].'/ubbthreads.php?ubb=showflat&Number='.$tPostID.'">'.$pSubj.'</a></td>';
$innerds  .= '<td class="'.$lineColor.'" align="center">'.$count.'</td></tr>';
$rowNum++;
}

// Check if we got any rows at all
if (!innerds) {
$stuff = '[censored] nothing found! :eek:';
} else {
$stuff .= $innerds.'</table>';
}
/* BODY HERE */
$body = <<<EOF
$stuff
EOF;
?>



Didn't test real hard, since i was in a hurry.. but that should get you real close.. you can apply the finishing touches..