WordPress 3.3 Upgrade

Unless, you are blind as a bat or need new glasses, you probably have seen the messages within WordPress, reminding you that you need to upgrade to WordPress 3.3. If that type of incessant nagging doesn’t get you to upgrade, I don’t know what does. So, I relented and upgraded several instances of my WordPress installs.

I use the WordPress upgrade via Subversion, but there were a couple of file conflicts in the upgrade. So, I ended up removing the .svn directories from the WordPress directories. I ended up upgrading WordPress via the easy and preferred, one-click method within the WordPress Dashboard.

So, what’s new with WordPress 3.3? The most obvious change is the redesign of the Dashboard. See snapshot of the Dashboard below. It’s supposed to be faster, functional and more accessible. To me, the eye candy of this whole upgrade is the new media uploader.

Uploading images into WordPress now supports the drag and drop of images into a media uploader. It’s makes uploading images much easier, if that wasn’t already the case. So, let me try a couple of images now.

The image above is a snapshot of the new Dashboard. As you can see, the Dashboard has been redesigned. It looks spiffy and neat. The image below is a partial snapshot of the new Media Uploader. As you can see, there’s a section where you can drop images for uploading.

To drag and drop images, I suggest that you minimize your browser, so that you can easily see and grab images from your Desktop. Just grab an image or several images to an area where it says “Drop files here” in media uploader. The media uploader will automatically upload the images for you. It’s impressive.

If you haven’t upgraded yet, I urge you to upgrade and take advantage of the new features of WordPress 3.3. Finally, here’s the obligatory video about WordPress 3.3.

A Background Image That Scales

I recently fixed an issue with my theme design. The dark wood background image that you see on this blog, was not big enough to fit most large monitors, where resolutions are higher than 1080px. Hat tip goes to Daniel Ritchie for pointing it out to me. So, I searched the web and found several possible solutions.

I found Chris Coyier’s at CSS-Tricks solution the most attractive, because it was by far the easiest one to implement. It not only adheres to CSS 3 standards, but it also works across most modern browsers. The result is a background image that fills up the entire page, scales to any size screen when needed, retains its aspect ratio, and centers the image properly.

What more can you ask for? Well, maybe something that loads a tiny bit faster than usual. So, I took the liberty to reduce the file size of my background image from 744kb to 128kb using my beloved Gimp. I use a little bit of image compression, without suffering too much in image quality. So, not only is the background image displaying properly on any size monitor, it also loads much, much faster. That’s a win-win situation.

If you like to know how I implemented a background image that scales to any screen resolution, just head on over to CSS-Tricks and check out Chris Coyier’s CSS3 solution. I hope you’ll find this article very helpful. I tested the new background with a HP w2207h monitor that rotates to landscape mode. Works great. If you find this to be otherwise, any input is appreciated.

Bluefish Blank Document Workaround

Since switching back to Ubuntu 10.04.3 LTS, I had one annoying issue with the Bluefish editor. When I double click on a PHP document, the Bluefish editor should automatically display the file. Instead, Bluefish launches a blank document.

Opening a file inside Bluefish, once it has launched, however, is not a problem. Blaming everything on Bluefish is unfair. The bug may be due to Nautilus. See discussion here. I call it a workaround because it fixes the issue, but it also creates another one. It disables opening up project files when launched.

If you don’t use project files, then by all means, use this workaround. This fix involves editing the command line options for Bluefish. Go to System > Preferences > Main Menu. You will find two Bluefish icons under Programming and Other.

Edit the command line option for the Bluefish icon under Other. Change it from bluefish -n -p %f to bluefish %F. See snapshot below. The two Bluefish icons should now have the same command line options, which is, bluefish %F.

I can now open files in Bluefish by double clicking a PHP file from within Nautilus. It’s no longer a blank document. Once again, this is workaround. It will disable opening up project files. I don’t use it, which is fine by me.

Remove index.php in Codeigniter

If you work with CodeIgniter, you will soon learn fast enough that the CodeIgniter framework, by default, uses the index.php in its URL. Here’s an example of how the URL would look like with the index.php being visible.

CodeIgniter URL

http://example.com/index.php/news/article/my_article

.htaccess

To remove the index.php from the URL, you will need to add mod rewrite rules to the .htaccess file in your main CodeIgniter directory. Use this code. Change the rewrite base to your own settings.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ci/
 
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
 
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
 
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

config.php

In addition, you will need to edit the /application/config/config.php file. Make sure to remove index.php reference within the file.

$config['index_page'] = '';

FIFA 2010 Online Service Down

EA Sports has finally turned off the online servers for FIFA 2010 on December 6. I have been trying to play online the last couple of days, but it kept saying the servers are down. And I thought the hiccup was due to the recent Xbox 360 update. Unfortunately it wasn’t. It was just EA turning off the online service for several games, in which FIFA 2010 is chief among them.

Here’s the service update notes from EA Sports.

The decisions to retire older EA games are never easy.  The development teams and operational staff pour their hearts into these games almost as much as the customers playing them and it is hard to see one retired.  But as games get replaced with newer titles, the number of players still enjoying the older games dwindles to a level — fewer than 1% of all peak online players across all EA titles — where it’s no longer feasible to continue the behind-the-scenes work involved with keeping these games up and running. We would rather our hard-working engineering and IT staff focus on keeping a positive experience for the other 99% of customers playing our more popular games.  We hope you have gotten many hours of enjoyment out of the games and we appreciate your ongoing patronage.

If you have further questions about your account or the shut down of these services, please visit http://support.ea.com.

Thank you,
Electronic Arts

Oh well, it was good while it lasted. In reality, I just about milked every cent out of that game. It was great fun. In the meantime, it’s time to look for a possible replacement. I heard FIFA 2012 has got rave reviews.

The Latest Xbox 360 Update

I was dismantling the Xbox 360 last night since the DVD tray would not open. I tried every trick in the book, but no cigar. I ended up breaking the seal (gulp, don’t tell anyone) and removing the plastic covers. I vacuumed the unit. and poked the hole near the DVD tray with a metal wire to free up the DVD tray. It worked.

I’m not sure if I needed to remove the plastic covers to poke the hole, but since it was already open, I took the opportunity to vacuum the unit. I can’t believe the amount of dust collected over the years. I left the covers off momentarily. It seems to have better ventilation without it. Who would have thought? Maybe, this will fix the red ring of death which I still get ocassionally.

Upon bootup, I was prompted with a message to run an Xbox update. So, I ran the update. After 20 minutes, the update completed. The Xbox rebooted. Lo and behold, the new Xbox 360 interface was right before my eyes. In case you haven’t seen it yet, here’s the new XBox 360 interface, courtesy of theRadBrad.

I’m not sure what to think of it yet. What’s with the Bing Search? You can now search the entire Xbox for movies, games, etc, but it’s not for searching the internet. I seem to like the easy access to videos and apps, like Netflix, Hulu Plus, etc. I also noticed viewing Youtube is now possible? I haven’t tried it yet. I’m going to have to play around with it some more before making anymore silly comments.

Find Your Linux Release Info

What’s the likelihood of you not knowing which version of Linux distro you are running? It’s probably a lot higher than you expect. I’ve had to do this at least twice before. If you’re not sure or you simply want to validate your distro, you can run the following commands to get the distro info.

Ubuntu

cat /etc/lsb-release

Fedora

cat /etc/fedora-release

Debian

cat /etc/*release

OpenSuse

cat /etc/SuSE-release

In Ubuntu, running the command above returns the following info.

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.3 LTS"

Back To Ubuntu 10.04 LTS

Remember the good old days of Ubuntu, way before Unity and Gnome 3 were the norm? Everything seemed to work just fine in those days. I finally did it. I took a major step back. I am now using Ubuntu 10.04 as my default Ubuntu Desktop.

Crazy as that may seem. It wasn’t because I was searching for a piece of nostalgia. I just wanted to go back to when everything worked. Ubuntu 10.04 LTS is a great distro to use as your base system.

Now that I am back to Ubuntu 10.04 LTS, everything works as I remembered. By the way, Ubuntu 10.04 is LTS or Long Term Support and is now supported for 3 years instead of the usual 2 years. Ubuntu 10.04.3 Desktop is set to expire April 2013.

Incidentally, I still have the latest Ubuntu releases on hand, as well as other notable Linux distros. They run as virtual machines via Virtualbox on my desktop. In reality, the latest Ubuntu releases are only a few clicks away.

str_replace

PHP has a built-in function called str_replace(). The function is used when you want to replace all occurrences of the search string with the supplied replacement string. The function contains the following options.

str_replace($search, $replace, $subject);

In this example, we have a string called $sample that contains the following.

$sample = "The quick, brown, fox, jumped over, the lazy dog, 
near the, bank of the river."

As you’ve noticed, our string contains many grammatical errors. It has too many commas. If we want to remove the commas and replaced them with blanks, we simply use the str_replace() function and look for the commas, and replace them with blanks.

$sample = "The quick, brown, fox, jumped over, the lazy dog, 
near the, bank of the river."
str_replace(",", "", $sample);
echo $sample

The above code will echo the following:

The quick brown fox jumped over the lazy dog near the bank 
of the river.

The str_replace() is a handy function when filtering inputs. You can use it before inserting data to the database or you can use it simply to change the content of a string. Check out the PHP Manual for more details.