Active
Project:
Decisions
Version:
6.x-1.7
Component:
Code - Base Decisions module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Jun 2010 at 16:13 UTC
Updated:
7 Aug 2011 at 18:43 UTC
I`d like to have a option to only display the results in percent instead percents and counts. This is essential to don`t let the user know the exact ammount of votes while showing the result.
Comments
Comment #1
BigMike commentedHello Gork,
I just got Decisions up and running and I was also unhappy with the number of votes being displayed for all to see. Here is what I did to change this:
Open file decisions.module, and navigate to line 363 where you'll find the following function:
You can see on line 366 that the vote count is being added after the percentage of votes. Here is how I resolved this:
I added lines 364-366 & modified my line 369. What I did was I created an empty variable called $votecounts to which the number of votes will be added to ONLY if the user has permissions to administrator Decisions. Then on my line 369, you can see where I inserted this variable after the vote percentage is displayed. If the user is not able to administrator Decisions, then this variable is blank so nothing is displayed on the browser. But if the user does have the permission to administrator Decisions, then he/she will also see the number of votes placed per choice.
Another thing I did is I added
style="float: right; font-size: 0.9em;"to the "percent" div and moved this div above the "bar" div. This way my results are displayed above each results bar, with the choice at the left, and the % at the right. Now my results for each choice only take up 2 lines on the users browser screen instead of 3 lines, which made it easier (more compact) to theme my Decisions block.So here is my exact theme_decisions_bar function:
You can see it in action at http://www.marlincrawler.com
Good luck,
BigMike