//-------------------------------------------- // Get a thread based on its thread id, then // set some of its permissions to the template // based on the current user. //-------------------------------------------- function _genericThreadStuff(&$reg, &$req, &$resp) { $info = &new InformationDisplay($reg, $req, $resp); $user = &$reg->get('user'); //-------------------------------------------- // Get the thread. //-------------------------------------------- $finder = &$this->getFinder('threads'); $thread = &$finder->find($req->get('thread_id')); //-------------------------------------------- // Whoops! This thread doesn't exist! //-------------------------------------------- if($thread === NULL) { $info->text("The requested thread does not exist."); } //-------------------------------------------- $thread->setUser($user); $thread->setPermissions(); //-------------------------------------------- $resp->assignRef('thread', $thread); }