viewforum_body.html
Code: Select all
<!-- IF S_TSRAT_ENABLE -->
<!-- INCLUDE recent_active_body.html -->
<!-- ENDIF -->
<!-- INCLUDE forumlist_body.html -->
<!-- ENDIF -->
<!-- IF S_TSMVT_ENABLE or S_TSMRT_ENABLE or S_TSMAU_ENABLE or S_TSMAF_ENABLE or S_TSLVB_ENABLE or S_TSLRU_ENABLE -->
<!-- INCLUDE top_stats_body.html -->
<!-- ENDIF -->
Code: Select all
// Recent Active Topics
$flist = $auth->acl_getf('f_read', true);
$flist = array_unique(array_keys($flist));
$flist = array_merge($flist, array(0));
$enable_active_topics = (!empty($config['tsrat_enable']) ? true : false);
if ($enable_active_topics && sizeof($flist))
{
$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_time, t.topic_views, t.topic_poster, t.topic_replies, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time, t.topic_last_view_time, t.topic_last_poster_id, f.forum_name, f.forum_image
FROM ' . TOPICS_TABLE . ' t
LEFT JOIN ' . FORUMS_TABLE . ' f ON (t.forum_id = f.forum_id)
WHERE ' . $db->sql_in_set('t.forum_id', $flist) . ' AND t.topic_moved_id = 0 AND t.topic_approved = 1
ORDER BY t.topic_last_post_time DESC';
$result = $db->sql_query_limit($sql, $config['tsrat_number']);
while ($row = $db->sql_fetchrow($result))
{
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']);
$view_last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id']);
$view_first_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_poster']);
$view_last_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_last_poster_id']);
$view_viewforum_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
$template->assign_block_vars('recent_active', array(
'TOPIC_TITLE' => $row['topic_title'],
'TOPIC_TIME' => $user->format_date($row['topic_time']),
'TOPIC_VIEWS' => $row['topic_views'],
'TOPIC_REPLIES' => $row['topic_replies'],
'TOPIC_FIRST_POSTER_NAME' => $row['topic_first_poster_name'],
'TOPIC_FIRST_POSTER_COLOUR' => $row['topic_first_poster_colour'],
'TOPIC_LAST_POSTER_NAME' => $row['topic_last_poster_name'],
'TOPIC_LAST_POSTER_COLOUR' => $row['topic_last_poster_colour'],
'TOPIC_LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
'TOPIC_LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
'U_FIRST_TOPIC' => $view_topic_url,
'U_LAST_TOPIC' => $view_last_post_url,
'USERNAME_FIRST' => $view_first_poster,
'USERNAME_LAST' => $view_last_poster,
'FORUM_NAME' => $row['forum_name'],
'FORUM_IMAGE' => $row['forum_image'],
'FORUM_URL' => $view_viewforum_url,
));
}
$db->sql_freeresult($result);
$template->assign_vars(array(
//isset we can enter a value ? : 'or leave empty' (value)
//!empty yes : no ,true : false (bool)
'JSSCROLL_SPEED' => (isset($config['tsjss_speed'])) ? $config['tsjss_speed'] : '',
'JSSCROLL_INTERVAL' => (isset($config['tsjss_interval'])) ? $config['tsjss_interval'] : '',
'TSRAT_NUMBER' => (isset($config['tsrat_number'])) ? $config['tsrat_number'] : '',
'TS_JSSCROLL_DIRECTION' => (!empty($config['ts_jsscroll_direction'])) ? true : false,
'TS_JSSCROLL_PAUSE' => (!empty($config['ts_jsscroll_pause'])) ? true : false,
'TS_JSSCROLL_NAVIGATION' => (!empty($config['ts_jsscroll_navigation'])) ? true : false,
'S_TSRAT_ENABLE' => (!empty($config['tsrat_enable'])) ? true : false,
'S_TS_JSSCROLL' => (isset($config['ts_jsscroll'])) ? $config['ts_jsscroll'] : '',
'S_TS_TICKER' => (!empty($config['ts_ticker_enable'])) ? true : false,
));
}