23 if($stop_date < date(
'Ymd'))
25 $stop_date = date(
'YmdHis', $_SERVER[
'REQUEST_TIME']+60*60*24*365);
33 unset($vars->_filter);
34 unset($vars->error_return_url);
35 unset($vars->stop_date);
37 foreach($vars as $key => $val)
39 if(stripos($key,
'tidx'))
44 $tmp_arr = explode(
'_', $key);
46 $poll_index = $tmp_arr[1];
57 if($tmp_args[$poll_index] == NULL)
59 $tmp_args[$poll_index] =
new stdClass;
62 if(!is_array($tmp_args[$poll_index]->item))
64 $tmp_args[$poll_index]->item = array();
69 $val = htmlspecialchars($val, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false);
75 $tmp_args[$poll_index]->title = $val;
78 $tmp_args[$poll_index]->checkcount = $val;
81 $tmp_args[$poll_index]->item[] = $val;
86 foreach($tmp_args as $key => $val)
93 if($val->title && count($val->item))
101 $args->stop_date = $stop_date;
111 $poll_args =
new stdClass;
112 $poll_args->poll_srl = $poll_srl;
113 $poll_args->member_srl = $member_srl;
114 $poll_args->list_order = $poll_srl*-1;
115 $poll_args->stop_date =
$args->stop_date;
116 $poll_args->poll_count = 0;
125 foreach(
$args->poll as $key => $val)
127 $title_args =
new stdClass;
128 $title_args->poll_srl = $poll_srl;
130 $title_args->title = $val->title;
131 $title_args->checkcount = $val->checkcount;
132 $title_args->poll_count = 0;
133 $title_args->list_order = $title_args->poll_index_srl * -1;
134 $title_args->member_srl = $member_srl;
135 $title_args->upload_target_srl = $upload_target_srl;
144 foreach($val->item as $k => $v)
146 $item_args =
new stdClass;
147 $item_args->poll_srl = $poll_srl;
148 $item_args->poll_index_srl = $title_args->poll_index_srl;
149 $item_args->title = $v;
150 $item_args->poll_count = 0;
151 $item_args->upload_target_srl = $upload_target_srl;
163 $this->
add(
'poll_srl', $poll_srl);
174 $tmp_item_srls = explode(
',',$poll_srl_indexes);
175 for($i=0;$i<count($tmp_item_srls);$i++)
177 $srl = (int)trim($tmp_item_srls[$i]);
183 if(!count($item_srls))
return new BaseObject(-1,
'msg_check_poll_item');
186 if($oPollModel->isPolled($poll_srl))
return new BaseObject(-1,
'msg_already_poll');
191 $args =
new stdClass;
192 $args->poll_srl = $poll_srl;
202 $args->poll_item_srl = implode(
',',$item_srls);
210 $log_args =
new stdClass;
211 $log_args->poll_srl = $poll_srl;
216 $log_args->member_srl = $member_srl;
217 $log_args->ipaddress = $_SERVER[
'REMOTE_ADDR'];
228 if(!$skin || !is_dir(
_XE_PATH_ .
'modules/poll/skins/'.$skin)) $skin =
'default';
230 $tpl = $oPollModel->getPollHtml($poll_srl,
'', $skin);
232 $this->
add(
'poll_srl', $poll_srl);
233 $this->
add(
'tpl',$tpl);
248 if(!$skin || !is_dir(
_XE_PATH_ .
'modules/poll/skins/'.$skin)) $skin =
'default';
251 $tpl = $oPollModel->getPollResultHtml($poll_srl, $skin);
253 $this->
add(
'poll_srl', $poll_srl);
254 $this->
add(
'tpl',$tpl);
264 if($pollSrls) $pollSrlList = explode(
',', $pollSrls);
267 if(count($pollSrlList) > 0)
270 $args =
new stdClass;
271 $args->pollIndexSrlList = $pollSrlList;
272 $output = $oPollAdminModel->getPollListWithMember(
$args);
275 if(is_array($pollList))
277 foreach($pollList AS $key=>$value)
279 if($value->checkcount == 1) $value->checkName = $lang->single_check;
280 else $value->checkName = $lang->multi_check;
290 $this->
add(
'poll_list', $pollList);
337 $args =
new stdClass();
342 $poll_srl =
$output->data->poll_srl;
345 $args->poll_srl = $poll_srl;
367 $comment_srl =
$obj->comment_srl;
370 $args =
new stdClass();
371 $args->upload_target_srl = $comment_srl;
375 $poll_srl =
$output->data->poll_srl;
378 $args->poll_srl = $poll_srl;
400 $match_cnt = preg_match_all(
'!<img([^>]*)poll_srl=(["\']?)([0-9]*)(["\']?)([^>]*?)>!is',$content, $matches);
401 for($i=0;$i<$match_cnt;$i++)
403 $poll_srl = $matches[3][$i];
405 $args =
new stdClass;
406 $args->poll_srl = $poll_srl;
410 if($poll->upload_target_srl)
continue;
412 $args->upload_target_srl = $upload_target_srl;
setMessage($message= 'success', $type=NULL)
triggerDeleteDocumentPoll(&$obj)
A poll deletion trigger when a post is removed.
procPollInsert()
after a qeustion is created in the popup window, register the question during the save time ...
procPollGetList()
poll list
triggerUpdateDocumentPoll(&$obj)
A poll synchronization trigger when a post is updated.
triggerInsertCommentPoll(&$obj)
A poll synchronization trigger when a new comment is registered.
setRedirectUrl($url= './', $output=NULL)
syncPoll($upload_target_srl, $content)
As post content's poll is obtained, synchronize the poll using the document number.
getAdminModel($module_name)
getInstance($db_type=NULL)
procPollViewResult()
Preview the results.
triggerUpdateCommentPoll(&$obj)
A poll synchronization trigger when a comment is updated.
procPoll()
Accept the poll.
triggerInsertDocumentPoll(&$obj)
A poll synchronization trigger when a new post is registered.
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
The parent class of the poll module.
triggerDeleteCommentPoll(&$obj)
A poll deletion trigger when a comment is removed.
Controller class for poll module.
if(isset($_REQUEST['encode'])) if(isset($_REQUEST['decode'])) $lang