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%' ;

Categories
General

Welcome to isaacwedin.com

It’s mostly a place for Photopress, my WordPress plugin, to live instead of at my personal web site. You’ll also find ideas about running a family weblog here eventually.

Categories
General

Hawk in the backyard

I startled this hawk from the deck railing and it flew up into one of the trees in the backyard. Looks like maybe it’s a Sharp-shinned or Cooper’s Hawk.

Hawk in the backyard