Thumbnail creation
I have been reading up on how to create thumbnails, but I have to modify part of a .php file, and it is full of $variables, and have no idea how to implement. Any help?

<pre>function saveUpload($filename, $userfile_name, $destpath, $timestamp, $useUrl = false, $useUrlDownloadDirectory = '')
	{
		global $ff_config, $mosConfig_fileperms;

		if ($this->dying) return '';
		$baseDir = JPath::clean(str_replace($this->findtags, $this->replacetags, $destpath));
		if (!file_exists($baseDir)) {
			$this->status = _FF_STATUS_UPLOAD_FAILED;
			$this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_DIRNOTEXISTS');
			return '';
		} // if

                /*
		if (!is_writable($baseDir)) {
			$this->status = _FF_STATUS_UPLOAD_FAILED;
			$this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_DIRNOTWRTBLE');
			return '';
		} // if
                */
                if ($timestamp) $userfile_name = date('YmdHis') . '_' . $userfile_name;
		$path = $baseDir.DS.$userfile_name;
		//if ($timestamp) $path .= '.'.date('YmdHis');
		if (JFile::exists($path)) {
			$rnd = md5( mt_rand(0, mt_getrandmax()) );
			$path = $baseDir.DS.$rnd.'_'.$userfile_name;
			//if ($timestamp) $path .= '.'.date('YmdHis');
			if (JFile::exists($path)) {
				$this->status = _FF_STATUS_UPLOAD_FAILED;
				$this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_FILEEXISTS');
				return '';
			}
		} // if

		if (!move_uploaded_file($filename, $path)) {
			$this->status = _FF_STATUS_UPLOAD_FAILED;
			$this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_FILEMOVEFAILED');
			return '';
		} // if
   
		$filemode = NULL;
		if (isset($mosConfig_fileperms)) {
			if ($mosConfig_fileperms!='')
				$filemode = octdec($mosConfig_fileperms);
		} else
			$filemode = 0644;
		if (isset($filemode)) {
			if (!@chmod($path, $filemode)) {
				$this->status = _FF_STATUS_UPLOAD_FAILED;
				$this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_FILECHMODFAILED');
				return '';
			} // if
		} // if

                $serverPath = $path;
                if($useUrl && $useUrlDownloadDirectory != ''){
                    $path = $useUrlDownloadDirectory . '/' . basename($path);
                }

		return array('default' => $rnd.'_'.$userfile_name, 'server' => $serverPath);
	} // saveUpload</pre>
Thumbnail creation
===

I have been reading up on how to create thumbnails, but I have to modify part of a .php file, and it is full of $variables, and have no idea how to implement. Any help?

<pre>function saveUpload($filename, $userfile_name, $destpath, $timestamp, $useUrl = false, $useUrlDownloadDirectory = '')
	{
		global $ff_config, $mosConfig_fileperms;

		if ($this->dying) return '';
		$baseDir = JPath::clean(str_replace($this->findtags, $this->replacetags, $destpath));
		if (!file_exists($baseDir)) {
			$this->status = _FF_STATUS_UPLOAD_FAILED;
			$this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_DIRNOTEXISTS');
			return '';
		} // if

                /*
		if (!is_writable($baseDir)) {
			$this->status = _FF_STATUS_UPLOAD_FAILED;
			$this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_DIRNOTWRTBLE');
			return '';
		} // if
                */
                if ($timestamp) $userfile_name = date('YmdHis') . '_' . $userfile_name;
		$path = $baseDir.DS.$userfile_name;
		//if ($timestamp) $path .= '.'.date('YmdHis');
		if (JFile::exists($path)) {
			$rnd = md5( mt_rand(0, mt_getrandmax()) );
			$path = $baseDir.DS.$rnd.'_'.$userfile_name;
			//if ($timestamp) $path .= '.'.date('YmdHis');
			if (JFile::exists($path)) {
				$this->status = _FF_STATUS_UPLOAD_FAILED;
				$this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_FILEEXISTS');
				return '';
			}
		} // if

		if (!move_uploaded_file($filename, $path)) {
			$this->status = _FF_STATUS_UPLOAD_FAILED;
			$this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_FILEMOVEFAILED');
			return '';
		} // if
   
		$filemode = NULL;
		if (isset($mosConfig_fileperms)) {
			if ($mosConfig_fileperms!='')
				$filemode = octdec($mosConfig_fileperms);
		} else
			$filemode = 0644;
		if (isset($filemode)) {
			if (!@chmod($path, $filemode)) {
				$this->status = _FF_STATUS_UPLOAD_FAILED;
				$this->message = BFText::_('COM_BREEZINGFORMS_PROCESS_FILECHMODFAILED');
				return '';
			} // if
		} // if

                $serverPath = $path;
                if($useUrl && $useUrlDownloadDirectory != ''){
                    $path = $useUrlDownloadDirectory . '/' . basename($path);
                }

		return array('default' => $rnd.'_'.$userfile_name, 'server' => $serverPath);
	} // saveUpload</pre>