WordPress.org

Ready to get started?Download WordPress

Forums

Thumbnail HTML addition for upload.php (33 posts)

  1. pstew21
    Member
    Posted 10 years ago #

    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.

  2. monkinetic
    Member
    Posted 10 years ago #

    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.

  3. monkinetic
    Member
    Posted 10 years ago #

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

  4. pstew21
    Member
    Posted 10 years ago #

    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...

  5. mog
    Member
    Posted 10 years ago #

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

  6. monkinetic
    Member
    Posted 10 years ago #

    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.

  7. monkinetic
    Member
    Posted 10 years ago #

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

  8. mumeimagpie
    Member
    Posted 10 years ago #

    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! :}

  9. bruce2004
    Member
    Posted 10 years ago #

    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.

  10. carthik
    Member
    Posted 10 years ago #

    It would be useful to add this to the regular WP source :)

  11. Anonymous
    Unregistered
    Posted 10 years ago #

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

  12. Tek
    Member
    Posted 10 years ago #

    Awesome hack! Thank you!

  13. drean
    Member
    Posted 10 years ago #

    I need a username and password to access the page?

  14. Anonymous
    Unregistered
    Posted 10 years ago #

    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

  15. Anonymous
    Unregistered
    Posted 10 years ago #

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

  16. monkinetic
    Member
    Posted 9 years ago #

    Hi all!
    I've posted a proper diff.
    upload_additions.diff found here.
    Use at your own risk.
    --Steve

  17. Anonymous
    Unregistered
    Posted 9 years ago #

    the thumbnail is usually located at http://yourserver.com/imagedir/thumb-pic.jpg where pic.jpg is the original images...
    -abhi.

  18. monkinetic
    Member
    Posted 9 years ago #

    abhi,
    I did discover that eventually, but in 90% of the situations where I'm uploading images (as opposed to FTPing them as in the case of site graphics) it's because I want to link to them from a blog post, and in 89% of those cases I want to link the thumbnail. I think I'm not alone.
    The patch here does not remove the original HTML code, it's only adds another version to the returned code.

  19. strunk
    Member
    Posted 9 years ago #

    As a latecomer, let me also say that this is an awesome and very useful contribution. Thanks!
    S.

  20. PinHead
    Member
    Posted 9 years ago #

    I was hoping for to find something like this! Nice!
    -PH

  21. strunk
    Member
    Posted 9 years ago #

    I found one small typo in this version of upload.php. It writes its link like this: <img/>, so if you try to validate your page, you get end tag for that is not open. To fix this, just replace line 224 with this modified line:
    $piece_of_code = "This code will display the thumbnail, linked to the full-sized image:

    <img ". $sizes[3] ." src=&quot;". get_settings('fileupload_url') ."/$thumbfile&quot; alt=&quot;$imgdesc&quot; />"."

    "."This code will display the full-sized image:

    <img src=&quot;". get_settings('fileupload_url') ."/$img1_name&quot; alt=&quot;$imgdesc&quot; />";
    Best,
    S.

  22. daload
    Member
    Posted 9 years ago #

    I keep getting this error:
    Parse error: parse error, unexpected T_VARIABLE in /home/nobodys/public_html/blog/wp-admin/upload.php on line 207
    What should I do?
    Ill email you a copy of upload.php

  23. moshu
    Member
    Posted 9 years ago #

    @daload > the same error was reported somewhere above... It seems it was caused by some characters (white space?) in the file. Try to check that everything is clean. HTH

  24. Anonymous
    Unregistered
    Posted 9 years ago #

    Parse error: parse error, unexpected T_VARIABLE in /www/htdocs/v109938/blog/wp-admin/upload.php on line 207
    I am getting the same error, but I dont know what to clean up.. someone help please??? :-)

  25. Anonymous
    Unregistered
    Posted 9 years ago #

    thank you! I was looking for something like this!

  26. Anonymous
    Unregistered
    Posted 9 years ago #

    worked great on my word press, but when i tried and install this into my friends wordpress I get the following error:
    Warning: chmod(): No such file or directory in /usr/home/******/public_html/wp-admin/upload.php on line 177
    Warning: getimagesize(/usr/home/******/public_html/images/thumb-abandonhouse10-13-04ss.jpg): failed to open stream: No such file or directory in /usr/home/******/public_html/wp-admin/upload.php on line 212
    weird... cause i can copy and paste my whole *working* upload.php into her space and she stll gets that error, works great on my wordpress. and we are using the same version...

  27. WoodiE
    Member
    Posted 9 years ago #

    monkinetic,
    Great work - I've been using this on one of my sites for a while now and love it. Thanks!
    -Michael

  28. WoodiE
    Member
    Posted 9 years ago #

    Over the weekend I upgraded from 1.2.1 to 1.2.2 and since then this peice of code does not work. Instead I'm getting upload errors of unsupported files even though I'm trying to upload .gif and .jpeg files.

    Any ideas what I need to change to make this work for 1.2.2?

    Thanks,

    -Michael

  29. WoodiE
    Member
    Posted 9 years ago #

    ttt

  30. XepoX
    Member
    Posted 9 years ago #

    I would just like to point out the issue with validity since the code snippet in Strunk's post is corrupted.

    What you need to do is to remove the / in the line mentioned by Strunk. You will find the correct / just after the title tag, and right before the starting img tag.

    As long as the code tag doesn't like the php code it is impossible to post the correct code in here.

    Cheers

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags