Skip to main content
Topic: Numbers of new posts inside a board (Read 3952 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Numbers of new posts inside a board

You use these fascinating numbers for likes, new messages and new mentions (see screenshot 1). I really love them!  :)

Question is: Is it possible to use such a system in the forum or board indexes, when new posts inside boards are published?

I think it would look awesome. It would be very easy to catch too. I made a second screenshot what it could look like.  O:-)

Plus I could use fontawesome icons from here (to show which boards are for what topics: announcements with an "!"-icon, FAQs with an "?"-icon, etc.) without worrying about how they must change their color when new posts are made inside the boards. The icons could show the number of the new posts, that would be all. Easy!

Is there any chance to get this to work?  O:-)

Re: Numbers of new posts inside a board

Reply #1

That would be an interesting option. Unfortunately (you guessed it was coming, right? :P), I'm quite sure the number of unread topics for each member in each board is not tracked anywhere, so in order to display it it would require... at the moment I don't know, I should try. lol
Bugs creator.
Features destroyer.
Template killer.


Re: Numbers of new posts inside a board

Reply #3

Would need to make sure it would not be too much of a load on server resources, too.

Re: Numbers of new posts inside a board

Reply #4

Hm, does this need much more ressources than we use for counting the new posts when a user is looking at the list of new posts or new answers? We do count new mentions and messages, is this much less work for the server? Have no idea about these things.  :-[

It would be so great to show a number of new posts per board in the index. Think about the possibilities: A user knows which board is used more frequently then the other boards. He knows where to find a lot of new threads or posts and can visit this board first, because it seems the most interesting one. A lot of improvements in my opinion.

I would give it a try if it is not too much work to get a test board live.

Re: Numbers of new posts inside a board

Reply #5

At least this would hopefully fix the current state of not even correctly listing which boards have new posts.

Re: Numbers of new posts inside a board

Reply #6

I had posted a mod link about the issue mentioned by scripple... Besides I think it'd be quite a nasty load for the server to implement such a thing, but of course emanuele knows better ;)
~ SimplePortal Support Team ~

Re: Numbers of new posts inside a board

Reply #7

Nice idea ! 

Be interesting to see how much of an impact the query(s) would have, 


Re: Numbers of new posts inside a board

Reply #9

Quote from: Burke Knight –
Quote from: Flavio93Zena – I had posted a mod link about the issue mentioned by scripple...
Um, where???
http://www.elkarte.net/community/index.php?topic=2653.msg18204#msg18204 I might have been wrong though, since nobody replied, lol.
~ SimplePortal Support Team ~


Re: Numbers of new posts inside a board

Reply #11

Yeah but the coding shouldn't be much different :)
~ SimplePortal Support Team ~

Re: Numbers of new posts inside a board

Reply #12

I see it as needing a modified version of https://github.com/elkarte/Elkarte/blob/development/sources/subs/Unread.class.php#L258 with COUNT(*) instead of all of the other stuff and a GROUP BY id_board. That is a lot of query for the boardindex.

It would be cool though.

One question: is that posts or topics?

Pretty much something along these lines:
Code: [Select]
		$request = $this->_db->query('substring', '
SELECT
COUNT(*)
FROM {db_prefix}messages AS ms
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = ms.id_topic AND t.id_first_msg = ms.id_msg)
INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)' . ($join == 'topics' ? '
LEFT JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)' : '
LEFT JOIN {db_prefix}boards AS b ON (b.id_board = ms.id_board)') . '
LEFT JOIN {db_prefix}members AS mems ON (mems.id_member = ms.id_member)
LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member)' . ($this->_have_temp_table ? '
LEFT JOIN {db_prefix}log_topics_unread AS lt ON (lt.id_topic = t.id_topic)' : '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})') . (!empty($custom_joins) ? implode("\n\t\t\t\t", $custom_joins) : '') . '
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = t.id_board AND lmr.id_member = {int:current_member})
WHERE t.id_board IN ({array_int:boards})
AND t.id_last_msg >= {int:min_message}
AND IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) < ml.id_msg' .
($this->_post_mod ? ' AND ms.approved = {int:is_approved}' : '') .
($this->_unwatch ? ' AND IFNULL(lt.unwatched, 0) != 1' : '') . '
GROUP BY t.id_board
array_merge($this->_query_parameters, array(
'current_member' => $this->_user_id,
'min_message' => $this->_min_message,
'is_approved' => 1,
))
);