TinyPortal

General => Chit chat => Topic started by: iowamf on December 01, 2005, 09:55:33 PM

Title: "Show Unread" (unread doesn't work?)
Post by: iowamf on December 01, 2005, 09:55:33 PM
I'm having a hard time understanding the "Show Unread" functionality that is in the User Block - yes, this is probably a SMF issue and there is a lot of discussion over there about this (perhaps too much).

On my site, I'm using a block of type "Recent Topics" and things show up there with a blue "New" icon when someone posts (good).

However, when people (not the person who did the new post) hit "Show Unread" -   the new post doesn't always show up in the list? (bad)

Also, clicking the "All Unread Posts" doesn't show all unread posts ... especially posts in child boards. (really bad)

I've tried cleaning out all the browser cache and even rebooting all the machines - but the "Unread" post behaviour (1.1 / RC1) is consistently not working.  Any ideas of what to look at next?
Title: Re: "Show Unread" (unread doesn't work?)
Post by: iowamf on December 02, 2005, 09:29:50 PM
getting closer on debugging this non-Tiny-Portal issue ... but still relevant.

All of my installation is using FULL URL's ... ie,

  www.tinyportal.co.uk (not http://tinyportal.co.uk)

and verified with repair_settings.php - the settings match the recommendations 100%.

If I use the default "Show Unread" - it goes to www.mysite.com/forum  and it doesn't show the unread posts.

If I edit the URL in the browser and erase the leading "www." - the unread posts show up - confusing.

Yes, I've got posts into SMF.org.
Title: Re: "Show Unread" (unread doesn't work?)
Post by: iowamf on March 01, 2006, 11:03:26 AM
Arrghh ... I'm closer to resolving why show ALL unread is not working.

Forget my posts below. I found  this  (http://www.simplemachines.org/community/index.php?topic=61428.msg425670#msg425670) on the simplemachines.org forum (bold below is mine):

Quote from: Oldiesmann on December 20, 2005, 02:10:23 PM
Several people have asked about this (surprisingly), and unfortunately I have not yet found a way to do this that would not result in a huge slowdown.

As soon as you view a board, SMF marks it as read, without marking each individual topic read. SMF then looks at the latest entry in the log_boards table for that board and your user ID and compares the resulting timestamp with the "lastmodified" timestamp for that board. If the "lastmodified" timestamp is larger, then the board is considered new.

In order to do things the way phpBB does them (in terms of not marking a board read until you click on "mark as read" or you've seen every topic in there), SMF would have to determine whether or not each topic in a board was new directly from the board index, which would result in a huge slowdown due to all the extra queries needed. SMF already keeps track of which messages have and have not been read (ie viewing a board doesn't mark every topic in that board as "read"). In 1.1, you can use the "unread;all" action to see all unread posts and the "boards" parameter to specify which board(s) to show new posts from:

.../index.php?action=unread;all - shows all unread topics from every board that you can see
.../index.php?action=unread;all;boards=1(,2,3,...) - shows all unread topics from the specified board(s)

If I can find a way to do this without causing a huge slowdown, I will gladly post this code.

If I understand the above post correctly, this is why a user can see a board full of "NEW" icons on individual topics - but still have ?action=unread;all;start=0 show up as an empty list. 

IMHO, this is a bug with SMF.
Title: Re: "Show Unread" (unread doesn't work?)
Post by: bloc on March 01, 2006, 11:10:28 AM
I think this is being looked upon..without having checked more throroughly. the "mark read" routines have undergone some changes even from early 1.1 to 1.1RC2.
Title: Re: "Show Unread" (unread doesn't work?)
Post by: iowamf on March 04, 2006, 09:26:18 PM
I found this tip and it's working (on my test SMF 1.1 RC2 install)  :)

From a   thread  (http://www.simplemachines.org/community/index.php?topic=61428.msg502851#msg502851) at SMF.ORG:

Quote from: iowamf on March 04, 2006, 09:16:50 PM
Thanks Compuart -

I tried this and so far - so good! No error messages either.

I don't know what this is going to do to performance - but I'm just testing for now and I'm more concerned with functionality than performance.

Keeping "unread" messages in the "unread list" is a good thing  ;)

Quote from: Compuart on December 21, 2005, 07:06:02 PM
In that case try (without the previous changes) adding before:
Code (Display.php) Select
// Have we recently cached the number of new topics in this board, and it's still a lot?
this:
$_REQUEST['topicseen'] = true;
if (isset($_REQUEST['boardseen']))
unset($_REQUEST['boardseen']);



Remove this again:
Code (MessageIndex.php) Select
db_query("
REPLACE INTO {$db_prefix}log_boards
(logTime, ID_MEMBER, ID_BOARD)
VALUES (" . time() . ", $ID_MEMBER, $board)", __FILE__, __LINE__);
if (!empty($board_info['parent_boards']))
{
db_query("
UPDATE {$db_prefix}log_boards
SET logTime = " . time() . "
WHERE ID_MEMBER = $ID_MEMBER
AND ID_BOARD IN (" . implode(',', array_keys($board_info['parent_boards'])) . ")
LIMIT " . count($board_info['parent_boards']), __FILE__, __LINE__);

// We've seen all these boards now!
foreach ($board_info['parent_boards'] as $k => $dummy)
{
if (isset($_SESSION['topicseen_cache'][$k]))
unset($_SESSION['topicseen_cache'][$k]);
}
}



I think this should result in the desired behaviour (untested though), that is, marking topics as seen instead of boards.
Title: Re: "Show Unread" (unread doesn't work?)
Post by: webpuppy on April 25, 2006, 12:32:16 PM
I was having this problem as well and have noticed if you uncheck Search engine friendly URLs
Apache only! in the Admin/Features and Options/Basic Features the unread topics link seems to work just fine.
Title: Re: "Show Unread" (unread doesn't work?)
Post by: deniz on May 11, 2006, 10:29:38 AM
my solution:

open: TPortalBlocks.template.php
find: echo '<br />'.$bullet.'<a href="', $scripturl, '?action=unread">' .$txt['tp-unread'].'</a>

replace with: echo '<br />'.$bullet.'<a href="', $scripturl, '?action=unread;all">' .$txt['tp-unread'].'</a>