'textfield', '#default_value' => variable_get('lovehate_vote_block_title', t('Rate This Topic')), '#size' => 30, '#maxlength' => 120, '#description' => t('Enter the title for the Love/Hate voting block'), '#title' => 'Block title', ); return $form; } case 'save': { variable_set('lovehate_vote_block_title', $edit['lovehate_block_title']); break; } case 'list': { $block[0]['info'] = "Love/Hate: ".variable_get('lovehate_vote_block_title', t('Rate This Topic')); return $block; } case 'view': { if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) { $term = taxonomy_get_term(arg(2)); } if ($term) { $block['subject'] = variable_get('lovehate_vote_block_title', t('Love / Hate')); $block['content'] = t('Cast your vote for this topic!'); $block['content'] .= theme('lovehate_term', $term); $users = array(); $votes = votingapi_get_content_votes('term', $term->tid); foreach ($votes as $uid=>$uid_votes) { foreach ($uid_votes as $vote) { if ($vote->value == 1 && count($users) <= 5 ) { $users[] = $uid; } } } $block['content'] .= t('People who like this topic:'); $block['content'] .= theme('lovehate_users', $users); return $block; } break; } } }