1
arlindo
Module developmant - Documentation or Info
  • 2008/9/8 10:08

  • arlindo

  • Just popping in

  • Posts: 23

  • Since: 2007/10/9


Hi there,

I am one active user of xoops, but i use only existing and some litle changed modules.

I Wold like to enter into one deep level of developmant, but i cannot find very documentation or info. For example "http://devteam.xoops.org/" is down.

Where can i find a list of options for here:
$modversion['xxxxxx']....
All the already available core 'functions', 'variavels' or 'classes' ?

If i needed to show the actual loged user email or name or ID? , is there any already active variavel or function that i can use instead of havind to make sql independent querys??


Thanks for the help in advance! XOOPS is Great!!

2
ghia
Re: Module developmant - Documentation or Info
  • 2008/9/8 10:24

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Are you looking for the API?

3
trabis
Re: Module developmant - Documentation or Info
  • 2008/9/8 11:15

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

arlindo wrote:

If i needed to show the actual loged user email or name or ID? , is there any already active variavel or function that i can use instead of havind to make sql independent querys??



You can use the 'online' handler to ger all logged users
Example:
$online_handler =& xoops_gethandler('online');
$onlines =& $online_handler->getAll();
foreach (
$onlines as $online) {
   echo 
$online['online_uid'].' - '.$online['online_uname'].';
}


Or get info about the current user
echo $xoopsUser->getVar('uid').' - '.$xoopsUser->getVar('uname');

4
trabis
Re: Module developmant - Documentation or Info
  • 2008/9/8 12:12

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1



5
dslchart
Re: Module developmant - Documentation or Info
  • 2008/9/8 14:25

  • dslchart

  • Not too shy to talk

  • Posts: 112

  • Since: 2008/9/7 1


thanks for this helpful link.

6
arlindo
Re: Module developmant - Documentation or Info
  • 2008/9/8 14:39

  • arlindo

  • Just popping in

  • Posts: 23

  • Since: 2007/10/9


Hi.

All good things!!

Greate resource link Travis. (Obrigado!)

Arlindo

7
hervet
Re: Module developmant - Documentation or Info
  • 2008/9/8 15:49

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Quote:

trabis wrote:
You can use the 'online' handler to ger all logged users

I believe that it will "run" only if the block is visible.

8
blindman
Re: Module developmant - Documentation or Info
  • 2008/9/8 18:14

  • blindman

  • Not too shy to talk

  • Posts: 119

  • Since: 2005/6/26


trabis, this is great resource link. I asked for a zone with some kind if tutorials for using XOOPS classes and handlers. This is what I was looking for.
Don't follow me. I'm lost too.

9
trabis
Re: Module developmant - Documentation or Info
  • 2008/9/8 18:25

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


You have to thank Irmtfan for that.

It is kind of lost in the wiki confusion is not it?
This is so useful that it deserves a direct link in front page.

10
trabis
Re: Module developmant - Documentation or Info
  • 2008/9/8 18:33

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

hervet wrote:
Quote:

trabis wrote:
You can use the 'online' handler to ger all logged users

I believe that it will "run" only if the block is visible.


I guess you we need to have the "who´s online block"(or similar) visible so it keeps database updated.

This would update the table
/*global $xoopsUser, $xoopsModule, $_SERVER;*/

    
$online_handler =& xoops_gethandler('online');

    
mt_srand((double)microtime()*1000000);
    
// set gc probabillity to 10% for now..
    
if (mt_rand(1100) < 70) {
        
$online_handler->gc(300);
    }
    if (
is_object($xoopsUser)) {
        
$uid $xoopsUser->getVar('uid');
        
$uname $xoopsUser->getVar('uname');
    } else {
        
$uid 0;
        
$uname '';
    }
    if (
is_object($xoopsModule)) {
        
$online_handler->write($uid$unametime(), $xoopsModule->getVar('mid'), $_SERVER['REMOTE_ADDR']);
    } else {
        
$online_handler->write($uid$unametime(), 0$_SERVER['REMOTE_ADDR']);
    }

Login

Who's Online

407 user(s) are online (315 user(s) are browsing Support Forums)


Members: 0


Guests: 407


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