/** * post new topic * @param $p _post array */ function postNewTopicXML($p) { $fdb = new DbForum(); $f = $fdb->getForum((int) $p['forum_id']); if (!$this->_checkUserPerm('', $f['forum_type'], 'post')) { return <<<EOF <html> <body> <script language="javascript" type="text/javascript"> \tif (window.parent.document.getElementById('tinyEditor')) \t\twindow.parent.tinyMCE.execCommand('mceRemoveControl', false, 'tinyEditor'); \twindow.parent.document.f.accessDenied(); </script> </body> </html> EOF; } if ($p['topic_sticky'] == 'on' && !$this->_checkUserPerm('', '', 'sticky')) { return <<<EOF <html> <body> <script language="javascript" type="text/javascript"> \tif (window.parent.document.getElementById('tinyEditor')) \t\twindow.parent.tinyMCE.execCommand('mceRemoveControl', false, 'tinyEditor'); \twindow.parent.document.f.accessDenied(); </script> </body> </html> EOF; } // post mesage here $user = $this->_getLoginUserName(); prepare_to_db($p['topic_subject'], 0); prepare_to_db($p['topic_text'], 1); $fdb->newTopic((int) $p['forum_id'], $p['topic_subject'], $p['topic_text'], $p['topic_sticky'] == 'on', $user); return <<<EOF <html> <body> <script language="javascript" type="text/javascript"> \tif (window.parent.document.getElementById('tinyEditor')) \t\twindow.parent.tinyMCE.execCommand('mceRemoveControl', false, 'tinyEditor'); \twindow.parent.document.f.postSuccess({$p['forum_id']}); </script> </body> </html> EOF; }