Saturday, July 20, 2013

How to Change the Gear Shift Knob of the Peugeot 306

Well, last week the gear shift knob of my car got teared down in my hand as I was driving as you can see it in the picture.
It was so really broken that the official knob from Peugeot would not fit anymore.
The good thing about it is that now I can replace it by a nice one.
gear shift broken

But it was a real pain to figure out how to dismount it, the main thing is to lift up the leather bag around it first, from the bottom and then turn the knob twice to the left and then pull from it till it comes off.
gear shift knob dismount

As you can see the white base support was broken too, so I had to dismount the whole thing and look for an universal knob to replace it. Well here is the gear shift itself all alone, I had to stick around it a piece of plastic and then tighten it up with a wire (I did this with my pliers to hold it tight), so that the leather bag will not move down later.

Here is the new knob, it has a nice fairy on it, well, I know you are smiling :) but it was the only one in the store one that fitted best to my hand size and I could not wait to buy it online
The new gear knob

Changing the knob


Finished!
Well, I'm proud!!! :)

Wednesday, July 3, 2013

Sitemap.xml with Drupal order by lastmod

If you have a Drupal 6 based site, you've probably installed the xmlsitemap module which works fairly well. A few days ago I reviewd mine and I saw that links were generated with no particular order, so I decided that it is good to show them ordered by lastmod to get the latest post first.
To make this work you need to change the source code of the xmlsitemap module file: xmlsitemap.generate.inc
Do a backup first!

And just find the function:

$query = array(
    'SELECT'   => 'SELECT x.loc, x.lastmod, x.changefreq,  x.changecount, x.priority, x.language',
    'FROM'     => 'FROM {xmlsitemap} x',
    'WHERE'    => 'WHERE x.access = 1 AND x.status = 1',
    'ORDER BY' => 'ORDER BY x.language, x.loc',
  );


and change it to:

$query = array(
    'SELECT'   => 'SELECT x.loc, x.lastmod, x.changefreq, x.changecount, x.priority, x.language',
    'FROM'     => 'FROM {xmlsitemap} x',
    'WHERE'    => 'WHERE x.access = 1 AND x.status = 1',
    'ORDER BY' => 'ORDER BY x.lastmod DESC',
  );



I know that it is not recommended to edit Drupal source code directly but the line in red did the trick! And now my sitemap.xml file is in descendant order showing the latest posts first.