MyBB Community Forums

Full Version: Add $lastactive value of specific one fixed user in a template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I've solved this case shortly after posting the thread so this is an edited version of OP Toungue

I have a special user on my board and people would like to have his lastvisit/lastactive date/time seen on all forum pages.
On my forum I've added this info to header_welcomeblock_member template.

You might need PHP and Template Conditionals  to run this. I've added those lines in my subnav.

<?php

global $db;

$query = $db->simple_select("users", "*",
"uid=THE FIXED USER ID NUMBER");

$lastactive = $db->fetch_field($query, "lastactive");
echo gmdate("H:i , d-m-Y", $lastactive); 
//OUTPUT:  10:13 , 10-07-2015
?>