[TYPO3] noobish php help

dave typo typothree at gmail.com
Thu May 31 16:25:26 CEST 2007


Hi everyone, In the extension 'Frontend news submitter with RTE
extension.' (fe_rtenews). Users can write ttnews articles from a
frontend RTE, preview what they have done, and then submit the content
to the site. Currently, the extension allows users to attach an image
with the article,  but they cannot attach files with the article. So
I've been trying to add code that would allow a user to submit files
with the news articles.



Here is the problem:

when a user writes bodytext in the RTE and attaches a file, or an
image to the ttnews article and then submits it, only the bodytext is
sent to the array. The image and the file is not attached.
But when a user writes some body text in the RTE and then PREVIEWS
what he or she has written, and THEN submits the article, the image
and the file are sent to the array (successfully attached), but the
bodytext is not sent to the array...

So I think the problem lies in how the image preview and file preview
are handled, and then submitted to the array.

here is where the preview/submit code comes in:


/******************************/
 	case ($check):

                $imagetest = t3lib_div::_POST('image_name');
					 $filetest = t3lib_div::_POST('file_name');
				  	if (!$imagetest) {
					$image = $this->storeImage();	
					
					} else {
					$image = $imagetest;
					}
				
					 if(!$filetest) {
					$filelinks = $this->storeFile();

					} else {
						$filelinks = $filetest;
						}
						
						$preview = @$this->news_preview($image,$filelinks);
			            default:

                $content = @$this->form_news_submit($preview,$image,$filelinks);
        }
        return $this->pi_wrapInBaseClass($content);
    }

/************************/

So can anyone see what is wrong with this code? If there isnt enough
code, I can submit the full file. If anyone knows, please let me know.
If you think you could solve the solution if you saw the full code,
I'll post that too

This is probably a simple solution, but I cant figure out how to do it
correctly! :(

thanks again,


Dave


More information about the TYPO3-english mailing list