1<?php 2 3if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../../').'/'); 4require_once(DOKU_INC.'inc/init.php'); 5require_once(DOKU_INC.'inc/common.php'); 6 7$filename = DOKU_PLUGIN . 'whoisonline/online.txt'; 8if( file_exists( $filename ) == true ) { // read in table 9 $online_users = json_decode(file_get_contents( $filename ), true); 10 if( count( $online_users ) == 0 ) { 11 $result .= "<div class='WIO_displayline'>No users online</div>"; 12 } else { 13 asort( $online_users ); 14 foreach( $online_users as $user ) { $result .= "<div class='WIO_displayline'>".$user['display']."</div>"; } 15 } 16} 17echo $result; 18?>