1
xpider
users online variable?
  • 2005/4/26 17:35

  • xpider

  • Not too shy to talk

  • Posts: 150

  • Since: 2004/5/9 2


Quick question... I'm creating a new theme and would like to put users online in the header. Is there a simple users online variable that i can call on and put in to acheive this? One that is simple from the core of XOOPS and doesn't need any special modules or files?

Thanks for any help... =)

2
xpider
Re: users online variable?
  • 2005/4/26 23:41

  • xpider

  • Not too shy to talk

  • Posts: 150

  • Since: 2004/5/9 2


I assume that's a no? Any Ideas at all?

3
xpider
Re: users online variable?
  • 2005/4/29 19:17

  • xpider

  • Not too shy to talk

  • Posts: 150

  • Since: 2004/5/9 2


One last bump... Anyone have a way I can do this =)

4
ackbarr
Re: users online variable?

no there isn't a smarty variable that holds this. If you are not faint of heart, I'd recommend looking into the code that creates the Who's Online block and putting a modified version of that code into a smarty <{php}> block. The code to create this block lives in the function b_system_online_show() in the file /modules/system/blocks/system_blocks.php

5
-DJNZ-
Re: users online variable?
  • 2005/4/29 21:36

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


The number of users online is not generated by the core but you can use the code that the Users Online system block uses to generate it. This is a bit hacky and will give you more than you want, but in your template file try the following:
<{php}>
include_once 
'/path/to/xoops/modules/system/blocks/system_blocks.php';
$this->assign('users_online'b_system_online_show());
<{/
php}>
<{
$users_online.online_total}>

6
-DJNZ-
Re: users online variable?
  • 2005/4/29 21:38

  • -DJNZ-

  • Just popping in

  • Posts: 30

  • Since: 2005/1/11


LOL answers are like buses - nothing for ages and then three all at once. There will be another one in a minute I bet.

7
ackbarr
Re: users online variable?

DJNZ - that's actually a pretty inventive way of getting block information into a global smarty variable. You're right it is a bit hacky and returns much more than what he wants, but not a bad solution at all.

Login

Who's Online

190 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 190


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits