Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Description
This module writes the current timestamp value, per user, to the users_data
table everytime hook_preprocess_page()
is called.
This is a utility module intended for use with other modules. If you want or need a current timestamp written everytime a page is loaded per unique User ID, use this module.
Details
users_data
row is written as:
function HOOK_preprocess_page() {
\Drupal::service('user.data')
->set('page_access_user_data_timestamp', $UID, 'access_timestamp', time());
}
and can be accessed by:
function MYMODULE_getUserData() {
return \Drupal::service('user.data');
}
function MYMODULE_preprocess_hook() {
$paudt_Timestamp = MYMODULE_getUserData()
->get('page_access_user_data_timestamp', $UID, 'access_timestamp');
}
Example Module Use
User Active Indicator uses this module to show an active mark and timestamp next to user names.
Project information
- Unsupported
Not supported (i.e. abandoned), and no longer being developed. Learn more about dealing with unsupported (abandoned) projects - No further development
No longer developed by its maintainers. - Module categories: Developer Tools
- Created by prestosaurus on , updated
- Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.