if($mybb->settings['portal_showwelcome'] != 0)
{
if($mybb->user['uid'] != 0)
{
// Get number of new posts, threads, announcements
$query = $db->simple_select("posts", "COUNT(pid) AS newposts", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' $unviewwhere");
$newposts = $db->fetch_field($query, "newposts");
if($newposts)
{
// If there aren't any new posts, there is no point in wasting two more queries
$query = $db->simple_select("threads", "COUNT(tid) AS newthreads", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' $unviewwhere");
$newthreads = $db->fetch_field($query, "newthreads");
$announcementsfids = explode(',', $mybb->settings['portal_announcementsfid']']);
if(is_array($announcementsfids))
{
foreach($announcementsfids as $fid)
{
$fid_array[] = intval($fid);
}
$announcementsfids = implode(',', $fid_array);
$query = $db->simple_select("threads", "COUNT(tid) AS newann", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' AND fid IN (".$announcementsfids.") $unviewwhere");
$newann = $db->fetch_field($query, "newann");
}
if(!$newthreads)
{
$newthreads = 0;
}
if(!$newann)
{
$newann = 0;
}
}
else
{
$newposts = 0;
$newthreads = 0;
$newann = 0;
}
// Make the text
if($newann == 1)
{
$lang->new_announcements = $lang->new_announcement;
}
else
{
$lang->new_announcements = $lang->sprintf($lang->new_announcements, $newann);
}
if($newthreads == 1)
{
$lang->new_threads = $lang->new_thread;
}
else
{
$lang->new_threads = $lang->sprintf($lang->new_threads, $newthreads);
}
if($newposts == 1)
{
$lang->new_posts = $lang->new_post;
}
else
{
$lang->new_posts = $lang->sprintf($lang->new_posts, $newposts);
}
eval("\$welcometext = \"".$templates->get("portal_welcome_membertext")."\";");
}
else
{
$lang->guest_welcome_registration = $lang->sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register');
$mybb->user['username'] = $lang->guest;
eval("\$welcometext = \"".$templates->get("portal_welcome_guesttext")."\";");
}
$lang->welcome = $lang->sprintf($lang->welcome, $mybb->user['username']);
eval("\$welcome = \"".$templates->get("portal_welcome")."\";");
if($mybb->user['uid'] == 0)
{
$mybb->user['username'] = "";
}
}
Ok, so now after changing what you said it ADDS that forum (ie it displays normal portal, aswel as forum "5"
The code above is a second point were it has the "$mybb->settings['portal_announcementsfid']']" Specifically:
>user['lastvisit']."' $unviewwhere");
$newthreads = $db->fetch_field($query, "newthreads");
$announcementsfids = explode(',', $mybb->settings['portal_announcementsfid']']);
if(is_array($announcementsfids))
{
When i change this to "5" it then makes the store all white, nothing displaying, do you know why this is?
On a side note, THANK YOU!!!! youve been a mojor help! seriously!
Somehow i got it working!
Im pretty sure by removing the following code...
// If there aren't any new posts, there is no point in wasting two more queries
$query = $db->simple_select("threads", "COUNT(tid) AS newthreads", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' $unviewwhere");
$newthreads = $db->fetch_field($query, "newthreads");
$announcementsfids = explode(',', $mybb->settings['portal_announcementsfid']);
if(is_array($announcementsfids))
{
foreach($announcementsfids as $fid)
{
$fid_array[] = intval($fid);
}
$announcementsfids = implode(',', $fid_array);
$query = $db->simple_select("threads", "COUNT(tid) AS newann", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' AND fid IN (".$announcementsfids.") $unviewwhere");
$newann = $db->fetch_field($query, "newann");
}