• This WP Photo Hack makes use of the existing WP Upload feature and quicktags to simplify adding photos to your posts. With the hack, inserting a photo takes two steps:

    1. Use the “Upload” feature to upload your pick, allowing WP to create a thumbnail.
    2. Use the “img” quicktag in the post editor, entering the filename of the photo you uploaded and a description.

    The hack will display the WP created thumbnail in your post, as a javascript link to a popup box that displays the full-size image. The popup automatically resizes to the size of the image. For visitors without javascript enabled, a simple link to the image is created.
    Hack and demo available here: WP 1.2 Photo DisplayHack
    Questions, comments, or help, please comment here.

Viewing 15 replies - 16 through 30 (of 32 total)
  • When I used ' as somebody else had pointed out further up, it just printed(echo) this 1:1 in WP. But if I come again across a similar situation, I’ll definitely will try your solution of \ too ??

    Hm. I seem to have a problem creating the thumbnails (whether I am using the plugin or not). I get an error message “file type not supported”. Any clues?

    Thread Starter sakamuyo

    (@sakamuyo)

    I’m not an expert in this area, but I’ll try to help. ??
    First, check your settings through the admin options and make sure you have upload enabled and the file type you are uploading is listed.
    Second, and especially if the main file uploads and the problem is only with generating the thumbnail, it might be that your webhost does not support this. I believe WP uses something called “GD” to do image manipulation. (Someone else please chime in if I’m wrong!) I would check with your webhost to see if they support GD. And, if so, if they can look at the script to make sure that part is working properly.
    If you end up having to manually create your thumbnails and upload them individually, make sure they use the “thumb-filename.jpg” format. For example, if your big picture is called “sailboat.jpg”, then name the thumbnail “thumb-sailboat.jpg”. Upload both to your images/ directory. If you do that, the quicktag will still work to generate the html code for your post.

    I cannot get this one to work at all. I do not understand what is meant by the escape characters not workign ?? I have put a \ in front of every ‘ in the code and it dont work….please help !

    Thread Starter sakamuyo

    (@sakamuyo)

    You do not want to put a \ before every ‘ in the script.
    I was going to tell you to look at the hack, itself, and make sure you have a \ everywhere it does. I noticed it was missing the needed \’s. My apologies to everyone. It has been fixed. Please go look at the updated page, as it has the proper escapes.

    The problem causing the quicktags to disappear, i believe, is the semicolon juz befor the word “Return false”

    Thread Starter sakamuyo

    (@sakamuyo)

    That semicolon is supposed to be there. If you give me the URL to your quicktags.js file, I’ll take a look at it for you.

    there should be a \ right before the ;

    Thread Starter sakamuyo

    (@sakamuyo)

    I don’t have a \ before the semicolon in mine, but if it works for you, go for it!

    thanks!
    I have another problem here..
    the url that popsup always is https://www.domain.com/images/pic.jpg instead of https://www.domain.com/wordpress/images/pic.jpg.
    and if I attempt to change the /images/ into /wordpress/images/ the quick tags would all disappear again. This is such a strange problem =/

    Thread Starter sakamuyo

    (@sakamuyo)

    Depending on how your webhost is setup, you might have to hardcode the entire “https://www.domain.com/wordpress/images/” part. There’s probably a nice way to use a WP tag to insert the base directly, but I don’t know what that would be.

    Well, I installed this hack a couple of days ago, and I know this thread is very old, but I did like the idea very much. I like it so much that I spent some time looking at the JaveScript that I added some helpfull additions to the hack to give it flexability rather then just a image planted at the end of a comment. I give the choice whether you want word-wrap options like: positioning, Hspace and Vspace for wrpping the text around the thumb-nail image.
    You are prompted 5 times in this hack:
    1) for the image file.
    2) for the alt. text you want to add.
    3) for the posistioning or Alignment of the image, either Left, Right or Middle.
    4) for the Horizontal value in number of pixles for the word-wrap.
    5) for the Vertical value in number of pixles for the word-wrap.
    Ia€?m still playing with it. Please let me know whe you think?
    here is the hack so far, I hope you dona€?t mind :):
    //START OF SCRIPT//
    function edInsertImage(myField) {
    var myValue = prompt(‘Enter the filename of the image’, ”);
    if (myValue) {
    myValue = ‘
    + myValue
    + ‘” onclick=”window.open(\’/popup.htm?/images/’
    + myValue
    + ‘\’,\’\’,\’resizeable=1,width=200,height=200\’); return false”‘
    + ‘>’
    + ‘<img src=”/images/thumb-‘
    + myValue
    + ‘” alt=”‘ + prompt(‘Enter a description of the image’, ”)
    + ‘” class=”photo”‘
    + ‘ Align=’ + prompt(‘Enter either: Left, Right, or middle for positioning’, ”)
    + ‘ Hspace=’ + prompt(‘Enter horizontal value in # of pixles for text-wrap’, ”)
    + ‘ Vspace=’ + prompt(‘Enter Vertical Value in # of pixles for text-wrap’, ”)
    + ‘ />‘;
    edInsertContent(myField, myValue);
    }
    }
    //END OF SCRIPT//

    I feel so silly… I have been trying to get this hackto work all day. I have double and triple checked the code, paths and escaped charecters. When I use the img quicktag to insert the image I just get the standard image, nothing else in the code or elsewhere. Can anyone help, please?

    Thread Starter sakamuyo

    (@sakamuyo)

    If you post the link to your blog and path to your quicktags file, I’l be happy to take a look.

    Im having a problem. Its not posting the thumbnail :S
    Check it out..
    https://peterbarbosa.com
    It just shows the description.. any help anyone?

Viewing 15 replies - 16 through 30 (of 32 total)
  • The topic ‘WP 1.2 Photo Display Hack’ is closed to new replies.