How to show list of blog's tags in the block

I need to group blog posts by category using drupal blog feature, also I want to show categories manu only then blog page is open. The short answer to create blog categories is to use taxonomy module. This module is part of drupal package, but it needs to be enabled in menu "Administer/Site building/Modules".

Create vocabulary in menu "Administer/Content management/Taxonomy" (it's easy); Create list of tags (list terms) in vocabulary (also no problem here)

Here it's became tricky, how to embedd "list terms" to the block? Drupal comunity suggests using "taxonomy menu" module, but I have no luck with it, actualy it works fine showing list of terms in the main menu, but  not in the block. After I played with "taxonomy menu" for a while without a positive result, I decided to go with plan "B". I found simple solution in drupal.org (actually it was two separate solutions, but I used them together).

First: create new block (Administer/Site building/Blocks/Add block), inside Block Body write simple script:

<?php
$vid = 2;

$items = array();
$terms = taxonomy_get_tree($vid,  0, -1, 1);
foreach($terms as $term)

{
   $items[]= l($term->name, "taxonomy/term/$term->tid");
}
if(count($items))

{
   return theme('item_list', $items);
}
?>

It adds terms (for specified vocabulary with code $vid) into the array, and returns the array if it's not empty. On the second line of the script $vid = 2; Instead of 2 should be vacabulary code (you will see this code in "Administer/Content management/Taxonomy" menu by pointing cursor to "edit vocabulary" and and see the link). Now we have block with list of terms (tags). But don't click "save block" yet, we only half-way done.

Second: I want to show list of terms only on the blog pages. On the same block edit page scroll down to "Page specific visibility settings" and select option "Show if the following PHP code returns true (PHP-mode, experts only)" and instead of Pages writing script:

<?php
$paths = "blog\r\nblog/*\r\ntaxonomy\r\ntaxonomy/*";
$types = array('blog' => 1);

 $match = FALSE;
 $path = drupal_get_path_alias($_GET['q']);
 $regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'.preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($paths, '/')) .')$/';
if (preg_match($regexp, $path)) {
  $match = TRUE;
}

if (arg(0) == 'node' && is_numeric(arg(1))) {
  $nid = arg(1);
  $node = node_load(array('nid' => $nid));
  $type = $node->type;
   if (isset($types[$type]))
   {
       $match = TRUE;
   }
}
 return $match;
?>

This script returns TRUE if page "blog", "blog/*" opens, or "taxonomy", "taxonomy/*" or page type is "blog"

Now you can save the block. This block shows list of tags for single vocabulary and hiddes itself when user navigates away from the blog.