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

vladyn's avatar
vladyn
176 posts
15 years ago
vladyn's avatar vladyn

my code

{exp:weblog:entries weblog="{wb}" order_by="date" sort="asc" limit="1" disable="member_data|trackbacks|pagination|category_fields"}
                <div class="flickr">
                    <a href="#" title="отвори колекцията от снимки">{exp:imgsizer:size src="{imgFiles}" width="85" height="57" alt="отвори колекцията от снимки"}</a>
                    <pre>галерия "{title}" {imgFiles}{total_results}{/imgFiles}</pre>

<pre><code>            </div>
        {/exp:weblog:entries}</code></pre>

it outputs all the urls + total result number

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

Exactly the problem I mentioned - you’re using the single variable/tag then the pair.

Do this instead:

<a href="#" title="отвори колекцията от снимки">{exp:imgsizer:size src="{imgFiles}{file_url}{/imgFiles}" width="85" height="57" alt="отвори колекцията от снимки"}</a>
                    <pre>галерия "{title}" {imgFiles}{total_results}{/imgFiles}</pre>

<p>
</pre>

Note the change in the imgsizer parameters.

       
vladyn's avatar
vladyn
176 posts
15 years ago
vladyn's avatar vladyn

ahaa -I’ve got it many many thanks this was tricky

       
vladyn's avatar
vladyn
176 posts
15 years ago
vladyn's avatar vladyn

Unfortunately that way

{exp:imgsizer:size src="{imgFiles}{file_url}{/imgFiles}" width="85" height="57" alt="отвори колекцията от снимки"}

expression image sizer doesn’t return image - only url

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

Try:

<a href="#" title="отвори колекцията от снимки">{imgFiles}{exp:imgsizer:size src="{file_url}" width="85" height="57" alt="отвори колекцията от снимки"}{/imgFiles}</a>
                    <pre>галерия "{title}" {imgFiles}{total_results}{/imgFiles}</pre>

<p>
</pre>

       
vladyn's avatar
vladyn
176 posts
15 years ago
vladyn's avatar vladyn

works but this returns all uploaded images and the total number the point is that this fragment of code tries to be like thumb of an album from gallery - so it needs to display only one image (first one in case file field returns first with i single tag) and the number os images, which are uploaded

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

Third try lucky…

<a href="#" title="отвори колекцията от снимки">{imgFiles}{if count == 1}{exp:imgsizer:size src="{file_url}" width="85" height="57" alt="отвори колекцията от снимки"}{/if}{/imgFiles}</a>
<pre>галерия "{title}" {imgFiles}{total_results}{/imgFiles}</pre>

<p>
</pre>

       
spacewalk's avatar
spacewalk
106 posts
15 years ago
spacewalk's avatar spacewalk
Thanks Ryan- I actually took a stab at it and put it at line 293 above the return.

For Mark Huot’s File v. 3.1.1 extension, could someone please show exactly where to insert the line of code? I tried it at 293 as this post suggests, and also at line 550 as another post suggests, and nothing’s working (errors loading the CP page for weblog entries using the File type field).

Also, is it necessary to set the field to some type other than File and then set it back as suggested here under “One More Thing”? http://devot-ee.com/articles/item/fix-it-yourself-extensions-or-field-formatting-fiasco/

I assume that’s going to break the linkages to any existing uploaded images for the field in question. Thanks.

       
spacewalk's avatar
spacewalk
106 posts
15 years ago
spacewalk's avatar spacewalk
Thanks Ryan- I actually took a stab at it and put it at line 293 above the return.
For Mark Huot’s File v. 3.1.1 extension, could someone please show exactly where to insert the line of code?

This info I asked for would be handy for many people, I’m sure, so if anybody knows, please post.

Myself, I just bagged Huot’s File extension altogether, and I’m now using the nGen File Field for Brandon Kelly’s FieldFrame framework. Works great.

http://brandon-kelly.com/fieldframe http://www.ngenworks.com/software/ee/ngen-file-field/

For people with massive weblogs full of entries managed with Huot’s File extension, you’re in for tedious conversion work unless you’re smarter than I am (quite possible).

nGen can be connected to the same Upload Directory you were using with File, and it will let you choose existing files on the server, so you don’t have to re-upload your image files. You do, however, have to re-assign them to the new nGen field.

To do this, I changed Huot’s File field to a text input (and updated all entries), which then contained the file name string when I edited entries, so I could see what file name I wanted. I then manually chose the old file name for nGen File Field in every weblog entry. Tedious, but worth it.

You will also probably have a slightly different system short name for your new nGen File Field, so obviously you’re gonna have to update all your display templates with that short name value. But after those steps, you’re done.

       
eddyfever's avatar
eddyfever
62 posts
15 years ago
eddyfever's avatar eddyfever

Does anybody know where i can fill in the max width and height?

       
spacewalk's avatar
spacewalk
106 posts
15 years ago
spacewalk's avatar spacewalk
Does anybody know where i can fill in the max width and height?

CP Home › Admin › Weblog Administration › File Upload Preferences › Edit File Upload Preferences

       
lukemcr's avatar
lukemcr
154 posts
15 years ago
lukemcr's avatar lukemcr

Occasionally, a client will have problems uploading files with Mark Huot’s File module. There’s something about the control panel input that’s malformed or something. It isn’t possible to delete the offending file using the standard mark for deletion way - I have to go in to the database and delete the contents of the custom field in the weblog entry that’s messing up.

I’ve attached a screenshot. Any help would be great!

       
eddyfever's avatar
eddyfever
62 posts
15 years ago
eddyfever's avatar eddyfever
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) {}

I push this one a bit to the front, because i searched a long time, maybe it helps other people too.

       
futurestudios's avatar
futurestudios
17 posts
15 years ago
futurestudios's avatar futurestudios

@LukeMCR I could be wrong but that looks like your client has used the default “upload file” button on the publish form? i.e. rather that the browse button that comes with the extension?.

       
netlinkblueEE's avatar
netlinkblueEE
39 posts
15 years ago
netlinkblueEE's avatar netlinkblueEE

Hi,

Can any one tell me how to write the code on the template to display multiple file upload images on the pages ?

i assigned “gallery_test” custom filed to my weblog name “test” and uploaded 4-5 pictures.

Thanks.

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