Hello,
on my site I'd like to implement a feature that'd allow me to collect votes on a poll but to hide the results until the poll is finished. I figured that the best way would be to add "hide results" as an option (admin only) to the poll creation menu. I tried to add it myself but I've started PHP programming not long ago so I've reached a point where I'm stuck. I've managed to add the feature "hide results" to the poll creation page but I'm not managing to actually use the value later on in the code to really hide the results.
For this to work I added an additional field to the poll table, called "hide".
I've attached the poll.module file to this post along with the changes that I've made.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | hide_poll_results-85840-7.patch | 3 KB | tbonomelli |
| poll_0.module | 18.03 KB | Snowflake1 |
Comments
Comment #1
killes@www.drop.org commentednot a proper patch, new features go into HEAD.
Comment #2
lilou commentedComment #3
gpk commentedMarked #234335: Disable View Results on Poll (6.1) as duplicate.
Comment #4
amateescu commentedComment #5
alexpottPoll has been removed from core
Comment #6
adammaloneComment #7
tbonomelli commentedAdded the field for the option to hide the result.
Work still in progress
Comment #8
tbonomelli commentedComment #9
tbonomelli commentedComment #10
dom. commentedWhy this useless statement ?
I think this should return FALSE
Also the patch misses a hook_update_N() for applying the basedfieldefinitions changes. Eventually some tests too.
Patch fails if the module have already been installed because of the lack of update path.
Comment #11
dom. commentedMarking this duplicate of #3007808: Fine grain control over results display since this new issue will take this into consideration among other possibilities.