Advertisement:

Author Topic: Show unread topics for a specific board  (Read 39312 times)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Show unread topics for a specific board
« on: September 11, 2004, 03:31:27 PM »
Ever wondered if you could show the unread topics in just one specific board?  For example, maybe you marked some topic in SMF Coding Discussion unread, but you can't find it - you just know it's in there.

Well, it'd sure help to be able to show unread topics in that board, wouldn't it?  You can!  All you do is you take this:

http://www.simplemachines.org/community/index.php?action=unread

And then you add the board to it:

http://www.simplemachines.org/community/index.php?action=unread;board=60.0

But we're not done.  You probably want "since all time", not "for a wee bit".  So let's add all on there too:

http://www.simplemachines.org/community/index.php?action=unread;board=60.0;all

Nice, eh?  Now you've got all the unread topics - in that board.  This works if you're looking for unread topics you've posted in too, like so:

http://www.simplemachines.org/community/index.php?action=unreadreplies;board=60.0
(this doesn't need "all" ;).)

There's no interface for this, but that doesn't mean you can't make a theme that has one ;).

-[Unknown]

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Show unread topics for a specific board
« Reply #1 on: September 13, 2004, 04:45:30 PM »
Pretty cool man, I was just thinking about this yesterday. :)

What other features are there in the code that are still not visible in the themes?
Cristián Lávaque http://cristianlavaque.com

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: Show unread topics for a specific board
« Reply #2 on: September 19, 2004, 04:55:50 AM »
I was hoping to make a small change to the unread topics function but it doesn't seem to be doing what I would like.

When clicking on "Show new replies to your posts" I would like the member to only see the posts that they started so I managed to find in SubsBoards.PHP

Code: [Select]
elseif (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'unreadreplies')
{
// Make sure all the boards are integers!
$topics = explode('-', $_REQUEST['topics']);

$setString = '';
foreach ($topics as $ID_TOPIC)
{
$ID_TOPIC = (int) $ID_TOPIC;
$setString .= "
(" . time() . ", $ID_MEMBER, $ID_TOPIC),";
}

db_query("
REPLACE INTO {$db_prefix}log_topics
(logTime, ID_MEMBER, ID_TOPIC)
VALUES" . substr($setString, 0, -1), __FILE__, __LINE__);

redirectexit('action=unreadreplies');
}

Whcih I then changed to

Code: [Select]
elseif (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'unreadreplies')
{
// Make sure all the boards are integers!
$topics = explode('-', $_REQUEST['topics']);

$setString = '';
foreach ($topics as $ID_TOPIC)
{
$ID_TOPIC = (int) $ID_TOPIC;
$setString .= "
(" . time() . ", $ID_MEMBER_STARTED, $ID_TOPIC),";
}

db_query("
REPLACE INTO {$db_prefix}log_topics
(logTime, ID_MEMBER_STARTED, ID_TOPIC)
VALUES" . substr($setString, 0, -1), __FILE__, __LINE__);

redirectexit('action=unreadreplies');
}

It didn't change the results though.
Is there any chance you could have a look and give me some pointers where I'm going wrong please?

Thanks



{edit>

Oh hang on, am I right in thinking that the above writes in to the 'log_topics' table?
That explains my goof in part. There is no field in the table for "ID_Member_Started" so I need to find something somewhere else to help me sort/filter the data?
« Last Edit: September 19, 2004, 05:00:07 AM by Fizzy »
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Show unread topics for a specific board
« Reply #3 on: September 19, 2004, 05:16:22 AM »
I think you're looking in the wrong file.  Try Recent.php.

-[Unknown]

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: Show unread topics for a specific board
« Reply #4 on: September 19, 2004, 06:05:00 AM »
Thanks [Unknown]

I was kind of hoping you wouldn't say Recent.php  ;D

Looking through that I am a bit totally confused (who am I trying to kid :) )  about which part to fiddle with without messing up the whole forum.
Any chance you could give me a clue please if I should be looking for something like
'id' => $row['ID_FIRST_MEMBER'],
or maybe
AND t.ID_MEMBER_STARTED = $ID_MEMBER

? ?
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Show unread topics for a specific board
« Reply #5 on: September 19, 2004, 03:41:14 PM »
Find:

Code: [Select]
$request = db_query("
SELECT COUNT(DISTINCT t.ID_TOPIC)
FROM {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b
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)
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_TOPIC = t.ID_TOPIC)
WHERE t.ID_MEMBER_UPDATED != $ID_MEMBER
AND m.ID_MEMBER = $ID_MEMBER
AND ml.ID_MSG = t.ID_LAST_MSG
AND b.ID_BOARD = t.ID_BOARD
AND $query_this_board
AND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime", __FILE__, __LINE__);

Replace:
Code: [Select]
$request = db_query("
SELECT COUNT(DISTINCT t.ID_TOPIC)
FROM {$db_prefix}messages AS ml, {$db_prefix}topics AS t, {$db_prefix}boards AS b
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_MEMBER_UPDATED != $ID_MEMBER
AND t.ID_MEMBER_STARTED = $ID_MEMBER
AND ml.ID_MSG = t.ID_LAST_MSG
AND b.ID_BOARD = t.ID_BOARD
AND $query_this_board
AND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime", __FILE__, __LINE__);

Find:
Code: [Select]
$request = db_query("
SELECT DISTINCT t.ID_TOPIC
FROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml
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 = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}messages AS m ON (m.ID_TOPIC = t.ID_TOPIC)
WHERE t.ID_MEMBER_UPDATED != $ID_MEMBER
AND m.ID_MEMBER = $ID_MEMBER
AND ml.ID_MSG = t.ID_LAST_MSG
AND b.ID_BOARD = t.ID_BOARD
AND $query_this_board
AND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime
ORDER BY ml.ID_MSG DESC
LIMIT $_REQUEST[start], $modSettings[defaultMaxTopics]", __FILE__, __LINE__);

Replace:
Code: [Select]
$request = db_query("
SELECT DISTINCT t.ID_TOPIC
FROM {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ml
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 = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)
WHERE t.ID_MEMBER_UPDATED != $ID_MEMBER
AND t.ID_MEMBER_STARTED = $ID_MEMBER
AND ml.ID_MSG = t.ID_LAST_MSG
AND b.ID_BOARD = t.ID_BOARD
AND $query_this_board
AND IFNULL(lt.logTime, IFNULL(lmr.logTime, 0)) < ml.posterTime
ORDER BY ml.ID_MSG DESC
LIMIT $_REQUEST[start], $modSettings[defaultMaxTopics]", __FILE__, __LINE__);

-[Unknown]

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: Show unread topics for a specific board
« Reply #6 on: September 20, 2004, 05:10:24 AM »
That's fantastic [Unknown]   :D

Thanks for your help with that.

I'm pleased that I was on the right track with the
AND t.ID_MEMBER_STARTED = $ID_MEMBER
but it looks like I made the mistake of leaving in the original
AND m.ID_MEMBER = $ID_MEMBER
which presumably caused a conflict.
"Reality is merely an illusion, albeit a very persistent one." - A.E.


Offline mytreo

  • Jr. Member
  • **
  • Posts: 284
    • treo
Re: Show unread topics for a specific board
« Reply #7 on: January 03, 2005, 07:45:29 PM »
Ever wondered if you could show the unread topics in just one specific board? For example, maybe you marked some topic in SMF Coding Discussion unread, but you can't find it - you just know it's in there.

Well, it'd sure help to be able to show unread topics in that board, wouldn't it? You can! All you do is you take this:

http://www.simplemachines.org/community/index.php?action=unread

And then you add the board to it:

http://www.simplemachines.org/community/index.php?action=unread;board=60.0

But we're not done. You probably want "since all time", not "for a wee bit". So let's add all on there too:

http://www.simplemachines.org/community/index.php?action=unread;board=60.0;all

Nice, eh? Now you've got all the unread topics - in that board. This works if you're looking for unread topics you've posted in too, like so:

http://www.simplemachines.org/community/index.php?action=unreadreplies;board=60.0
(this doesn't need "all" ;).)

There's no interface for this, but that doesn't mean you can't make a theme that has one ;).

-[Unknown]

This is Brilliant [Unknown], really Brilliant!

But (oh no :) ), I discovered a problem maybe you can help fix please? When I view this link for example and there is more than 1 page of new replies, clicking the link to the next page in the [1] [2] [3] page menu doesn't keep the "board=4.0" in the URL and so it takes you to the ALL Unread replies page. Not so useful.

Thanks for reading, I hope someone can help
Chris
Treo forum - Powered by SMF, of course
Treo news - powered by MovableType and integrated with SMF
Treo downloads - hacked from phpNuke and integrated with SMF
Treo knowledge base - powered by Wikka and integrated with SMF
Treo 650 | Treo 700w | Treo 700p

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Show unread topics for a specific board
« Reply #8 on: January 03, 2005, 11:18:33 PM »
Darn, fixed...

-[Unknown]

Offline mytreo

  • Jr. Member
  • **
  • Posts: 284
    • treo
Re: Show unread topics for a specific board
« Reply #9 on: January 04, 2005, 06:35:16 AM »
Darn, fixed...

-[Unknown]

Great! This is an awesome built in feature. I intend to code this into our theme so that when there are new posts in a board you can click the "On.gif" icon on the board index to quickly view all unread from that board.
Treo forum - Powered by SMF, of course
Treo news - powered by MovableType and integrated with SMF
Treo downloads - hacked from phpNuke and integrated with SMF
Treo knowledge base - powered by Wikka and integrated with SMF
Treo 650 | Treo 700w | Treo 700p

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Show unread topics for a specific board
« Reply #10 on: January 04, 2005, 08:01:51 AM »
Great! This is an awesome built in feature. I intend to code this into our theme so that when there are new posts in a board you can click the "On.gif" icon on the board index to quickly view all unread from that board.

That's a great idea to implement it. :)
Cristián Lávaque http://cristianlavaque.com

Offline mytreo

  • Jr. Member
  • **
  • Posts: 284
    • treo
Re: Show unread topics for a specific board
« Reply #11 on: January 04, 2005, 08:45:11 AM »

That's a great idea to implement it. :)

Thanks I thought so too! :D :D
Treo forum - Powered by SMF, of course
Treo news - powered by MovableType and integrated with SMF
Treo downloads - hacked from phpNuke and integrated with SMF
Treo knowledge base - powered by Wikka and integrated with SMF
Treo 650 | Treo 700w | Treo 700p

Offline mytreo

  • Jr. Member
  • **
  • Posts: 284
    • treo
Re: Show unread topics for a specific board
« Reply #12 on: January 14, 2005, 06:13:36 AM »
Darn, fixed...

-[Unknown]

Hi [Unknown] I noticed this is fixed in v1.0.1 :D :D thank you, but unfortunately it revealed another tiny thing that needs your developer gun...

When there is more than one page of new topics on a specific board like in this link clicking to go to the next page has no effect, it's like it doesn't understand what to do with the start=xx. Could you let me know what changes to make please so that this works? Thank you! :)

On a related note, it would be nice if when board=xx is set the page <title> displayed "Board Name - All Unread Topics" intead of "All Unread Topics".

Cheers
Chris
« Last Edit: January 14, 2005, 06:17:47 AM by mytreo »
Treo forum - Powered by SMF, of course
Treo news - powered by MovableType and integrated with SMF
Treo downloads - hacked from phpNuke and integrated with SMF
Treo knowledge base - powered by Wikka and integrated with SMF
Treo 650 | Treo 700w | Treo 700p

Offline Cerberus

  • Jr. Member
  • **
  • Posts: 278
  • Gender: Male
    • My main site: Pocket PC Russia
Re: Show unread topics for a specific board
« Reply #13 on: May 28, 2005, 11:03:29 AM »
It would be nice to have a sort of dropdown menu with the list of the boards (like the jump to)
Best Regards, Cerberus
YaBB Gold -> YaBB 1.1 -> YaBB SE (YaPP -> PfaBB) -> SMF
Pocket PC Russia

bloc

  • Guest
Re: Show unread topics for a specific board
« Reply #14 on: May 28, 2005, 12:24:09 PM »
Yes, a dropdown menu could easily made when on frontpage, you could just traverse the boards info for that.

But 2 or 3 small icons instead would be cool..maybe put them in top right corner of board name/description, or even in a narrow single column to the right of the whole board-row. 

Offline forumite

  • Charter Member
  • Full Member
  • *
  • Posts: 408
    • The RV Forum
Re: Show unread topics for a specific board
« Reply #15 on: May 30, 2005, 08:52:54 PM »
I'm getting requests from folks who want to exclude one or more boards when they click show unread posts. Can this be done with some modification of the URL examples here or a code change?

TIA

Offline Ivan Minic

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
  • Owner: www.Burek.com
    • Burek Forum
Re: Show unread topics for a specific board
« Reply #16 on: June 27, 2005, 06:24:02 PM »
I'm getting requests from folks who want to exclude one or more boards when they click show unread posts. Can this be done with some modification of the URL examples here or a code change?

TIA
Need this badly too... but exclude it only in show unread posts, not as ignore forum mod does.
Maybe put a table with forums next to results in another column where you can click what to exclude od something like that...

Offline altdot

  • Semi-Newbie
  • *
  • Posts: 56
Re: Show unread topics for a specific board
« Reply #17 on: September 21, 2006, 09:49:18 PM »
Is there a way to show unread/recent topics per category instead of per board? Our forum has a pretty wide demographic, and members want to see everything in a category rather than everything in boards x, y, z.  (Like, "see all unread topics in SMF SUPPORT".) Right now, I've got hard-coded links that append the boards in the various categories, but that's a PITA to maintain when new sub-boards are created.

bloc

  • Guest
Re: Show unread topics for a specific board
« Reply #18 on: September 22, 2006, 10:37:24 AM »
Yes, it is. And its dead easy. The link is simply index.php?action=unread;c=2 where 2 is the id of the category.

Offline altdot

  • Semi-Newbie
  • *
  • Posts: 56
Re: Show unread topics for a specific board
« Reply #19 on: September 22, 2006, 01:10:04 PM »
Oh, excellent! What versions is that supported in?