$not_auth_forums = $user->get_excluded_forums(AUTH_VIEW);
if (!$last_added = CACHE('lenta')->get("last_added_".$hide_poster_opt."_na_".$not_auth_forums))
{
$not_auth_sql = (!empty($not_auth_forums))?" AND f.auth_view IN(". $not_auth_forums.") ":"";
$cat_ids = ($hide_poster_opt) ? implode(',', array_flip($hide_poster_user)) : 0;
$last_added = DB()->fetch_rowset("SELECT tr.topic_id, tr.forum_id,
tr.size, t.topic_title, t.topic_image, f.forum_name, u.username, 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.forum_id NOT IN (". get_id_csv(explode(',', $bb_cfg['last_added_excluded'])) .")
AND f.cat_id NOT IN($cat_ids)
AND f.allow_porno_topic = 0
AND f.allow_reg_tracker = 1
$not_auth_sql
ORDER BY tr.reg_time DESC LIMIT ". $bb_cfg['limit_poster']);
CACHE('lenta')->set("last_added_".$hide_poster_opt."_na_".$not_auth_forums, $last_added, 3600);
}