Categories
General

Photopress update

Bugs keep appearing, so I won’t give it a new version number yet, but it’s getting there. The major change is in the album, which now supports categories that can be edited at Manage: Photopress Album.

Try it out: photopress.zip or photopress.tar.gz

To upgrade, you should be able to just overwrite the old files. If you were using an earlier version that required Ezstatic, you’ll need to fix any linked thumbs you may have inserted into posts – the Browse tool makes this pretty easy though.

You can also go to wp-plugins.org to download bleeding-edge files directly.

Categories
General

Photopress 0.3

Try it out: photopress.zip or photopress.tar.gz

The major improvements are 1) an Options page instead of the old config file and 2) GIF and PNG support. I don’t think I did anything to help the button problems some people are having, but you never know. Give it a try and let me know how it goes.

Make sure you at least view the options page, even if you don’t plan on changing them – otherwise the plugin won’t have any options to work with. I’d imagine I can write some code to use some defaults if the plugin doesn’t find any options variables in the database – I’ll try to figure that out for the next version.

If you inserted linked thumbs in posts using an earlier version that used Ezstatic, you should go back and edit those posts to use the new album. The Browse button should make this very easy. I’d like to figure out some generalized way to put a linked thumb in a post so that messing with the album or changing where images are located doesn’t break stuff like it does now…

Categories
General

Photopress 0.2

Seems to be improved enough and working well enough to share another version. Let me know what you think!

Partial list of changes:

  • Changed the button javascript a bit, no idea yet whether I’ve fixed anything though
  • More options: see photopress-inc.php in the photopress folder for details (wouldn’t an admin page be nice…)
  • No requirements anymore: uses the template_redirect action instead of Ezstatic to make the album work (thanks to Jerome’s Keywords plugin for the hint)
  • Self-contained: just the plugin and the supporting folder, no files outside of wp-content
  • Automatically places photo album link and random image in the meta list in the sidebar

As usual, extract it in your WP root and it should all end up in the right places. If you’re upgrading, you can delete album.php from your root folder. Make sure the photos folder in wp-content is writable.

Get photopress.zip or photopress.tar.gz and give it a try.

Categories
General

Photopress

Go to isaacwedin.com/photopress for the latest version of this plugin!

Photopress is a plugin that adds a set of helper tools to WordPress to make working with images much easier. It adds a pop-up uploader and a pop-up image browser to the posting page and a groovy random image function for your template.

To install, download and extract the archive in your WordPress root directory, which should put the files in the right places. To install manually, here’s where everything should go:

  • album.php: in your WordPress root directory
  • photopress.php: in wp-content/plugins/
  • upload.php, browse.php, and photopress-inc.php: in wp-content/plugins/photopress/
  • photos folder: in wp-content/, and it should be writable by your server

The album requires ezstatic to blend into the rest of the blog.

Photopress is based on Florian Jung’s Image Browser, the built-in WordPress upload tool, and Owen Winkler’s Edit Button Template.

To use the random image function, add something like < ?php echo random_image_pp(); ?> to your template (I like to put it at the top of sidebar.php in the default 1.5 theme).

That’s about it. Download photopress.tar.gz or photopress.zip and give it a try.

Update: The archives I uploaded earlier were somehow corrupted – thanks to Larry for noticing that. I fixed them and both worked fine on my clean 1.5 testbed when I tried them out. Just the photopress.php file was corrupted, so replacing that with the new one should do the trick. Note that you may need to change the permissions on the “photos” folder – to test it try uploading a photo.

Update again: Internet Explorer (and some versions of Firefox?) apparently doesn’t like spaces in the window name used in window.open. That’s fixed now, along with a couple of other things. You should be able to just extract the updated version right over the old one. Sorry for the bumpy ride – I appreciate all the debugging help!

Categories
General

Replacing strings in old WP posts

After trying several different methods of including photos in posts I had images scattered in several folders and links pointing all over the place. I could have just left the old stuff in place, but that offended some silly aesthetic sense. So, I wanted all of the image references and links in the old posts replaced with the new stuff.

Unfortunately, WordPress doesn’t have a built-in tool to find and replace strings in old posts, probably a good thing due to the potential for disastrous user error. There are some plugins that filter the text in posts, for instance to censor posts or to expand shorthand, but nothing to change old posts directly. Finally, I found this thread at webxpertz.net with a discussion of how to do exactly what I wanted to do. Feeding this SQL snippet to PHPMyAdmin worked perfectly:

UPDATE wp_posts SET post_content= REPLACE (post_content,'old string','new string') WHERE post_content LIKE '%old string%' ;