|
@@ 280-286 (lines=7) @@
|
| 277 |
|
$pollObject->setVar('question', Request::getString('question', '', 'POST')); |
| 278 |
|
$pollObject->setVar('description', Request::getString('description', '', 'POST')); |
| 279 |
|
$end_time = Request::getString('end_time', '', 'POST'); // (empty($_POST['end_time'])) ? "" : $_POST['end_time']; |
| 280 |
|
if ('' !== $end_time) { |
| 281 |
|
$timezone = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('timezone') : null; |
| 282 |
|
$pollObject->setVar('end_time', userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time), $timezone)); |
| 283 |
|
} else { |
| 284 |
|
// if expiration date is not set, set it to 10 days from now |
| 285 |
|
$pollObject->setVar('end_time', time() + (86400 * 10)); |
| 286 |
|
} |
| 287 |
|
|
| 288 |
|
$pollObject->setVar('display', 0); |
| 289 |
|
$pollObject->setVar('weight', Request::getInt('weight', 0, 'POST')); |
|
@@ 693-698 (lines=6) @@
|
| 690 |
|
} |
| 691 |
|
|
| 692 |
|
$end_time = !Request::getInt('end_time', 0, 'POST'); |
| 693 |
|
if (0 !== $end_time) { |
| 694 |
|
$timezone = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('timezone') : null; |
| 695 |
|
$pollObject->setVar('end_time', userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time), $timezone)); |
| 696 |
|
} else { |
| 697 |
|
$pollObject->setVar('end_time', time() + $default_poll_duration); |
| 698 |
|
} |
| 699 |
|
|
| 700 |
|
$isNotify = Request::getInt('notify', 0, 'POST'); |
| 701 |
|
if (!empty($isNotify) && ($end_time > time())) { |