We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2734
    • 165 Posts
    This is an auto-generated support/comment thread for EasyPoll.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    EasyPoll is a new Poll Module for MODx. It allows the creation of Polls for multiple Languages, timed Polls, Poll Archive and highly customizable Output.
      • 2734
      • 165 Posts
      The EasyPoll Module/Snippet has landed.
      It would be great, if some of you guys could create translations of the Language files, since thats whats missing at the moment smiley

      If you would like to contribute a translation to this project:
      The lang files for the Module can be found in modules/EasyPoll/lang. Have a look at the existing files. Name the file after the naming convention of MODx.

      The Language files for the Snippet are located in snippets/EasyPoll/lang and should currently be named like this:
      lang.<ISO 639-1 Code>.php

      Snippet Translations are easier to do and have a higher priority. You can just translate the Snippet or the Module part, they are not dependent on each other. If you did a translation, zip it and post it in this thread. I’ll happily integrate it into a next release of this Module/Snippet!

      Current Translation status:
      Thanks to all that contributed something to this module!

      • English (Module/Snippet): Original by banal, corrections and proof-reading by dflock
      • German (Module/Snippet): by banal
      • Dutch (Module/Snippet): by peterruiter
      • French (Snippet only): by banal
      • Italian (Snippet only): by banal

      Feedback, error reports wishes etc. are welcome! Please post them here.
      Cheers -- banal

      Update Version 0.3.1 adds French and Italian translations of the Snippet
        • 19605
        • 11 Posts
        I’d like the polls to be manageable by the frontend users (that belong to certain webgroup). Any suggestions?
          • 2734
          • 165 Posts
          Quote from: minder at Mar 24, 2008, 09:11 AM

          I’d like the polls to be manageable by the frontend users (that belong to certain webgroup). Any suggestions?
          Hi minder
          A Module can’t be accessed by Web-Users AFAIK. It could still be doable by rewriting parts of the module code in a way that it will work as a Snippet though.
          I just did a small test by copying the module code into a snippet. It works, when you remove the part where the manager language is determined. Probably you’ll have to pass the desired language as a parameter to the snippet or just leave it as english (default).

          Doing so will output the module to a page of your choice (by calling the newly created snippet with the module code). However there are some issues that remain:
          URLs point to the wrong page if you’re using friendly URLs.
          To fix this you’ll have to alter the EasyPollController.class.php File. In the static getURL method you’ll have to replace
          $self = $_SERVER['PHP_SELF'];

          with:
          global $modx;
          $self = $modx->makeUrl($modx->documentObject['id']);


          The Stylesheets are missing. You’ll have to include the manager stylesheets and mootools.js as seen in the htmlHeader() method (also to be found in EasyPollController.class.php)

          And last but not least you should check if the Web-User is indeed logged in (best somewhere at the beginning of the snippet code)!
          Hope that helps.
            • 19605
            • 11 Posts
            Thanks! Works almost flawlessly grin
            I have some comments though:
            If I don’t create any language, MODx exist with error that default (en) language can not be found. IMHO the Internal Title should be displayed if no translations are available. The way it works now, I am forced to add "en" language and enter poll title and choices twice (internal and en). I’ll try to hack it myself, but please consider this when releasing new version.

            The number of votes is redundant in the DB (once in polls table and second time at each choice). I wonder if this could not be computed simply when displaying results.

            I don’t know if SimpleMachinesForum hasn’t got better way of adding choices - creating a poll displays a form with title and places for possible answers (let’s say 5 of them) but at any time you can add one more field. I think it’s done by POSTing actual content to the same form, adding new line and displaying what was previously entered (I didn’t read the code but it looks like that). Now this could be made easier with AJAX, I think - just adding new field by clicking "add choice" - and yet be good handled with JavaScript turned off. I know it is bit different philosophy, but I find it more intuitive - but it probably will be hell to handle translations this way.

            Anyway thanks for this great module! smiley
              • 2734
              • 165 Posts
              Hi minder

              Well, you don’t have to create two languages at all. You can create just the language you like (eg. ’de’ for German). However if you’re creating another Language than English you have to add the lang Parameter to your Snippet Call.
              [!EasyPoll? &lang=`de`!]

              This way you can skip the creation of English Translations...

              Edit:
              If you do not translate the lang file for the Snippet, you’ll have to specify the easylang param. Like so:
              [!EasyPoll? &lang=`en` &easylang=`de`!]

              This way, the english language File (lang.en.php) will be used for texts like "Vote" etc. and German will be used for the questions and answers entered in the module.

              The number of votes is redundant in the DB (once in polls table and second time at each choice). I wonder if this could not be computed simply when displaying results.
              Umm.. I don’t know where you saw this. Number of Votes are just being counted in the "ep_choice" Table. You must confuse this module with the Poll Module created by garryn (it had this redundancy because of mysql compatibility afaik).

              Yeah i know, the whole Setup of Polls and Choices could be better from a User Inteface Perspective. However it was the easiest way to do without relying on AJAX and integrate the whole Translation Idea. Personally i create Polls in 4 Languages.

              Oh, regarding Translations: If you have some time it would be really nice if you could supply us with a Snippet/Module Translation in your native language? Just in case you’re doing it anyway, you could send the lang Files to me. That would be great!

              Cheers -- banal
                • 26947
                • 1 Posts
                I really like your version of the Polls Module smiley I was able to easily integrate it to my existing ModX site and the admin interface was very good.

                I was wondering if there was a way to make this run in a PHP4 environment?

                  • 2734
                  • 165 Posts
                  Quote from: shaukawla at Mar 30, 2008, 09:26 PM

                  I really like your version of the Polls Module smiley I was able to easily integrate it to my existing ModX site and the admin interface was very good.

                  I was wondering if there was a way to make this run in a PHP4 environment?
                  Hi shaukawla
                  Glad you like the Poll Module.
                  I’m pretty sure the code can be made PHP4 compliant. Currently i don’t have a Testing-Environment for PHP4 though. However, most hosting providers that still run PHP4 allow you to run PHP5 in some subdirectories or similar.

                  If you absolutely need PHP4 support, feel free to modify the code accordingly. If you’re facing problems doing so, just ask. I’ll do my best to help.
                    • 36571
                    • 145 Posts
                    When trying to run both the module and the snippet I get the following error:

                    Parse error: syntax error, unexpected ’{’ in /export/httpd/websites/www.creditaction.org.uk/manager/includes/document.parser.class.inc.php(766) : eval()’d code on line 77

                    Any ideas what might be causing it? Really appreciate any help. Thanks.


                    EDIT: I am using 0.9.6 by the way.
                      • 2734
                      • 165 Posts
                      Quote from: danielw at May 09, 2008, 10:31 AM

                      When trying to run both the module and the snippet I get the following error:

                      Parse error: syntax error, unexpected ’{’ in /export/httpd/websites/www.creditaction.org.uk/manager/includes/document.parser.class.inc.php(766) : eval()’d code on line 77

                      Any ideas what might be causing it? Really appreciate any help. Thanks.


                      EDIT: I am using 0.9.6 by the way.
                      Hi danielw

                      Are you running PHP 5? EasyPoll was developed on a PHP 5 Setup and might not run on a PHP 4 installation.