HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media


Welcome to TinyPortal. Please login or sign up.

March 23, 2023, 05:08:40 PM

Login with username, password and session length
  • Total Posts: 194,243
  • Total Topics: 21,145
  • Online today: 90
  • Online ever: 3,540
  • (September 03, 2022, 01:38:54 AM)
Users Online
Users: 1
Guests: 76
Total: 77

"Show Unread" (unread doesn't work?)

Started by iowamf, December 01, 2005, 09:55:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


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?


getting closer on debugging this non-Tiny-Portal issue ... but still relevant.

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

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

If I use the default "Show Unread" - it goes to  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


Arrghh ... I'm closer to resolving why show ALL unread is not working.

Forget my posts below. I found this on the 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.


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.


I found this tip and it's working (on my test SMF 1.1 RC2 install)  :)

From a   thread 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?
$_REQUEST['topicseen'] = true;
if (isset($_REQUEST['boardseen']))

Remove this again:
Code (MessageIndex.php) Select
REPLACE INTO {$db_prefix}log_boards
VALUES (" . time() . ", $ID_MEMBER, $board)", __FILE__, __LINE__);
if (!empty($board_info['parent_boards']))
UPDATE {$db_prefix}log_boards
SET logTime = " . time() . "
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]))

I think this should result in the desired behaviour (untested though), that is, marking topics as seen instead of boards.


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.


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>