WordPress.org

Ready to get started?Download WordPress

Forums

Picture Frame 0.8 Beta plugin (4 posts)

  1. abccba57
    Member
    Posted 8 years ago #

    I've just written this plugin today, if anyone if interested, please try it out and let me know if there are any bugs. You can download it here.

    Basically what Picture Frame does is replace <img src="http://a.com/b.jpg" /> in posts with a framed and linked version of the picture. Frames are absolutely customizable and there is a sample in "wp-content/pictureframe/pictureFrame.gif" in the ZIP file. You can see a sample page here.

    Frames work by taking a chunk of the original image and putting it "in" the frame. How it works will be clear once you start playing around with it. What Picture Frame does not do is re-size the image. If you need more explanation into how images are used let me know.

    Installation

    1. Extract plugin files to a temporary directory.
    2. Open "wp-content/plugins/pictureframe.php".
    3. Scroll down to the part with "-- Settings".
    4. Change "http://www.paulchiu.net/" to the address of your blog. You will need to end the address with a "/".
    5. Other settings explained:
      • "plugin_dir" ; Plugin directory for your blog, relative to your blog's address.
      • "frame_file" ; Frame file location, relative to your blog's address.
      • "frame_transparency" ; The color to be considered transparent in your frame file, replace "255, 0, 255" (pink) with the RGB value desired.
      • "option" ; Default display option to use when one is not specified. Option values are explained in the usage section.
    6. Upload Picture Frame files to your blog.
    7. Activate the plugin in your WordPress admin.
    8. Change linked images' style in your theme's style.css file.

    Use
    One limitation of the plugin is that images must be referenced absolutely. E.g. "http://www.paulchiu.net/images/x.jpg" and not "images/x.jpg". The following are some samples accepted image declarations:

    <img src="http://www.a.net/images/x.JPG" alt="Pic 1" />
    <img src="http://www.a.net/images/y.JPG" alt="Pic 2" option="topleft" />
    <img src="http://www.a.net/images/z.JPG" alt="Pic 3" option="bottomright" />

    The "option" attribute is a combination of either "top", "middle", "bottom" and "left", "center", "right" combined. The default option is "middlecenter". Option will decide which section of the image to place into the picture frame if the image is larger than the frame. If an image is smaller than the frame, it will be centered in the frame. When including images smaller than the frame in posts you will notice another limitation of the plugin, and that is the background color of the frame that is not filled by the specified image will be black. Unfortunately that black cannot be changed yet (I still need to figure out how).

    That's it, hope my explanations are reasonably easy to understand and that you'll find the plugin useful.

  2. genosypheus
    Member
    Posted 8 years ago #

    just what i've always wanted, thanks!

  3. attackofthegeek
    Member
    Posted 8 years ago #

    Very nice indeed. Thanks for sharing!

  4. 3stripe
    Member
    Posted 8 years ago #

    Tasty! =)

Topic Closed

This topic has been closed to new replies.

About this Topic