All Unread Posts for New Members

Started by waynewalls, November 29, 2007, 12:53:41 AM

Previous topic - Next topic

waynewalls

It appears that when a newly registered member requests to view all unread posts (using a link with an action of 'unread;all;start=0') that the number of posts returned is limited.  This makes sense in case the forum contains many thousands of posts that would be returned as unread to a new member.

This limit seems to be based on returning posts that were created during a predetermined time period prior to the new member's registration--maybe 24 or 48 hours or some other period.

Can this limit period be adjusted?  I've looked through the UnreadTopics() function in Recent.php but do not see anything obvious.

Any suggestions appreciated.  Thanks.

SleePy

For a newly registered user it would just hide the unread unless all is used. If all is used then it would show all posts they haven't read.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

waynewalls

SMF: v1.1.4
THEME: Default

Thanks for your reply.  In fact, the behavior you described for 'unread;all' is exactly what I'm looking for but not getting.

In the original post I was making an inference based on behavior I was seeing--it appeared 'unread;all' was returning a subset of all unread posts.  Since them 'unread;all' has stopped returning any posts for newly registered members.

In the meantime, I started this thread (I apologize for spreading this issue across multiple topics).  Any comments on what is described in that thread would be appreciated.

So, as of now, the behavior of 'unread;all' has changed from returning some posts to returning no posts for newly registered members.

Is this a database issue?  Can anyone suggest a place that I might start investigating.

I've tried "find and repair errors" in the Admin interface.  I've also tried emptying the log_boards, log_mark_read, and log-topics tables to see if that made any difference--it did not.

Thanks for your help.

SleePy

Dang you are running SMF 1.1.4..
There was a bug in earlier versions that caused this to fail sometimes
Does this happen if the newely created user is an admin? You could enable $db_show_debug = true; in your Settings.php and show queries.
Then create the new user admin and see what queries are being made. Then for the ones related to the unread you can try those in phpmyadmin and see the returned results. Or click on them if you like our page better ;)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

waynewalls

No posts are returned for a newly created user with administrator privileges.

The action 'unread;all' was the first request after this user signed on for the first time.  The three queries that seemed associated with that action are shown below--I did like your page better ;D

There were 32 unread posts in this test forum at the time the above request was made.

The data returned from the queries is opaque to me.  Is it indicative of the bug in v1.1.4?  If it is, is there a workaround for v1.1.4?

Thanks for your assistance.


SELECT b.ID_BOARD
FROM smf_boards AS b
WHERE 1
in C:\xampp\htdocs\smf\Sources\Recent.php line 513, which took 0.00141501 seconds.

id select_type table type possible_keys key key_len ref rows Extra

1 SIMPLE b index  PRIMARY 2  10 Using index


SELECT MIN(lmr.ID_MSG)
FROM smf_boards AS b
   LEFT JOIN smf_log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = 11)
WHERE 1
in C:\xampp\htdocs\smf\Sources\Recent.php line 629, which took 0.00184703 seconds.

id select_type table type possible_keys key key_len ref rows Extra

1 SIMPLE b index  PRIMARY 2  10 Using index
1 SIMPLE lmr eq_ref PRIMARY PRIMARY 5 const,smfsameside.b.ID_BOARD 1 


SELECT COUNT(*), MIN(t.ID_LAST_MSG)
FROM smf_topics AS t
   LEFT JOIN smf_log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = 11)
   LEFT JOIN smf_log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = 11)
WHERE t.ID_BOARD IN (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
   AND t.ID_LAST_MSG > 60
   AND IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) < t.ID_LAST_MSG
in C:\xampp\htdocs\smf\Sources\Recent.php line 755, which took 0.00320005 seconds.

id select_type table type possible_keys key key_len ref rows Extra

1 SIMPLE t range lastMessage,ID_BOARD lastMessage 4  1 Using where
1 SIMPLE lt eq_ref PRIMARY,ID_TOPIC PRIMARY 6 const,smfsameside.t.ID_TOPIC 1 
1 SIMPLE lmr eq_ref PRIMARY PRIMARY 5 const,smfsameside.t.ID_BOARD 1 Using where

SleePy

So this does happen as an admin?
Some of those queries you can click on and it will do an explain and I believe show the results it returns.. Does it?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

waynewalls

Quote from: SleePy on December 28, 2007, 04:34:36 PM
So this does happen as an admin?

Yes this does happen with an admin user.

Quote from: SleePy on December 28, 2007, 04:34:36 PM
Some of those queries you can click on and it will do an explain and I believe show the results it returns.. Does it?

My previous post showed everything that was returned when I clicked on each of the queries that was run in Recent.php.

I am certainly willing to try anything I can to help ferret this out.  Let me know what I can do.

Again, thanks for your assistance.

Advertisement: