How To: Remove nofollow from WordPress Comments


By StrangeWork.com: I decided to remove the nofollow code from my blog comments. Nofollow is an attribute that can be added to links to discourage comment spam. I use Akismet to block spam comments, which works about 98% of the time, so why penalize good comments from reaping the SEO benefits of outbound links on my blog?

I used the dofollow WordPress plugin. You can download the plugin here:
http://www.semiologic.com/software/wp-fixes/dofollow/

To install upload the dofollow plugin folder into your plugins directory and activate the plugin through your WordPress Plugins admin panel. Easy as that! Now readers of my blog who post comments will receive a good inbound link to their site. I wonder if this counts for good karma points?

How To: Move a WordPress Blog to a New Hosting Account


By StrangeWork.com. So you’ve decided to move your WordPress blog to a new hosting account, but need to know the proper steps to accomplish the transfer seamlessly. WordPress does have some tools available to help you move your blog, but I’m going to show you a much simpler approach.

I’ve broken this tutorial down so even a novice user can understand the steps involved.

Export your entire WordPress database using phpMyAdmin.

1. Login to cPanel on your OLD hosting account. Your login credentials should have been supplied to you when you created your hosting account.
2. Click the MySQL Databases icon listed on your cPanel home screen.
3. Scroll to the bottom of the screen and click on the phpMyAdmin link.
4. Click the Databases link and select your WordPress blog database. The default naming convention is username_wrdp1.
5. Click the Check All link to select all of your WordPress tables.
6. Click the Export link at the top of the page to export your data.
7. Verify that SQL export is selected and click the Go button to export your database into a SQL file.

This will generate a textbox containing all of the SQL code you need to recreate your WordPress database. Copy this code to a textfile on your computer and save it. You will need it later.

Install WordPress on your new hosting account
Next you need to install WordPress on your new hosting account. The easiest way to do this is using Fantastico, which is a typical component of cPanel.

1. Login to cPanel on your NEW hosting account.
2. Click the Fantastico icon listed on your cPanel home screen.
3. Click the WordPress link under Blogs to begin the WordPress installation.
4. Click New Installation and fill out the required installation information.
5. Install WordPress

Import your WordPress data in to your new WordPress installation
Now we need to import the SQL code from earlier into your new WordPress database

1. Login to cPanel on your NEW hosting account. Your login credentials should have been supplied to you when you created your hosting account.
2. Click the MySQL Databases icon listed on your cPanel home screen.
3. Scroll to the bottom of the screen and click on the phpMyAdmin link.
4. Click the Databases link and select your WordPress blog database. The default naming convention is username_wrdp1.
5. Click the Check All link to select all of your WordPress tables.
6. Select Drop from the With Selected drop down list.
7. Confirm you want to delete the selected tables. These tables are from your new installation of WordPress and contain no data.
8. Click the SQL link at the top of the page
9. Copy and paste the SQL code from earlier in to the SQL textbox and click Go to execute the query.

Your data has now been imported in to your new WordPress database on your new hosting account.

Copy themes and components to your new hosting account
Your database has all of your settings saved and knows what components and themes you have installed. Simply copy the themes and plugins folder (located in wp-content) over to your new hosting account and your all set!

How To: Update your Twitter status with ASP


Here is a simple script I wrote in classic ASP to update your Twitter status via the Twitter API. This script handles basic HTTP authentication to validate your Twitter account and URL Encoding to send over friendly status updates.

<%
Response.Buffer = True
Dim xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")

twitter_username = "username"	'change to your twitter username
twitter_password = "password"	'change to your twitter password

new_status = "visit strangework.com!"		'change to your new status

xml.Open "POST", "http://" & twitter_username & ":" & twitter_password & "@twitter.com/statuses/update.xml?status=" & server.URLencode(new_status), False
xml.setRequestHeader "Content-Type", "content=text/html; charset=iso-8859-1"
xml.Send

Response.Write xml.responseText		'view Twitter's response

Set xml = Nothing
%>

How To: Keep iTunes video window “always on top”


One small annoyance I’ve had for some time with iTunes is the fact you can’t keep the video window “always on top” of other windows. This is really annoying if you are trying to work and watch your favorite podcasts or movies.

Currently there is no way to accomplish this with iTunes. However I found a nice small program, for Windows and Apple, that allows you to designate any window you want to always stay on top!

For Windows: PowerMenu
Description: PowerMenu is a small application that adds some extra menu items to the windows control menu: Always On Top, Transparency and Minimize To Tray.

For Apple: Afloat
Description: Afloat is a small Cocoa plug-in that adds “Keep Floating”, “Always on Top” and “Make Transparent” commands to the Window menu of many Mac applications.

Once installed simply right-click your iTunes video window and select “Always on Top” from the menu. Now you can easily enjoy your favorite videos while working away!

How To: Install WordPress Plugin Twitter Tools


I just added a new module to my sidebar to show my Twitter updates (stalker vision ;). The module is from a WordPress plugin called Twitter Tools create by Alex King.

The plugin is very easy to setup and only contains 1 necessary PHP file.

1. Download Twitter Tools Plugin for WordPress

2. Upload the Twitter Tools plugin into your plugins directory via FTP. From your root FTP folder the path would be: \wp-content\plugins\

3. Login to your WordPress blog admin account. The web address is by default: www.domain.com/wp-admin

4. Click on the Plugins tab at the top of your admin page.

5. Twitter Tools will be listed as a plugin, but will not be active. Click the “activate” link to enable Twitter Tools to run.

6. Click the “Configure your settings here” or from the Options tab > Twitter Tool

7. Save your Twitter.com username and password into the module. Your all set!

From the Twitter Tools admin page you can add and remove various options. Here’s a quick example:

Show Tweets/Updates on Sidebar

1. Open your WordPress theme sidebar file called sidebar.php. From your root FTP folder the file would be located: \wp-content\themes\[YOUR THEME FOLDER]\sidebar.php

2. Add the following code anywhere you would like your Twitter tweets to appear:

<pre lang="php"><?php aktt_sidebar_tweets(); ?></pre>

Your tweets will automatically be displayed on your sidebar for everyone to see! For more features be sure to view the Help Documentation

Alex King created a solid Twitter plugin so be sure to support Alex.

How To: Create Custom ASP URLs with Querystrings using ISAPI Rewrite


ISAPI Rewrite is a powerful URL manipulation engine based on regular expressions. It acts mostly like Apache’s mod_Rewrite, but is designed specifically for Microsoft’s Internet Information Server (IIS). ISAPI_Rewrite is an ISAPI filter written in pure C/C++ so it is extremely fast. ISAPI_Rewrite gives you the freedom to go beyond the standard URL schemes and develop your own scheme.

Below are a few very easy to follow ISAPI Rewrite rules using regular expressions:



EXAMPLE 1

DESCRIPTION:
use one querystring as a subdirectory

ORIGINAL URL:
domain.com/member.asp?username=brad

NEW URL:
domain.com/brad

ISAPI REWRITE RULE:
RewriteRule /([^/]+) /member.asp\?username=$1 [I,L]



EXAMPLE 2

DESCRIPTION:
use two querystrings as subdirectories

ORIGINAL URL:
domain.com/member.asp?username=brad&page=2

NEW URL:
domain.com/brad/2

ISAPI REWRITE RULE:
RewriteRule /(?!images|js|css)([^/]+)/([^/]+) /member.asp\?username=$1&page=$2 [I,L]

* notice the (?!images|js|css) section of the rule. This piece tells the above rule to ignore those subdirectories (images, js, css).



EXAMPLE 3

DESCRIPTION:
use one hard coded subdirectory and one querystring as a subdirectory

ORIGINAL URL:
domain.com/member.asp?user_id=1

NEW URL:
domain.com/widget/1

ISAPI REWRITE RULE
RewriteRule /widget/([^/]+) /member.asp\?user_id=$1 [I,L]


Search engine spiders, and users, will ONLY see the newly formatted link. The querystrings are still being passed to the server, but they are not visible to anyone surfing the site. This is a HUGE advantage for making a dynamic site SEO friendly. Search engine spiders have always had issues with long complex querystrings, but masking the URL using ISAPI REWRITE has finally closed the gap between dynamic sites and SEO.

ISAPI Rewrite Homepage

How To: Return an Xbox 360 for repairs


If you read my post Xbox 360 Red Ring of Death, you know my Xbox has recently died. I got motivated today and called Xbox support to start the process of returning my Xbox for repairs. Here is a quick guide outlining the steps I took to get my Xbox repaired.
Xbox 360 Red Ring of Death image
Step 1: Call Microsoft Xbox support at 1-800-4MY-XBOX (1-800-469-9269)

Step 2: Get a support specialist on the line. Go through their basic troubleshooting steps to determine your Xbox is indeed broke.

Step 3: Microsoft will send a pre-paid UPS box for your Xbox to be shipped in. Make sure you write your reference number on the side of your Xbox before sending it off.

Step 4: Remove all attachments from your Xbox including your hard drive and face plate.

Step 5: Send your Xbox to Microsoft in the UPS package and wait for a refurb to arrive.

The support tech said the normal turn around time is 4-6 weeks. I have a feeling that wait time is going to increase dramatically when Halo 3 launches in September.

It’s too bad we have to do this, but at least Microsoft has stepped up to the plate to cover these repairs.

How To: Create ASP and AJAX username availability check example


So you’re using Classic ASP and you want to incorporate some AJAX into your scripts? No problem! The below example shows how easily it is to include a username availability check on your site using classic ASP and AJAX.

The below example checks the username after each key is pressed rather than when the form is submitted. You will need to create two files: ajax.asp and ajax_username.asp

You can download the sample source files at the bottom of this post

ajax.asp code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD>
	<TITLE>ASP and AJAX username availability check</TITLE>
	<script language="javascript">
	function OnChangedUsername()
	{
		if(document.form1.newuserid.value == "")
			{
				document.form1.btnCheckAvailability.disabled = true;
			}
		else
		{
			document.form1.btnCheckAvailability.disabled = false;
		}
	}
	function createRequestObject() {
		var ro;
		var browser = navigator.appName;
		if(browser == "Microsoft Internet Explorer"){
			ro = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
			ro = new XMLHttpRequest();
		}
		return ro;
	}

	var http = createRequestObject();

	function sndReq() {
		http.open('get', 'ajax_username.asp?username='+document.form1.newuserid.value);
		http.onreadystatechange = handleResponse;
		http.send(null);
	}

	function handleResponse() {
		if(http.readyState == 4){
			var response = http.responseText;
			var update = new Array();

			if(response.indexOf('|' != -1)) {
				update = response.split('|');
				document.getElementById("username_chk").innerHTML = update[0];
			}
		}
	}
	</script>
</HEAD>
<BODY>

<form method="post" action="javascript:void(0);" name="form1">
	<table>
		<tr>
			<td><input type="newuserid" name="newuserid" id="newuserid" size="20" onKeyUp="sndReq();" /></td>
		</tr>
		<tr>
			<td><input id="btnCheckAvailability" type="button" disabled="disabled" value="Check Availability" onClick="sndReq();"></td>
		</tr>
		<tr>
			<td><div ID="username_chk"></div></td>
		</tr>
		<tr>
			<td>Brought to you by <a href="http://strangework.com" target="_blank">Brad Williams</a></td>
		</tr>
	</table>
</form>

</BODY>
</HTML>

ajax_username.asp code:

<%
Set username = Request.QueryString("username")

'*** START - SET YOUR DNS-LESS CONNECTION VARIABLES
db_username = "username"		'DB username
db_password = "password"		'DB password
db_catalog = "database_name"		'DB name
dp_datasource = "192.168.1.1"		'DB IP
'*** END - SET YOUR DNS-LESS CONNECTION VARIABLES

Set conn = Server.CreateObject("ADODB.Connection")
conn.CommandTimeout = 0
c="Provider=SQLOLEDB.1;User ID=" & db_username & ";password=" & db_password & ";Initial Catalog=" & db_catalog & ";Data Source=" & dp_datasource & ";Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096"
conn.Open c

'*** ADJUST THIS SELECT QUERY TO CHECK THE USERNAME AGAINST YOUR MEMBERS TABLE
SQL = "SELECT username FROM table WHERE username='" & username & "' "
Set chk_username = Server.CreateObject("ADODB.Recordset")
chk_username.Open SQL, conn, 3, 3
If chk_username.EOF = False then
	response.write "USERNAME ALREADY TAKEN"
Else
	response.write "USERNAME IS AVAILABLE"
End if

chk_username.close
set chk_username = nothing

conn.close
set conn = nothing
%>

Just adjust the DSN-Less connection settings and the SELECT query above and your all set!

If you would rather check a username after the submit button is pressed just change this line:

to this:

DISCLAIMER - There is no error handling, form validation, or query injection functions or routines in this script. This is a basic username checking script. Be sure to include these features if you use this code!

Feel free to do whatever you would like with this code. If this helps then you might consider sending a link back to strangework.com!

click here to download both source files