Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: Scferg - toukokuu 30, 2008, 10:58:49 IP

Otsikko: Total time logged in
Kirjoitti: Scferg - toukokuu 30, 2008, 10:58:49 IP
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?
Otsikko: Re: Total time logged in
Kirjoitti: Mturco11x - toukokuu 31, 2008, 12:40:53 AP
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
Otsikko: Re: Total time logged in
Kirjoitti: Scferg - toukokuu 31, 2008, 12:50:32 AP
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.