November 8th, 2007
It's remarkable easy, and quick, to do a search/replace on a MySQL database. PHPmyAdmin makes it even easier.
For example, say you have a table containing Web links to a server on your network and the server name gets changed or, more likely, the Web pages get moved. You might have links such as http://oldwebserver/importantstuff/index.html that should now be http://newwebserver/importantstuff/index.html. To correct these with an SQL statement, use:
UPDATE table_name SET field_name = REPLACE (
field_name,
"old text",
"new text");
For example:
UPDATE mytable SET url = REPLACE (
url,
"http://oldwebserver/importantstuff/",
"http://newwebserver/importantstuff/");

Note: The reason I didn't just replace "oldwebserver" with "newwebserver" is as a safeguard against changing things I didn't want changed. You've got to be pretty careful about what you do, and I would strongly advise that you always back up the database before making any changes like this.
WordPress expert Lorelle has some good advice about doing this kind of thing on your WordPress tables at:
http://lorelle.wordpress.com/2005/12/01/search-and-replace-in-wordpress-mysql-database/
Potentially similar posts
October 30th, 2007
In March I wrote a couple of posts about a problem using Microsoft Live Writer to post blog entries where I'd included an image above a certain size:
Live Writer large image problem
Live Writer large image problem #2
Basically, if I tried including an image above about 30KB I got the following error:
|
Error attempting to connect to weblog at: http://www.itauthor.com/xmlrpc.php
The underlying connection was closed: The connection was closed unexpectedly.
|
I got the problem again, this evening, trying to upload my previous post, which included several decent-sized images, and I was determined to get to the bottom of the problem. It turns out the problem is with the PHP memory limit. The fix is to adjust the memory limit for PHP for your blog. To do this, simply add the following line to the .htaccess file in the root directory of your blog (in my case this directory is /var/www/html/wordpress on my Web server):
php_value memory_limit 16M
You don't need to restart Apache or anything. Just change the .htaccess file and click Publish in Live Writer and it should work fine now. I can't promise it'll work in all cases, but it worked for me.
Potentially similar posts
October 2nd, 2007
Now that WordPress 2.3 is out I really must upgrade this blog. In fact I never finished designing the blog, as you can see. I couldn't find a theme that suited me so I decided to create my own. Bad move. I hardly have time to write blog posts. I never find the time to do podcasts. So the chance of me finding time to fiddle about designing my own WordPress theme is slim to non-existent.
So, when I do find some time (hopefully some weekend soon), I'm going to upgrade WordPress and choose an off-the-shelf theme for 2.3 that looks like it might be supported through future upgrades and stick with that, so that at least everything works, even if it doesn't work, or look, like I'd like it to.
At the moment I'm on WordPress 2.1.3 so I'm just hoping the upgrade to 2.3 is fairly painless. We'll see.
Potentially similar posts
September 13th, 2007
I was looking for a WordPress theme to replace the half-finished, half-broken theme I'm currently using. I stumbled upon a site called Fire & Knowledge by Joshua Sowin. Joshua uses a simple, clean theme that I might try out, rather than using my own theme, which I've never finished and am not likely to.
In the list of Latest Essays on Joshua's site I noticed one called A Guide to Writing Well, which isn't aimed at technical writing but, nevertheless, lists lots of useful principles that we should keep in mind while writing technical documents. Here's a few:
- Omit needless words. Write simply and without clutter. Don’t add words for “style.”
- Avoid fancy words.
“Never use a long word where a short one will do.” (George Orwell)
“Look for all fancy wordings and get rid of them.” (Jacques Barzun)
Examples: Assistance (help), facilitate (ease), implement (do), referred to as (called).
- After every sentence, ask yourself what the reader wants to know next.
- Use orthodox spelling, punctuation, and capitalization.
- Use active verbs. Example: “He was seen by Joe” should be “Joe saw him.”
- Keep sentences short.
“There’s not much to be said about the period except that most writers don’t reach it soon enough.” (Zinsser)
- Remove laborious phrases. Why use “at the present time” instead of “now”?
- Use contractions when they sound natural.
- Write like a person and not like a scientist.
Potentially similar posts
June 24th, 2007
The search functionality that comes with WordPress is limited. Results are always listed in chronological order, rather than by relevance.
I've just installed a plugin that makes it much easier to find posts in your blog. The plugin is very easy to install, just follow the instructions here:
http://www.zirona.com/software/wordpress-advanced-search
Potentially similar posts