PheRum
Легенда
PHP:
// BEGIN last 10.
if($bb_cfg['t_last_added_num'])
{
if (!$last_added = $datastore->get('last_added'))
{
$datastore->update('last_added');
$last_added = $datastore->get('last_added');
}
$template -> assign_vars(array(
'LAST_ADDED_ON' => true,
));
$last_added = $datastore->get('last_added');
foreach ($last_added as $last_add)
{
$template -> assign_block_vars('lastAdded',array(
'TITLE' => $last_add['topic_title'],
'TOPIC_ID' => $last_add['topic_id'],
'FORUM' => $last_add['forum_name'],
'FORUM_ID' => $last_add['forum_id'],
'POSTER' => profile_url(array('username' => $last_add['username'], 'user_rank' => $last_add['user_rank'])),
'POSTER_ID' => $last_add['user_id'],
'TORRENT_TIME' => bb_date($last_add['reg_time'], 'd-M', 'false'),
)) ;
}
}
// END last 10
// BEGIN TopDownloaded
if($bb_cfg['t_top_downloaded'])
{
if (!$top_downloaded = $datastore->get('top_downloaded'))
{
$datastore->update('top_downloaded');
$top_downloaded = $datastore->get('top_downloaded');
}
$template -> assign_vars(array(
'TOP_DOWNLOADED_ON' => true,
));
foreach ($top_downloaded as $top_download)
{
$template -> assign_block_vars('TopDownloaded',array(
'TITLE' => $top_download['topic_title'],
'TOPIC_ID' => $top_download['topic_id'],
'FORUM' => $top_download['forum_name'],
'FORUM_ID' => $top_download['forum_id'],
'POSTER' => profile_url(array('username' => $top_download['username'], 'user_rank' => $top_download['user_rank'])),
'POSTER_ID' => $top_download['user_id'],
'COMPLETED' => $top_download['complete_count'],
'TORRENT_TIME' => bb_date($top_download['reg_time'], 'd-M', 'false'),
)) ;
}
}
// END TopDownloaded