By seehui on
I want to show the user a list of contents created since his last login. Is that possible?
If it is possible, I would like to show the list of events created after his last login.
I want to show the user a list of contents created since his last login. Is that possible?
If it is possible, I would like to show the list of events created after his last login.
Comments
The node creation time is
The node creation time is saved into the database, as is the users last login. All you have to do is run a query on nodes that have been created since the last login time.
Contact me to contract me for D7 -> D10/11 migrations.
I'm weak in query. If you
I'm weak in query. If you don't mind, can you help me with the query?
<?phpglobal $user;$new_nodes
Something like that (untested).
Contact me to contract me for D7 -> D10/11 migrations.
It turn out to be the last
It turn out to be the last access time is the time when I login now. Lets say my last login is yesterday, so it should appear as nodes created since last day. But it shows nodes created after my login now. It tooks the time I login now. I think it is because the database table was updated once i login.
Ahh of course. That makes
Ahh of course. That makes sense. You probably need to use hook_user and add a value to the user when they login, showing their last login time.
I don't really have time to put that together now though.
Contact me to contract me for D7 -> D10/11 migrations.
Never mind. At least I
Never mind. At least I figured out how it works. Thanks.
Great thanks to Jay
Great thanks to Jay Matwichuk, I read your post, and some other posts in the forum, and finally get it.
My steps are: create another table in database, so when user logout, the logout date and time is stored. Then call the query (provided by Jay Matwichuk), and it works.
For those who may want to have a page or block to show new contents since last login, here are the reference that I found useful.
http://drupal.org/node/409808
http://drupal.org/node/24690
Great idea... any code ? please
it should be great if you share your code or if you know if a module do the same thing. thx