ssi_topPoll
Description
Gets information about the top poll and either displays this poll or returns an array of information, depending on output_method.
Syntax
array ssi_topPoll ([string $output_method])
Parameter $output_method
Expected type: String
Description: If 'echo', the function will output the poll. Otherwise the array will be returned. Also returns an empty array if there's nothing to display.
Return value
Expected type: Array
Description:
Array Elements | |||
Key | Optional | Expected type | Description |
allowed_warning | no | String | If you're allowed to vote for more than one option, this is the "You may only select up to x options" text. Otherwise it's an empty string |
id | no | Integer | Poll ID |
image | no | String | "poll" (used to display the poll message icon) |
is_locked | no | Boolean | Always false. Indicates that the poll isn't locked. |
options | no | Array | An array of info about the specific poll options: percent (percentage of votes cast for this option), votes (total votes this option has received), bar (the graphical bar that's displayed next to each option), option (formatted poll option [all bbcode, etc. has been parsed]), vote_button (a radio or checkbox depending on poll settings) |
question | no | String | Poll question |
topic | no | Integer | The ID of the topic that this poll is associated with |
total_votes | no | Integer | The total number of votes that have been cast in this poll |
Notes
- Same as calling ssi_recentPoll(output_method, true);
- Requires that you have permission to view and vote in polls on at least one board
- Finds the poll with the most votes that you haven't voted in yet (don't ask...)
- Returns an empty array if there's nothing to display
- Outputs the poll if output_method is 'echo', otherwise returns information about the poll.