Index: lovehate.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/lovehate/lovehate.module,v
retrieving revision 1.24
diff -u -F^f -r1.24 lovehate.module
--- lovehate.module	20 Jul 2006 16:25:34 -0000	1.24
+++ lovehate.module	5 Aug 2006 00:36:33 -0000
@@ -164,15 +164,36 @@ function lovehate_block($op = 'list', $d
       break;
     }
     case 'list': {
-      $block[0]['info'] = "Love/Hate: ".variable_get('amazon_read_blocktitle', t('Popular topics'));
+      $block[0]['info'] = t("Love/Hate: "). variable_get('amazon_read_blocktitle', t('Popular topics'));
+      $block[1]['info'] = t("Love/Hate: Vote on this node");
       return $block;
     }
     case 'view': {
-      $terms = lovehate_get_top_terms(variable_get('lovehate_block_count', 10));
-      if (count($terms)) {
-        $block['subject'] = variable_get('amazon_read_blocktitle', t('Popular topics'));
-        $block['content'] = theme('lovehate_block_list', $terms);
-        return $block;
+      switch ($delta) {
+        case 0:
+          $terms = lovehate_get_top_terms(variable_get('lovehate_block_count', 10));
+          if (count($terms)) {
+            $block['subject'] = variable_get('amazon_read_blocktitle', t('Popular topics'));
+            $block['content'] = themetheme('lovehate_block_list', $terms);
+            return $block;
+          }
+          break;
+        
+        case 1:
+          if (arg(0) == 'node' && is_numeric(arg(1))) {
+            $terms = lovehate_get_node_terms(arg(1), TRUE);
+            if(count($terms)){
+              foreach($terms as $term) {
+                $output .= theme('lovehate_term', $term);
+              }
+              $block['subject'] = t('Love/Hate');
+              $block['content'] = theme('lovehate_voteblock', $output);
+            }
+            
+          }
+          return $block;
+        
+          break;
       }
       break;
     }
@@ -296,6 +317,16 @@ function lovehate_ajax_vote($tid = NULL,
 // Utility functions for handling lovehate data
 // ********************************************
 
+
+/**
+ * Get an array of love/hate terms for this node
+ *
+ * @param $nid
+ * @param $precache
+ *   if TRUE, adds the lovehate score object to term attributes
+ * @return
+ *   an array of term objects
+ */
 function lovehate_get_node_terms($nid, $precache = FALSE) {
   $vid = variable_get('lovehate_vocabulary', 0);
   if ($vid == 0) {
@@ -521,6 +552,14 @@ function theme_lovehate_user_page($uid =
   return $output;
 }
 
+/**
+ * Theme function to output ... something
+ *
+ * @param unknown_type $term
+ * @param unknown_type $show_description
+ * @param unknown_type $show_count
+ * @return unknown
+ */
 function theme_lovehate_term($term, $show_description = FALSE, $show_count = FALSE) {
   $output = '<div class="lovehate_term_detail">';
   $output .= '<h3>' . l($term->name, 'lovehate/' . $term->tid);
@@ -555,6 +594,12 @@ function theme_lovehate_users($users) {
   return $output;
 }
 
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $term
+ * @return unknown
+ */
 function theme_lovehate_vote_widget($term) {
   $options = array();
   if ($term->lovehate->current_user != 1) {
@@ -574,4 +619,12 @@ function theme_lovehate_block_list($term
     $links[] = l($term->name, "lovehate/$term->tid", array('title' => 'Total score: '.$term->lovehate->score));
   }
   return theme('item_list', $links);
+}
+
+function theme_lovehate_voteblock($content){
+  $output .= '<div class="lovehate-voteblock">';
+  $output .= '<div>'. t('Love it or hate it!') .'</div>';
+  $output .= $content;
+  $output .= '</div>';
+  return $output;
 }
\ No newline at end of file
