Esempio n. 1
0
 public function dataAction()
 {
     $id = $this->intVal(3);
     $threadModel = new ThreadModel();
     $userModel = new UserModel();
     $reputation = $userModel->reputation($this->userid);
     $thread = $threadModel->threadById($id);
     if (!$thread || $thread["del"] == 1) {
         header("HTTP/1.1 301 Moved Permanently");
         header("location: /home/");
         die;
     }
     $replys = $threadModel->replysById($id);
     $replysText = "";
     foreach ($replys as $reply) {
         $replysText .= "{$reply['name']}说道:{$reply['content']}\r\n";
     }
     $thread["replysText"] = $replysText;
     $url = "http://" . SEARCHSERVER . ":9200/ourcoders/thread/{$id}/";
     $data = ToolModel::postJSON($url, json_encode($thread));
     echo $data;
 }