We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

File

Development and Programming

Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

I would probably just use Mark’s other extension, Multi-Text, to make your related text fields, bypassing the need for php on your template.

Good solution with the php, though!

       
jeremydouglas's avatar
jeremydouglas
292 posts
17 years ago
jeremydouglas's avatar jeremydouglas

Thanks for that mdesign, I was thinking of trying to get it to work in a saef.

It would be neat if multi-text would work on a saef, then you could have the two fields lined up horizontally to see which caption lines up with which image… though that might take some work to make sure the heights work out. I haven’t heard of or tried using multi-text on a saef.

       
jeremydouglas's avatar
jeremydouglas
292 posts
17 years ago
jeremydouglas's avatar jeremydouglas

wups, double post, it’s late.

       
DMT Media's avatar
DMT Media
12 posts
17 years ago
DMT Media's avatar DMT Media

SQL Error FIX Error when trying to create a new upload destination.

MySQL ERROR: Error Number: 1064 Description: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1 Query: SELECT * FROM exp_mh_file WHERE upload_id=

Fixed it by going to line 442

replace:

$prefs = $DB->query("SELECT * FROM exp_mh_file WHERE upload_id={$id}");

with:

$prefs = $DB->query('SELECT * FROM exp_mh_file WHERE upload_id="'.$id.'"');
       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

Nice SQL fix, DMT. I hope Mark is planning a release soon!

       
Silencio's avatar
Silencio
46 posts
17 years ago
Silencio's avatar Silencio

Another possible problem:

I noticed that when uploading any jpeg with an “.JPG” extension it will save it as a gif with a jpeg extension. (Making the resolution very low quality and the file size quite higher.)

I was able to fix it by making the writing of the jpeg come first before the gif… though what’s causing it to happen is in the code above.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.
I noticed that when uploading any jpeg with an “.JPG” extension it will save it as a gif with a jpeg extension. I was able to fix it by making the writing of the jpeg come first before the gif… though what’s causing it to happen is in the code above.

I noticed this too. I was(am) getting some pixelation in the images (GIF looking) - and I don’t really want to go ahead with File on my current project if the images are going to do that…would you mind going into a little more detail what you did to fix this?

       
Silencio's avatar
Silencio
46 posts
17 years ago
Silencio's avatar Silencio
I noticed this too. I was(am) getting some pixelation in the images (GIF looking) - and I don’t really want to go ahead with File on my current project if the images are going to do that…would you mind going into a little more detail what you did to fix this?

You’ll just need to change a few lines in the extension file.

Around line #1030 under the heading “Write File”

Change from:

if(@imagegif($dst_img, $dst) !== false) {}
else if(@imagejpeg($dst_img, $dst) !== false) {}
else if(@imagepng($dst_img, $dst) !== false) {}

Change to:

if(@imagejpeg($dst_img, $dst) !== false) {}
else if(@imagegif($dst_img, $dst) !== false) {}
else if(@imagepng($dst_img, $dst) !== false) {}

This will take care of your problem and save your jpeg as a true jpeg. The default image size is set to 60% quality (this is medium in Photoshop)… if you want it set to a higher quality add the number below. (90 means 90% image quality)

if(@imagejpeg($dst_img, $dst, 90) !== false) {}
       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

Thanks for that info. Is this forum great, or what?

       
H&O's avatar
H&O
34 posts
17 years ago
H&O's avatar H&O

I cant seem to get the extension to work. I have the following code:

{exp:weblog:entries weblog="downloads"}
<li>{title}
{bestand}
{file_path}
{/bestand}
</li>d

{/exp:weblog:entries}

Where ‘bestand’ is my custom field for the files.

it outputs the following:

<li>Name of entry 1
{file_path}
</li>
                
<li>Name of entry 2
{file_path}
</li>

Has anyone an idea of what i am doing wrong?

       
michaelTSCPL's avatar
michaelTSCPL
105 posts
17 years ago
michaelTSCPL's avatar michaelTSCPL

I can’t get the extension to work at all. I can get it installed but when I go to upload whether it is an image, pdf, or other file type I get this message:

ERROR There was an error uploading 'File'.

File is the name of my custom field used for uploading. I have tried the newest version and older versions of the extension with the same result. The built in EE upload works just fine.

Has anyone seen this?

       
Silencio's avatar
Silencio
46 posts
17 years ago
Silencio's avatar Silencio

Not sure what’s causing your problems… perhaps refer to the documentation.


Another possible error with the extension.

The crop feature doesn’t work for me when I set the max height and max width fields.

So I went into the source code and commented the code under the heading “Crop Images”, and it is now working.

around line 963

changed from

//  =============================================
//  Crop Images
//  =============================================
      if($resize == 'crop')
      {
      $src_x = ($src_width/2)-($dst_width/2);
      $src_y = ($src_height/2)-($dst_height/2);
                        
      $src_width = $dst_width;
      $src_height = $dst_height;
      }

changed to

//  =============================================
//  Crop Images
//  =============================================
      if($resize == 'crop')
      {
      //$src_x = ($src_width/2)-($dst_width/2);
      //$src_y = ($src_height/2)-($dst_height/2);
                        
      //$src_width = $dst_width;
      //$src_height = $dst_height;
      }
       
AppliedMotionProducts.com (Webmaster)'s avatar
AppliedMotionProducts.com (Webmaster)
6 posts
17 years ago
AppliedMotionProducts.com (Webmaster)'s avatar AppliedMotionProducts.com (Webmaster)

Another issue is the dropdown menu for the “crop” settings isn’t sticky. You have to reset it everytime you modify your upload destination settings to keep it the same.

       
Dane Thomas's avatar
Dane Thomas
139 posts
17 years ago
Dane Thomas's avatar Dane Thomas
I’m working on a project, where for the first time, I’m using the built in category image facility within EE. As has been mentioned here http://ellislab.com/forums/viewthread/43349/ (and is somewhat related) I was wondering if there was a chance that file could be developed to replace the built in ‘Category Image’ field and replace it with a ‘File’ field. I even tried to add a custom category field but with the File extension installed File isn’t an option in the drop down - it seems it only works (as I had expected) on the regular custom filed section. The current category image field is extremely non user friendly and pretty much makes it impossible for a non technical person to add a new category and supply a nice image to match.

I’m working on this tonight and was wondering if anyone had any ideas how I could get this to work?

I imagine it’s not much to enable this for the new 1.6.1 feature of custom category fields as well.

I see around line 195

if(preg_match_all("/C=admin&M=blog_admin&P=edit_field&field_id=(\d*).*?<\/td>.*?<td.*?".">.*?<\/td>.*?<\/td>/is", $out, $matches))

The admin code when adding custom category fields is in the following format

index.php?S=0&C=admin&M=blog_admin&P=edit_cat_field&group_id=2

I tried editing that line at 195 to be …… edit_cat_field …… but ‘file’ didn’t come up in the drop down.

I imagine there is a little bit more editing but if someone could point me in the right direction that would be great.

       
Paul_B's avatar
Paul_B
86 posts
17 years ago
Paul_B's avatar Paul_B

I’m getting this on the publish page: You have not defined a server path in the Upload Settings

Except that I have - it’s still the default value. Problem gets more involved, and most likely EE-specific when I try to create a new upload destination in the upload manager - I get this SQL error:

MySQL ERROR:

Error Number: 1064

Description: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1

Query: SELECT * FROM exp_mh_file WHERE upload_id=

I didn’t have this issue with 1.6.0 but am with 1.6.1

Anyone out there got any solutions, I’d be most grateful for any assistance 😊

       
First 23 24 25 26 27 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.