diff --git a/README.md b/README.md
index 4fd82fe..2e0c576 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,17 @@
### poll
-## Модуль Опросы/Голосование v1.26.1a
+## Модуль Опросы/Голосование v3.31
+### для AVE.CMS ALT ≥ v3.31
-### Данный модуль предназачен для организации системы опросов на сайте.
+### Данный модуль предназачен для организации системы опросов на сайте с возможностью оставлять комментарии.
* Возможности модуля позволяют создавать неограниченное количество опросных листов, а также неограниченное количество вопросов.
- * Добавить в .htaccess (вне секции | Rewrite engine )
-
- ### Poll
- RewriteRule ^poll-([0-9]+).html$ index.php?module=poll&action=result&pid=$1
- RewriteRule ^pollcomment-([0-9]+).html$ index.php?module=poll&action=form&pop=1&pid=$1
- RewriteRule ^poll-archive.html$ index.php?module=poll&action=archive
+
### Changelog:
+29.03.2026 - обновление модуля - версия 3.31 - рефакторинг кода для работы в ave.cms ALT v3.31. Добавлена Captcha. Реализована поддержка ЧПУ-алиасов для внутренних ссылок модуля.
+
04.09.2019 - версия 1.26.1а - адаптация для ave.cms 3.26
22.09.2013 - версия 1.1a
\ No newline at end of file
diff --git a/ReadMe.txt b/ReadMe.txt
deleted file mode 100644
index a1834cf..0000000
--- a/ReadMe.txt
+++ /dev/null
@@ -1,7 +0,0 @@
- .htaccess
-
-
- ## Poll
- RewriteRule ^poll-([0-9]+).html$ index.php?module=poll&action=result&pid=$1
- RewriteRule ^pollcomment-([0-9]+).html$ index.php?module=poll&action=form&pop=1&pid=$1
- RewriteRule ^poll-archive.html$ index.php?module=poll&action=archive
\ No newline at end of file
diff --git a/admin/admin_comments.tpl b/admin/admin_comments.tpl
index 699aea4..394900a 100644
--- a/admin/admin_comments.tpl
+++ b/admin/admin_comments.tpl
@@ -24,7 +24,7 @@
| {#POLL_STATUS#}? | - poll_status==1}checked{/if} value="1"/> - poll_status==0}checked{/if} value="0" /> + poll_status) && $row->poll_status == 1}checked{/if} value="1"/> + + + poll_status) || $row->poll_status == 0}checked{/if} value="0" /> + | ||
| {#POLL_CAN_COMMENT#} | - poll_can_comment==1}checked{/if} /> - poll_can_comment==0}checked{/if} /> + poll_can_comment) && $row->poll_can_comment == 1}checked{/if} /> + + + poll_can_comment) || $row->poll_can_comment == 0}checked{/if} /> + + | +||
| {#POLL_ANTISPAM#} | ++ poll_anti_spam) && $row->poll_anti_spam == 1}checked{/if} /> + + + poll_anti_spam) || $row->poll_anti_spam == 0}checked{/if} /> + | ||
| {#POLL_START_TIME#} | - + | {#POLL_END_TIME#} | - + |
|
-
+
+
+
|
@@ -75,6 +78,12 @@ | ++ + + + | +@@ -99,4 +108,6 @@ {$page_nav} -{/if} \ No newline at end of file +{/if} + + \ No newline at end of file diff --git a/class/poll.php b/class/poll.php index 67d1bc2..0291ce3 100644 --- a/class/poll.php +++ b/class/poll.php @@ -115,7 +115,7 @@ class Poll } } - /** +/** * Учет результатов опроса * * @param int $pid идентификатор опроса @@ -124,56 +124,86 @@ class Poll { global $AVE_DB; + $pid = (int)$pid; $row = $AVE_DB->Query(" SELECT * FROM " . PREFIX . "_module_poll WHERE id = '" . $pid . "' ")->FetchRow(); + if (!$row) return; + + // Проверяем: если дата окончания установлена и она уже прошла + if ($row->poll_end > 0 && $row->poll_end < time()) + { + // перенаправляем на страницу результатов, ничего не записывая в базу + header('Location: ' . $this->_pollLinkRewrite('index.php?module=poll&action=result&pid=' . $pid)); + exit; + } + $poll_groups_id = empty($row->poll_groups_id) ? array() : explode(',', $row->poll_groups_id); $poll_users_id = empty($row->poll_users_id) ? array() : explode(',', $row->poll_users_id); $poll_users_ip = empty($row->poll_users_ip) ? array() : explode(',', $row->poll_users_ip); - $current_user_ip = empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']; + $current_user_ip = $_SERVER['REMOTE_ADDR'] ?? ''; - $back = $this->_pollLinkRewrite('index.php?module=poll&action=result&pid=' . $pid); + // убрал & из ссылки редиректа + $back = $this->_pollLinkRewrite('index.php?module=poll&action=result&pid=' . $pid); - if (!(@in_array(UGROUP, $poll_groups_id))) + // Проверка прав группы + if (!in_array(UGROUP, $poll_groups_id)) { - header('Location:' . $back); + header('Location: ' . $back); exit; } - if (@in_array($current_user_ip, $poll_users_ip) || - @in_array($_SESSION['user_id'], $poll_users_id) || - $_COOKIE['poll_' . $pid] == '1') + // Проверка: голосовал ли уже + $already_voted = false; + if (in_array($current_user_ip, $poll_users_ip)) $already_voted = true; + if (isset($_SESSION['user_id']) && in_array($_SESSION['user_id'], $poll_users_id)) $already_voted = true; + if (isset($_COOKIE['poll_' . $pid]) && $_COOKIE['poll_' . $pid] == '1') $already_voted = true; + + if ($already_voted) { - header('Location:' . $back); + header('Location: ' . $back); exit; } - setcookie('poll_' . $pid, '1', time() + 3600 * 3600); + // Устанавливаем куку + setcookie('poll_' . $pid, '1', time() + 3600 * 3600, '/'); - $AVE_DB->Query(" - UPDATE " . PREFIX . "_module_poll_items - SET poll_item_hits = poll_item_hits + 1 - WHERE id = '" . (int)$_POST['p_item'] . "' - "); + $p_item = (int)($_POST['p_item'] ?? 0); - $AVE_DB->Query(" - UPDATE " . PREFIX . "_module_poll - SET - poll_users_ip = CONCAT_WS(',', poll_users_ip, '" . $current_user_ip . "') - " . ((UGROUP != 2) ? ", poll_users_id = CONCAT_WS(',', poll_users_id, '" . $_SESSION['user_id'] . "')" : '') . " - WHERE - id = '" . $pid . "' - "); + if ($p_item > 0) + { + $AVE_DB->Query(" + UPDATE " . PREFIX . "_module_poll_items + SET poll_item_hits = poll_item_hits + 1 + WHERE id = '" . $p_item . "' + "); - header('Location:' . $back); + // Обновляем список проголосовавших (IP и ID) + $sql_user_update = ""; + if (UGROUP != 2 && isset($_SESSION['user_id'])) { + $sql_user_update = ", poll_users_id = CONCAT_WS(',', poll_users_id, '" . (int)$_SESSION['user_id'] . "')"; + } + + $AVE_DB->Query(" + UPDATE " . PREFIX . "_module_poll + SET + poll_users_ip = CONCAT_WS(',', poll_users_ip, '" . addslashes($current_user_ip) . "') + $sql_user_update + WHERE + id = '" . $pid . "' + "); + } + + // редирект + header('Location: ' . $back); exit; } - /** +/** * Подробная информация и статистика опроса, комментарии пользователей * * @param string $tpl_dir путь к папке с шаблонами модуля @@ -184,21 +214,37 @@ class Poll { global $AVE_DB, $AVE_Template; + if (empty($pid) && isset($_GET['pid'])) $pid = (int)$_GET['pid']; + + if (empty($pid) && isset($_SERVER['REQUEST_URI'])) { + if (preg_match('/poll-(\d+)/', $_SERVER['REQUEST_URI'], $matches)) { + $pid = (int)$matches[1]; + } + } + $pid = (int)$pid; + $AVE_Template->config_load($lang_file, 'showresult'); + $AVE_Template->assign('comment_title', ''); + $AVE_Template->assign('comment_text', ''); + $AVE_Template->assign('errors', array()); + + // Обработка нового комментария if (isset($_REQUEST['sub']) && $_REQUEST['sub'] == 'new') { $errors = $this->pollCommentNew($pid); - if (sizeof($errors) == 0) + if (empty($errors)) { - header('Location:' . $this->_pollLinkRewrite('index.php?module=poll&action=result&pid=' . $pid)); + $redirect_url = 'index.php?module=poll&action=result&pid=' . $pid; + header('Location:' . $this->_pollLinkRewrite($redirect_url)); exit; } $AVE_Template->assign('errors', $errors); } + // Основной запрос данных опроса $poll = $AVE_DB->Query(" SELECT poll.*, @@ -207,7 +253,7 @@ class Poll " . PREFIX . "_module_poll AS poll LEFT JOIN " . PREFIX . "_module_poll_items AS itm - ON poll_id = poll.id + ON itm.poll_id = poll.id WHERE poll.id = '" . $pid . "' AND poll.poll_title != '' AND @@ -216,32 +262,33 @@ class Poll GROUP BY poll.id ")->FetchRow(); - if ($poll === false) return; + if (!$poll) return; + // Варианты ответов $items = array(); + $votes_total = (int)$poll->votes; $sql = $AVE_DB->Query(" SELECT *, - " . ($poll->votes > 0 ? 'ROUND(poll_item_hits*100/' . $poll->votes . ')' : 0) . " AS sum + " . ($votes_total > 0 ? 'ROUND(poll_item_hits*100/' . $votes_total . ')' : 0) . " AS sum FROM " . PREFIX . "_module_poll_items WHERE poll_id = '" . $pid . "' ORDER BY poll_item_position ASC "); while ($row_items = $sql->FetchRow()) { - array_push($items, $row_items); + $items[] = $row_items; } + // Комментарии + $comments = array(); if ($poll->poll_can_comment == 1) { - //include_once(BASE_DIR . '/lib/markitup/sets/bbcode/markitup.bbcode-parser.php'); - - $comments = array(); $sql = $AVE_DB->Query(" SELECT cmnt.*, - IFNULL(firstname, '') AS firstname, - IFNULL(lastname, '" . $AVE_Template->get_config_vars('POLL_GUEST') . "') AS lastname + IFNULL(usr.firstname, '') AS firstname, + IFNULL(usr.lastname, '" . addslashes($AVE_Template->get_config_vars('POLL_GUEST')) . "') AS lastname FROM " . PREFIX . "_module_poll_comments AS cmnt LEFT JOIN @@ -252,66 +299,65 @@ class Poll "); while ($row_comments = $sql->FetchRow()) { - $row_comments->poll_comment_text = $row_comments->poll_comment_text; - - array_push($comments, $row_comments); + $comments[] = $row_comments; } - $poll->count_comments = $sql->NumRows(); } + // Проверка прав и кук $poll_users_id = empty($poll->poll_users_id) ? array() : explode(',', $poll->poll_users_id); $poll_users_ip = empty($poll->poll_users_ip) ? array() : explode(',', $poll->poll_users_ip); - - $current_user_ip = empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']; + $current_user_id = isset($_SESSION['user_id']) ? (int)$_SESSION['user_id'] : 0; + $current_user_ip = $_SERVER['REMOTE_ADDR'] ?? ''; $is_vote = 1; - if (@in_array($current_user_ip, $poll_users_ip) || - @in_array($_SESSION['user_id'], $poll_users_id) || + if (in_array($current_user_ip, $poll_users_ip) || + ($current_user_id > 0 && in_array($current_user_id, $poll_users_id)) || (isset($_COOKIE['poll_' . $pid]) && $_COOKIE['poll_' . $pid] == '1')) { $is_vote = 0; } $rights = 0; - $groups = array(); - if ($poll->poll_groups_id != '') + $groups_names = array(); + if (!empty($poll->poll_groups_id)) { + // фильтр ID групп (только цифры и запятые) + $safe_groups = preg_replace('/[^0-9,]/', '', $poll->poll_groups_id); $sql = $AVE_DB->Query(" - SELECT - user_group, - user_group_name - FROM - " . PREFIX . "_user_groups - WHERE - user_group IN(" . $poll->poll_groups_id . ") + SELECT user_group, user_group_name + FROM " . PREFIX . "_user_groups + WHERE user_group IN(" . $safe_groups . ") "); while ($row_g = $sql->FetchRow()) { if (UGROUP == $row_g->user_group) $rights = 1; - array_push($groups, $row_g->user_group_name); + $groups_names[] = $row_g->user_group_name; } } - $poll->can_vote = ($is_vote == 1 && $rights == 1) ? 1 : 0; - $poll->groups = implode(', ', $groups); + // Наполнение объекта для шаблона + $is_expired = ($poll->poll_end > 0 && $poll->poll_end < time()) ? 1 : 0; + $poll->can_vote = ($is_vote == 1 && $rights == 1 && $is_expired == 0) ? 1 : 0; + $poll->is_expired = $is_expired; + $poll->groups = implode(', ', $groups_names); $poll->can_comment = ($poll->poll_status == 1 && $poll->poll_can_comment == 1 && $rights == 1) ? 1 : 0; - $poll->anti_spam = ($this->_antispam == 1 && function_exists('imagettftext') && function_exists('imagejpeg')) ? 1 : 0; - $poll->comment_max_chars = $this->_commentwords; + $poll->anti_spam = ($poll->poll_anti_spam == 1 && function_exists('imagettftext')) ? 1 : 0; + $poll->comment_max_chars = (int)$this->_commentwords; $poll->items = $items; $poll->comments = $comments; - $poll->formaction = 'index.php?module=poll&action=vote&pid=' . $pid; - $poll->link_result = $this->_pollLinkRewrite('index.php?module=poll&action=result&pid=' . $pid); -// $poll->link_archive = $this->_pollLinkRewrite('index.php?module=poll&action=archive'); -// $poll->link_comment = $this->_pollLinkRewrite('index.php?module=poll&action=form&pop=1&pid=' . $pid); + + // Ссылки + $poll->formaction = 'index.php?module=poll&action=vote&pid=' . $pid; + $poll->link_result = $this->_pollLinkRewrite('index.php?module=poll&action=result&pid=' . $pid); $AVE_Template->assign('poll', $poll); - define('MODULE_SITE', $AVE_Template->get_config_vars('POLL_PAGE_TITLE_PREFIX') . $poll->poll_title); - define('MODULE_CONTENT', $AVE_Template->fetch($tpl_dir . 'result.tpl')); + if (!defined('MODULE_SITE')) define('MODULE_SITE', $AVE_Template->get_config_vars('POLL_PAGE_TITLE_PREFIX') . $poll->poll_title); + if (!defined('MODULE_CONTENT')) define('MODULE_CONTENT', $AVE_Template->fetch($tpl_dir . 'result.tpl')); } - /** +/** * Список завершенных и действующих опросов * * @param string $tpl_dir путь к папке с шаблонами модуля @@ -321,13 +367,17 @@ class Poll { global $AVE_DB, $AVE_Template; - if (empty($_REQUEST['order'])) + // Добавляем инициализацию для Smarty, чтобы убрать Warning в шаблоне + $req_order = isset($_REQUEST['order']) ? $_REQUEST['order'] : ''; + $req_by = isset($_REQUEST['by']) ? $_REQUEST['by'] : ''; + + if (empty($req_order)) { $order = 'poll_title'; } else { - switch ($_REQUEST['order']) + switch ($req_order) { case 'title': $order = 'poll_title'; @@ -351,7 +401,7 @@ class Poll } } - if (isset($_REQUEST['by']) && $_REQUEST['by'] == 'desc') + if ($req_by == 'desc') { $order .= ' DESC'; } @@ -372,25 +422,29 @@ class Poll " . PREFIX . "_module_poll AS poll LEFT JOIN " . PREFIX . "_module_poll_items AS itm - ON poll_id = poll.id + ON itm.poll_id = poll.id WHERE poll.poll_title != '' AND poll.poll_status = '1' AND - poll.poll_start < '" . time() . "' + poll.poll_start < '" . (int)time() . "' GROUP BY poll.id ORDER BY " . $order ); + while ($row = $sql->FetchRow()) { - $row->plink = $this->_pollLinkRewrite('index.php?module=poll&action=result&pid=' . $row->id); + $row->plink = $this->_pollLinkRewrite('index.php?module=poll&action=result&pid=' . (int)$row->id); array_push($items, $row); } $AVE_Template->assign('items', $items); + $AVE_Template->assign('order', $req_order); + $AVE_Template->assign('by', $req_by); + $AVE_Template->config_load($lang_file, 'showarchive'); - define('MODULE_SITE', $AVE_Template->get_config_vars('POLL_ARCHIVE_TITLE')); - define('MODULE_CONTENT', $AVE_Template->fetch($tpl_dir . 'archive.tpl')); + if (!defined('MODULE_SITE')) define('MODULE_SITE', $AVE_Template->get_config_vars('POLL_ARCHIVE_TITLE')); + if (!defined('MODULE_CONTENT')) define('MODULE_CONTENT', $AVE_Template->fetch($tpl_dir . 'archive.tpl')); } /** @@ -424,7 +478,7 @@ class Poll } $AVE_Template->assign('max_chars', $this->_commentwords); - if ($this->_antispam == 1 && function_exists('imagettftext') && function_exists('imagejpeg')) + if (isset($row->poll_anti_spam) && $row->poll_anti_spam == 1 && function_exists('imagettftext') && function_exists('imagejpeg')) { $AVE_Template->assign('anti_spam', 1); } @@ -437,82 +491,96 @@ class Poll $AVE_Template->display($tpl_dir . 'poll_form.tpl'); } - /** - * Метод создания нового комментария +/** + * Метод создания нового комментария (UTF-8 Only) * - * @param string $tpl_dir путь к папке с шаблонами модуля - * @param string $lang_file путь к языковому файлу модуля - * @param int $pid идентификатор опроса + * @param int $pid идентификатор опроса */ - function pollCommentNew($pid) - { - global $AVE_DB, $AVE_Template; +function pollCommentNew($pid) +{ + global $AVE_DB, $AVE_Template; - $errors = array(); + $errors = array(); + $pid = (int)$pid; - if (isset($_REQUEST['ajax']) && $_REQUEST['ajax'] == 1) - { - $comment_title = iconv('utf-8', 'cp1251', $_POST['comment_title']); - $comment_text = iconv('utf-8', 'cp1251', $_POST['comment_text']); - } - else - { - $comment_title = $_POST['comment_title']; - $comment_text = $_POST['comment_text']; - } + $poll_settings = $AVE_DB->Query(" + SELECT poll_anti_spam, poll_groups_id + FROM " . PREFIX . "_module_poll + WHERE id = '" . $pid . "' + AND poll_status = '1' + AND poll_can_comment = '1' + LIMIT 1 + ")->FetchRow(); - $text = (mb_strlen($comment_text) > $this->_commentwords) - ? mb_substr($comment_text, 0, $this->_commentwords) . '...' - : $comment_text; + if (!$poll_settings) { + $errors[] = $AVE_Template->get_config_vars('POLL_ERROR_PERM'); + // Если это AJAX, отдаем ошибку сразу + if (isset($_REQUEST['ajax'])) { @ob_clean(); die('###ERR###' . end($errors)); } + return $errors; + } - if (mb_strlen($text) <= 10) $errors[] = $AVE_Template->get_config_vars('POLL_ENTER_TEXT'); - if (empty($comment_title)) $errors[] = $AVE_Template->get_config_vars('POLL_ENTER_TITLE'); + $comment_title = isset($_POST['comment_title']) ? trim(addslashes($_POST['comment_title'])) : ''; + $comment_text = isset($_POST['comment_text']) ? trim(addslashes($_POST['comment_text'])) : ''; - if ($this->_antispam == 1) - { - if (! (isset($_SESSION['captcha_keystring']) && isset($_POST['securecode']) - && $_SESSION['captcha_keystring'] == $_POST['securecode'])) - { - $errors[] = $AVE_Template->get_config_vars('POLL_ENTER_CODE'); - } + $max_len = (int)$this->_commentwords; + $text = (mb_strlen($comment_text) > $max_len) + ? mb_substr($comment_text, 0, $max_len) . '...' + : $comment_text; - unset($_SESSION['captcha_keystring']); - } + if (mb_strlen($text) < 5) $errors[] = $AVE_Template->get_config_vars('POLL_ENTER_TEXT'); + if (empty($comment_title)) $errors[] = $AVE_Template->get_config_vars('POLL_ENTER_TITLE'); - if (sizeof($errors) == 0) - { - $poll_groups_id = $AVE_DB->Query(" - SELECT poll_groups_id - FROM " . PREFIX . "_module_poll - WHERE id = '" . $pid . "' - AND poll_status = '1' - AND poll_can_comment = '1' - ")->GetCell(); + if ($poll_settings->poll_anti_spam == 1 && function_exists('imagettftext')) + { + $session_captcha = $_SESSION['captcha_keystring'] ?? ''; + $post_captcha = $_POST['securecode'] ?? ''; - if (!empty($poll_groups_id) && in_array(UGROUP, explode(',', $poll_groups_id))) - { - $author_id = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : 0; - $author_ip = empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']; + if (empty($post_captcha) || $session_captcha !== $post_captcha) + { + $errors[] = $AVE_Template->get_config_vars('POLL_ENTER_CODE_ERR'); + } + + if (empty($errors)) { + unset($_SESSION['captcha_keystring']); + } + } - $AVE_DB->Query(" - INSERT " . PREFIX . "_module_poll_comments - SET - poll_id = '" . $pid . "', - poll_comment_time = '" . time() . "', - poll_comment_author_id = '" . $author_id . "', - poll_comment_author_ip = '" . $author_ip . "', - poll_comment_title = '" . $comment_title . "', - poll_comment_text = '" . $text . "' - "); + if (empty($errors)) + { + $allowed_groups = explode(',', $poll_settings->poll_groups_id); + if (in_array(UGROUP, $allowed_groups)) + { + $author_id = (int)($_SESSION['user_id'] ?? 0); + $author_ip = addslashes($_SERVER['REMOTE_ADDR'] ?? ''); - return $errors; - } + $AVE_DB->Query(" + INSERT INTO " . PREFIX . "_module_poll_comments + SET + poll_id = '" . $pid . "', + poll_comment_time = '" . time() . "', + poll_comment_author_id = '" . $author_id . "', + poll_comment_author_ip = '" . $author_ip . "', + poll_comment_title = '" . $comment_title . "', + poll_comment_text = '" . $text . "' + "); - $errors[] = $AVE_Template->get_config_vars('POLL_ERROR_PERM'); - } + if (isset($_REQUEST['ajax'])) { @ob_clean(); die('###OK###'); } + return array(); + } + else + { + $errors[] = $AVE_Template->get_config_vars('POLL_ERROR_PERM'); + } + } - return $errors; - } + // Если мы здесь и это AJAX — значит есть ошибки. Выплевываем их. + if (isset($_REQUEST['ajax'])) { + @ob_clean(); + die('###ERR###' . implode(' |
| {#POLL_PUB_TITLE#} | -{#POLL_PUB_START#} | -{#POLL_PUB_END#} | -{#POLL_ARCHIVE_HITS#} | -
| {$item->poll_title} | -{$item->poll_start|date_format:$DATE_FORMAT|pretty_date} | -{$item->poll_end|date_format:$DATE_FORMAT|pretty_date} | -{$item->votes} | -
| + + {#POLL_PUB_TITLE#} + {if $order=='title'}{/if} + + | + ++ + {#POLL_PUB_START#} + {if $order=='start'}{/if} + + | + ++ + {#POLL_PUB_END#} + {if $order=='end'}{/if} + + | + ++ + {#POLL_ARCHIVE_HITS#} + {if $order=='votes'}{/if} + + | +
|---|---|---|---|
| + + {$item->poll_title|escape} + + | ++ {$item->poll_start|date_format:$DATE_FORMAT|pretty_date} + | ++ {$item->poll_end|date_format:$DATE_FORMAT|pretty_date} + | ++ {$item->votes} + | +
| Архив пока пуст | |||
{$poll->poll_title}
- \ No newline at end of file +{$poll->poll_title}
-- {foreach from=$items item=item} -
{$poll->message}
{/if} - \ No newline at end of file +| {#POLL_ALL_HITS#} | {$poll->votes} |
| {#POLL_PUB_STATUS#} | {if $poll->poll_end > $smarty.now}{#POLL_ACTIVE_INFO#}{else}{#POLL_INACTIVE_INFO#}{/if} |
| {#POLL_STARTED#} | {$poll->poll_start|date_format:$TIME_FORMAT|pretty_date} |
| {#POLL_ENDED#} | {$poll->poll_end|date_format:$TIME_FORMAT|pretty_date} |
| {#POLL_QUESTION_LIST#} | -{#POLL_RESULT_INFO#} | -||
|---|---|---|---|
| {$item->poll_item_title|escape} | - {$item->poll_item_hits} |
-
-
-
- sum}%{else}1%{/if};height:12px;background-color:{$item->poll_item_color}">
-
- |
- {$item->sum} % |
-
| {#POLL_INFOS#} | -|
|---|---|
| {#POLL_ALL_HITS#} | -{$poll->votes} | -
| {#POLL_PUB_STATUS#} | -{if $poll->poll_end > $smarty.now}{#POLL_ACTIVE_INFO#}{else}{#POLL_INACTIVE_INFO#}{/if} | -
| {#POLL_STARTED#} | -{$poll->poll_start|date_format:$TIME_FORMAT|pretty_date} | -
| {#POLL_ENDED#} | -{$poll->poll_end|date_format:$TIME_FORMAT|pretty_date} | -
| {#POLL_GROUPS_PERM#} | -{$poll->groups|escape} | -