Ejemplo n.º 1
0
 public function user($user_name = '')
 {
     $user = User::getUser($user_name);
     if ($user === NULL) {
         $this->__load_404();
     } else {
         $this->__lib("CountMessage");
         $count = new CountMessage();
         $this->theme->setTitle($user->getAliases() . "(" . $user->getName() . ") 的主页");
         $this->__view("Home/header.php");
         $this->__view("Show/user.php", ['user' => $user, 'count' => $count->getUserCount($user)]);
         $this->__view("Home/footer.php");
     }
 }
Ejemplo n.º 2
0
 public function count_views_add()
 {
     try {
         $this->throwMsgCheck('is_post');
         $this->__lib("CountMessage");
         $cm = new CountMessage();
         $req = req();
         $id = +$req->post('id');
         $type = trim($req->post('type'));
         if (in_array($type, $cm->getTypeList()) && $id > 0) {
             if (($this->rt_msg['content'] = $cm->addCount($type, $id)) !== false) {
                 $this->rt_msg['status'] = true;
             }
         }
     } catch (\Exception $ex) {
         $this->rt_msg['msg'] = $ex->getMessage();
         $this->rt_msg['code'] = $ex->getCode();
     }
 }