Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 81 lines (64 sloc) 2.62 KB
<?php /*
Copyright (c) ocProducts, 2004-2012
See text/EN/licence.txt for full licencing information.
Do not edit this file. If you need to make changes, save your changed file to the appropriate *_custom folder
**** If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes ****
* @license Common Public Attribution License
* @copyright ocProducts Ltd
* @package core_ocf
* Add a forum poll.
* @param AUTO_LINK The ID of the topic to add the poll to.
* @param SHORT_TEXT The question.
* @param BINARY Whether the result tallies are kept private until the poll is made non-private.
* @param BINARY Whether the poll is open for voting.
* @param integer The minimum number of selections that may be made.
* @param integer The maximum number of selections that may be made.
* @param BINARY Whether members must have a post in the topic before they made vote.
* @param array A list of pairs of the potential voteable answers and the number of votes.
* @param boolean Whether to check there are permissions to make the poll.
* @return AUTO_LINK The ID of the newly created forum poll.
function ocf_make_poll($topic_id,$question,$is_private,$is_open,$minimum_selections,$maximum_selections,$requires_reply,$answers,$check_permissions=true)
if (($check_permissions) && (!ocf_may_attach_poll($topic_id)))
foreach ($answers as $answer)
if (is_array($answer))
} else $num_votes=0;
// Now make the topic validated if this is attaching immediately
if (get_param_integer('re_validate',0)==1)
if ((is_null($forum_id)) || (has_specific_permission(get_member(),'bypass_validation_midrange_content','topics',array('forums',$forum_id))))
return $poll_id;
Jump to Line
Something went wrong with that request. Please try again.