I did a little tweak with this drupal site. Enabling clean URLs is very nice and enabling Path module which you can alias URL of each node is nicer. Last thing I want is the Categories block in the right navigation menu sorted alphabetically. (Default is sorted by last updated.)
After Googling for a while, I found this page "Overridding Drupal Sort order on node display". It's exactly what I want but after looking some code, I found that php code isn't the same (parameter and somethings). maybe different version of Drupal.
Finally, I decided to edit the code myself and here is the solution: