Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Total time logged in

Aloittaja Scferg, toukokuu 30, 2008, 10:58:49 IP

« edellinen - seuraava »

Scferg

I've been wanting to add something like:

Total time logged in: 7 days, 12 hours and 55 minutes.

...just like it shows in the user stats page. I looked for the code that resulted in the total time logged in, which is
$context['time_logged_in'], '

But when I put that code on my index.template.php, it doesn't do anything. I've also tried
$user['time_logged_in'], '
and
$context['user']['time_logged_in'], '

...but still nothing happens.

Any idea on how to get it working?

Mturco11x

Want to post your code? Are you trying to add this line to a file outside the forum? Is so, are you hooking up with SSI.php correctly? If this is in a function, did you global the $context array?

- Matt

Scferg

No, I'm trying to add it to my SMF theme's index.template.php file. My theme only has an index.template.php and a boardindex.template.php file. The rest,  it uses the files from the default SMF theme.

Advertisement: