Archive for the ‘Coding’ Category

How to Get Comments onto Pages in WordPress’s Default Theme

Thursday, March 20th, 2008

As you may have noticed, if you use WordPress’s default theme, “Kubrick”, the comments form does not show up on pages even when you have the option switched-on for a page. I regard this as a theme bug. I fixed it by adding the PHP call to WordPress’s comments function to the bottom of the page.php file.

I did this with WordPress v2.3.3, and have no idea if it will work with other versions. Be careful when editing theme files. Make sure to download a copy of the file first with your FTP program so that you can upload it again if something goes wrong. If you blow up your blog, it’s not my fault.

Steps:

  1. Go to your admin panel
  2. Click Presentation
  3. Click Theme Editor
  4. Make sure that “WordPress Default” is selected
  5. Click the “Page Template” link
  6. Make sure that you are editing “page.php”
  7. Find this line near the bottom: <?php endwhile; endif; ?>
  8. Right below it, enter this: <?php comments_template(); ?>
  9. That tells WordPress to add the comments form.
  10. This is code, so each and every character must be typed exactly.

I don’t have a lot of comments on this site, so this hasn’t been battle tested. Let me know how it works for you.

SDB File Extension Warning

Thursday, March 6th, 2008

Bottom line: Windows thinks that files using the .sdb extension are registry patch files, and during a system restore, will roll them back to previous versions.

Many applications use the SQLite database engine, and a good number of them use the .sdb extension for the database files that they create. This is fine on the Mac, iPhone, and Linux, but definitely not a good idea on Windows. If your system crashes, and Windows forces you to do a system restore, you might lose important data. Windows thinks that your .sdb files may have been responsible for damaging the registry and tries to return your system to its previous state by rolling back the files to previous versions.

For example, if you have a customer-database program that you update throughout the day, Windows will replace it with a copy that it has stored in the most-recent restore point. Having a back-up copy of your database won’t help unless you make copies throughout the day.

Another consequence is that if you have many large database files, Windows will use up more time and space for restore points. Windows appears to scan your system, and make copies of any file that ends in .sdb, regardless of whether or not it was used to modify the registry. If Windows puts a lot of large database files into its restore points, they will take up more of the allocated space, and you will have fewer restore points. When you have to do a system restore, you want to have a few restore points to choose from.

Search your system for all files that end in .sdb. If you find anything that looks important, make a back-up copy of it every time you update it. You should also complain to the software company, and request a new version of the software that evades the problem. A programmer can fix this problem pretty easily. Nothing more than choosing a new file extension is required. While there is no “official” extension that I know of, I think .sqlite is reasonable. I use .rsd, but only because that’s what the REALbasic language likes.

I learned this .sdb hazard the hard way after a power outage. When my Vista Ultimate system started-up, Windows insisted on doing a system restore. It re-assured me that my data would not be harmed. So, I clicked the OK button, and soon realized that Windows was lying. It most certainly did harm my data. Each of my SQLite database files was missing recent updates, while my other files were fine.

I googled around and didn’t find mention of this problem elsewhere, so I am claiming to be the originator.