// Sprachvariablen laden
$lang->load("portal");
// Neue Themen etc. ermitteln
$query = $db->query("SELECT COUNT(pid) AS newposts FROM ".TABLE_PREFIX."posts WHERE dateline>'".$mybb->user['lastvisit']."' $unviewwhere");
$newposts = $db->result($query, 0);
if($newposts) { // if there aren't any new posts, there is no point in wasting two more queries
$query = $db->query("SELECT COUNT(tid) AS newthreads FROM ".TABLE_PREFIX."threads WHERE dateline>'".$mybb->user['lastvisit']."' $unviewwhere");
$newthreads = $db->result($query, 0);
$query = $db->query("SELECT COUNT(tid) AS newann FROM ".TABLE_PREFIX."threads WHERE dateline>'".$mybb->user['lastvisit']."' AND fid='".$mybb->settings['portal_announcementsfid']."' $unviewwhere");
$newann = $db->result($query, 0);
if(!$newthreads) {
$newthreads = 0;
}
if(!$newann) {
$newann = 0;
}
} else {
$newposts = 0;
$newthreads = 0;
$newann = 0;
}
$lang->new_announcements = sprintf($lang->new_announcements, $newann);
$lang->new_threads = sprintf($lang->new_threads, $newthreads);
$lang->new_posts = sprintf($lang->new_posts, $newposts);
$header_newcontents = $lang->new_announcements." | ".$lang->new_threads." | ".$lang->new_posts;