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

Categories
General

WordPress Comment Spam Fun

I started getting comment spam at wedin.org over Thanksgiving, and since then every WordPress site I’m involved with has gotten at least some. It’s relatively easy to delete the spam, but that’s clearly not a real solution. Turning off comments would obviously fix it, but a blog isn’t very fun without comments. I’ve listed below a few sites with information and tools that I’ve found helpful.

This site has a nice overview of the problem, and many (all?) of the various available methods of fighting it.

Spam Karma seems to be highly recommended, and it uses tons of different methods of detecting spam. However, I’ve found it tends to eat real comments, which sucks. It’s highly adjustable though, so it may just be a matter of checking the right boxes.

This post at the WordPress support forum suggests renaming a couple of comment-related files to confuse the spam bots.

This WordPress plugin is very simple, and shouldn’t affect real users at all. Seems like spammers will find a workaround pretty easily though.

So far, there’s no method that’s perfect. Spam Karma works very well, but deletes real comments occasionally. The last two methods seem to work, but are so simple that I’m afraid spammers will be able to program a way around them too easily.