public function add_new($tid, $content) { if (!$content or !$tid) { return false; } session('atpage', $tid); $data = array('uid' => session('user_auth_sign'), 'tid' => $tid, 'content' => ParseAtUser($content)); trace($data, 'DEBUG', 'user', true); session('atpage', null); if ($this->create($data)) { $this->add(); return true; } else { return false; } }
public function add_new($title, $content, $class, $project_id = 0) { if (!$content or !$title or !$class) { return false; } $data = array('uid' => session('user_auth_sign'), 'title' => $title, 'content' => '', 'class' => $class, 'project_id' => $project_id); session('atpage', null); if ($this->create($data)) { $tid = $this->add(); session('atpage', $tid); $data = array('id' => $tid, 'content' => ParseAtUser($content)); $this->save($data); return $tid; } else { return false; } }