Exemplo n.º 1
0
 public function createNewThread($title, $text, $toptopic = -1)
 {
     $this->connect->exec("INSERT INTO `" . $this->dbPrefix . "forum_threads` (`forumid`, `userid`, `title`, `text`, `timestamp`, `toptopic`) VALUES (NULL, '" . $this->user->getId() . "', '" . $title . "', '" . $text . "', CURRENT_TIMESTAMP, '" . $toptopic . "');");
     $this->nrOfThreads += 1;
     $thread = new thread();
     $thread->setId($this->connect->lastInsertId());
     $thread->setText($text);
     $thread->setTimestamp("");
     $thread->setTitle($title);
     $thread->setUserId($this->user->getId());
     $thread->setTopTopic($toptopic);
     $thread->setUsername($this->user->getUsername(), $this->connect);
     array_push($this->threads, $thread);
     return $this->connect->lastInsertId();
 }