Extension:AJAXPoll

From MediaWiki.org
(Redirected from Extension:AJAX Poll)
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
AJAX Poll

Release status: stable

Implementation Parser extension
Description Allows AJAX-based polls with <poll> tag
Author(s) Dariusz Siedlecki, Jack Phoenix, Thomas Gries
Last version 1.79 (2013-01-01)
MediaWiki 1.16+
trunk version works with mw trunk
Database changes php update.php
License GNU Free Documentation License [sic]
Download
Example Any ShoutWiki site
Hooks used
ParserFirstCallInit
Check usage and version matrix
Bugs: list open list all report

AJAX Poll extension allows one or more AJAX-based polls on MediaWiki pages with <poll> tag.

Installation [edit]

You can download the extension directly from the MediaWiki source code repository (browse code). You can get:

One of the extensions tags

Not all extensions have tags. Some extensions have tags for each release, in which case those tags have the same stability as the release. To download a tag

  • Go to the tags list
  • Click the name of the tag you want to download
  • Click "snapshot"
The latest version of one of the extensions branches

Each extension has a master branch containing the latest code (might be unstable). Extensions can have further branches as well.

  • Go to the branches list
  • Click the branch name
  • Click "snapshot"
A snapshot made during the release of a MediaWiki version.

This might be unstable and is not guaranteed to work with the associated MediaWiki version.

After you've got the code, save it into the extensions/AJAXPoll directory of your wiki.

If you are familiar with git and have shell access to your server, you can obtain the extension, with all its tags and branches, as follows:

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AJAXPoll.git


  • Download and extract the files in a directory called "AJAXPoll" in your extensions/ folder.
  • Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/AJAXPoll/AJAXPoll.php" );
  • Run the update script which will automatically create the necessary database tables that this extension needs.
  • Yes check.svg Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
# if you want to restrict the poll
# use the following code lines after calling the AJAXPoll extension
# to restrict to user group (example)

# $wgGroupPermissions['*']['ajaxpoll-vote'] = false;
# $wgGroupPermissions['user']['ajaxpoll-vote'] = true;


Usage [edit]

<poll>
Do you like this poll ?
Yes, it is awesome.
Yes.
No, I do not like polls.
</poll>

20120216 AJAX Poll screenshot.png

If the first line after <poll> is "STATS", then some statistics about the wiki and its polls will be displayed. These statistics are not localizable and this whole feature will probably be removed (or at least refactored, but probably removed) in the future.

To-do list [edit]

  1. List of open bugs
  2. add/implement options
    1. bug 35118 option to allow only users with edit rights to vote, or only logged-in user implemented in version 1.63 (r113355)
    2. bug 35119 AJAXPoll: add option to show poll results only for users who have voted}}
    3. bug 35120 AJAXPoll as simple ranking tool (add a different skin for poll vote and result layout)
  3. a new permission / user rights group for a new Special page for Poll maintenance (list, stop, delete polls)