CoolPlayer, Brian's Threaded Comments and WordPress 2.3.1

Hello everyone. I'm back. First, I want to apologize for the two false alarms (via RSS/email) in the last two weeks. The first false alarm was caused by switching the IP address of this blog with my EDA Blog. For some reason, the IP switch triggered FeedBurner into thinking there was a new post when there wasn't. That's why you saw a bunch of stuff for my EDA Blog (FeedBurner used the old IP for iZachy, which was really mapping to EDA Blog). The second false alarm occurred when I reactivated my plugins after upgrading to WordPress 2.3.1. My guess is that the Better Feed plugin triggered FeedBurner. You might want to leave that plugin activated for your next WordPress upgrade.

As I mentioned previously, I upgraded to WordPress 2.3.1 (from WP 2.2.2) recently using my WordPress upgrade process. After upgrading, all of my plugins worked except for the Crawl Page and Brian's Threaded Comments plugins. One of my readers mentioned that CoolPlayer did not work with WordPress 2.3.1. I can assure you that is not the case. Both CoolPlayer 9.0 and 9.3 worked with WordPress 2.3.1. However, I had to hit the browser reload button after I upgraded from CoolPlayer 9.0 to 9.3 before the plugin worked correctly.

I could never get the Crawl Page 1.00 plugin to work, but I did get Brian's Threaded Comments plugin to work with WordPress 2.3.1. After upgrading to WP 2.3.1, I got a 404 error whenever I tried to leave a comment. The fix for this problem is actually fairly simple. You just need to enter "wp-comments-post.php" in the custom box on the threaded comments admin page (Options => Threaded Comments):

Brian's Threaded Comments

WordPress 2.3.1 breaks a lot of plugins. You should check around to be sure your plugins work before upgrading. At the bottom of this post, I listed plugins that I use that work with WordPress 2.3.1. If you are using an older version of the Google XML Sitemaps plugin (I was using 2.7.1), you should upgrade to the latest version (currently 3.0.2.1). The new version works with WP 2.1+ and has a bunch of new features. It's a big improvement on already nice plugin.

Plugins that work with WordPress 2.3.1:

  • Akismet 2.0.2
  • Audio player 1.2.3
  • Better Feed 1.1
  • Brian's Threaded Comments 1.5.12
  • Contact Form ][ 2.0.13
  • CoolPlayer 9.3 (CoolPlayer 9.0 also works)
  • Democracy 2.0.1
  • FeedBurner FeedSmith 2.3
  • Google XML Sitemaps 3.0.2.1
  • Head META Description R1.1.2
  • Related Posts 2.02
  • Similar Posts 2.3.6
  • Simple Recent Comments 0.1.2
  • Smart Update Pinger 2.0
  • Spam Karma 2 2.3 rc3
  • Unfancy Quote 2.0
  • WordPress Database Backup 2.1.5

Threaded Comments Plugin for WordPress

I've been testing Brian's Threaded Comments WordPress plugin. As the name implies, the plugin enables threaded comments…giving you and your readers the ability to reply to a particular comment.

I like the plugin, but it requires more work than the standard WordPress plugin. For one thing, the plugin requires you to replace your existing comments.php file for your theme with the file supplied with the plugin files. Then, unless you are lucky, you have to mess around with the style to get the plugin to format correctly for your theme. I think the plugin was designed to work with the default (Kubrick) WordPress theme. This is the reason why I switched back to the default theme for my blog. I didn't have time to edit the style sheet for my previous theme.

I've also noticed that the threaded comments plugin and the CoolPlayer plugin conflicts with each other, resulting in some of the comments being garbled in IE 6. The plugin seems to work fine in IE 7 and FireFox.

Download Brian's Threaded Comments plugin for WordPress and see if it works out of the box for your theme. If it doesn't, you will need to edit the plugin files (comments.php and briansthreadedcomments.php) and/or your style sheet (style.css) for your theme.

WordPress Database Backup

When I upgraded to WordPress 2.1, I noticed that the backup plugin was no longer bundled with the WordPress 2.1 installation files. I'm not exactly sure why; probably a combination of (1) WP 2.1 includes a new import/export feature and (2) the plugin changed hands (from Skippy to Austin Matzko).

I tested the new import/export feature. It worked as advertised, but it does not save everything. For instance, the options you have already setup and the descriptions of the categories are not included in the exported XML file. When I moved this site to a different web host this past week, I used the new WordPress Database Backup 2.0 plugin to save my posts and configuration. Then I restored the backup on the new host using phpMyAdmin.

WordPress Database Backup 2.0 PluginThe new backup plugin has a very useful feature: automatic backups (Manage –> Backup). As you can see in the screen shot on the right, you can schedule backups to occur hourly, daily, or weekly. I have to admit, I was a bit nervous when I used the automatic backup feature. But it has worked like a charm for over two weeks now. At first, I limited my tests to just this site, but now I also use the automatic backup feature on my other four sites. I find the automatic backup feature very handy because it is a bit of a chore to manually backup five sites.

BTW, the backup files are emailed to you. I actually used one of the automatic backup files to restore the database when I moved to my new web host. My guess is that if you have a massive blog, you might have problems having your backup emailed to you. I think if you leave out your email address in the "Email backup to" box, the backup will be saved on the server (not confirmed). The backup of my largest WordPress site has 2,882 posts and the 3.8M backup file arrived daily via email without any problems.

Hack for RSS Feed Ads

I've been playing with the Better Feed WordPress plugin to insert ads in my RSS feed. As I mentioned previously, it's fairly easy to add a text footer or graphics ad into your feed. However, if you want to rotate between multiple ads, then you need to hack the plugin. Read on to find out how.

You will need to find the following line in the Better Feed plugin (if you have not added a footer or modified the plugin, it's around line #101):

$content .= wp_ozh_betterfeed_detokenize($wp_ozh_betterfeed['footer']);

I'm going to call it the "footer" line. Once you have found the "footer" line, you will need to add a block of code above that line. Something like:

[block of code]
$content .= wp_ozh_betterfeed_detokenize($wp_ozh_betterfeed['footer']);

I have put together three sets of block codes that you can use. Select the one that best suits your needs.

Block 1 – Alternate ads
This code block is for alternating ads in your feed. For instance, post #1 will show "Ad-B", post #2 will show "Ad-A", post #3 will show "Ad-B" again, post #4 will show "Ad-A" again, etc. Here's the block to insert above the "footer" line:

if ($id % 2 == 0 ) {
  $ad = "Ad-A";
} else {
  $ad = "Ad-B";
}
$content .= $ad;

Block 2a – Rotate between four ads
[2007.03.10 note: The random number generator used in this block can cause old posts to show up as "updated" in Bloglines. If you don't want this to happen, use Block 2b instead.]
This code block is for displaying one of four ads in your feed. For instance, post #1 will show either "Ad-C" or "Ad-D", post #2 will show either "Ad-A" or "Ad-B", post #3 will show either "Ad-C" or "Ad-D" again, post #4 will show either "Ad-A" or "Ad-B" again, etc. Here's the block to insert above the "footer" line:

if ($id % 2 == 0) {
  $num = rand(1,2);
  if ($num == 1) {
    $ad = "Ad-A";
  } else {
    $ad = "Ad-B";
  }
} else {
  $num = rand(1,2);
  if ($num == 1) {
    $ad = "Ad-C";
  } else {
    $ad = "Ad-D";
  }
}
$content .= $ad;

Block 2b – Rotate between four ads
[Added on 2007.03.10]
This code block is for displaying one of four ads. It's like the block of code above, but it uses the timestamp of the post instead of a random number generator. It shouldn't change an old post to "updated" in Bloglines. Here's the block to insert above the "footer" line:

$num = get_post_time('s');
if ($id % 2 == 0) {
  if ($num < 30) {
    $ad = "Ad-A";
  } else {
    $ad = "Ad-B";
  }
} else {
  if ($num < 30) {
    $ad = "Ad-C";
  } else {
    $ad = "Ad-D";
  }
}
$content .= $ad;

Block 3 – Display an ad for every 3rd, 6th, and 9th post
I use this code block for my news site. I write over 20 posts a day on that site and it would look too commercial if I ran a RSS ad in every post. This block of code will display an ad for every 3rd, 6th, and 9th post. Here's the block to insert above the "footer" line:

$ad3 = "Ad-A";
$ad6 = "Ad-B";
$ad9 = "Ad-C";
$num = substr ($id, -1);
switch ($num)
{
  case 3:
    $content .= $ad3;
    break;
  case 6:
    $content .= $ad6;
    break;
  case 9:
    $content .= $ad9;
    break;
}

You will need to replace "Ad-A", "Ad-B", "Ad-C", and "Ad-D" with the html code for your ads. Keep in mind that the code is already using double quotes. So, you will either need to use single quotes or omit the quotes in your html code for your ads. For instance:

$ad = "<p align=center><a href=http://www.embeddedstar.com/careers/><img src=http://edageek.com/adimages/jobs468.gif border=0></a></p>";

As you can see, I didn't use any quotes between the double quotes above.

One other note. WordPress assigns post id numbers in the order you saved them. The id numbers can get out of order if you don't publish your posts in the same order you saved them. This may cause the ads to appear to display out of sequence (ie – the same ad displaying two times in a roll). That is not the case.

free creative and multimedia magazines