function profile() { $id = $_GET['id']; $user = new User(); $user->id = $id; $user->getUsername(); //show error if user does not exist if (!isset($user->username)) { header('Location: ' . BASE_PATH . 'error/404'); die; } $user->createFromIDFull($id); $email = $user->getEmail(); $user->subscriptions = $user->getSubscriptions(); if ($this->_user['id']) { $current_user = new User(); $current_user->createFromID($this->_user['id']); $current_user->subscriptions = $current_user->getSubscriptions(); $this->set('isFollowing', $current_user->isFollowing('user', $id)); } else { $this->set('isFollowing', 0); } $this->set('profile', $user); $this->set('email', $email); $this->set('login_user', $this->_user['id']); $this->set('page_title', "SlideWiki User - " . $user->username); $this->set('page_description', $user->description); $this->set('page_additional_footer', '<p><a href="user/alldecks/' . $user->id . '">( "' . $user->username . '" plain decks )</a></p>'); }