Extension talk:Poll

From MediaWiki.org

Jump to: navigation, search

Contents

[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