1
alandail
module not supporting who's online?
  • 2006/6/2 3:37

  • alandail

  • Just popping in

  • Posts: 94

  • Since: 2006/4/18


I wrote a custom module for my site and I've noticed that who's online never shows who's browsing in my module. What have I done wrong? I suspect it's something simple I need to set, but I am not quite sure what it would be.

Any help in solving this would be much appreciated.

2
snow77
Re: module not supporting who's online?
  • 2006/6/2 4:18

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


Have you checked if in administration menu > system > blocks >

edit on the who's online block, your module is selected having view permissions?

3
alandail
Re: module not supporting who's online?
  • 2006/6/2 4:46

  • alandail

  • Just popping in

  • Posts: 94

  • Since: 2006/4/18


Either I'm in the wrong place or I didn't explain it well.

I can see the who's online block everywhere. What I can't see is who's currently online inside my module. I can see when they go to other modules, but not when they go in the one I wrote.

4
Quest
Re: module not supporting who's online?
  • 2006/6/2 4:54

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


I can understand clearly what you are saying. So let me ask again. What version of XOOPS are you running? What did you use to create the module? Or. Did you hard code it yourself? If, and I am only playing with an if here- based on the information you provided. If you created/hard coded it yourself then you probably left out some important coding.
But I nor anyone else would or could know that with what you have provided.
So.
You could go to the module repository and choose one of the content modules or you could do a search for something called mypage and use the module creation templated file and add your code to it following all the instructions. Then your who's online should respond accordingly.

You can also check the F.A.Q.s
You can also check the Documentation.

Links are on the left in Main Menu.

Regards
Quest

5
alandail
Re: module not supporting who's online?
  • 2006/6/2 5:34

  • alandail

  • Just popping in

  • Posts: 94

  • Since: 2006/4/18


I hard coded the module myself and am using XOOPS 2.0.13 - the online records are not being written to the database when someone is in my module.

6
McNaz
Re: module not supporting who's online?
  • 2006/6/2 7:15

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


This doesn't happen automagically and you have to code this feature into your module.

7
alandail
Re: module not supporting who's online?
  • 2006/6/2 11:48

  • alandail

  • Just popping in

  • Posts: 94

  • Since: 2006/4/18


how do you do that? I've looked at some other modules and don't see where it's done. I would have thought if it required code it would be in the module's header.php file.

8
snow77
Re: module not supporting who's online?
  • 2006/6/2 13:58

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


I know nothing of coding, but I have before included an iframe inside XOOPS calling an external application and made it behave as a module so I could add group permissions to access this page and add some XOOPS blocks to it. It's a messy way to do it but I got it done by putting the folder inside the modules directory with 2 files in it: index.php and xoops_version.php, and an icon too like the module icons on left of the admin side. I don't know if this is of any help but the xoops_version.php contents of this thing I do is like this:

Quote:

$modversion['name'] = "YourModuleName";
$modversion['version'] = "Version 1.0";
$modversion['description'] = "Module description";
$modversion['credits'] = "Crédits";
$modversion['author'] = "Module author";
$modversion['help'] = "archivo de ayuda, de existir alguno";
$modversion['license'] = "GPL see LICENSE";
$modversion['official'] = 0;
$modversion['image'] = "logosm.png";
$modversion['dirname'] = "ads";

$modversion['hasMain'] = 1;
$modversion['hasAdmin'] = 1;
// Menu$modversion['hasMain'] = 1;?>


and the index.php which makes the iframe is like this:

Quote:

include("../../mainfile.php");
include("../../header.php");
include("header.php");
OpenTable();
?>

Inicio |



CloseTable();
include ("../../footer.php");
?>

9
alandail
Re: module not supporting who's online?
  • 2006/6/3 15:48

  • alandail

  • Just popping in

  • Posts: 94

  • Since: 2006/4/18


I seem to be doing everything right but it's not working. Is there a call I can just make to force the online data to be updated for the user who has opened the page?

10
alandail
Re: module not supporting who's online?
  • 2006/6/4 2:02

  • alandail

  • Just popping in

  • Posts: 94

  • Since: 2006/4/18


I hard coded a solution. I put this in the header file for my module (not the main XOOPS header)

$onlinehandler =& xoops_gethandler('online');
if ($onlinehandler)
{
if (is_object($xoopsUser)) {
$uid = $xoopsUser->getVar('uid');
$uname = $xoopsUser->getVar('uname');
$name = $xoopsUser->getVar('name');
} else {
$uid = 0;
$uname = '';
$name = '';
}
$onlinehandler->write($uid, $uname, time(), 12, $_SERVER['REMOTE_ADDR']);
}

Login

Who's Online

361 user(s) are online (188 user(s) are browsing Support Forums)


Members: 0


Guests: 361


more...

Donat-O-Meter

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

Latest GitHub Commits