News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Check if a user has ever read a topic?

Started by samborabora, May 27, 2015, 08:17:35 AM

Previous topic - Next topic

samborabora

I need to check if a topic has been read by the user at any point, not unread posts, but if they have actually ever clicked on it. $topic['new'] isn't quite the same, as that is unread new posts, period, but I need to see if the user has ever actually clicked on the thread. Is there a variable?

Kindred

no...   and actually, there is no way to track this at all with any accuracy....   because the user COULD just click "mark all unread as read" and it would be marked, as if the user had read it.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Pipke

Topic view log, althought the mod is deleted you could get more info by visiting SMFSimple.com
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

samborabora

Quote from: Kindred on May 27, 2015, 08:37:51 AM
no...   and actually, there is no way to track this at all with any accuracy....   because the user COULD just click "mark all unread as read" and it would be marked, as if the user had read it.

I haven't got "mark all unread as read" avilable from MessageIndex any more, so any interaction the user would have with the thread would count as a view, which is what I am interested in. Basically, if the user clicks on the topic at all, I want it to count as having viewed the topic. Is there no built in functionality that would cover this?

Quote from: Pipke on May 27, 2015, 09:47:29 AM
Topic view log, althought the mod is deleted you could get more info by visiting SMFSimple.com

Looks interesting, I guess it could be done by using this mod and just checking if the topic view count for the user was >1?

Illori

did you make it so that they can not manually build the url that is behind the mark all as read action and make it work anyway? some that really want to may find a way.

samborabora

Quote from: Illori on May 27, 2015, 10:14:04 AM
did you make it so that they can not manually build the url that is behind the mark all as read action and make it work anyway? some that really want to may find a way.

It's not a problem if they could, I'm trying to hide the "unread new posts" link on MessageIndex to anyone who hasn't engaged the thread by reading it once, if they have read it, the "unread new posts" link will appear for all topics the user has read, rather than just a bunch of "unread new post" links next to topics they wouldn't be interested in.

Kindred

you know, if you are trying to make sure that users read a specific topic, there is a mod to do that...

http://custom.simplemachines.org/mods/index.php?mod=1364


or force them to read the sticky topics before posting?
http://custom.simplemachines.org/mods/index.php?mod=1847
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

samborabora

Quote from: Kindred on May 27, 2015, 10:44:55 AM
you know, if you are trying to make sure that users read a specific topic, there is a mod to do that...

http://custom.simplemachines.org/mods/index.php?mod=1364


or force them to read the sticky topics before posting?
http://custom.simplemachines.org/mods/index.php?mod=1847

No, I'm making sure that users don't see an unread new posts link on messageindex for topics they haven't read yet. Any topcis they haven't read won't have an unread new posts link since they haven't clicked on it before.

Burke ♞ Knight

Though you can force people to a post, there is not any real way to force people to actually READ the post. ;)

samborabora

Quote from: Burke ♞ Knight on May 27, 2015, 11:13:46 AM
Though you can force people to a post, there is not any real way to force people to actually READ the post. ;)

I'm not forcing people to read anything. I'm trying to check every thread if the user has read it or not. If they have read it, and there is an unread post on the topic, an "unread" post link will appear. If they haven't read it and there are unread posts, there will not be an unread post link.

I'm not sure where this idea about forced posting and reading came from?

Burke ♞ Knight

Then I really do not see your point of this.
Either you want to force someone to read a post, like it seemed you wanted until now, or you want to spy on your users, trying to find out which posts they have read. What the heck difference is it, if they read a topic, or marked it as read?

When I'm on a forum, I only read posts that interest me. Like here, I have no interest in reading on the other language boards, since I can't. So why should I be forced to read the posts I do not, just because an admin wants to disable mark as read, and have everyone read every post. That's forcing people, in my opinion. And that is how your posts feel like you want.

Now your last post, is full of inaccuracies:

"If they have read it, and there is an unread post on the topic, an "unread" post link will appear."

If they read the topic and there was unread, then after they read the topic and the latest post is on the page they are, it will be seen as read. However, if they read and a post pops up after, or on another page, then it will not be listed as read. That is why sometimes, have to be careful when reading topics, the pages can get you! LOL

"If they haven't read it and there are unread posts, there will not be an unread post link."

If they have not read a topic, or marked it read, any post to that topic will be seen as UNREAD.


It seems to me, you are trying to remove Unread Posts links. Why?

Quote from: samborabora on May 27, 2015, 11:07:55 AMNo, I'm making sure that users don't see an unread new posts link on messageindex for topics they haven't read yet. Any topcis they haven't read won't have an unread new posts link since they haven't clicked on it before.

I just do not understand why you'd not want them to know and see list of unread posts. This really goes against the ways forums run. New posts are meant to be shown well, as NEW.

samborabora

Spy? It's not about not wanting them to see unread posts, it's about not needing them to see a link on the message index to unread posts to topics they would not have interest in.

Let's say, I have only clicked on topic 2 as I was only interested in reading it:

+ Topic 1 |
+ Topic 2 | Unread Posts
+ Topic 3 |
+ Topic 4 |

That's what would appear, the other three, whether or not they have unread posts to the user, would appear as such without the Unread Posts text as the topic had never been clicked on by the user.

Burke ♞ Knight

There would be no way to do that, and if there was, would be very server heavy.
The calls to the database alone to check every topic for every user, to see if they have or have not read it, would put a huge strain on any server.

Also, I have no idea, where you'd get that info from anyway. Sure, you can block mark as read, but you can't block people just clicking the topic and immediately closing it, just to get it marked as read. (I've known people to do that.)

samborabora

Quote from: Burke ♞ Knight on May 27, 2015, 12:47:52 PM
There would be no way to do that, and if there was, would be very server heavy.
The calls to the database alone to check every topic for every user, to see if they have or have not read it, would put a huge strain on any server.

Also, I have no idea, where you'd get that info from anyway. Sure, you can block mark as read, but you can't block people just clicking the topic and immediately closing it, just to get it marked as read. (I've known people to do that.)

Err, im not blocking mark as read. I'm not blocking a thing at all. They absolutely can do that if they want, i mean, they can do anything they want, I'm not blocking anything, i just dont have marked as read on the message index.

As for server heavy, yeah, exactly like how much fun it is for the server to load every unread message for every topic the user has or has not seen. The messageindex is a serverfest for checking things, and I only need to load if the user has or hasn't read the topic in their life at all.

margarett

You can try to check your table smf_log_topics. You should be able to find when a certain user (id_member) checked a certain topic (id_topic), and even a message inside that post (id_msg)

The "glitch" is exactly id_msg. It only stores either the "new" (if you follow the #new link) or the last post in page, not all the posts in between.
If your topic only has 1 post (eg: rules), this should be a good confirmation. If not, you need to apply further logics (and queries) to determine if the topic you want is or is not between the information which is stored...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

Quote from: samborabora on May 27, 2015, 12:59:22 PM
As for server heavy, yeah, exactly like how much fun it is for the server to load every unread message for every topic the user has or has not seen. The messageindex is a serverfest for checking things, and I only need to load if the user has or hasn't read the topic in their life at all.

ummm... no..... now you need to check every single message *AND* perform logic on it.  Basically, you have added at least another 50% to your server load to do what you are asking.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

samborabora

Quote from: margarett on May 27, 2015, 01:05:42 PM
You can try to check your table smf_log_topics. You should be able to find when a certain user (id_member) checked a certain topic (id_topic), and even a message inside that post (id_msg)

The "glitch" is exactly id_msg. It only stores either the "new" (if you follow the #new link) or the last post in page, not all the posts in between.
If your topic only has 1 post (eg: rules), this should be a good confirmation. If not, you need to apply further logics (and queries) to determine if the topic you want is or is not between the information which is stored...

I just need to know if the topic has ever been read or not, would id_topic be empty if it has never been read, do you think? If so, will I need to have new sql markup for retrieving this, or is there a variable already that could handle this?

Quote from: Kindred on May 27, 2015, 02:01:56 PM
ummm... no..... now you need to check every single message *AND* perform logic on it.  Basically, you have added at least another 50% to your server load to do what you are asking.
Well, it's just a simple check if or not to show a link, not gonna break the bank.

Kindred

well, for one...   the system already performs part of what you are asking.... in your description, you are essentially doing exactly what the <NEW> icon already DOES...

When you start adding things to it is when it beomces more expensive...   you ONLY want to show the "read unread" link when a user HAS unread posts?   
That query alone is one of THE MOST EXPENSIVE queries in the entire system....   and you want to do that query on EVERY page?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Burke ♞ Knight

Quote from: samborabora on May 27, 2015, 12:59:22 PMErr, im not blocking mark as read. I'm not blocking a thing at all. They absolutely can do that if they want, i mean, they can do anything they want, I'm not blocking anything, i just dont have marked as read on the message index.

Really? Sure looks like you said earlier, that you were.

Quote from: samborabora on May 27, 2015, 10:08:56 AM
I haven't got "mark all unread as read" avilable from MessageIndex any more, so any interaction the user would have with the thread would count as a view, which is what I am interested in. Basically, if the user clicks on the topic at all, I want it to count as having viewed the topic. Is there no built in functionality that would cover this?

margarett

It's not that simple...
If $context['topics'][topic_id_here]['new'] then the topic *has unseen messages*. But the user might have visited the topic already, yet new replies were posted after his last visit.

So I guess that you do need to perform a new check, yes. Potentially an expensive one, as it requires a COUNT of id_topic WHERE id_topic = xxx AND id_member = your_member
If count is 0, then the topic as a whole was never seen by said user.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: