1
jonsimmonds
whos online block question

I wish to edit the pop-up from the whos online block, from the template of the block the link to the pop up is $block.lang_more but were can I find the code?

If im totaly blind to were the code is then sorry but I spent 20 mins searching for it with no luck

Thakns

Jon

[fixed title to reflect that it is a block and not a module: Mith]

2
jonsimmonds
Re: whos online module question

BUMP!!

Surly someone must know the answer to this...

3
Dave_L
Re: whos online module question
  • 2005/3/4 0:27

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


The actual link is:

<a href="javascript:openWithSelfMain('<{$xoops_url}>/misc.php?action=showpopups&type=online','Online',420,350);"><{$block.lang_more}></a>


In misc.php:

if ( $action == "showpopups" ) {
   ...
   switch ( 
$type ) {
      ...
      case 
'online':]
         ... [
color=ff0000]<<< here's the code[/color]
         break;
      case '
debug':

4
jonsimmonds
Re: whos online module question

Cheers mate! and i knew it would be something obvious

Many thanks

Jon :)

5
jonsimmonds
Re: whos online module question

right ive found and done what I wanted to do, which was to add the hostname to the whos online more link, under the IP.
heres the code from the popup, the bits in bold are what I added, did I do it right? will it cause much of a slowdown?
$isadmin 0;
        echo 
'<table  width="100%" cellspacing="1" class="outer"><tr><th colspan="3">'._WHOSONLINE.'</th></tr>';
        
$start = isset($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0;
        
$online_handler =& xoops_gethandler('online');
        
$online_total =& $online_handler->getCount();
        
$limit = ($online_total 20) ? 20 $online_total;
        
$criteria = new CriteriaCompo();
        
$criteria->setLimit($limit);
        
$criteria->setStart($start);
        
$onlines =& $online_handler->getAll($criteria);
        
$count count($onlines);
        
$module_handler =& xoops_gethandler('module');
        
$modules =& $module_handler->getList(new Criteria('isactive'1));
        for (
$i 0$i $count$i++) {
            if (
$onlines[$i]['online_uid'] == 0) {
                
$onlineUsers[$i]['user'] = '';
            } else {
                
$onlineUsers[$i]['user'] =& new XoopsUser($onlines[$i]['online_uid']);
            }
            
$onlineUsers[$i]['ip'] = $onlines[$i]['online_ip'];
            [
b]$onlineusers[$i]['host'] = gethostbyaddr($onlineUsers[$i]['ip']);[/b]
               
$onlineUsers[$i]['updated'] = $onlines[$i]['online_updated'];
            
$onlineUsers[$i]['module'] = ($onlines[$i]['online_module'] > 0) ? $modules[$onlines[$i]['online_module']] : '';
        }
        
$isadmin = ($xoopsUser && $xoopsUser->isAdmin()) ? 0;
        
$class 'even';
        for (
$i 0$i $count$i++) {
            
$class = ($class == 'odd') ? 'even' 'odd';
            echo 
'<tr valign="middle" align="center" class="'.$class.'">';
            if (
is_object($onlineUsers[$i]['user'])) {
                
$avatar $onlineUsers[$i]['user']->getVar('user_avatar') ? '<img src="'.XOOPS_UPLOAD_URL.'/'.$onlineUsers[$i]['user']->getVar('user_avatar').'" alt="" />' '&nbsp;';
                echo 
'<td>'.$avatar."</td><td><a href="javascript:window.opener.location='".XOOPS_URL."/userinfo.php?uid=".$onlineUsers[$i]['user']->getVar('uid')."';window.close();">".$onlineUsers[$i]['user']->getVar('uname')."</a>";
            } else {
                echo 
'<td>&nbsp;</td><td>'.$xoopsConfig['anonymous'];
            }
            if (
$isadmin == 1) {
                echo 
'<br />('.$onlineUsers[$i]['ip'].')';
                [
b]echo '<br />('.$onlineusers[$i]['host'].')';[/b]
            }
            echo 
'</td><td>'.$onlineUsers[$i]['module'].'</td></tr>';
        }
        echo 
'</table><br />';
        if (
$online_total 20) {
            include_once 
XOOPS_ROOT_PATH.'/class/pagenav.php';
            
$nav = new XoopsPageNav($online_total20$start'start''action=showpopups&amp;type=online');
            echo 
'<div style="text-align: right;">'.$nav->renderNav().'</div>';
        }
        break;

Login

Who's Online

229 user(s) are online (141 user(s) are browsing Support Forums)


Members: 0


Guests: 229


more...

Donat-O-Meter

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

Latest GitHub Commits