Categories
General

Auto-update an image every X seconds

For a web cam site I’m working on, I wanted to automatically update the web cam image every so often. The classic way to do this is with meta refresh, but that’s supposedly deprecated and it unnecessarily reloads the entire page. JavaScript to the rescue! This little snippet reloads any image with the “refresh” ID every 60 seconds. It’s mostly borrowed from here, with the setInterval thing added because I didn’t like the onload thing in the body tag.

function cambox_refresh() {
echo "n" . '<script type="text/javascript">// <![CDATA[
function refreshCam() {
image = document.getElementById("refresh");
image.src = image.src + "?rand=" + Math.random();
}                 setInterval("refreshCam()", 60000);
// ]]></script>'. "n";
}
add_action('wp_footer', 'cambox_refresh');
Categories
General

Photopress2 0.6

This version is a big update, so there are bound to be some bugs. The plugin now uses the WordPress taxonomy system for tags, and includes paging all over the album. There’s a tool for importing your tags into the new taxonomy.

The tag displaying template function now has more options:

<?php if (function_exists('photopress2_image_tags')) photopress2_image_tags($before='Image tags: ', $between=' ', $after='', $id=get_the_ID()); ?>

If you’re using the template function in your theme you should update that since the old version will display all of your tags…

Suggested upgrade steps:

  1. Deactivate and delete the old plugin.
  2. Unzip the new plugin, creating a “photopress2” folder in your plugin folder.
  3. Make sure your album page contains <!–photopress2_album–>
  4. Go to Photopress2 : Settings and verify your album page slug and other settings.
  5. Refresh your permalinks at Settings : Permalinks.
  6. Go to Tools : Import photo tags to import your Photopress2 0.4 tags.
  7. If you’re using the template function, update that.
  8. If you use a cache plugin, clear it.

Get Photopress2: photopress2.0.6.zip.

Categories
General

Birthdaze 0.5

This update corrects WP_DEBUG warnings in Birthdaze, mostly in the widget. If you’re using the widget you’ll need to reconfigure it due to the changes. This version also adds an option to display the next week’s birthdays. The “thismonth” option in the shortcode and template function is now called “time” and should be set to “all,” “month,” or “week” depending on what you want to display. The readme.txt file should be up-to-date if you need more information.

Get the latest version of Birthdaze here: birthdaze.0.5.zip.

Categories
General

Titlematic 0.2

Titlematic is a simple plugin that gives title-less posts a title. This version adds an options page to configure the automatic title length, the character after the automatic title, and the fallback title text. It’s also now hosted at the WordPress plugins repository for easy upgrades.

Get Titlematic 0.2 from the WordPress Plugin Directory.

Update: If you auto-upgrade from 0.1, the old version may not be deleted and the new version may not be activated. If so, you’ll need to deactivate and delete 0.1, then activate 0.2.

Categories
General

flickpress 1.9.2

This version fixes more bugs uncovered by WP_DEBUG and adds a way to import Flickr images into the Media Library. When you’ve clicked through to a photo, if your user has upload permission there’ll be a link at the bottom of the popup to import the image as an attachment to the current post. Then you can use the imported image as you would any other attachment, such as for the post thumbnail or featured image. Please only import images when you have permission to do so!

Get flickpress 1.9.2 at the WordPress Plugin Directory or by upgrading as usual in your WordPress admin panel.

Update: I installed a derivative of Twenty Ten so you can sorta see the image import feature in action. I imported a photo of a leaf and set it as the featured image for this post, so if you’re viewing this post by itself you should see that as the header image.