$person = preg_match( '/(?<=\[INFO\] )\S+/' , $thing );...to...
$results = []; preg_match( '/(?<=\[INFO\] )\S+/' , $thing , $results ); $person = $results[0];
else if ( strpos($thing,"logged in") ) { $time = "[" . substr($thing, 11, 5) . "]"; preg_match( '/(?<=\[INFO\] )\S+/' , $thing , $results ); $person = $results[0]; $chats[] = $time.' <i>Joined:</i> <b>'.htmlspecialchars($person).'</b>'; } else if ( strpos($thing,"lost connection") ) { $time = "[" . substr($thing, 11, 5) . "]"; preg_match( '/(?<=\[INFO\] )\S+/' , $thing , $results ); $person = $results[0]; $reason = trim(substr(strrchr($thing, '.'), 1)); $chats[] = $time.' <i>Disconnected:</i> <b>'.htmlspecialchars($person).'</b> ('.$reason.')'; }
Auto-refresh is up and running. It'll refresh the chat every 20 seconds.
Next on my to-do list (when I can be bothered) are:
List of currently Online Users.
Ability to chat from the chat page.
Down to 2 secs now. NO SPAMING etc etc.
Though I can't yet find the setting to increase the length of time the messages show for. I've tried a couple of settings but it's still about 15 seconds per message.