Page 1 of 1

uploader

Posted: Sat Jan 07, 2006 4:41 pm
by vronsky
like asked inhttp://forum.cmsmadesimple.org/index.ph ... 645.0.html

My need is to upload a file or an image from a module :
ex I have the News module, but i would not use the WYSiIWYG editor because (maybe) I would like to have more control on data formatting in the front-end.
So I have any pure text fields and a field where i store an image name.
But also I would upload that image while I'm compiling my news.

I wrote a little uploader, maybe unuseful : If you have better, pls help because is an important need for me.

change in News.module.php line 971

Code: Select all

$this->smarty->assign('foto', $this->CreateInputText($id, 'foto', $foto, 30, 255,'id="foto"'));
change in editarticle.tpl

Code: Select all

<p class="pageinput">{$foto}<input name="upload" value="upload" type="button" onclick="window.open('../upload.php?element=foto','Uploader','HEIGHT=400,WIDTH=400')"/></p>
attached : uploadr.php

[attachment deleted by admin]