/[drupal]/contributions/modules/taxonomy_block/taxonomy_block.module
ViewVC logotype

Diff of /contributions/modules/taxonomy_block/taxonomy_block.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.22, Wed Jun 24 10:36:56 2009 UTC revision 1.23, Wed Jun 24 11:49:39 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: taxonomy_block.module,v 1.21 2009/06/23 19:16:37 thenicespider Exp $  // $Id: taxonomy_block.module,v 1.22 2009/06/24 10:36:56 thenicespider Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 83  function taxonomy_block_block($op = 'lis Line 83  function taxonomy_block_block($op = 'lis
83          $tid_parent = $term_parent->tid;          $tid_parent = $term_parent->tid;
84          $name_parent= $term_parent->name;          $name_parent= $term_parent->name;
85    
86          $output .= '<li class="dhtml-menu">';          $output .= '<li>';
87          $output .= l(tt("taxonomy:term:$tid_parent:name", $name_parent), "taxonomy/term/$tid_parent");          $output .= l(tt("taxonomy:term:$tid_parent:name", $name_parent), "taxonomy/term/$tid_parent");
88          if ($node_count) {          if ($node_count) {
89            $total_parent = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $tid_parent));            $total_parent = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $tid_parent));
90            $output .= " ($total_parent)";            $output .= " ($total_parent)";
91          }          }
92            $output .= "</li>";
93    
94          $sql_count_childs = " SELECT count(td.tid) from {term_data} td "          $sql_count_childs = " SELECT count(td.tid) from {term_data} td "
95                             ." INNER JOIN {term_hierarchy} th ON th.tid=td.tid "                             ." INNER JOIN {term_hierarchy} th ON th.tid=td.tid "
# Line 101  function taxonomy_block_block($op = 'lis Line 102  function taxonomy_block_block($op = 'lis
102                              ." INNER JOIN {term_hierarchy} th ON th.tid=td.tid "                              ." INNER JOIN {term_hierarchy} th ON th.tid=td.tid "
103                              ." WHERE vid='%d' AND th.parent='%d' ORDER BY name ASC LIMIT %d";                              ." WHERE vid='%d' AND th.parent='%d' ORDER BY name ASC LIMIT %d";
104            $term_childs = db_query($sql_term_childs, $vid, $tid_parent, $num_term );            $term_childs = db_query($sql_term_childs, $vid, $tid_parent, $num_term );
105            $output .= '<ul class="menu" style="display: block;">';            $output .= '<ul>';
106            while ($term_child = db_fetch_object($term_childs)) {            while ($term_child = db_fetch_object($term_childs)) {
107              $tid_child = $term_child->tid;              $tid_child = $term_child->tid;
108              $name_child = $term_child->name;              $name_child = $term_child->name;
109    
110              $output .= '<li class="leaf dhtml-menu">';              $output .= '<li>';
111              $output .= l(tt("taxonomy:term:$tid_child:name", $name_child), "taxonomy/term/$tid_child");              $output .= l(tt("taxonomy:term:$tid_child:name", $name_child), "taxonomy/term/$tid_child");
112              if ($node_count) {              if ($node_count) {
113                $total_child = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $tid_child));                $total_child = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $tid_child));
# Line 116  function taxonomy_block_block($op = 'lis Line 117  function taxonomy_block_block($op = 'lis
117            }            }
118            $output .= "</ul>";            $output .= "</ul>";
119          }          }
         $output .= "</li>";  
   
120        }        }
121    
122        $output .= "</ul>";        $output .= "</ul>";

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

  ViewVC Help
Powered by ViewVC 1.1.2