Replace:
PHP Code:
eval("\$chat .= \"".$comma.gettemplate('forumdisplay_loggedinuser')."\";");
With:
PHP Code:
eval('$chat.= "' . $comma . fetch_template('forumdisplay_loggedinuser') . '";');
I'm not sure what kind of chat you have, but if it's IRC I suggest taking a look at the vB3 mIRC & Eggdrop hacks I have for displaying who is online from your chat (see my sig).