Couple usage examples for that Textpattern plugin

Written 22.07.2016 at 17:09

A few days ago I released a small and simple Textpattern plugin with perhaps needlessly complex name: kuo_user_last_action. It records to a database table what action and currently logged in used did for the last time. So the plugin is simple loaded when a page is loaded, then a database query is made. It doesn’t do anything else, it just logs data. Here are couple PHP code examples that uses that data.

Timestamp of last activity

If for some reason it’s wanted to show date and time to user when that user’s activity was logged for the last time, then this code could be used:

Detect inactive users

A bit more useful code is this below. It lists all those users whose activity has been logged with kuo_user_last_action, but who haven’t had any activity in the previous six months. With this block of code an administrator of website could, for example, send a notification email or a newsletter to those users inviting them to visit the site.

"Couple usage examples for that Textpattern plugin" is rated 7 out of 10. That rating was formed of 2 vote(s). Kuopassa.net´s blog includes a total of 1248 posts including this one. If you´d like to link to this page from a blog or a forum, please use this permalink. Tag or tags: textpattern.