Extension talk:Poll
[edit] Version
Works fine with MediaWiki 1.10.1
[edit] Couple of bugs....
- The .sql file that's needed to create the initial table contains some excesive comments which prevent the file from being able to create the tabels trough phpMyAdmin
- Enter them one table at a time and they parse just fine.Mschwar99 15:18, 16 September 2008 (UTC)
- The images all reffer to $wgScriptPath/../image.jpg, might be better to change this too $wgScriptPath/extensions/poll/image.jpg
- Neither Poll.php nor Poll.sql (obviously) use $wgDBprefix, so table names have to be dealth with manually in each install.
[edit] Error with the extension
I have an error with this extension : Parse error: syntax error, unexpected T_VARIABLE in /home/aochell/public_html/AOCHell/extensions/Poll/Poll.php on line 113
My LocalSetings.php : http://www.filebox.ro/download.php?key=590433cb49043e065d9d494a9e9bb826 .
What is the problem ? I'm using : MediaWiki 1.12.0.
[edit] Formatting error
Using IE7 and FF3, the 0% rating is too close to the poll answers. This makes them look funny
- Edit line 414 of Poll.php, and insert the padding-left style to bump the poll bars and percentage to the right (e.g. 5 pixels), as follows: (--202.49.41.201 01:13, 22 June 2009 (UTC))
$str .= '<td width=160 style="padding-left: 5px;"'.($i%2==0?$bginfo2:$bginfo).'><font size=1>';
[edit] Change <poll> tag to e.g. [poll]?
Hi,
I am using TinyMCE as an editor for Mediawiki and it disallows <poll> tags. Where could I change it to e.g. [Poll] as a tag? Thanks. - Danielpott 08:42, 5 December 2008 (UTC)
[edit] Multiple Polls
I have this in and enjoy it. However it would seem to block the use of multiple polls. Since I have two polls and it will not let me vote on the second. Is there a way around this??
-Shannara Fan 21:51, 10 December 2008 (UTC)
[edit] Extracting data from the poll
Is there any way the data from the polls: the question or the responses can be extracted into a variable that can be used on other pages? If another page is actually reporting the survey and wants to say what number or % of respondents voted for a particular question, how would one do that? If I use this on a semantic wiki can I extract the result (read only, not write) into a semantic variable? --AnupamSaraph 04:34, 9 April 2009 (UTC)
[edit] Code Flaw
Works fine with MW 1.14
One general code flaw:
- The whole block after the "if" statement in line 281 (// PROCESS VOTE ONLY FOR LOGGED USERS) needs to be enclosed in curly brackets... Otherwise the statement is void
[edit] Developer Code Question
Hello, I really like this extension and I recently got into Developing for the wiki.
I am wondering how this extension is able to post to itself. I've seen the code does something like
'<from name=poll method=post action="#'.$ID.'">'. '<input type="hidden" name="poll_ID" value="'.($ID).'"> ...blah blah...</form>';
Anyways, Im having problems with the Post. I am able to $_POST a value and check if its set inside the 'Main Page' but if I create a new page, I know the value is posting, but my script cant detect the posted value. I am testing with isset() and empty() without any luck.
Any thoughts or comments about how this extension posts to newly created pages would be a GREAT help, thanks!
Answer: as it happens, I was using a
<button type="submit">Click Me!</button>
instead of:
<input type="submit">
Which is pretty dumb, but was giving me expected behavior in the main pages but not in pages that were created.
[edit] Question
It seems that by default if a user hasn't voted yet, they can already see the poll results. this both biases users and disinsentives them (from voting)
Is it possible to make it so they can only see other people's votes after they vote or to keep the results on a second page?
Or is there another extension that does this?
Thanks!
[edit] Getting it to work with Posgresql
Just installed 1.15.1 have tried several other poll extension None of them work with postgresql database.
This extension now does work with Postgresql if the author chooses to accept these changes
Removed all the mysql_query() replaced with Wiki Database wrapper. there is still work to be done in some the SQL queries to be portable between postgresql and mysql. example is the date calculations
Cleaned up allot of the formatting in the code in hopes its easer to read. Also fixed the problem where any users could vote and it displays a message "only log in users can vote". We might want to add a setting in LocalSettings.php so its easer to change how polls work for anonymous users.
Have the sql file available to setup tables for Postgresql.
I have noticed after editing a page with a Poll, the Poll resets this is very bad IMHO, and leaves the poll_answer table with entries??? Does anyone have suggestion for the most eloquent way to fix this problem?
The problem where editing an article/document containing a poll caused the polls to reset has been fixed Only need to get the author include my changes
I am desperately trying to find some polling extension that would work with with postgres and failing miserably. Could you make the alterations you have made to get this to work with postgres available? Or perhaps send it to me personally? It would be very much appreciated
--Camilo Fitzgerald (c.fitzgerald (at) cs.ucl.ac.uk)
[edit] XSS issue
Comments have an XSS issue.
[edit] Installation Question
** Could you please explain the installation process with regards to the SQL file. I have no idea what the instructions are explaining, please for us the lamens?
How do you implement the sql file for use in the wiki? I have all the files but im stuck on the .sql file part :)- Thanks
-
- You will need to execute the contained sql. This can be done via the unix comand line, as seen above, or by pasting the contents of the file into a mysql manager like phpmyadmin 94.193.106.14 16:19, 21 September 2009 (UTC)
++I run it on windows but i opened my SQL manager and connected to the Wiki db then pretty much did an open file, execute Query. the script will handle the rest. Poll is working for me, just need to look into making a page for an admin to see who voted for what
[edit] MediaWiki 1.17alpha
Just updated to the current MediaWiki 1.17alpha nightly build and I'm seeing fatal errors from this extension:
PHP Fatal error: Call to a member function setCacheTime() on a non-object in mw117a/includes/parser/Parser.php on line 4907 PHP Stack trace: PHP 1. {main}() mw117a/index.php:0 PHP 2. require_once() mw117a/index.php:41 PHP 3. require_once() mw117a/includes/WebStart.php:132 PHP 4. call_user_func() mw117a/includes/Setup.php:377 PHP 5. wfPoll() mw117a/includes/Setup.php:0 PHP 6. Parser->disableCache() /usr/home/sophia/domains/extensions/Poll.php:24
where the offending
Parser->disableCache();
call is at the end of this Poll.php initialisation code section:
$wgExtensionFunctions[] = "wfPoll"; function wfPoll() { global $wgParser; # register the extension with the WikiText parser # the first parameter is the name of the new tag. # In this case it defines the tag <Poll> ... </Poll> # the second parameter is the callback function for # processing the text between the tags $wgParser->setHook( "poll", "renderPoll" ); $wgParser->disableCache(); }
I've removed the Parser->disableCache(); command and the system then appears to be usable. Perhaps this is a function which should *not* be called on initial parser startup at a point where no page is actually loaded yet? It's not just that every superfluous use of Parser->disableCache() increases load on already-overburdened servers (by causing the same pages to be re-rendered on every page hit instead of delivered from cache). That can be enough of an issue on its own, but in this case a PHP fatal generates a blank page to the user, effectively taking the content off line. --Carlb 19:35, 20 June 2010 (UTC)
I too can confirm this is an issue in the official release of 1.17. If already using this extension (on MW version 1.14), and upgrading to 1.17, the update routines do not work.
e.g. 1 if running it from the "website" (html) installation package, at the "Upgrade existing installation" page, it just hangs and doesn't complete.
e.g. 2 if running this from the command line:php upgrade.phpit throws the errorPHP Fatal error: Call to a member function setCacheTime() on a non-object in....
To get the upgrade to successfully complete, i need to hash out the LocalSettings.php line# require_once("$IP/extensions/Poll/Poll.php");, thus rendering it unusable =(
--131.203.252.214 23:50, 1 September 2011 (UTC) David Fear