u.username, u.user_id, u.user_rank
,atd.rating_count, atd.rating_sum
LEFT JOIN ". BB_USERS ." u ON tr.poster_id = u.user_id
,LEFT JOIN ". BB_ATTACHMENTS_DESC ." atd ON tr.attach_id = atd.attach_id
foreach ($last_added as $last_add)
{
$rating_sum = $last_add['rating_sum'];
$rating_count = $last_add['rating_count'];
$stars = array('one','two','three','four','five');
$rate_on = '<ul class="rating';
if($rating_sum && $rating_count>0) {
$rate_on .= ' '.$stars[round($rating_sum/$rating_count,1)-1].'star">';
}
else {$rate_on .='">';}
$rate_on .='</ul>';
$template -> assign_block_vars('lastAdded',array(
'RATING' => $rate_on,
<link rel="stylesheet" href="./templates/default/css/rating.css" type="text/css" />
<div>{lastAdded.RATING}</div>
//Store TopDownloaded
if($bb_cfg['t_top_downloaded'])
{
$this_month = time();
$data = DB()->fetch_rowset("SELECT
tr.topic_id, tr.forum_id, tr.reg_time, tr.complete_count, tr.tor_status,
t.topic_title, t.topic_image,
f.forum_name,
u.username, u.user_id, u.user_rank
FROM
". BB_BT_TORRENTS ." tr
LEFT JOIN ". BB_TOPICS ." t ON tr.topic_id = t.topic_id
LEFT JOIN ". BB_FORUMS ." f ON tr.forum_id = f.forum_id
LEFT JOIN ". BB_USERS ." u ON tr.poster_id = u.user_id
WHERE tr.reg_time >= ".$this_month." - 2629743 AND tr.reg_time < ".$this_month."
ORDER BY tr.complete_count DESC
LIMIT 0,".$bb_cfg['t_top_downloaded']);
$this->store('top_downloaded', $data);
}
//Store TopUploaders