pollpress_filter('the_content'); $this->factory = new pollpress_poll_factory(); $this->options_controller = new pollpress_controller_options(); } function generate_report($matches) { $poll_id = $matches[1]; $poll = $this->factory->get_poll($poll_id); $options = $poll->get_options(); $report = ''; // spit out the css file if ( !$css_included ) { $report .= ''; $css_included = true; } // Tally up the total votes $total_votes = 0; foreach ( $options as $option ) { $total_votes += $option->get_votes(); } // Actually generate the code $report .= '
| '; $report .= ' | ' . $option->get_votes() . ' ' . __('votes') . ' / ' . $percentage . '% | '; $report .= '