Example #1
0
 public function showAction()
 {
     header('Pragma: ');
     header("cache-control: s-maxage=600");
     $id = $this->intVal(3);
     if ($id == 0) {
         header('HTTP/1.1 301 Moved Permanently');
         header("location:/user/show/0/");
     }
     $userModel = new UserModel();
     $threadModel = new ThreadModel();
     $cacheModel = new FilecacheModel();
     $userinfo = $cacheModel->getCache("userinfo", "{$id}");
     if (!$userinfo) {
         $userinfo = $userModel->userInfo($id);
         $userinfo["image"] = DiscuzModel::get_avatar($id, "middle");
         $userinfo["threadscreate"] = $threadModel->threadsByUserid($id);
         $userinfo["threadsreply"] = $threadModel->threadsReplyByUserid($id);
         $cacheModel->createCache("userinfo", "{$id}", $userinfo);
     }
     $this->_mainContent->assign("user", $userinfo);
     $this->setTitle($userinfo["username"]);
     $this->display();
 }