3 of 4
3
Just bought Module and need help
Posted: 05 March 2008 10:48 PM   [ Ignore ]   [ # 31 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3373
Joined  2006-10-18

Stinhambo,

You need 2 extra templates…

Your first template (which will be a popup from the SAEF), will contain the File Upload code:

{exp:file_upload:upload_form form_name="entryform" destination="Main Upload Directory" field_name="body" return="popups/file_upload_placement"}

<p><input type='file' name='userfile' /></p>
<
input type='submit' value='Upload' />

{/exp:file_upload:upload_form}

Your second template (which will share that same popup, and is the return url from the Upload form), will contain the following code:

{javascript}

{exp
:file_upload:upload_confirm field_replace="replace"}
<input type='submit' value='Place Image and Close Window' onclick='fileplacer();window.close();' />
{/exp:file_upload:upload_confirm}

That template is both a confirmation page (providing you enter whatever message you want it to say), as well as providing a button for the user to generate and place the code to that uploaded image into the custom field designated in the Upload template.

And best of all, you have full control over how those templates look, etc. smile

Any other questions? smile

 Signature 
Profile
 
 
Posted: 05 March 2008 10:52 PM   [ Ignore ]   [ # 32 ]
Member
RankRankRank
Total Posts:  100
Joined  2007-03-12

Are you hard-wired to the net? haha

So with the second template, do I need a doctype etc?

Profile
 
 
Posted: 05 March 2008 10:57 PM   [ Ignore ]   [ # 33 ]
Member
RankRankRank
Total Posts:  100
Joined  2007-03-12

Ah it works! Yes lovely.

Is there no way to chain the upload and insert file into field events or are you letting this module die?

Profile
 
 
Posted: 05 March 2008 11:02 PM   [ Ignore ]   [ # 34 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3373
Joined  2006-10-18
Stinhambo - 05 March 2008 10:57 PM

Ah it works! Yes lovely.

Is there no way to chain the upload and insert file into field events or are you letting this module die?

Hehe, awesome! LOL

I’m not quite sure what you mean here… wink
Are you after it automatically inserting the data into the field form when uploaded, instead of having to click the Placement button?

I wonder if this would work:

<body onload="document.forms[0].submit();">

 Signature 
Profile
 
 
Posted: 05 March 2008 11:44 PM   [ Ignore ]   [ # 35 ]
Member
RankRankRank
Total Posts:  100
Joined  2007-03-12

Is there any way to not add the <img src="” bit to the insert?

I use another plugin called Image Sizer and it looks like this -

{exp:imgsizer:size src="{archive_photograph_file}" height="150" width="150" alt="{title}"}

and it won’t work if I add Extract URL in the mix.

Profile
 
 
Posted: 06 March 2008 07:00 AM   [ Ignore ]   [ # 36 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3373
Joined  2006-10-18

My guess is you’d have to dig into the code… however, I’m not sure if the File Upload Module runs that code off of it’s own… or off native EE code… so you might have to edit either or… I’ll see if I can dig something up smile

 Signature 
Profile
 
 
Posted: 06 March 2008 07:39 AM   [ Ignore ]   [ # 37 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3373
Joined  2006-10-18

It appears to be located in cp.publish.php

In ExpressionEngine 1.6.2, around line 9830:

if ($data['is_image'== 1)
  
{  
   $imgsrc 
'<img src="'.$file_url.'"'.$properties;
   
   
$wh '';
   
   if (
function_exists('getimagesize')) 
   
{
 $imgdim 
= @getimagesize($query->row['server_path'].$data['file_name']);
 
 if (
is_array($imgdim)) 
 
{
  $imgsrc 
.= " width=\"".$imgdim['0']."\" height=\"".$imgdim['1']."\"";
  
$wh "width=".($imgdim['0']+15).",height=".($imgdim['1']+15).",";
 
}
 
 
if (isset($data['orig_name']) AND $data['orig_name'!= '')
 
{
  $imgdim 
= @getimagesize($query->row['server_path'].$data['orig_name']);
  
  if (
is_array($imgdim)) 
  
{
   $wh 
"width=".($imgdim['0']+15).",height=".($imgdim['1']+15).",";
  

 }
 
   }
   
   $imgsrc 
.= " />";

She’s all yours though LOL

 Signature 
Profile
 
 
Posted: 06 March 2008 07:55 PM   [ Ignore ]   [ # 38 ]
Member
RankRankRank
Total Posts:  100
Joined  2007-03-12
Pie Man - 06 March 2008 07:39 AM

It appears to be located in cp.publish.php

In ExpressionEngine 1.6.2, around line 9830:

if ($data['is_image'== 1)
  
{  
   $imgsrc 
'<img src="'.$file_url.'"'.$properties;
   
   
$wh '';
   
   if (
function_exists('getimagesize')) 
   
{
 $imgdim 
= @getimagesize($query->row['server_path'].$data['file_name']);
 
 if (
is_array($imgdim)) 
 
{
  $imgsrc 
.= " width=\"".$imgdim['0']."\" height=\"".$imgdim['1']."\"";
  
$wh "width=".($imgdim['0']+15).",height=".($imgdim['1']+15).",";
 
}
 
 
if (isset($data['orig_name']) AND $data['orig_name'!= '')
 
{
  $imgdim 
= @getimagesize($query->row['server_path'].$data['orig_name']);
  
  if (
is_array($imgdim)) 
  
{
   $wh 
"width=".($imgdim['0']+15).",height=".($imgdim['1']+15).",";
  

 }
 
   }
   
   $imgsrc 
.= " />";


She’s all yours though LOL

Damn....

Why is there never a simple method ?!?!

Profile
 
 
Posted: 07 March 2008 07:21 AM   [ Ignore ]   [ # 39 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3373
Joined  2006-10-18

Haha… you like it! rasberry

 Signature 
Profile
 
 
Posted: 08 March 2008 12:05 PM   [ Ignore ]   [ # 40 ]
Member
RankRankRank
Total Posts:  100
Joined  2007-03-12

Hello Pie Man,

Well I have found a solution better suited to my needs for file uploading via SAEF so as I have paid for this module (without realising I needed to) can I put it towards the User module which I’ll definitely need?

Profile
 
 
Posted: 09 March 2008 08:52 PM   [ Ignore ]   [ # 41 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  701
Joined  2004-03-30

We’re happy to do this stinhambo. I see that you purchased User already. Let us know if you would like a refund or an extra module of some other kind. Just want to give you the tools you need.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
Posted: 09 March 2008 08:55 PM   [ Ignore ]   [ # 42 ]
Member
RankRankRank
Total Posts:  100
Joined  2007-03-12
Mitchell Kimbrough - 09 March 2008 08:52 PM

We’re happy to do this stinhambo. I see that you purchased User already. Let us know if you would like a refund or an extra module of some other kind. Just want to give you the tools you need.

mk

Yeah I got a bit impatient there smile

I’m sure you’ll cook something nice up that’ll interest me.

PS. How did the Solspace nightcap go?

Profile
 
 
Posted: 29 July 2008 05:52 PM   [ Ignore ]   [ # 43 ]
Newbie
Rank
Total Posts:  16
Joined  2008-07-26
Mark Bowen - 28 October 2007 06:50 AM


When I click on the File Upload link in the SAEF then the photo-upload template does indeed pop-up as it is supposed to. I choose a file and click upload and it does get uploaded as I can check with FTP in that folder. If I then click on the Place Image and Close Window link all that happens is that this smaller window refreshes back to my main homepage URL and nothing gets placed into the field in the SAEF although as mentioned before the file is uploaded correctly.

Mark or Chris did you ever get this issue resolved? If so could you advise me on how i’m getting the same problem.

THANKS SO MUCH!

Profile
 
 
Posted: 30 July 2008 07:44 AM   [ Ignore ]   [ # 44 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3373
Joined  2006-10-18

lmb124

Do you have the correct field name specified in your File Upload template? smile

field_name="body"

 Signature 
Profile
 
 
Posted: 30 July 2008 08:02 AM   [ Ignore ]   [ # 45 ]
Newbie
Rank
Total Posts:  16
Joined  2008-07-26

Yes,
I gave it the custom field name on the textarea where i want the image code to place.

Profile
 
 
   
3 of 4
3