1
CCV_Pinto
Mod at xmemberstats
  • 2006/2/15 21:21

  • CCV_Pinto

  • Just popping in

  • Posts: 5

  • Since: 2005/11/6


hi all,

i use XOOPS for almost 2 years, but i dnt know progaming at php code

i want to do one modification at xmemberstats module

let me explain:

that module has a block wich show the user who are online and the module wich the user is

but when the user is at the Home of my site it doesnt show anything... and i want to appear "Home"

so i was looking at the php code of the block, and this is the part of the code:

if ($options[0] == ) {

        for (
$i 0$i $total$i++) {

        
$onlineUsers[$i]['ip'] = $onlines[$i]['online_ip'];
        if (
$onlines[$i]['online_uid'] > 0) {
                
$module_handler =& xoops_gethandler('module');
                
$modules =& $module_handler->getList(new Criteria('isactive'1));
                
$onlineUsers[$i]['module'] = ($onlines[$i]['online_module'] > 0) ? $myts->makeTareaData4Show($modules[$onlines[$i]['online_module']]) : '';
            
$ip $onlines[$i]['online_ip'];
            
$numbers=explode (".",$ip);
            
$code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
            
$country_query  $xoopsDB->query("SELECT country2,country FROM ".$xoopsDB->prefix("iptoc")." WHERE IPFROM<=$code"." AND IPTO>=$code");
            list(
$domain,$country) = $xoopsDB->fetchRow($country_query);
            if(
$domain==''$domain='-';
            
$members .= '.XOOPS_URL.'/userinfo.php?uid='.$onlines[$i]['online_uid'].'">'.$onlines[$i]['online_uname'].''.$onlineUsers[$i]['module'].'.XOOPS_URL.'/modules/xmmemberstats/images/flags/'.$domain.'.gif" alt="'.$country.'">';
            
$bil++;


so i think this variable: '.$onlineUsers[$i]['module'].' show the module in wich the visitor is

i think i have to do something simple like (in C, wich i know)

if ('.$onlineUsers[$i]['module'].' == 0){
'.$onlineUsers[$i]['module'].' 'Home';
}


someone can tell me how i have to do that at PHP and working for this module and xoops

ps: my XOOPS is 2.0.13 and thats is the latest module of xmemberstats

sorry for my bad english
[]´s

2
CCV_Pinto
Re: Mod at xmemberstats
  • 2006/2/15 22:55

  • CCV_Pinto

  • Just popping in

  • Posts: 5

  • Since: 2005/11/6


i did it!

if (empty($onlineUsers[$i]['module'])){
$onlineUsers[$i]['module'] = 'Home';
}


now it works fine

[]´s

can close ;)

Login

Who's Online

364 user(s) are online (317 user(s) are browsing Support Forums)


Members: 0


Guests: 364


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