31
mrphilong
Re: Format membership ONLINE List
  • 2008/6/2 10:29

  • mrphilong

  • Quite a regular

  • Posts: 351

  • Since: 2006/7/14


Just a little bit of moving stuff around to <Flag> <IP address> or <Username> so it won't break the column. See demo here right column

in \membership\blocks\membership_block.php

replace
$members .= '<table class="outer" cellspacing="0"><tr><td class="even" width="40%"><a href="'.XOOPS_URL.'/userinfo.php?uid='.$onlines[$i]['online_uid'].'">'.$onlines[$i]['online_uname'].'</td><td class="odd" align="center">'.$onlineUsers[$i]['module'].'</td><td class="even" align="center" width="10%"><img src="'.XOOPS_URL.'/modules/membership/images/flags/'.$country.'.gif" alt="'.$alt.'" title="'.$alt.'"></td></tr></table>';
                
//if is not a user
                
} else {
                    
$hostname strtolower(gethostbyaddr($onlines[$i]['online_ip']));
                    
$pos1 strpos($hostname$findbot);
                    
$pos2 strpos($hostname$findsearch);

                    
//if is bot
                    
if ($pos1 !== false || $pos2 !== false) {
                        
$alt $hostname;
                        
$guess .= '<table class="outer" cellspacing="0"><tr><td class="even" colspan="2">'.$censored.'</td><td class="odd" align="center">'.$onlineUsers[$i]['module'].'</td><td width="10%" align="center" class="odd"><img src="'.XOOPS_URL.'/modules/membership/images/bots.gif" alt="'.$alt.'" title="'.$alt.'"></td></tr></table>';
                        
$bots++;
                    } else {
                        
$guess .= '<table class="outer" cellspacing="0"><tr><td class="even" colspan="2">'.$censored.'</td><td class="odd" align="center">'.$onlineUsers[$i]['module'].'</td><td width="10%" align="center" class="odd"><img src="'.XOOPS_URL.'/modules/membership/images/flags/'.$country.'.gif" alt="'.$alt.'" title="'.$alt.'"></td></tr></table>';
                    }
                    
$guests++;


with

$members .= '<table class="outer" cellspacing="0"><tr><td class="even" width="18px" align="left"><img src="'.XOOPS_URL.'/modules/membership/images/flags/'.$country.'.gif" alt="'.$alt.'" title="'.$alt.'"></td><td class="odd" align="left"><a href="'.XOOPS_URL.'/userinfo.php?uid='.$onlines[$i]['online_uid'].'">'.$onlines[$i]['online_uname'].'</td></tr></table>';
                
//if is not a user
                
} else {
                    
$hostname strtolower(gethostbyaddr($onlines[$i]['online_ip']));
                    
$pos1 strpos($hostname$findbot);
                    
$pos2 strpos($hostname$findsearch);

                    
//if is bot
                    
if ($pos1 !== false || $pos2 !== false) {
                        
$alt $hostname;
                        
$guess .= '<table class="outer" cellspacing="0"><tr><td width="18px" align="left" class="even"><img src="'.XOOPS_URL.'/modules/membership/images/bots.gif" alt="'.$alt.'" title="'.$alt.'"></td>
                        <td class="odd" colspan="2">'
.$censored.'</td><td class="even" align="center">'.$onlineUsers[$i]['module'].'</td></tr></table>';
                        
$bots++;
                    } else {
                        
$guess .= '<table class="outer" cellspacing="0"><tr><td width="18px" align="center" class="even"><img src="'.XOOPS_URL.'/modules/membership/images/flags/'.$country.'.gif" alt="'.$alt.'" title="'.$alt.'"></td><td class="odd" colspan="2">'.$censored.'</td></tr></table>';
                    }
                    
$guests++;
www.UcChau.Net
www.XoopsViet.Org

32
trabis
Re: Format membership ONLINE List
  • 2008/6/2 12:43

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Nice work mrphilong!

I noticed you have also a counter integrated, can you share that?
Thanks

33
mrphilong
Re: Format membership ONLINE List
  • 2008/6/2 22:55

  • mrphilong

  • Quite a regular

  • Posts: 351

  • Since: 2006/7/14


Hi Trabis,

I am using PHP Stats and installed it separately from Xoops, you can get a copy from here.

Once installed modify your XOOPS footer.php and put this code in:

$xoopsLogger->stopTime();
}
// Code for PHP-Stats counter
define('__PHP_STATS_PATH__','/xxxxxxxxx/html/yourwebsite.net/stats/');
include(
__PHP_STATS_PATH__.'php-stats.redir.php');
?>


in membership module, modify templates\blocks\membership_block.html and put this code in:

<b><u>Site Statistic:</u></b><br />
<
table style="font-size:9px;text-align:right;" align="center">
    <
tr >
        <
td style="font-size:9px"><{if $xoops_isadmin}><strong>Now:</strong><script type="text/javascript" src="http://www.yourwebsite.com/stats/view_stats.js.php?mode=0"></script><{/if}></td><td style="font-size:9px"><strong>Visitor</strong></td>
        <
td style="font-size:9px">&nbsp;</td>
        <
td style="font-size:9px"><strong>View</strong></td>
    </
tr>
    <
tr>
        <
td style="font-size:9px"><strong><strong>Today:</strong></td>
        <
td style="font-size:9px"><script type="text/javascript" src="http://www.yourwebsite.com/stats/view_stats.js.php?mode=1"></script></td>
        <
td style="font-size:9px">&nbsp;</td><td style="font-size:9px"><script type="text/javascript" src="http://www.yourwebsite.com/stats/view_stats.js.php?mode=2"></script></td>
    </
tr>
    <
tr>
        <
td style="font-size:9px"><strong>Y'day:</strong></td><td style="font-size:9px"><script type="text/javascript" src="http://www.yourwebsite.com/stats/view_stats.js.php?mode=5"></script></td>
        <td style="font-size:9px">&nbsp;</td><td style="font-size:9px"><script type="text/javascript" src="http://www.yourwebsite.com/stats/view_stats.js.php?mode=6"></script></td>
    </tr>
    <tr>
        <td style="font-size:9px"><strong>Total:</strong></td><td style="font-size:9px"><script type="text/javascript" src="http://www.yourwebsite.com/stats/view_stats.js.php?mode=3"></script></td>
        <td style="font-size:9px">&nbsp;</td><td style="font-size:9px"><script type="text/javascript" src="http://www.yourwebsite.com/stats/view_stats.js.php?mode=4"></script></td>
    </tr>
    <tr>
        <td colspan=4 style="font-size:9px;text-align:center"><a href="http://www.yourwebsite.com/stats/admin.php" target="_blank">Since: 09/09/2006</a></td>
    </tr>
</table>
www.UcChau.Net
www.XoopsViet.Org

34
trabis
Re: Format membership ONLINE List
  • 2008/6/3 0:31

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Thank you mrphilong!

Login

Who's Online

145 user(s) are online (103 user(s) are browsing Support Forums)


Members: 0


Guests: 145


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