type !== 'vision') { $vars['is_project'] = TRUE; } $votesUp = (int)db_query("SELECT * FROM {votingapi_vote} vv WHERE vv.entity_type = 'node' AND vv.entity_id = :nid AND vv.value = 100", [ ':nid' => $vars['content_id'], ])->rowCount(); $votesDown = (int)db_query("SELECT * FROM {votingapi_vote} vv WHERE vv.entity_type = 'node' AND vv.entity_id = :nid AND vv.value = 0", [ ':nid' => $vars['content_id'], ])->rowCount(); $vars['votes_total'] = (int)($votesUp + $votesDown); $vars['value'] = $vars['votes_total'] > 0 ? round(($votesUp / $vars['votes_total']) * 100, 0, PHP_ROUND_HALF_UP) : 0; $vars['chart_spacing'] = [ 'top' => 10, 'right' => 10, 'bottom' => 10, 'left' => 10, ]; $vars['widget_feedback_class'] = ''; if (isset($vars['results']['user_vote'])) { if ($vars['results']['user_vote'] == 0) { $vars['widget_feedback_class'] = 'rate-widget-vote-negative'; } else { $vars['widget_feedback_class'] = 'rate-widget-vote-positive'; } } $vr_button = '