template(); $inc->file(); if (isset($_FILES['file'])) { $GLOBALS['template']->assign('submit', 'true'); if ($_FILES["file"]["size"] > 0) { $size = $GLOBALS['file']->insert('false', $_FILES["file"], addslashes($_GET['chatid'])); $GLOBALS['template']->assign('onload', ' onload="window.opener.parent.window.Chat.file(\''.$size.'\');window.close();"'); $GLOBALS['template']->assign('fail', 'false'); } else { $GLOBALS['template']->assign('fail', 'true'); } } $GLOBALS['template']->assign('chatid', addslashes($_GET['chatid'])); $GLOBALS['template']->assign('max_size', $GLOBALS['file']->max_size()); // Display the output $GLOBALS['template']->display('chat_upload.tpl'); // do events that need to be done at the end of the file $inc->finished(); ?>