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

Mark Huot File Extension

Development and Programming

notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch

towards the end of the file, between the last bit of script and before the script tag is closed

i think it would look something like the below (i added the “// INSERT CODE HERE” to illustrate)



						
       
mooo's avatar
mooo
168 posts
16 years ago
mooo's avatar mooo

hmmm. I followed the instructions, but when I click on an arrow to move a file up the list, it acts like an anchor link and jumps me up to the top of the page without moving the file.

       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch
hmmm. I followed the instructions, but when I click on an arrow to move a file up the list, it acts like an anchor link and jumps me up to the top of the page without moving the file.

did you add the onclick events? it wouldnt go in the code tag for some reason

hrm… some reason the inline javascript don’t get posted, add these to the links onclick=“swapFiles(this, \‘up\’); return false;” onclick=“swapFiles(this, \‘down\’); return false;”

those would go inside the links found in the code snippet

$r.= '<a href="#">'.PATH_CP_IMG.</a> ';
            $r.= '<a href="#">'.PATH_CP_IMG.</a>';
       
mooo's avatar
mooo
168 posts
16 years ago
mooo's avatar mooo

facepalm

I copied the code from your post, but when I pasted it, it turned the quotes into question marks and I didn’t notice. Changing those fixed it and it works! Thanks.

       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch

ahaha it’s always the little things that get right by.

the code i’m working on kept breaking all over the place because I forgot a “+1”. >_<

im glad to hear it’s working though. let me know if you run into any problems in usage. i had some problems with regex and newlines but that should be taken care of.

       
mooo's avatar
mooo
168 posts
16 years ago
mooo's avatar mooo

thanks. I once spent three hours looking for a problem on a page only to finally find that it as a missing endquote breaking the whole page. It’s the details that’ll kill ya.

       
notacouch's avatar
notacouch
92 posts
16 years ago
notacouch's avatar notacouch

figured i should link this here

how to add width/height variables courtesy Chris Newton http://ellislab.com/forums/viewthread/103527/#526454 (might want to put an ‘@’ before getimagesize as Mark Huot did to suppress potential errors)

one thing that would make some scripting easier for me is to know which dimension is greater ahead of time so i added a variable for that, too

,
'file_gd' => ( $mh_file_width > $mh_file_height ) ? 'width' : 'height'

havent tried it yet but i dont see why it wouldnt work

       
cityzen's avatar
cityzen
83 posts
15 years ago
cityzen's avatar cityzen

Just a heads up to people that are finding the quality of their images greatly reduced using Mark’s file uploader. It’s not the uploader as it’s using all of the correct methods to optimize the image resampling, it’s the actual image. The best way to preserve quality is to first optimize the image in Photoshop (or whatever you use to optimize jpg’s) and then upload it. I was uploading some raw images, possibly with strange color profiles (client is a photographer) and they would always look like crap. Once I optimized them and saved them at 100% jpeg quality and uploaded them, HUGE difference…

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

In addition to cityzen’s post, ensure it’s RGB format! A client kept uploading CYMK images which then appeared in a wild variety of colours once on the site. These had to be converted to RGB and 72dpi first before uploading.

       
Roger Glenn's avatar
Roger Glenn
54 posts
15 years ago
Roger Glenn's avatar Roger Glenn

STAND ALONE ENTRY FORM CHOKES IF FILE ALREADY EXISTS ON SERVER

I notice that when using the stand alone entry form to upload a file with Mark Huot’s File extension, the upload chokes if the file already exists in the upload destination.

In the control panel I get a nice error message:

Attached Files – The file ‘LATIN_861723.pdf’ already exists, please rename your file before uploading it to the server. ( Automagically rename this file the next time it’s uploaded?)

But the stand alone entry form just dies out to a blank screen. Anybody else run into this issue?

       
sagebrown's avatar
sagebrown
13 posts
15 years ago
sagebrown's avatar sagebrown

Hi all -

Quick question - for some reason the {count} variable is getting mixed up with the weblog:entries {count} variable, and returning the number of weblog entries, and not the number of images found. Does this make sense? Here’s the code I’m using below. Instead of counting the images returned, it just repeats “1” for the number of weblog entries found.

[code]    {exp:weblog:entries weblog="projects" limit="1"}
            <ul>
                {project-lightbox-images}
                    <li>                            
                        {file_url} 
                    </li>
                {/project-lightbox-images}        
            </ul>    
    {/exp:weblog:entries}[/code]
       
Art Practical's avatar
Art Practical
13 posts
15 years ago
Art Practical's avatar Art Practical

Note: I answered my own question. I just set the Resize Images dropdown to Auto. Thanks.

Hey,

Is there a way to anchor both the height and the width for the resized version?

I’ve anchored the width by editing the File Upload Preferences and it works great, but I want to be able to anchor the height to the same value at the same time.

Thank you.

       
Tim Smith's avatar
Tim Smith
15 posts
15 years ago
Tim Smith's avatar Tim Smith
just found one bug. The {count} variable doesn’t increment right. It was switching between 1 and 2.

<

blockquote author=”sagebrown” date=”1261875290”>Hi all - Quick question - for some reason the {count} variable is getting mixed up with the weblog:entries {count} variable, and returning the number of weblog entries, and not the number of images found. Does this make sense? Here’s the code I’m using below. Instead of counting the images returned, it just repeats “1” for the number of weblog entries found.

[code]    {exp:weblog:entries weblog="projects" limit="1"}
            <ul>
                {project-lightbox-images}
                    <li>                            
                        {file_url} 
                    </li>
                {/project-lightbox-images}        
            </ul>    
    {/exp:weblog:entries}[/code][/quote]

I’m using 3.1.1 of Mark Houts file extension and the count variable doesn’t increment. After investigating this is because he’s using array_flip as part of the variable setup code, which has the effect of losing the count variable on the last file returned from a multiple file list. This is because array_flip will remove duplicate entries.

To fix it I changed lines 1234 to 1236 from

$var = array_flip($var);
$var = array_map(create_function('$x', 'return LD.$x.RD;'), $var);
$var = array_flip($var);

to

$var_keys = array_keys($var);
$var_keys = array_map(create_function('$x', 'return LD.$x.RD;'), $var_keys);
$var = array_combine($var_keys,$var);
       
First 2 3 4

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.