dannytalk ™ A Danny Ng Blog

Danny Ng blogs about SEO, Web Development, Christianity, and Life in General

New Wordpress Theme Launched!

Posted by danny On February - 28 - 2009

Ok, I’ve finally managed to spend a good portion of my Saturday evening tweaking, testing and configuring this new theme locally. Seems like I’ve ironed out most of the bugs I encountered earlier and viola, this theme is finally live!

Since I couldn’t be bothered hacking the social bookmarking plugin using jQuery, I decided to look for a plugin that uses jQuery already. SocioFluid is a great social bookmarking plugin that uses jQuery. It has a cool feature which is similar to your navigational bar on mac computers.

I’ve also added adsense in the header and within the posts in hopes of generating some dollars from this website, but mainly to try it out and see what it is capable of since I’m working in the search industry. It’d be quite a handy piece of knowledge to have and master :)

There are also 4 125×125 banner ads available for advertising, so feel free to contact me if you’re interested. Most likely I’ll charge a flat rate rather than CPM/CPC models as I couldn’t be bothered going through tracking systems.

If you do encounter some strange or unexpected behaviours on the site, please let me know and I’ll fix it. Obviously I’m unable to go through each post and make sure they all look correct.

Tell me what do you guys think. Is it better? Worse?

Better I hope :)

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png

Wordpress: Getting unwanted 302 redirects locally

Posted by danny On February - 22 - 2009

If you’re trying to do some testing on your existing Wordpress website locally (using something like XAMPP) using the same files and database but find that it keeps 302 redirecting to your website rather than running it locally, you will have to configure your Wordpress options to set your home and site URL to your local address.

Since you can’t even access your Wordpress admin interface because of the redirects, you’ll have to configure this on the backend, your database.

Run your trustworthy phpMyAdmin or your favourite SQL client, connect to your local database and browse to your Wordpress database (this is usually prefixed with wp_). Then browse to a table called wp_options or wp_kicpl0_options and look for a table field called siteurl.

The current value of this field should be your website. Edit this field value to your local address (i.e. http://localhost/wordpress). Remember NOT to use a / at the end. Save this.

The next field to edit is called home. If you can’t find this field on your current view in phpMyAdmin, it’s probably on the next page of fields. Edit this field value to the same value you used in siteurl. Save this.

Once you’ve edited both fields, just simply type in your local address again in your browser and you should be running your website locally instead of being redirected to your online website.

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png

Wordpress Fatal Error: Cannot redeclare pclziputilpathreduction

Posted by danny On February - 14 - 2009

If you’re using Wordpress 2.7 and you’re trying to upgrade to Wordpress 2.7.1 and you come across an error message like “Cannot redeclare pclziputilpathreduction()“, make sure that your Wordpress Automatic Upgrade plugin is disabled/deactivated.

Then proceed to upgrade your Wordpress to version 2.7.1 from your dashboard and it should work fine (make sure your backup your files & database before hand!).

Seems like Wordpress has already incorporated automatic upgrade into its core features already which will probably render the Wordpress Automatic Upgrade plugin useless now.

Thanks though to the plugin creator for all your hardwork as it was probably one of the best plugins available ever since it came out.

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png
Categories: Web Development
Tags:

You may have read my previous entry on performing a 301 redirect from Blogger to Wordpress, where I wrote a script that will capture all traffic to your old Blogger site and redirect it to your new Wordpress site. Ideally you’d want to do the 301 redirects from the web server, but unfortunately Blogger doesn’t allow you to do that and thus, you’re left with the client-side solution: Javascript.

First of all, let me clarify briefly on my previous post and inform you what the core strengths of my script are.

  • Client-side redirect will not work without Javascript. Pretty obvious huh? What that means is that search engine crawlers aren’t able to follow the redirect. Nasty limitation in a simplistic sense.
  • Strengths of my script are:
    1. It works.
    2. You need a client-side solution if you’re on Blogger. No other way.
    3. It captures and redirects all traffic from your old site to your new site.

That being said, let me now expand on these two major points: the limitations of search engine crawlers and why is capturing traffic important.

Read the rest of this entry »

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png

How to 301 redirect from Blogger to Wordpress

Posted by danny On July - 26 - 2008

As promised in my previous post (301 Meta Refresh Redirects: How Google and Yahoo Sees It), I will show you a script I wrote that will handle 301 redirects from Blogger to Wordpress using the meta refresh tag and javascript.

I have tested it on my old blogger (http://dannynsl.blogspot.com) and it seems to have worked fine so far.

There are a few steps you will first need to do.

  1. Install Wordpress on your domain. There should be installation tutorials on the website. I haven’t had time yet to do my own installation tutorial.
  2. Import your Blogger posts into Wordpress. In your dashboard, go to Manage and then Import.
    Wordpress - Import Blogger
  3. Change your permalink structure. In your dashboard, go to Settings and then Permalinks. The Day and name or Month and name settings should work. However, for my script I think Month and name should be safer.
    Wordpress - Permalinks Settings
  4. Use my javascript code just after the start of the <head> tag in your Blogger layout template. Note: Please make sure you do a backup before making changes. The variables that you need to change are old_root_domain and new_root_domain. This script handles redirection of individual posts, monthly archives and yearly archives. Anything else it will redirect to your homepage.

    When assigning values to old_root_domain and new_root_domain, DO NOT use ‘/’ at the end.

<script type='text/javascript'>
/*
 * Written by Danny Ng (http://www.dannytalk.com/2008/07/26/how-to-301-redirect-from-blogger-to-wordpress/)
 * Free to use and distribute but must keep this comment in place.
 */
var post_regex = /^http:\/\/(www.)?.*\.blogspot\.com\/\d{4}\/\d{2}\//;
var month_archive_regex = /http:\/\/(www.)?.*\.blogspot\.com\/\d{4}_\d{2}_\d{2}_archive.html/;
var year_archive_regex = /updated-min=\d{4}/;
var label_regex = /search\/label\/.+/;
var old_root_domain = 'http://dannynsl.blogspot.com', new_root_domain = 'http://www.dannytalk.com', tag_url = '/tag/', redirect_suffix;

if (post_regex.test(location.href))
	redirect_suffix = (location.href.search(/www/i) == 7) ? location.href.substring(old_root_domain.length+4, location.href.length-5) : location.href.substring(old_root_domain.length, location.href.length-5); // -5 to strip .html
else if (month_archive_regex.test(location.href))
{
	redirect_suffix = (location.href.search(/www/i) == 7) ? location.href.substring(old_root_domain.length+4, location.href.length-16) : location.href.substring(old_root_domain.length, location.href.length-16); // -16 to strip _XX_archive.html
	redirect_suffix = redirect_suffix.replace(/_/g, '/');
}
else if (year_archive_regex.test(location.href))
{
	redirect_suffix = year_archive_regex.exec(location.href).toString();
	redirect_suffix = redirect_suffix.replace(/updated-min=/, '/');
}
else if (label_regex.test(location.href))
{
	redirect_suffix = label_regex.exec(location.href).toString();
	redirect_suffix = tag_url + redirect_suffix.split('/')[2];
}
else
	redirect_suffix = '';

document.write("<meta content='0;URL=" + new_root_domain + redirect_suffix + "' http-equiv='refresh'/>");
</script>

If you want to do a 302 redirect equivalent, just change the number in the meta content from 0 to 1 or 2.

Hope this works for you and please let me know if there are any bug issues.

[edit date=26/07/08]

I just fixed the code to accommodate blog addresses with ‘www’ subdomains. As for redirects for labels, I’ll try to update the code for it tomorrow if I have time.

[/edit]

[edit date=27/07/08]

I’ve added a new regular expression to handle labels and also another variable tag_url that points to your permalink structure for tags or categories.

Wordpress - Category, Tag edit

This setting can be found under Setting, then Permalinks and just scroll right down to the bottom. You will need to edit the variable tag_url to what you’ve sent in the permalinks structure. Make sure you add the ‘/’ at the end of it.

I think by default, Wordpress automatically imports posts from Blogger and sets the labels to categories instead of tags. In this case, just set the variable to the category slug name unless you can be bothered to go through all the posts and set them as tags instead.

[/edit]

[edit date=14/02/08]

Just found a bug (thanks to Chris Lee) that the redirection didn’t seem to work in IE7. For some reason I needed to add URL= in the meta content attribute for the redirection to work.

Basically I just changed,

document.write(“<meta content=’0;” + new_root_domain + redirect_suffix + “‘ http-equiv=’refresh’/>”);

to

document.write(“<meta content=’0;URL=” + new_root_domain + redirect_suffix + “‘ http-equiv=’refresh’/>”);

Please let me know if you guys ever come across bugs for this script and I will try my best to fix it as soon as possible :)

Happy Valentines Day everyone!

[/edit]

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png