MyBB Community Forums

Full Version: lastvisit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i have the portal_welcome on the index page.

it shows the regular stuff (new announcements, new threads, new posts)

these values arent updating *unless i logout and login again*
is there a way to make them update every refresh of the page?

the portal_pms does just fine so its gotta be possible some how Smile

where does $lastvisit or $mybb->user['lastvisit'] get defined?
Do they get updated if you mark all forums read?
yes!!!!

is it possible to do that without clicking that button? or marking forums read (i just want it to update all the time - every load of index.php)
im pretty sure i just want to change these to the current time instead of lastvisit

$query = $db->query("SELECT COUNT(pid) AS newposts FROM ".TABLE_PREFIX."posts WHERE dateline>'".$mybb->user['lastvisit']."' $unviewwhere");

$query = $db->query("SELECT COUNT(tid) AS newthreads FROM ".TABLE_PREFIX."threads WHERE dateline>'".$mybb->user['lastvisit']."' $unviewwhere");

$query = $db->query("SELECT COUNT(tid) AS newann FROM ".TABLE_PREFIX."threads WHERE dateline>'".$mybb->user['lastvisit']."' AND fid='".$mybb->settings['portal_announcementsfid']."' $unviewwhere");

what if i use lastactive instead?
hm im unsure if this will give me what i want

» 0 new announcements
» 0 new threads
» 0 new posts

i want it to list the number of "unread".
chelle Wrote:im pretty sure i just want to change these to the current time instead of lastvisit

$query = $db->query("SELECT COUNT(pid) AS newposts FROM ".TABLE_PREFIX."posts WHERE dateline>'".$mybb->user['lastvisit']."' $unviewwhere");

$query = $db->query("SELECT COUNT(tid) AS newthreads FROM ".TABLE_PREFIX."threads WHERE dateline>'".$mybb->user['lastvisit']."' $unviewwhere");

$query = $db->query("SELECT COUNT(tid) AS newann FROM ".TABLE_PREFIX."threads WHERE dateline>'".$mybb->user['lastvisit']."' AND fid='".$mybb->settings['portal_announcementsfid']."' $unviewwhere");

what if i use lastactive instead?

It won't work if you use current time or lastactive. Think about it for a minute. You're trying to select the number of announcements/threads/posts after the current time, or when you were last active (same as current time), which means the announcement/thread/post must be in the future (sorry, not possible at this point).

The values will show any new announcements/threads/posts since your last visit, and it's the most sensible thing to do. If you post a thread, the value will update.
how do the forum icons change based on whether youve read them or not?

this is the type of thing i need but a total number instead of pictures
They find if there were threads created after your last visit of the forum.