Exemple #1
0
            // poll doesn't exist or user doesn't have access
            COM_handle404($_CONF['site_url'] . '/polls/index.php');
        } else {
            // Meta Tags
            $headercode = '';
            if ($_PO_CONF['meta_tags'] > 0) {
                $headercode = LB . PLG_getMetaTags('poll', $pid, array(array('name' => 'description', 'content' => stripslashes($A['meta_description'])), array('name' => 'keywords', 'content' => stripslashes($A['meta_keywords']))));
            }
            if ($msg > 0) {
                $display .= COM_showMessage($msg, 'polls');
            }
            if (isset($_POST['aid'])) {
                $display .= COM_showMessageText($LANG_POLLS['answer_all'] . ' "' . $polltopic . '"', $LANG_POLLS['not_saved']);
            }
            if (DB_getItem($_TABLES['polltopics'], 'is_open', "pid = '{$pid}'") != 1) {
                $aid = -1;
                // poll closed - show result
            }
            if (!isset($_COOKIE['poll-' . $pid]) && !POLLS_ipAlreadyVoted($pid) && $aid != -1) {
                $display .= POLLS_pollVote($pid, true, 0, $order, $mode, $page);
            } else {
                $display .= POLLS_pollResults($pid, 400, $order, $mode, $page);
            }
            $display = COM_createHTMLDocument($display, array('pagetitle' => $polltopic, 'headercode' => $headercode));
        }
    } else {
        $display .= polllist();
        $display = COM_createHTMLDocument($display, array('pagetitle' => $LANG_POLLS['pollstitle']));
    }
}
COM_output($display);
Exemple #2
0
            $display .= COM_siteHeader('menu', $LANG_POLLS['pollstitle']) . COM_showMessageText(sprintf($LANG25[12], $pid));
        } else {
            $display .= COM_siteHeader('menu', $topic);
            if ($msg > 0) {
                $display .= COM_showMessage($msg, 'polls');
            }
            if (isset($_POST['aid'])) {
                $display .= COM_startBlock($LANG_POLLS['not_saved'], '', COM_getBlockTemplate('_msg_block', 'header')) . $LANG_POLLS['answer_all'] . ' "' . $topic . '"' . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
            }
            if (DB_getItem($_TABLES['polltopics'], 'is_open', "pid = '{$pid}'") != 1) {
                $aid = -1;
                // poll closed - show result
            }
            if (!isset($_COOKIE['poll-' . $pid]) && !POLLS_ipAlreadyVoted($pid) && $aid != -1) {
                $display .= POLLS_pollVote($pid);
            } else {
                $display .= POLLS_pollResults($pid, 400, $order, $mode);
            }
        }
    } else {
        $poll_topic = DB_query("SELECT topic FROM {$_TABLES['polltopics']} WHERE pid='{$pid}'" . COM_getPermSql('AND'));
        $Q = DB_fetchArray($poll_topic);
        if (empty($Q['topic'])) {
            $display .= COM_siteHeader('menu', $LANG_POLLS['pollstitle']) . polllist();
        } else {
            $display .= COM_siteHeader('menu', $Q['topic']) . POLLS_pollResults($pid, 400, $order, $mode);
        }
    }
}
$display .= COM_siteFooter();
COM_output($display);