public function processform() { extract($_POST, EXTR_SKIP); $forum = tforum::i(); $forum->rootcat = (int) $rootcat; $forum->idview = (int) $idview; $forum->idperm = (int) $idperm; $forum->moderate = isset($moderate); $forum->save(); }
public function processform() { // return dumpvar($_POST); extract($_POST, EXTR_SKIP); $posts = tposts::i(); $this->basename = 'posts'; $html = $this->html; if ($id == 0) { $forum = tforum::i(); if (!$forum->moderate || litepublisher::$options->ingroup('editor')) { $status = 'published'; } else { $status = 'draft'; // if too many drafts then reject $hold = $posts->db->getcount('status = \'draft\' and author = ' . litepublisher::$options->user); if ($hold >= 3) { return $html->manydrafts; } } if (empty($title)) { $lang = tlocal::i('editor'); return $html->h4->emptytitle; } } $post = tpost::i((int) $id); $post->title = $title; $post->categories = array((int) $category); if ($post->author == 0) { $post->author = litepublisher::$options->user; } if (isset($files)) { $files = trim($files); $post->files = $files == '' ? array() : explode(',', $files); } $post->content = tcontentfilter::remove_scripts($raw); if ($id == 0) { $post->status = $status; $post->comstatus = $forum->comstatus; $post->idview = $forum->idview; $post->idperm = $forum->idperm; $post->url = tlinkgenerator::i()->addurl($post, 'forum'); $id = $posts->add($post); $_GET['id'] = $id; $_POST['id'] = $id; $this->idpost = $id; } else { $posts->edit($post); } return $html->h4->successedit; }