'red', 'yellow', 'aqua', 'orange', 'deepskyblue', 'lawngreen', 'hotpink', 'khaki', 'gold', 'orangered', 'cadetblue', 'yellowgreen', 'seagreen' );
// Pick the bar graph width.
$bar_width = 250;
?>
Poll - <$MTEntryTitle$>
<$MTEntryBody$>
');
if ($_REQUEST['display_results'] == 1) {
results();
} else {
survey();
}
function survey() {
// If you haven't voted yet, show the voting form.
if ($_COOKIE['poll'] == 1) {
results();
} else {
// Build and print the list of poll options.
?>
';
print 'View results
';
?>
== 0) {
print "Nobody has voted yet!
\n";
} else {
// Tell us if the survey is closed for voting.
print 'This poll is now closed. Final results are below.
';
// Count votes.
$all_votes = explode(' ', ' ');
$sorted_votes = array_count_values($all_votes);
$total_votes = array_sum($sorted_votes);
global $options;
$colorkey = 1;
print '';
foreach ($options as $key => $value) {
$key++;
if ($sorted_votes[$key] == 0) {
$votes = 0;
} else {
$votes = $sorted_votes[$key];
}
$percent = round(($sorted_votes[$key] * 100) / );
if ($colorkey > count($colors)) {
$colorkey = 1;
}
print "\n";
print "| $value | \n";
print '' . $percent . '% | ';
print "
\n";
$colorkey++;
}
print "
\n";
print "Total votes: .
\n";
if ($_COOKIE['poll'] != 1) {
print "\">« back
\n";
} else {
print "(You have already voted in this poll.)
\n";
}
}
}
?>