Exemplo n.º 1
0
 public function vote_count($post)
 {
     $votersflaggers = $this->get_post_voters_flaggers($post['raw'], @$post['vote_opostid'] ? $post['raw']['opostid'] : $post['raw']['postid']);
     $tooltip = '';
     if (isset($votersflaggers)) {
         $uphandles = '';
         $downhandles = '';
         foreach ($votersflaggers as $voterflagger) {
             if ($voterflagger['vote'] > 0) {
                 $uphandles .= (strlen($uphandles) ? ', ' : '') . qa_html($voterflagger['handle']);
             }
             if ($voterflagger['vote'] < 0) {
                 $downhandles .= (strlen($downhandles) ? ', ' : '') . qa_html($voterflagger['handle']);
             }
             $tooltip = trim((strlen($uphandles) ? '&uarr; ' . $uphandles : '') . "\n\n" . (strlen($downhandles) ? '&darr; ' . $downhandles : ''));
         }
     }
     $post['vote_count_tags'] = @$post['vote_count_tags'] . ' title="' . $tooltip . '"';
     qa_html_theme_base::vote_count($post);
 }
 public function vote_count($post)
 {
     $postid = isset($post['vote_opostid']) && $post['vote_opostid'] ? $post['raw']['opostid'] : $post['raw']['postid'];
     $votersflaggers = $this->get_post_voters_flaggers($post['raw'], $postid);
     if (isset($votersflaggers)) {
         $uphandles = array();
         $downhandles = array();
         foreach ($votersflaggers as $voterflagger) {
             if ($voterflagger['vote'] != 0) {
                 $newflagger = qa_html($voterflagger['handle']);
                 if ($voterflagger['vote'] > 0) {
                     $uphandles[] = $newflagger;
                 } else {
                     // if ($voterflagger['vote'] < 0)
                     $downhandles[] = $newflagger;
                 }
             }
         }
         $tooltip = trim((empty($uphandles) ? '' : '&uarr; ' . implode(', ', $uphandles)) . "\n\n" . (empty($downhandles) ? '' : '&darr; ' . implode(', ', $downhandles)));
         $post['vote_count_tags'] = sprintf('%s title="%s"', isset($post['vote_count_tags']) ? $post['vote_count_tags'] : '', $tooltip);
     }
     parent::vote_count($post);
 }