News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

July 16, 2019, 10:32:48 PM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 188515
  • Total Topics: 20736
  • Online Today: 265
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 16
Total: 16

Author Topic: "Show Unread" (unread doesn't work?)  (Read 3100 times)

0 Members and 1 Guest are viewing this topic.

iowamf

  • Guest
"Show Unread" (unread doesn't work?)
« on: December 01, 2005, 02: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?

iowamf

  • Guest
Re: "Show Unread" (unread doesn't work?)
« Reply #1 on: December 02, 2005, 02: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.

iowamf

  • Guest
Re: "Show Unread" (unread doesn't work?)
« Reply #2 on: March 01, 2006, 04:03:26 AM »
Arrghh ... I'm closer to resolving why show ALL unread is not working.

Forget my posts below. I found this on the simplemachines.org forum (bold below is mine):

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.

Offline bloc

  • Founder
  • *
  • Posts: 5214
    • Bloc
Re: "Show Unread" (unread doesn't work?)
« Reply #3 on: March 01, 2006, 04: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.

iowamf

  • Guest
Re: "Show Unread" (unread doesn't work?)
« Reply #4 on: March 04, 2006, 02:26:18 PM »
I found this tip and it's working (on my test SMF 1.1 RC2 install)  :)

From a   thread at SMF.ORG:

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  ;)

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:
Code: [Select]
$_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.

webpuppy

  • Guest
Re: "Show Unread" (unread doesn't work?)
« Reply #5 on: April 25, 2006, 05:32:16 AM »
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.

deniz

  • Guest
Re: "Show Unread" (unread doesn't work?)
« Reply #6 on: May 11, 2006, 03:29:38 AM »
my solution:

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