toivo blog web and other experiments
  • joomla
    • Fetching User Custom Fields in Joomla 4
    • Updating articles by deleted authors
    • how to list users with custom fields
    • finding the origin of cryptic messages
    • careful with uninstall
    • adding time to logged-In users
  • smtp in joomla
    • troubleshooting smtp connection
    • gmail as smtp host in joomla
  • hiking
    • viking way part 1
    • viking way part 2

Adding Time to Logged-In Users

The Joomla 3.x Control Panel shows a list of users who were active at the site, at the front end or the back end.  

logged in before

The data is displayed by a module called Logged-in Users.  In previous versions of Joomla the time of the last activity was also displayed for each user, which was useful.  In version 3.x only the date is included.  If you want to add the time back to the listing, it can be done easily in a template override.  Here are brief instructions how to do that in Joomla 3.4.3, using the Isis administration template.

Copy the file administrator/modules/mod_logged/tmpl/default.php to administrator/templates/isis/html/mod_logged and edit line 44 there:
 
<span class="icon-calendar"></span> <?php echo JHtml::_('date', $user->time, JText::_('DATE_FORMAT_LC4')); ?>
 
Replace with this version:
 
<span class="icon-calendar"></span> <?php echo JHtml::_('date', $user->time, 'Y-m-d H:i'); ?>
 
logged in after
 

If you do not want to hard code the date & time format into the layout, you can define your own format as a language constant in the Language Manager - Overrides.

Subsequent Joomla updates will not overwrite the override code but you need to maintain it, should something change in the core code.

Details
Toivo Talikka logo
Joomla
10 July 2015
Hits: 11026
joomla
Read more: Adding Time to Logged-In Users
Page 2 of 2
  • Start
  • Prev
  • 1
  • 2
  • Next
  • End