Beispiel #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);
Beispiel #2
0
    } else {
        if (isset($pid)) {
            $display .= POLLS_siteHeader();
            if ($msg > 0) {
                $display .= COM_showMessage($msg, 'polls');
            }
            if (isset($_POST['aid'])) {
                $eMsg = $LANG_POLLS['answer_all'] . ' "' . DB_getItem($_TABLES['polltopics'], 'topic', "pid = '" . DB_escapeString($pid) . "'") . '"';
                $display .= COM_showMessageText($eMsg, $LANG_POLLS['not_saved'], true);
            }
            if (DB_getItem($_TABLES['polltopics'], 'is_open', "pid = '" . DB_escapeString($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='" . DB_escapeString($pid) . "'" . COM_getPermSql('AND'));
            $Q = DB_fetchArray($poll_topic);
            if (empty($Q['topic'])) {
                $display .= POLLS_siteHeader($LANG_POLLS['pollstitle']) . POLLS_pollList();
            } else {
                $display .= POLLS_siteHeader($Q['topic']) . POLLS_pollResults($pid, 400, $order, $mode);
            }
        }
    }
}
$display .= POLLS_siteFooter();