Howto Manually Merge 2 categories in wordpress

So I had imported a few different blogs and other websites when i put together this one. the idea was that i could be rid of the 4 other websites or so and just have the 1. This was great in theory and i was a wordpress virgin. Everything previously used was ‘roll your own’ stuff I had written from scratch. This time I decided I would give it a go, and i stuck with it.

The importer worked brilliantly and imported blogger.com and other things all over the show. Some copy/paste was required for my own stuff, but for the most part a few well thought out SQL queries worked nicely.

My problem was that I had a couple of double up categories. Like “Facts” and “Informative”, and also “Humour” and “Funny” . I wanted to merge these together without having to manually edit every single post.

I found a few different plugins – however they were for earlier versions of wordpress. Then Apon googleing i found the following page which gave a great rundown!

http://www.franzone.com/2008/10/02/how-to-manually-merge-wordpress-tags/

Okay this is the dumbed down version for people NOT familiar with computering and SQL. Find PHPMyAdmin – its a pretty web interface thats probably installed on your server that interacts with the database.

Select your database name. Export your entire database and save it to your HDD. This is important, you might screw things up ok? No biggie if you do, you can restore it.

Now login to your WordPress backend. Click on “Categories” which shows your categories.  On the right hand side of each Category it shows how many posts are in each one. If you hover your mouse over that you can see the link goes to yoururl.com/wp-admin/edit.php?cat=xxx  in your status bar. If unsure then you can click the link and it will be in your URL.

The xxx is a number, That number is the category number which is the key to it all.

So find your 2 numbers of the ones you want to merge. Choose one of them as the one you want to merge into the other (ie if you have say 25 and 26 you are going to merge 25 INTO 26).

Now, heres the fun part. Updating the posts.

Open your PHPMyAdmin, click the tab at the top that says SQL. It will have a big empty box with the name at the top “Run SQL query/queries on database”

Into this box you need to type

UPDATE `wp_term_relationships`
SET `term_taxonomy_id` = xx1
WHERE `term_taxonomy_id` = xx2;

replace the xx1 and xx2 with the 2 categories you want to merge. xx1 would be the one you want to move them FROM, and xx2 is the one they are all going to move to.

If you get an error on this, by all means stop what you are doing and consult somebody else, Probably means you have that post in both categories already.

If it runs and says something along the lines of ‘complete, updated xxx posts’ then we win. Now you can remove any leftover garbage and the category. Do not run this if you have any errors.

DELETE FROM `wp_terms` WHERE `term_id` = xx1;
DELETE FROM `wp_term_taxonomy` WHERE `term_id` = xx1;

When i have xx1 here i mean use the same number you replaced earlier with xx1, the ones you moved posts out of. It should be fairly empty already.

This will not delete any posts. If all goes wrong then the most it will do is put your posts into Uncategorized.

Good luck!

Car gadets, GPS, MP3, Movies, etc

So ive been working on a neat little project lately. I decided i wanted a GPS in the car (no NEED for one, just a want) plus in car entertainment. Currently Ive always used an ipod in dock which charges the ipod and fm transmits the sound to the stereo in my android car stereo set up. I have pretty good sound quality too, I thought the transfer would cause some degradation but it’s fine.

So i grabbed my eeePC the other day, went online and bought a bluetooth adapter which im going to soldar inside, a GPS device, FM transmitter (usb powered), i had a USB hub already and some other things.

So I now have 3 wires from the eeePC.

* Power cable to the cigg lighter – I wanted to only have 1 power cable and minimize power consumption if at all possible. So the laptop is the only thing powered.

* USB hub. – From this all USB devices plug into. This will be in a small box under the dash when im done. It has the USB powered fm transmitter, GPS, Bluetooth (which eventually will be soldared into the laptop itself) .

* Audio out cable – this goes to the FM transmitter, I prefered this option to fully USB fm transmitter for cost sake and configurability .. “it just works”

I had some issues with trying to work out how I was going to dock the laptop in the car. Where it was going to sit or go. But because of the layout of my dash i was having issues. I didnt want it to sit in my way so I couldnt move or it interfeered with things, and a lot of PDA holders i saw did not hold the 1kg weight of the laptop well.  Then there is the issue of blocking the wind screen if it was too high.

Because of the layout of my dashboard i came to the conclusion that im an idiot.  This is what my dash looks like

interior19ns

Not an overly great shot, but you get the idea that the normal dash is actually in the center not behind the steering wheel like most cars. Heres a more modern version so you can get an idea of the layout (mine doesnt look half as good as this one though)

toyota_belta_dash

So this leaves a prime real-estate of between steering wheel and window for my laptop to sit i’ve decided. It shouldnt be too distracting and hard to see as this is where most dash speedos are located so i wont need to look too far. Eventually I can invest in a bluetooth or wireless kb so passengers can operate things if need be, but for now its fine.

Ill be getting a non-stick rubber mat and it *should* just sit there. Under the steering wheel is a shelf which is a great size for all my wiring and plugs and anything else i might need. A great place to keep it tidy.  Anyway for now Ive spent hours and hours compiling NavIT to get it going the way i wanted with the maps i wanted (ill post tutorials on that later). And im just debating using nghost or myth for the media in general. The screen seems a tad small for nghost, but ill see if i can hack it some.

Its on my ‘to do’ list. Another thing to do is to read this car DVD player guide and this scrap car yard in Montreal as the best place for selling old cars.

As for other software. I tried LinuxICE, it was worst than garbage and nothing worked.  I moved to straight ubuntu, compiled NavIT, and currently for now using rythembox and vlc for media.

I have an 8GB SD card i found lieing about for media, however i plan on buying a 32GB usb thumb drive, putting it apart and also soldaring it inside the laptop. I did think about external USB HDD, however this brings up power consumption problems i didnt want to deal with. Solid State all the way for now.

The @OfficeChair that twitters your farts!

It seems somebody REALLY wanted to invent something that twitters … everything! but without having to actually do so!

Twitter is supposed to happen in that space between Flickr posts and Facebook updates, in the space when life actually happens. Well, in the space of time “when life actually happens,” life actually happens. It is neither pretty nor ugly. It is just life. If Twitter is supposed to be a document of life as it happens, then it should really document life, indiscriminately, as it happens without interference. If it fails to do this, then life then becomes the space between “tweets” (Twitter posts).

Therefore, it is of the utmost importance, to be able to update Twitter with life events without actually interfering with the event themselves. The documentation of life, henceforth, needs to be automated.

That said, I decided the first part of life that needed to be documented was my daily flatulence at work. I am not going to lie, I am a gassy individual. Since my flatulence is a part of life, it would be fraudulent of me to document life as it happens without documenting these occurrences.

In keeping with the process of non-interference in daily activity, I have created an office chair to both detect and Twitter my flatulence without having to bother me to update it myself.

You can find the Instructable for his twittering fart chair here

You can follow his farting progress here