• The Context: WP allows you to upload images, optionally creating a thumbnail of the image automagically.
    The Problem: The handy HTML it gives you after uploading an image does not include any reference to the thumbnail.
    The Solution: I modified wp-admin/upload.php so that, if you specify a thumbnail, it will find the size of the thumbnail and create HTML that displays the thumbnail image, wrapped with a link to the original image. It actually gives you two versions of the HTML – the first has the thumbnail code included, the second is the same HTML that the page used to generate.
    There’s a pseudo “diff” here:
    https://rm.bookdev.com/upload_with_thumbnail_code.phps
    I’d be very interested in feedback. I’ve tested it on my server, and it seems to work fine. (See it in action here.)

Viewing 15 replies - 1 through 15 (of 33 total)
  • Nice addition. Any way you can clean it up a bit in wording back to indicate which is the thumbnail clickable link and which is just the embedded link?
    Also, any chance to pass on the upload code result right to the post new article body area? Not that copy and pasting is that hard, but an option to create a new post after uploading would be nice.

    Thread Starter monkinetic

    (@monkinetic)

    Good idea about the wording on the returned code. As for adding the code to a new post, I know that MT does this, and it’s something I’d be interested in as well, but for the moment it’s beyond my knowledge of WP to add it.
    If anyone want’s to suggest a way to do it, I’d be interested.

    Thread Starter monkinetic

    (@monkinetic)

    Ok, I’ve added the explanatory text to the output, you can find the code at the same place.

    Cool, thanks, I’ll check it out… Hopefully this can get vetted into 1.2 before release. Hate to hack the upload.php each time for such and obvious feature…

    Spiffy, will have to try it. I just discovered the thumbnail making feature worked, thought it hadn’t but files were there.

    Thread Starter monkinetic

    (@monkinetic)

    Yeah at first I thought the thumbnailing wasn’t working either, because it did not put any code in to display the thumbnail. Hence this hack. Glad you like it.

    Thread Starter monkinetic

    (@monkinetic)

    mumeimagpie,
    Would you mind sending me your upload.php?
    steve at redmonk dot net.

    All fixed on my end — I had some silly extra characters in my upload.php file, but thanks to muchly helpful people all is well! :}

    Way to go monkinetic!!!! Thanks!!!
    Totally awesome, now I can quit whining ?? and get back to work making a site and recomending WordPress to customers (the few I have lol).
    Photo handling capabilities is a sign of a small cms that makes it great. Now WP has making of thumbs which it had, which is great, and your hack which makes it even better. I appreciate all the hard work the developers and people like you that know their stuff put into it, and am confident that progress will continue.

    It would be useful to add this to the regular WP source ??

    Just want to say a heartfelt “thank you” for this piece of code. It will ease my life immeasurably.
    Beth aka woolgathering

    Awesome hack! Thank you!

    I need a username and password to access the page?

    monkinetic, this is great. Thanks for that! I would like to add a few style tags to the image / thumbnail links:
    style=”float: left; padding-right: 10px; padding-bottom: 10px;
    Could you or maybe someone else please point to where these tags should be added within the upload.php (or prob. your code snippet) to always assign above mentioned style tags to a thumb per default?
    Thanks,
    Chris

    This is exactly what I’ve been looking for. Thank you

Viewing 15 replies - 1 through 15 (of 33 total)
  • The topic ‘Thumbnail HTML addition for upload.php’ is closed to new replies.