News:

Wondering if this will always be free?  See why free is better.

Main Menu

Coding Help: Modified Topics since last visit

Started by calpha, May 29, 2005, 03:37:02 AM

Previous topic - Next topic

calpha

Background:

I work for a small software company.  We have a board we are using for open issues.
Since there are so many, we've done a little trick so that:

Under Open Issues, each Thread = Category of Open Issue
Under Each Thread:, each post = open issue

All three developers are mods of this forum:  So when we answer an open issue, instead of hitting reply, we hit modify, and then bracket our response in quotes.

The problem is this:
I'm working on a modification to alter so unread posts since last visit, to include any modified posts that you haven't read yet.

In working with ./Sources/Recent.php (UnreadTopics), the initial count of unread topics (around line 372) uses a session variable to get the unread posts with a topic_id > SESSION(ID_MSG_LAST_VISIT).

This is the key to making unread posts work until the logged in user reads the post.
With the modified mod, you can't have a max-id, because anything can be modified:

What I need help with:
How to get the count of posts that were modified since your last visit.

The problem is I need to have a between statement on smf_messages.modifiedtime being between smf_members.lastlogin and <current time>

Please don't offer questions about why we are doing it this way-------we have a legit reason.

I was able to get one query to work the first time "Show Unread Topics" was pressed.
However, any subsequent time after that, nothing would show up, because last login was being updated.

Thanks for the input (I do hope I get some)

Assume member = admin.  We are looking for any messages modified since last logn by any other users:

SELECT count(*) FROM smf_messages AS m, smf_members AS memb
WHERE
memb.id_member = 1
AND m.modifiedtime > memb.lastlogin


The above SQL Works once:  I can login with admin, click view unread messages, and see my debug-print of modified-messages = 1.
Clicking view unread messages a second time, i get modified-messages = 0.

Trying to add in smf_log_topics, smf_log_boards, smf_topics, smf_log_mark_read doesn't work, because I can't use a max-message id as the minimum.
I just need to get all posts that have been modified at some time, and that have not been read by admin since they were modified.

Thanks again,
Chris


[Unknown]

Well, it's going to be a lot slower, but you can still base it off the existing "all unread topics".  Just use "GREATEST(posterTime, IFNULL(modifiedTime, 0))" instead of posterTime.

-[Unknown]

Advertisement: