In viewtopic_body.html, you wold use this if test:ulong wrote:When im viewing thread, and i see new posts and posts, which are already read, how to mark unread posts with something, for example text "this post is unread"?
I think i just need something like " <IF POST_UNREAD>this post is unread "or something like that
As I said in the very first post in this topic (and repeated many times throughout this thread):ulong wrote:And is it possible to show number of unread posts?
For example "You have [xx] unread posts"
The code this mod uses to figure out if there are unread posts is from phpbb3's core code in functions_display(). It is quite efficient and should not weigh down a board. If you change the code to count topics that have unread posts in them, that will begin to weigh down large boards (and may confuse people because the number of topics with unread posts is different from the number of unread posts). And if you change the code to count unread posts (rather than just topics that have unread posts), I suspect that will substantially weigh down boards (perhaps enough to be noticeable on boards that aren't that big). I don't think the overhead is worth it, and as a result I don't plan to add that feature.
However, anyone who wants to write the code is free to do that and post it here for people to try (I don't think it would be that hard if you know your way around php and mysql).
its working nice!asinshesq wrote:In viewtopic_body.html, you wold use this if test:ulong wrote:When im viewing thread, and i see new posts and posts, which are already read, how to mark unread posts with something, for example text "this post is unread"?
I think i just need something like " <IF POST_UNREAD>this post is unread "or something like that
<!-- IF postrow.S_UNREAD_POST --><!-- ENDIF -->
So if you want to hard-code "this post is unread" in there and don't feel like doing it the normal phpbb3 way where phrases get put into a language file, you could do something like this:
<!-- IF postrow.S_UNREAD_POST -->this post is unread<!-- ENDIF -->
The rest of the html to control font size, color, placement, etc. is up to you.
<!-- ELSEIF S_USER_UNREAD_PRIVMSG -->ulong wrote:its working nice!asinshesq wrote:In viewtopic_body.html, you wold use this if test:ulong wrote:When im viewing thread, and i see new posts and posts, which are already read, how to mark unread posts with something, for example text "this post is unread"?
I think i just need something like " <IF POST_UNREAD>this post is unread "or something like that
<!-- IF postrow.S_UNREAD_POST --><!-- ENDIF -->
So if you want to hard-code "this post is unread" in there and don't feel like doing it the normal phpbb3 way where phrases get put into a language file, you could do something like this:
<!-- IF postrow.S_UNREAD_POST -->this post is unread<!-- ENDIF -->
The rest of the html to control font size, color, placement, etc. is up to you.
Thank you
Do u know any else IF, which is checking if there are new private messages?
IF unread private message THEN blabla
Code: Select all
$sql = 'SELECT COUNT(post_id) as count
FROM ' . POSTS_TABLE . '
WHERE post_time > ' . $user->data['user_lastvisit'] . '
AND poster_id != ' . $user->data['user_id'];
$result = $db->sql_query($sql);
$post_count = $db->sql_fetchfield('count', false, $result);
$db->sql_freeresult($result);
It's the entry in the users table called 'user_unread_privmsg', so you never need to do a sql query for it. Instead, just use $user->data['user_unread_privmsg']. But note that there is already a message that overall_header.php sends to the template that includes the number of unread pms. That message gets assigned in functions.php and is in {PRIVATE_MESSAGE_INFO_UNREAD}ulong wrote:where can i find in database unread posts?