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.
visit my sites
http://www.cavsworld.com
http://www.cafeshopper.com
http://celebrity.cafeshopper.com
http://www.1sies.com

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?
www.polymorphee.com
www.xoopsdesign.com

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.
visit my sites
http://www.cavsworld.com
http://www.cafeshopper.com
http://celebrity.cafeshopper.com
http://www.1sies.com

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.
visit my sites
http://www.cavsworld.com
http://www.cafeshopper.com
http://celebrity.cafeshopper.com
http://www.1sies.com

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.
visit my sites
http://www.cavsworld.com
http://www.cafeshopper.com
http://celebrity.cafeshopper.com
http://www.1sies.com

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:

<?php
$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:

<?php
include("../../mainfile.php");
include("../../header.php");
include("header.php");
OpenTable();
?>
<!--CHANGE LINKS BELOW TO YOUR OWN-->
<a href="javascript:jumpto('http://myurl.com/ads')">Inicio</a> |


<script language="javascript">
<!--

//Drop-down Document Viewer II- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visithttp://www.dynamicdrive.com

//Specify display mode (0 or 1)
//0 causes document to be displayed in an inline frame, while 1 in a new browser window
var displaymode=0
//if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
var iframecode='<iframe id="external" style="width:100%;height:1200px" src="http://myurl.com/ads"></iframe>'

/////NO NEED TO EDIT BELOW HERE////////////

if (displaymode==0)
document.write(iframecode)

function jumpto(inputurl){
if (document.getElementById&&displaymode==0)
document.getElementById("external").src=inputurl
else if (document.all&&displaymode==0)
document.all.external.src=inputurl
else{
if (!window.win10||win10.closed)
win10=window.open(inputurl)
//else if win2 already exists
else{
win10.location=inputurl
win10.focus()
}
}
}
//-->
</script>
<?
CloseTable();
include ("../../footer.php");
?>
www.polymorphee.com
www.xoopsdesign.com

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?
visit my sites
http://www.cavsworld.com
http://www.cafeshopper.com
http://celebrity.cafeshopper.com
http://www.1sies.com

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']);
}
visit my sites
http://www.cavsworld.com
http://www.cafeshopper.com
http://celebrity.cafeshopper.com
http://www.1sies.com

Login

Who's Online

127 user(s) are online (86 user(s) are browsing Support Forums)


Members: 0


Guests: 127


more...

Donat-O-Meter

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

Latest GitHub Commits