Multiple color poll result bars

When you make a poll topic in phpBB, the result of the votes will be shown as bars, one for each option. These bars consist of three images, a left cap image, an image that is repeated to create the center of the bar and a right cap. The code for these bars can be found in viewtopic_poll_result.tpl.

Originally, the poll result bars weren’t intended to be designed this way. Instead the developers intended one image to be used, and for it to be stretched by setting its width to represent the per cent of votes. There was also the intention of supporting votebars in several colors, or designs. If you open the CFG file (myTemplate.cfg) you will find the following code:

$images['voting_graphic'][0] = "$current_template_images/voting_bar.gif";
$images['voting_graphic'][1] = "$current_template_images/voting_bar.gif";
$images['voting_graphic'][2] = "$current_template_images/voting_bar.gif";
$images['voting_graphic'][3] = "$current_template_images/voting_bar.gif";
$images['voting_graphic'][4] = "$current_template_images/voting_bar.gif";

By removing the code for adding the left and right end caps and assigning a different bar image for each of these you can display poll results as up to five differently colored bars. I haven’t used done myself but I imagine that if there are more than five options the colors are reused.