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

MarqueDigital's avatar
MarqueDigital
33 posts
16 years ago
MarqueDigital's avatar MarqueDigital

It’d be really nice if there was a way to assign captions to the images that you upload… possible?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
It’d be really nice if there was a way to assign captions to the images that you upload… possible?

Whilst I definitely don’t want to knock this extension as I have used it on many an occasion, nowadays I tend to use the FieldFrame extension along with the Ngen File Field field type.

This will allow you to do exactly what you need and a whole heap more too!! 😊

I would definitely advise looking into this combination if you haven’t already. It must also be noted that Mark (creator of the File extension) has already stated that he doesn’t have any intention of updating this extension to work with ExpressionEngine 2.0 when it arrives.

There is an altered version on one of the pages of this thread though I believe which does allow you to have captions with each image but really there is so much more you can do now using FieldFrame and the Ngen File field that I would seriously recommend that avenue.

Best wishes,

Mark

       
Peter Lewis's avatar
Peter Lewis
280 posts
16 years ago
Peter Lewis's avatar Peter Lewis

Anything is possible, you’d have to hack into the code, I don’t think Mark will be updating this extension any further and more and more users are moving over to nGen File Field, which can support what you’re after if used with FF Matrix (so create a FF Matrix field, with a field for nGen File, and a text entry field for caption, etc).

Edit: got to type faster or refresh before posting! 😊

       
MarqueDigital's avatar
MarqueDigital
33 posts
16 years ago
MarqueDigital's avatar MarqueDigital

Thanks Mark, Twobelowzero.

I’ve installed the two plugins you both suggested and will work from there.

Best regards.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen
Edit: got to type faster or refresh before posting! 😊

Well I cheat a little bit as I have a direct link to my cerebral cortex so I only have to think the words and they appear in the forums 😉

Thanks Mark, Twobelowzero. I’ve installed the two plugins you both suggested and will work from there. Best regards.

Hope it all goes well for you. Any problems then you know where we all are 😊

Best wishes,

Mark

       
dapacreative's avatar
dapacreative
21 posts
16 years ago
dapacreative's avatar dapacreative

I’m using this extension to create a slideshow using javascript on the page. I have everything working they way I want except for one thing. I need a conditional to display the controls only if there is more than 1 image being uploading using the extension. Something like: {if total_results > 1}{/if} Is there anyway to do this?

       
mhulse's avatar
mhulse
329 posts
about 16 years ago
mhulse's avatar mhulse
I’m getting a 403 Forbidden error when uploading files using the latest version of this extension. Files seem to get 600 permissions instead of 644. Any ideas? …<snip>… You might also add some error messages by checking the return value of the chmod function and also add surpress warning by superceeding it with a @, but in my case that was not neccessary.

The above fix worked for me. The line numbers changed slightly though:

File: ext.mh_file_ext.php
 Changed: 
            foreach($file_tmp_names as $file_key=>$file_tmp_name)
            {
                if(@move_uploaded_file($file_tmp_name, $server_path.$file_names[$file_key]) === FALSE)
                {
                    $errors[] = str_replace(array('%{field}', '%{file}'), array($file_field['field_label'], $file_names[$file_key]), $LANG->line('error_transfer'));
                }
            }
 Line(s): #867 - #873
   Added: 
            foreach($file_tmp_names as $file_key=>$file_tmp_name)
            {
                if(@move_uploaded_file($file_tmp_name, $server_path.$file_names[$file_key]) === FALSE)
                {
                    $errors[] = str_replace(array('%{field}', '%{file}'), array($file_field['field_label'], $file_names[$file_key]), $LANG->line('error_transfer'));
                }
                // If all went well, set the permissions on the uploaded + moved file:
                else
                {
                    @chmod($server_path.$file_names[$file_key], 0644);
                }
            }
 Line(s): #874 - #885
    Info: http://ellislab.com/forums/viewthread/38997/P486/#389993
       
Peter Lewis's avatar
Peter Lewis
280 posts
about 16 years ago
Peter Lewis's avatar Peter Lewis
I’m using this extension to create a slideshow using javascript on the page. I have everything working they way I want except for one thing. I need a conditional to display the controls only if there is more than 1 image being uploading using the extension. Something like: {if total_results > 1}{/if} Is there anyway to do this?

Not sure if you solved this, but it should work - it needs to be wrapped in the custom field pair and you may need to try wrapping total_results in additional curly brackets

{[custom_field]}
{if {total_results} > 1} ... {/if}
{/[custom_field]}

Alternatively where you want the controls to appear duplicate the custom field loop and use count:

{[custom_field]}
display image using {file_url}
{/[custom_field]}

{[custom_field]}
{if count == 2} display controls {/if}
{/[custom_field]}

There’s been a couple of fixes to the plugin mentioned in this thread which haven’t been incorporated into the plugin download - one of these may have rectified the issue if total_results isn’t working - I can’t remember what fixes I’ve now made to the plugin locally!

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
about 16 years ago
Andrew Gunstone's avatar Andrew Gunstone

Hi all… quick question… has anyone got Mark’s file module (or even nGen’s one) working with a progress bar? Probably using some form of jQuery/Ajax would be the go I imagine.

The client has asked for one… but I am not really sure where to start.

       
Peter Lewis's avatar
Peter Lewis
280 posts
about 16 years ago
Peter Lewis's avatar Peter Lewis

Just a quick thought if there’s no other solution, you could add some JavaScript to trap the Save button (when the images are uploaded) which replaces the button for an repeating animated GIF, so at least the client knows something is happening…?

       
Andrew Gunstone's avatar
Andrew Gunstone
101 posts
about 16 years ago
Andrew Gunstone's avatar Andrew Gunstone

Thanks Twobelowzero. I have looked and looked, and I think you are spot on. I am going to make it look “nice” by throwing up a lovely transparent grey div over the top of the window, with a nice little repeating gif.

Simple but effective!

😉

       
vladyn's avatar
vladyn
176 posts
about 16 years ago
vladyn's avatar vladyn

Can I get something like this

{my_field}{total_results} images in this gallery{/my_filed}

without outputting the url of the files

       
Peter Lewis's avatar
Peter Lewis
280 posts
about 16 years ago
Peter Lewis's avatar Peter Lewis

Yes. Exactly that, although your closing tag is mis-spelt. :cheese:

{[custom_field]}…{/[custom_field]} — When used as a pair the contained code will loop, outputting all the uploaded files. count — Numeric number of each file total_results — Total number of files uploaded to the custom field file_name — Filename of the uploaded file. file_url — URL to the uploaded file. file_thumb_name — Filename of the uploaded thumbnail. file_thumb_url — URL to the uploaded thumbnail.

http://docs.markhuot.com/ee/extensions/file

       
vladyn's avatar
vladyn
176 posts
about 16 years ago
vladyn's avatar vladyn

with above code I’m getting the number the images, but I also getting the fileUrl’s as loop - that’s the reason I’m asking is there any way to get ONLY number of the uploaded images

       
Peter Lewis's avatar
Peter Lewis
280 posts
about 16 years ago
Peter Lewis's avatar Peter Lewis

This should work fine as the code previous. I’ve noticed that problems can appear when you mix a single tag with a tag pair, for example:

Total Images: {my_image_field}{total_results}{/my_image_field}
This is my Image URL: {my_image_field}

So instead do something like this:

Total Images: {my_image_field}{total_results}{/my_image_field}
This is my Image URL: {my_image_field}{file_url}{/my_image_field}

Also I made a modification to the extension based on code previously supplied in this thread regarding “single” which made it more unstable - so ensure you’re using the correct version.

       
First 57 58 59 60 61 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.