New Posts icon to remain until all new posts read

Started by roytheboy, December 20, 2005, 04:54:26 AM

Previous topic - Next topic

iowamf

I was hoping 1.1.1 would change (fix?) this - but it did not.

The "show unread" or action=unread;all;start=0 still does not show all unread posts.

"show unread" is more like "show unseen subjects".

It's easy to duplicate, never read the default welcome post from SMF in the General category, but read everything else and select "show unread"- the default welcome post will stay "new" but never show up in the "unread" list (assuming you've clicked on the General category at least once). Go back to the General Category and there will be a "new" icon on the welcome message.

I respect the concern for performance on a large board with tons of posts and understand the tradeoff, but I wish SMF would rethink their choice of performance gains over intuitive behavior of an important commad -at least give us a choice of functionality vs performance. Especially on small boards where functionality is more important than performance.

What if it was "mail messages" instead of "forum posts" - surely just viewing the subject line in a list of mail messages isn't considered having read the message. Nobody would be using gmail/hotmail if google/microsoft marked every new message as read to save on performance because they displayed the subject line to the user .. unread means unread.

Can't there be some action=unread;actual (or similar) to really get ALL the unread posts to show up?


Peter Duggan

Quote from: iowamf on January 29, 2007, 07:34:26 PM
I respect the concern for performance on a large board with tons of posts and understand the tradeoff, but I wish SMF would rethink their choice of performance gains over intuitive behavior of an important commad -at least give us a choice of functionality vs performance. Especially on small boards where functionality is more important than performance.

To me (as an SMF user), it *is* both functional and intuitive and other systems get it wrong! So I don't necessarily expect to read every unread post on a board at one sitting, but I do expect the New Posts indicator to tell me when there's something new since I last looked.

iowamf

#24
Quote from: Peter Duggan on February 26, 2007, 03:24:25 AM
Quote from: iowamf on January 29, 2007, 07:34:26 PM
Especially on small boards where functionality is more important than performance.

To me (as an SMF user), it *is* both functional and intuitive and other systems get it wrong! So I don't necessarily expect to read every unread post on a board at one sitting, but I do expect the New Posts indicator to tell me when there's something new since I last looked.

Although SMF is awesome, I don't think SMF "got it right" in this matter.

The algorithms for marking posts as "read" take some serious liberties ... acceptable trade-off for large boards - unacceptable trade-off for small boards.

Getting it right would be giving forum admins the ability to have "show all unread" actually "show all unread".  The "show all unread" (if I understand it correctly) only shows posts that are newer than the last time you read a board.

I initially thought it was a bug - but now I understand its a choice.

If my understanding is wrong - I hope I'll be corrected.

青山 素子

The "show all unread" thing does appear to be a bug. Topics don't count as "read" until you have actually loaded them. I believe there is a report filed on this and it is being investigated.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


iowamf

Quote from: Motoko-chan on May 07, 2007, 11:30:59 AM
The "show all unread" thing does appear to be a bug. Topics don't count as "read" until you have actually loaded them. I believe there is a report filed on this and it is being investigated.

Your reply is confusing ... topics are counted as "read" when they should not be ... that is the problem.

I agree that topics should not be counted as "read" until you have actually read them ... but the "show all unread" does not "show all unread".

Can you reference the report that is filed?

I'm glad to see someone at SMF realize that this functionality is less than perfect.

T.Linden

Quote from: iowamf on January 29, 2007, 07:34:26 PM
I was hoping 1.1.1 would change (fix?) this - but it did not.

The "show unread" or action=unread;all;start=0 still does not show all unread posts.

Can't there be some action=unread;actual (or similar) to really get ALL the unread posts to show up?

Exactly. I can't believe this is still unfixed years later.

Quote from: Peter Duggan on February 26, 2007, 03:24:25 AM
To me (as an SMF user), it *is* both functional and intuitive and other systems get it wrong!

In what bizzarro world could this ever be seen as intuitive?

User X *has* dozens of unread post and topics.

User X clicks "Click here to try all unread topics"

Result: SMF displays No unread posts.

Which is patently incorrect, disfunctional, and *counter* unintuitive.

I run a small board, and the traffic for the past year where I've been running SMF has dropped dramatically from when I ran my own board software. Literally a 1/4 of the number of posts compared to the preceding year.

It can directly be attributed to the braindead "unread topics" behaviour. My users simply don't know that there are new posts that they've not read. They click the link, the system says no new posts, they go elsewhere.

It looked promising in this thread that this would be dealt with, but alas, no. Hopefully in 2.0

Snakehit

For this problem I'm already searching a couple of days to get a workaround.

Problem description:
When you to the boardindex and you click a board you see all the unreaded topics by the "new" marker. When you return back to the boardindex while there are still unread topic in that board, the board is marked as read. It should still be marked as unread while there are unreaded topics.


The problem is in the Sources/MessageIndex.php file on line: 100.

db_query("
REPLACE INTO {$db_prefix}log_boards
(ID_MSG, ID_MEMBER, ID_BOARD)
VALUES ($modSettings[maxMsgID], $ID_MEMBER, $board)", __FILE__, __LINE__);

There they set the smf_log_board while there are still unread topics. Removing this isn't a option because then the boards will always be marked as unread.

Need to find a workaround to know what topic isn't viewed yet.
I'm busy with it... need to find it, users are mentioning about it ;-)

Anyway SMF you rock :o
(excuse me for bad english)

Snakehit

#29
Wii,
I'm proud to pronounce you that I've found a way to fix this :P
It's still under testing surveillance but normally it works fine...

Only tested with SMF 1.1.4!

@SMF: it could be bad code or sql, sorry for that but I think that you guys could fix this ;-) Thanks for that  ;)


ATTENTION: Do not use the find and replace function because there are a lot similair lines in the files!!

MessageIndex.php
Line 100:
db_query("
REPLACE INTO {$db_prefix}log_boards
(ID_MSG, ID_MEMBER, ID_BOARD)
VALUES ($modSettings[maxMsgID], $ID_MEMBER, $board)", __FILE__, __LINE__);


Replace:
// Snakehit
// Mark boards as readed if there aren't any new topics any more
// Search all unreaded topics
$request = db_query("
SELECT COUNT(*)
FROM {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)
WHERE t.ID_BOARD = $board
AND IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) < t.ID_LAST_MSG", __FILE__, __LINE__);
list ($unreadtopics) = mysql_fetch_row($request);
mysql_free_result($request);

// All topics are readed, mark them as readed
if ($unreadtopics == 0)
db_query("
REPLACE INTO {$db_prefix}log_boards
(ID_MSG, ID_MEMBER, ID_BOARD)
VALUES ($modSettings[maxMsgID], $ID_MEMBER, $board)", __FILE__, __LINE__);



Display.php
Line 342:
// Mark board as seen if we came using last post link from BoardIndex. (or other places...)
if (isset($_REQUEST['boardseen']))
{
db_query("
REPLACE INTO {$db_prefix}log_boards
(ID_MSG, ID_MEMBER, ID_BOARD)
VALUES ($modSettings[maxMsgID], $ID_MEMBER, $board)", __FILE__, __LINE__);
}


Replace:
// Snakehit
// Mark boards as readed if there aren't any new topics any more
// Search all unreaded topics
$request = db_query("
SELECT COUNT(*)
FROM {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)
WHERE t.ID_BOARD = $board
AND IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) < t.ID_LAST_MSG", __FILE__, __LINE__);
list ($unreadtopics) = mysql_fetch_row($request);
mysql_free_result($request);

// All topics are readed, mark them as readed
if ($unreadtopics == 0)
db_query("
REPLACE INTO {$db_prefix}log_boards
(ID_MSG, ID_MEMBER, ID_BOARD)
VALUES ($modSettings[maxMsgID], $ID_MEMBER, $board)", __FILE__, __LINE__);


Post.php
Line: 1689

// Mark the board as read.... because it might get confusing otherwise.
db_query("
UPDATE {$db_prefix}log_boards
SET ID_MSG = $modSettings[maxMsgID]
WHERE ID_MEMBER = $ID_MEMBER
AND ID_BOARD = $board", __FILE__, __LINE__);


Replace:

// Snakehit
// Mark boards as readed if there aren't any new topics any more
// Search all unreaded topics
$request = db_query("
SELECT COUNT(*)
FROM {$db_prefix}topics AS t
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)
WHERE t.ID_BOARD = $board
AND IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) < t.ID_LAST_MSG", __FILE__, __LINE__);
list ($unreadtopics) = mysql_fetch_row($request);
mysql_free_result($request);

// All topics are readed, mark them as readed
if ($unreadtopics == 0)
db_query("
REPLACE INTO {$db_prefix}log_boards
(ID_MSG, ID_MEMBER, ID_BOARD)
VALUES ($modSettings[maxMsgID], $ID_MEMBER, $board)", __FILE__, __LINE__);



Subs-Boards.php
Line: 281

Find:
// Use a time one second earlier than the first time: blam, unread!
db_query("
REPLACE INTO {$db_prefix}log_topics
(ID_MSG, ID_MEMBER, ID_TOPIC)
VALUES ($earlyMsg, $ID_MEMBER, $topic)", __FILE__, __LINE__);



Add behind:

// This allows Snakehit's mod to detect posts that have
// been changed from the read state to the unread state
db_query("
REPLACE INTO {$db_prefix}log_boards
(ID_MSG, ID_MEMBER, ID_BOARD)
VALUES ($earlyMsg, $ID_MEMBER, $board)", __FILE__, __LINE__);

Mention that this is still a beta test! So it could be wrong at some places


青山 素子

Quote from: Snakehit on October 04, 2007, 07:25:45 AM
For this problem I'm already searching a couple of days to get a workaround.
Problem description:
When you to the boardindex and you click a board you see all the unreaded topics by the "new" marker. When you return back to the boardindex while there are still unread topic in that board, the board is marked as read. It should still be marked as unread while there are unreaded topics.

I believe that is a completely different issue from the topic here. The issue here is that the "unread" link only shows new topics that have been created since your last visit, not all unread topics since the beginning of time.

Quote from: Snakehit on October 04, 2007, 09:01:25 AM
Wii,
I'm proud to pronounce you that I've found a way to fix this :P
It's still under testing surveillance but normally it works fine...

Only tested with SMF 1.1.4!

I haven't checked it, but if that code actually does make the "unread posts" function like "unread posts since the beginning of time", you'll probably be causing some of the larger boards to bog down. Think of a board with about 30k posts. Now, a new user joins and clicks that link. Suddenly, the system will be having to go through all those posts, calculate the pages, etc. With a few users doing that, it will get very busy on resources very quickly. Of course, only time and tests will see how badly it really is on the systems.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


roytheboy

#31
Quote from: Motoko-chan on October 04, 2007, 11:06:36 PMI believe that is a completely different issue from the topic here. The issue here is that the "unread" link only shows new topics that have been created since your last visit, not all unread topics since the beginning of time.

Actually, speaking as the OP, I suggest that Shakehit's post does indeed address the issue that started this thread. The 'unread link' issue is secondary to the primary issue as described.

Because I am so pleased with SMF in all other respects, and because I don't like to take for granted all the hard work that has been put into creating it, I accepted Oldiesmann's explanation (echoed by you) that to give the board the required functionality would be resource intensive. As a sysadmin/developer, this is a very important consideration for me.

I followed Oldiesmann's original advice and added this code to the board index in a prominent position:

<a href="http://www.foobar.com/forum/index.php?action=unread;all">Show all unread messages</a>

The forum members soon got used to using the link and nobody has complained since, so I did not spend any more time studying the source code. That said, I am still on the lookout for a good solution to the original problem, as long as it is resource friendly :)
Life's a b*tch and then you die!

Snakehit

Quote from: Motoko-chan on October 04, 2007, 11:06:36 PM
Quote from: Snakehit on October 04, 2007, 07:25:45 AM
For this problem I'm already searching a couple of days to get a workaround.
Problem description:
When you to the boardindex and you click a board you see all the unreaded topics by the "new" marker. When you return back to the boardindex while there are still unread topic in that board, the board is marked as read. It should still be marked as unread while there are unreaded topics.

I believe that is a completely different issue from the topic here. The issue here is that the "unread" link only shows new topics that have been created since your last visit, not all unread topics since the beginning of time.

Hmm, i've been reading the complete topic and in my opinion this is the problem of this topic. Like roytheyboy said the unread link was the secondary issue. I understand you have to read a lot ;-) No problem for that.

Quote from: Motoko-chan on October 04, 2007, 11:06:36 PM
I haven't checked it, but if that code actually does make the "unread posts" function like "unread posts since the beginning of time", you'll probably be causing some of the larger boards to bog down. Think of a board with about 30k posts. Now, a new user joins and clicks that link. Suddenly, the system will be having to go through all those posts, calculate the pages, etc. With a few users doing that, it will get very busy on resources very quickly. Of course, only time and tests will see how badly it really is on the systems.

I'm busy with testing on a forum with 1400 members and 100.000 posts, doesn't see any slows down. But still I can tell you we watch the serverstatics to see the evolution. I'll keep you inform if anything happens. I can tell you the other members didn't reported any bugs yet, so I think it works. It can be a help for you (great people) of SMF to implement that. Thank you for that, and still you guys do great work.

waynewalls

SMF: v1.1.4
THEME: Default

@ Snakehit: Thanks for you modification.

We've been running Snakehit's mod for a week now without any problems.  Our forum is very small and keeping the board index "new post" icons in the on state whenever there are unread posts is a better fit for our group of users.

The problem I ran into was changing a post from the read state to the unread state was not accompanied by the board index icon ALSO changing back to the on state to reflect an unread post.

To try and fix this, I did the following...

After this query in Subs-Boards.php (line 281)

// Use a time one second earlier than the first time: blam, unread!
db_query("
REPLACE INTO {$db_prefix}log_topics
(ID_MSG, ID_MEMBER, ID_TOPIC)
VALUES ($earlyMsg, $ID_MEMBER, $topic)", __FILE__, __LINE__);


I added the following query

// This allows Snakehit's mod to detect posts that have
// been changed from the read state to the unread state
db_query("
REPLACE INTO {$db_prefix}log_boards
(ID_MSG, ID_MEMBER, ID_BOARD)
VALUES ($earlyMsg, $ID_MEMBER, $board)", __FILE__, __LINE__);


I'm new to SMF, PHP, and MySQL.  Does anyone see where this change will have any unintended consequences?

Thanks for your help.

Snakehit


Advertisement: