Function __global->cns_edit_poll
Definitions
sources/cns_polls_action2.php
- Edit a forum poll.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: int
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $poll_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The ID of the poll we're editing |
| $question | SHORT_TEXT | No | No | required parameter | N/A | N/A | The question |
| $is_private | BINARY | No | No | required parameter | N/A | N/A | Whether the result tallies are kept private until the poll is made non-private |
| $is_open | BINARY | No | No | required parameter | N/A | N/A | Whether the poll is open for voting |
| $minimum_selections | integer | No | No | required parameter | N/A | N/A | The minimum number of selections that may be made |
| $maximum_selections | integer | No | No | required parameter | N/A | N/A | The maximum number of selections that may be made |
| $requires_reply | BINARY | No | No | required parameter | N/A | N/A | Whether members must have a post in the topic before they made vote |
| $answers | array | No | No | required parameter | N/A | N/A | A list of the potential voteable answers |
| $view_member_votes | BINARY | No | No | required parameter | N/A | N/A | Whether others can see which members voted for each option on the results |
| $vote_revocation | BINARY | No | No | required parameter | N/A | N/A | Whether to allow voters to revoke their vote when the poll's voting is still open |
| $guests_can_vote | BINARY | No | No | required parameter | N/A | N/A | Whether guests can vote on the poll without logging in |
| $point_weighting | BINARY | No | No | required parameter | N/A | N/A | Whether results for this poll should be weighed based on voter's points |
| $reason | LONG_TEXT | No | No | Blank (empty string) | N/A | N/A | The reason for editing the poll |
| $poll_closing_time | ?TIME | No | No | Null | N/A | N/A | The time voting should close on this poll (null: the poll will not close automatically) |
| $erase_votes | boolean | No | No | False | N/A | N/A | Whether to erase all the current votes |
Returns
- The ID of the topic the poll is on
- Type: AUTO_LINK
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Edit a forum poll.
*
* @param AUTO_LINK $poll_id The ID of the poll we're editing
* @param SHORT_TEXT $question The question
* @param BINARY $is_private Whether the result tallies are kept private until the poll is made non-private
* @param BINARY $is_open Whether the poll is open for voting
* @param integer $minimum_selections The minimum number of selections that may be made
* @param integer $maximum_selections The maximum number of selections that may be made
* @param BINARY $requires_reply Whether members must have a post in the topic before they made vote
* @param array $answers A list of the potential voteable answers
* @param BINARY $view_member_votes Whether others can see which members voted for each option on the results
* @param BINARY $vote_revocation Whether to allow voters to revoke their vote when the poll's voting is still open
* @param BINARY $guests_can_vote Whether guests can vote on the poll without logging in
* @param BINARY $point_weighting Whether results for this poll should be weighed based on voter's points
* @param LONG_TEXT $reason The reason for editing the poll
* @param ?TIME $poll_closing_time The time voting should close on this poll (null: the poll will not close automatically)
* @param boolean $erase_votes Whether to erase all the current votes
* @return AUTO_LINK The ID of the topic the poll is on
*/
function cns_edit_poll(int $poll_id, string $question, int $is_private, int $is_open, int $minimum_selections, int $maximum_selections, int $requires_reply, array $answers, int $view_member_votes, int $vote_revocation, int $guests_can_vote, int $point_weighting, string $reason = '', ?int $poll_closing_time = null, bool $erase_votes = false) : int
* Edit a forum poll.
*
* @param AUTO_LINK $poll_id The ID of the poll we're editing
* @param SHORT_TEXT $question The question
* @param BINARY $is_private Whether the result tallies are kept private until the poll is made non-private
* @param BINARY $is_open Whether the poll is open for voting
* @param integer $minimum_selections The minimum number of selections that may be made
* @param integer $maximum_selections The maximum number of selections that may be made
* @param BINARY $requires_reply Whether members must have a post in the topic before they made vote
* @param array $answers A list of the potential voteable answers
* @param BINARY $view_member_votes Whether others can see which members voted for each option on the results
* @param BINARY $vote_revocation Whether to allow voters to revoke their vote when the poll's voting is still open
* @param BINARY $guests_can_vote Whether guests can vote on the poll without logging in
* @param BINARY $point_weighting Whether results for this poll should be weighed based on voter's points
* @param LONG_TEXT $reason The reason for editing the poll
* @param ?TIME $poll_closing_time The time voting should close on this poll (null: the poll will not close automatically)
* @param boolean $erase_votes Whether to erase all the current votes
* @return AUTO_LINK The ID of the topic the poll is on
*/
function cns_edit_poll(int $poll_id, string $question, int $is_private, int $is_open, int $minimum_selections, int $maximum_selections, int $requires_reply, array $answers, int $view_member_votes, int $vote_revocation, int $guests_can_vote, int $point_weighting, string $reason = '', ?int $poll_closing_time = null, bool $erase_votes = false) : int

