Firefox PHP

Module: Topic Poll

Posted by Maurice Makaay 
All files from this thread

File Name File Size   Posted by Date 103.1 KB open | download Maurice Makaay 09/01/2016 Read message
Module: Topic Poll
August 05, 2007 06:25AM
This module makes it possible to add polls to forum topics. For each forum the administrator can configure who can create polls. Features:

o Admin interface that allows for a specific configuration for each forum.
o CSS based styles, each forum can have its own style.
o Revoking votes for registered users who have voted.
o Polls can be for registered users only or for all visitors.
o Anonymous vote tracking is done using a combi of cookies and IP blocking.
o Easy poll editor for users, implemented as a separate posting editor screen.
o Topics with polls in them can be tagged in the message list


2016-09-01 v1.0.22 Oliver Riesen-Mallmann <>

    - Made XHTML 1.0 Transitional compliant.

2015-09-18 v1.0.21 Oliver Riesen <>

    - Fixed various warnings and errors from the W3C validator.

    - Fixed undefined index warning when using together with the Post Preview
      Module, see:

    - Performance improvements.

    - Added simplified chinese language file. Thanks to user

2011-01-09 v1.0.20

    - Added new German language files. Thanks to Oliver Riesen!

    - Added Russian translation. Thanks to user sailord.

    - Added Swedish translation. Thanks to user CHR.

2010-10-27 v1.0.19

    - A small change to explicitly set the POST action URL for
      Topic Poll forms.

2010-05-19 v1.0.18

    - Fixed an issue with the voting form being visible after the first
      anonymous vote when the IP-block is fully disabled. BTW: posting the
      poll for the second time would not register the vote. The only problem
      was that the results were not visible directly after the first post.
      Thanks to Zdravko Balorda for the bug report!

2010-04-18 v1.0.17

    - Renamed constants to avoid redefining the same contstants when
      the "rate_this_thread" module is enabled as well. That module
      was based on the Topic Poll module and copied the CAST_* constants.

2009-11-08 v1.0.16

    - Fixed displaying of the poll style preview in the admin interface.

2009-10-25 v1.0.15

    - Fixed an issue with execution priorities, that could cause
      other formatting modules to fail.

2009-08-01 v1.0.14

    - Fixed a small bug with using BBcode in the poll question and/or
      answers. When editing a poll, the BBcode would show up as the
      rendered HTML for that BBcode in the edit form. After saving,
      the poll would show the HTML escaped in the page, instead of
      showing the desired formatting.

2009-07-04 v1.0.13

    - Moved the separator between poll and message body to a module
      template, so it can be modified without hacking the code.

    - Fixed an issue where other formatting modules (especially the
      smileys module) could break the form code of the Poll module.
      Thanks to Phorum user paranid for reporting the problem.

    - Removed templates/default, because that one was only there for
      supporting some of the very early 5.2 development versions.

2009-06-05 v1.0.12

    - Made the module compatible with the CSRF protection in Phorum 5.2.11.

    - Added German translation files.
      Thanks to Oliver Riesen.

2008-07-14 v1.0.11

    - Added a new option to the settings for a poll, to make it possible to
      hide all thread reply messages until the visitor casts a vote.

2008-01-01 v1.0.10

    - It is now possible to not add an icon to the subjects in the list
      page for threads that have a poll in them, but instead setup some
      template variables. This way, it's possibly to fully control the
      way in which polls are indicated in the message list page. See the help
      information in the module admin settings for info about this feature.
    - Added a Latin American Spanish tranlation.
      Thanks to Phorum user "marcelarr".

2007-11-19 v1.0.9

    - Reset the $messages array in the read hook, so each() will get the
      first message in the array. This didn't work correctly if some
      previous read hook from another module iterated over the $messages
      array as well.

2007-08-17 v1.0.8

    - Copied templates/default to templates/emerald to match the default
      fall back template for Phorum 5.2.

2007-07-13 v1.0.7

    - Fixed a compatibility issue for using this module in combination
      with Phorum version 5.1.23. From here on, 5.1.23 is also the minimal
      version for which the module will work.

2007-06-19 v1.0.6

    - Fixed a bug in the feed message rendering.

    - Added an option in the poll editor for displaying the poll before
      or after the message body.

    - Included updated French language file by Fran.

2007-05-01 v1.0.5

    - Fixed a typo in the Dutch language file.

2007-04-06 v1.0.4

    - If a topic is closed, then the poll is closed too now.

2007-02-22 v1.0.3

    - Fix for finding the raw_datestamp on 5.1 systems, in case the
      messages in the format message array are from multiple forums.

2007-01-19 v1.0.2

    - Added German translation (thanks Netwalker!).

    - Added French translation (thanks Fran!).

    - Changed the maximum width for the score bars to 95% instead of 100%,
      to provide some extra space for styling the bars.

    - Fixed a bug which could cause failure to draw the graph after
      editing the poll form (showing only some undefined index
      warnings instead).

    - Added a simple rendering to the format hook for displaying polls
      inside RSS/ATOM feeds. In the feed, the poll will show up as the
      poll question.

2006-09-07 v1.0.1

    - The preview of the poll in the admin interface (for selecting a
      style) resulted into a nested form (voting form within the admin
      form). A change was made, so the poll now doesn't start a
      new form if it's in the admin interface.

2006-09-06 v1.0.0

    - Initial revisionf

Maurice Makaay Phorum Development Team my blog linkedin profile secret sauce Edited 16 time(s). Last edit at 09/01/2016 09:33AM by Oliver Riesen-Mallmann.
open | download - (103.1 KB)
Re: Module: Topic Poll
November 25, 2007 07:12AM
Released version 1.0.9 of the Topic Poll module. This fixes a possible module conflict. If your Topic Poll does not seem to register votes, then this version will fix that behavior.

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Topic Poll
January 01, 2008 05:18PM
How much trouble would it be for the poll icon to show on the left with the flag and stickies, instead of to the right of the thread title?
Re: Module: Topic Poll
January 01, 2008 06:12PM
Try the new 1.0.10 version. I added a feature for this. In the poll settings (in the module admin), you can now choose to setup template variables instead of automatically tagging the subjects with an appended icon. With these, you can modify your list.tpl to indicate polls in any way you see fit. My test was adding this code after the icon image code in the list.tpl:
        {IF MESSAGES->topic_poll 0}NO POLL{/IF}
        {IF MESSAGES->topic_poll 1}POLL{/IF}
        {IF MESSAGES->topic_poll 2}NEW POLL{/IF}

This is of course in no way a pretty sight, but it gives you an idea of what template variables you can use. It's up to you to modify list.tpl / list_threads.tpl to your liking.

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Topic Poll
February 10, 2008 06:09PM
I noticed topic poll didnt have a Spanish translation, so I want to go ahead and upload mine, its a Sanish Latin American Version.

Please let me know if this is what I have to call it in order for it to be read properly or I have to rename it.

mmakaay: removed the translation file from this message. The file "spanish_latin_american.php" is now part of the 1.0.10 distribution package.

Edited 1 time(s). Last edit at 02/11/2008 05:55PM by mmakaay.
Re: Module: Topic Poll
February 10, 2008 06:42PM
I prefer "spanish_latin_american.php" for these. I will add it as such to the next release of the module. Thanks for the translation.

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Topic Poll
February 14, 2008 09:52AM

just a question : i use this module for my association's poll (new members, important decisions).
It would be useful for us to know who make vote (not what, just the users who participate). as the votes are important for the life of my association, this option give me a good view of members's active participation.

Lot's of stuff to do that ?

my Phorum
Re: Module: Topic Poll
February 14, 2008 10:48AM
Maybe yes. This data is all serialized in the database, so there's no way to retrieve all this info in a clean single SQL query from the database. Being able to do more advanced reporting would require storing the voter user_ids in the message meta data too, but that could result in the meta data growing quite large. A full scaling solution for this would be to use a real database table for the votes. That is quite some work.

As for the current method: the poll, its questions and aggregated voting results are stored in the meta data for the message. What each user voted for each poll is stored in a custom profile field for the user. You could build a reporting tool from this info maybe by retrieving all mod topic poll custom profile fields from the database and aggregating those. I would advice against live retrieval and computation of this data though.

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Topic Poll
February 14, 2008 11:03AM
ok, thank's for your reply. it's too hard for me. best way for me asking my members to reply in the topic when they do the vote :)

my Phorum
Re: Module: Topic Poll
February 14, 2008 11:27AM
I'll keep it in mind for future versions.
But don't stay up late for the release.
A lot of other tasks have precedence :)

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login