Archive for the ‘WordPress’ Category.

No quarters required

Thanks to a little assist from my coworker John Boker, the amazing Asteroids javascript from Erkie is now fully integrated into this here very web site. Alls you have to do is type asteroids on any web page of this roided up web site (just make sure the focus is not set on a text field or the URL field), and blast away.

Here is the javascript that I added to the footer of my pages:

<!-- asteroids -->
 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
 
    <script type="text/javascript">
        function asteroids()
        {
            var s = document.createElement('script');
            s.type = 'text/javascript';
            document.body.appendChild(s);
            s.src = 'http://erkie.github.com/asteroids.min.js';
        }
        var roids = "";
        $(document).keypress(function(e)
        {
            roids += String.fromCharCode(e.which);
            if ("asteroids".indexOf(roids) != 0)
            {
                roids = "";
            }
            else if (roids == "asteroids")
            {
                roids = "";
                asteroids();
            }
        });        
    </script>

Enjoy.

Can we all get along?

I finally got tired of living with the inability of WordPress to automatically update on this very blog site, which is hosted on 1&1, so I did some digging into the WordPress forums. In addition to the automatic update just hanging up when trying to download the updated zip file, I also would never see anything appear under the WordPress Development Blog and Other WordPress News sections on the right side of the main dashboard.

One of the solutions mentioned was to set up your web site to use PHP5 instead of PHP4. So, I logged into the 1&1 administration panel, but could find no setting for the version of PHP used by my web sites. (My company has sites hosted on Rackspace Cloud, formerly Mosso, which has a nice little choice list on their admin panel to set the PHP version.)

A quick phpinfo() page on my blog site indicated that version 4.x of PHP is used. An equally quick search of the 1&1 FAQs yielded the answer.

You have to put the following line into the .htaccess file in the root of your web site:

AddType x-mapp-php5 .php

Apparently, this makes it appear to 1&1 hosting that all of your PHP files are meant to be run using PHP version 5 instead of version 4, without having to rename all of your files to have a php5 extension instead of php.

Oh, and I hope everyone is having a nice Boxing Day.