Tapatalk Modification for vB3 - Adding User for System Information

Referring back to this thread:

Tapatalk Modification for vB3 - Issue with Avatar Icons

I mentioned that we had some "system bot" code:

In this post, I describe that code and how easy it is to create a "system bot" user for Tapatalk (TT):

Basically, its quite easy. We add a hook to the TT file get_online_users.php in the location below:

 $from = 'browser';
if(isset($loggedin['useragent']))
      {
                $userAgent = $loggedin['useragent'];
                if(strpos($userAgent,'Android') !== false || strpos($userAgent,'iPhone') !== false || strpos($userAgent,'BlackBerry') !== false)
                    $from = 'mobile';
                if(strpos($userAgent,'Tapatalk') !== false)
                    $from = 'tapatalk';
                if(strpos($userAgent,'BYO') !== false)
                    $from = 'byo';            }
            
                $username = mobiquo_encode($loggedin['musername']) ? mobiquo_encode($loggedin['musername']) : mobiquo_encode($loggedin['username']);

            ($hook = vBulletinHook::fetch_hook('neo_tapatalk_online_bits')) ? eval($hook) : false;

             $online_user = array(
                'user_id'       => new xmlrpcval($loggedin['userid'], 'string'),
                'username'      => new xmlrpcval($username, 'base64'),
                'user_name'     => new xmlrpcval($username, 'base64'),
                'user_type'     => new xmlrpcval(get_usertype_by_item($loggedin['userid']), 'base64'),
                'icon_url'      => new xmlrpcval(mobiquo_get_user_icon($loggedin['userid'],$from), 'string'),
         
                'from'         => new xmlrpcval($from, 'string'),
                'display_text'  => new xmlrpcval(mobiquo_encode($display_text), 'base64'),
  );

and in this hook location we put the hook code:

  if($count == 1 AND can_moderate() ) 

      { 

            $string=file_get_contents('/proc/loadavg'); 
            $loadavg=explode(' ', $string); 
            $la = $loadavg['0'].' .. '.$loadavg['1'].' .. '.$loadavg['2']; 

            $online_user = array( 
                'user_id'       => new xmlrpcval('3804', 'string'), 
                'username'      => new xmlrpcval('System Bot', 'base64'), 
                'user_name'     => new xmlrpcval('System Bot', 'base64'), 
                'user_type'     => new xmlrpcval(get_usertype_by_item('3804'), 'base64'), 
                'icon_url'      => new xmlrpcval(mobiquo_get_user_icon('3804'), 'string'), 
                'from'         => new xmlrpcval($from, 'string'), 
                'display_text'  => new xmlrpcval(mobiquo_encode('System Load: '.$la), 'base64'), 
            ); 

            $login_users[] = new xmlrpcval($online_user, 'struct'); 
        } 

And this code add one user with some simple system information to the page, so we can easily see some system information (in this case, the load average of the server), when using TT.

This information is in the first "user" show "online" below in this example screenshot:

So, I hope forum owners can easily see that although it is not easy to create new pages in the TT app (I wish there was), it is easy to create and add users that display system information (or other information), as required.