Carma poll
From TMM Wiki
Jump to navigationJump to searchcarma_poll
Note: the word poll in this article refers to a user survey.
- Purpose: Display a poll.
- Usage: {carma_poll poll="randomnew"}
- Required: none
- Optional: poll, results, tpl, data_only, assign_prefix, assign, display_on_assign
- Default Templates Used: poll
- Variables created: $carma_poll, $params
Parameters
(Required parameters in bold)
Parameter | Description | Possible Values | Default Value | Example |
---|---|---|---|---|
poll | Which poll to display | random, randomnew, poll ID number, poll shortname (See Notes section below) | randomnew | poll="123" |
results | Display the results after a vote | 1 | None. Does not display the results | results="1" |
tpl | Display comments using this template | Any valid template name | comments_display (Display comments using the comments_display template) | tpl="my_template" |
data_only | Put the comments in an array | 1 | None. Displays comments | data_only=1 |
assign_prefix | Prefix output variables with this word. (Click link for details) | Any valid Smarty variable name | None. (No prefix is used) | assign_prefix="myvar" |
assign | Name of the Smarty variable that stores the output | Any valid Smarty variable name | None. Output is displayed, not stored | assign="my_var" |
display_on_assign | Display comments even when the assign parameter (above) is used | 1 | None If assign is used, no comments are displayed | display_on_assign=1 |
Description
Displays a single poll. It lets the member vote for it, or display their vote after voting. It uses the poll template.
Notes
An explanation of the options available to the poll parameter:
- random: a random active poll
- randomnew: a random active poll the member has not voted on
- randomany: any random poll, even inactive
- numeric id: the ID number of a specific poll
- shortname: the shortname of a specific poll.