Code Monkey home page Code Monkey logo

Comments (30)

funkatron82 avatar funkatron82 commented on July 21, 2024

The code for the new media uploader can be found in the /wp-admin/include/media.php file in the WordPress 3.3 beta. Been looking at it to see it can be integrated in the meta-box plugin.

from meta-box.

jezthomp avatar jezthomp commented on July 21, 2024

Is the new media uploader going to be workable once WordPress 3.3 is out?

Also work like the featured image so any images attached to a post or page can be used elsewhere also?

from meta-box.

bainternet avatar bainternet commented on July 21, 2024

take a look at my fork, i've created a new field type which uses the built in media uploader, and works with the new drag and drop uploader.

from meta-box.

jezthomp avatar jezthomp commented on July 21, 2024

Ooo looks good. :)

Can you add further images at the same time, like the old checkbox method of this script?

from meta-box.

funkatron82 avatar funkatron82 commented on July 21, 2024

I asked for more info about about plupload (the new media uploader) on Stack Exchange and the combo of EAMann and One Trick Pony came in for the win: http://wordpress.stackexchange.com/questions/33173/plupload-intergration-in-a-meta-box

One Trick Pony's answer especially gives insight to how to use plupload nicely. I added a few corrections via comment to make it truly functional

from meta-box.

funkatron82 avatar funkatron82 commented on July 21, 2024

Almost done with a solution. Currently got ajax uploading working. Just got get the code readable, set up some error responses in case of failure and enable a drag and drop area. I think I may get this done by the weekend.

from meta-box.

jezthomp avatar jezthomp commented on July 21, 2024

Awesome i look forward to seeing it. :)

How is the image being attached though, like with a featured image thus able to use a single image across multiple posts or how a gallery is, so only one image user per post?

The former would be amazing, but dont think its possible.

from meta-box.

funkatron82 avatar funkatron82 commented on July 21, 2024

New image field called plupload_image is up: https://github.com/funkedgeek/meta-box/tree/master

example image: New uploader example

I wanted to ask a question to further customize this: currently, only the bottom half of the field area has the ability of having files dragged onto it. Does anyone prefer the whole area to to have this ability?

from meta-box.

Teddd1 avatar Teddd1 commented on July 21, 2024

It would be great if the user could select images from the media gallery too. At the moment I can only select images from the harddrive - I can remember that I could use media gallery images with WP3.2 + V3 of the meta box script.

from meta-box.

 avatar commented on July 21, 2024

By the bottom half, do you mean the upload area itself or where the loading-images currently are? (as a php newb myself, could you also perhaps update the demo.php?)

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

@funkedgeek To answer your drag & drop position Q: I'd prefer to have it at the top upon the images themselves. If someone uploads a massive amount of images, the drag & drop box would go beyond the fold/visible viewport.

We will also need to
a) restrict file types,
b) restrict number of files.
Both shouldn't be js or css solutions for safety reasons. Console just gives too much freedom :)

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

@rilwis I hope you can merge this ASAP in. I'll take a look at the code today and tomorrow and would need to have a full repo to see possible js-conflicts. Maybe we could update the readme.md for some days to state that the current version is Alpha. Thanks. :)

from meta-box.

funkatron82 avatar funkatron82 commented on July 21, 2024

Another Q: Should I just combine my uploader with the standard one and use an option to pic between the two?

from meta-box.

rilwis avatar rilwis commented on July 21, 2024

@franz-josef-kaiser I'll try my best, just too busy at the moment :(

@funkedgeek Looks like you did a great work. Yes, I guess the option to choose which uploader is good. I'm waiting for your commit :)

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

@rilwis N/P. :)

@funkedgeek @rilwis (imho) think it's better to leave them apart. Maybe it get's harder to divide them, when we deprecate the old one - which we will. I could also imagine that people would be confused when they overread something and get the "wrong" uploader.

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

@funkedgeek Just in case, you're currently working on this: I found a lot of bugs, copy/pasted your code and currently working on it.

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

@funkedgeek In case you read this: Please upload the image-error.gif and image-loading.gif to your repo. Thanks :)

from meta-box.

funkatron82 avatar funkatron82 commented on July 21, 2024

Okay, sorry for the wait. Newly updated with the missing images. Also combined the two image uploaders. All you have to do to change it is add the uploader argument to the array with the field options. Example is in the demo file. Now that I've wrapped my head around plupload I'll be working on incorperating it into the file field as well

@franz-josef-kaiser : let me know what errors you find. I'm pretty sure I covered files being too large. File types are set in the localized object I set up for the uploader to use. I think I can set up a filter for that for the field type in general but I don't know how to do it for a particular field.

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

@funkedgeek Oh, no :/ As I said: Currently working on this. I already added a pull request with all the fixes... Could you take a look at my last pull request and diff it with your old files? There're also some minor improvements like for the label, etc.

from meta-box.

rilwis avatar rilwis commented on July 21, 2024

Thanks both of you for the great works. I just accepted the pull request from @franz-josef-kaiser and will check it soon. After seeing the code, I think making it a separate field type is a good idea ;)

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

@rilwis I'll take the images and the contents of the demo file from @funkedgeek and work it in tomorrow - hope you got time to merge it in then. We really need a) a clean state to work from and b) come up with an idea to avoid such stupid double work. So far the only idea I can think of is that I make another repo as clone from @funkedgeek, then work in all changes, make a pull request to @funkedgeek fork and then delete my new clone/fork... which is stupid... absolutely stupid. :/ I hope you guys got some better ideas.

@funkedgeek I think another filter isn't that good idea (I even added another one for the drop-message - not kool). We should really find a way to better parse in our arguments to deprecate all our actions and filters. This should be a one step process (time for another ticket).

from meta-box.

funkatron82 avatar funkatron82 commented on July 21, 2024

Okay, changes updated on my branch. Add some new features including an edit link

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

@funkedgeek It's getting harder :)

Did you start working from @rilwis merge, or did you update your old pull request? I really want to avoid that we collide again and work parallel.

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

@funkedgeek Just tried your last changes and got some errors for plupload-image.php. You use the vars $link and $image on line 231. If there're no attachments so far, $wpdb->get_col() delivers and empty array(), so your foreach loop will work, but$imagewill stay empty. So currently you're adding mark-up for stuff that's not there. The second problem is right after the loop, when you're adding the hidden field: You're calling$image, which is again hidden and$link` is again not set. Also there's no reason to add mark-up if you got nothing to display.

from meta-box.

funkatron82 avatar funkatron82 commented on July 21, 2024

If the array is empty it shouldn't loop by default. The rest I'll check after work.

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

@funkedgeek With empty I meant a white space. But I was messing up line numbers. After inspecting further I fund myself beeing wrong on this. The errors came from the part after the loop. Inside the loop there's just $link that's set nowhere.

from meta-box.

funkatron82 avatar funkatron82 commented on July 21, 2024

Got it fixed in the latest update

from meta-box.

franz-josef-kaiser avatar franz-josef-kaiser commented on July 21, 2024

Works for me. Guess we close it and move on.

from meta-box.

 avatar commented on July 21, 2024

Same here. Thanks!

from meta-box.

rilwis avatar rilwis commented on July 21, 2024

Seems that the thread is long :D, and we have the working version, so I close it. You can open any issue if have any problem.

from meta-box.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.