All pastes #87408 Raw Edit

k4st

public php v1 · immutable
·published 2006-07-13 22:52 UTC
rendered paste body
//--------------------------------------------	// 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);	}