Пример #1
0
        /**
         * Set main template placeholders required after content parsing
         * @todo Remove usage of globals
         * @global array $_CONFIG
         * @global type $themesPages
         * @global type $objBanner
         * @global type $_CORELANG
         * @return type
         */
        protected function setPostContentLoadPlaceholders()
        {
            global $_CONFIG, $themesPages, $objBanner, $_CORELANG;
            if ($this->mode == self::MODE_BACKEND) {
                $formattedVersion = htmlentities($_CONFIG['coreCmsName'], ENT_QUOTES, CONTREXX_CHARSET) . ' ' . htmlentities(str_replace(' Service Pack 0', '', preg_replace('#^(\\d+\\.\\d+)\\.(\\d+)$#', '$1 Service Pack $2', $_CONFIG['coreCmsVersion'])), ENT_QUOTES, CONTREXX_CHARSET) . ' ' . htmlentities($_CONFIG['coreCmsEdition'], ENT_QUOTES, CONTREXX_CHARSET) . ' ' . htmlentities($_CONFIG['coreCmsStatus'], ENT_QUOTES, CONTREXX_CHARSET);
                $this->template->setGlobalVariable(array('TXT_FRONTEND' => $_CORELANG['TXT_FRONTEND'], 'TXT_UPGRADE' => $_CORELANG['TXT_UPGRADE'], 'TXT_FEEDBACK_AND_HELP' => $_CORELANG['TXT_FEEDBACK_AND_HELP'], 'CONTREXX_VERSION' => $formattedVersion));
                $this->template->setVariable(array('TXT_LOGOUT' => $_CORELANG['TXT_LOGOUT'], 'TXT_PAGE_ID' => $_CORELANG['TXT_PAGE_ID'], 'CONTAINER_BACKEND_CLASS' => 'backend', 'CONTREXX_CHARSET' => CONTREXX_CHARSET));
                //show Feedback and help block
                \Permission::checkAccess(192, 'static', true) ? $this->template->touchBlock('feedback_help') : $this->template->hideBlock('feedback_help');
                return;
            }
            $objCounter = null;
            $componentRepo = $this->getDb()->getEntityManager()->getRepository('Cx\\Core\\Core\\Model\\Entity\\SystemComponent');
            $statsComponentContoller = $componentRepo->findOneBy(array('name' => 'Stats'));
            if ($statsComponentContoller) {
                $objCounter = $statsComponentContoller->getCounterInstance();
            }
            // set global template variables
            $boolShop = \Cx\Modules\Shop\Controller\Shop::isInitialized();
            $objNavbar = new \Navigation($this->resolvedPage->getId(), $this->resolvedPage);
            $objNavbar->setLanguagePlaceholders($this->resolvedPage, $this->request->getUrl(), $this->template);
            $metarobots = $this->resolvedPage->getMetarobots();
            $this->template->setVariable(array('CHARSET' => \Env::get('init')->getFrontendLangCharset(), 'TITLE' => contrexx_raw2xhtml($this->resolvedPage->getTitle()), 'METATITLE' => contrexx_raw2xhtml($this->resolvedPage->getMetatitle()), 'NAVTITLE' => contrexx_raw2xhtml($this->resolvedPage->getTitle()), 'GLOBAL_TITLE' => $_CONFIG['coreGlobalPageTitle'], 'DOMAIN_URL' => $_CONFIG['domainUrl'], 'PATH_OFFSET' => $this->codeBaseOffsetPath, 'BASE_URL' => ASCMS_PROTOCOL . '://' . $_CONFIG['domainUrl'] . $this->codeBaseOffsetPath, 'METAKEYS' => $metarobots ? contrexx_raw2xhtml($this->resolvedPage->getMetakeys()) : '', 'METADESC' => $metarobots ? contrexx_raw2xhtml($this->resolvedPage->getMetadesc()) : '', 'METAROBOTS' => $metarobots ? 'all' : 'none', 'METAIMAGE' => $metarobots ? contrexx_raw2xhtml($this->resolvedPage->getMetaimage()) : '', 'CONTENT_TITLE' => $this->resolvedPage->getContentTitle(), 'CONTENT_TEXT' => $this->resolvedPage->getContent(), 'CSS_NAME' => contrexx_raw2xhtml($this->resolvedPage->getCssName()), 'STANDARD_URL' => contrexx_raw2xhtml(\Env::get('init')->getUriBy('smallscreen', 0)), 'MOBILE_URL' => contrexx_raw2xhtml(\Env::get('init')->getUriBy('smallscreen', 1)), 'PRINT_URL' => contrexx_raw2xhtml(\Env::get('init')->getUriBy('printview', 1)), 'PDF_URL' => contrexx_raw2xhtml(\Env::get('init')->getUriBy('pdfview', 1)), 'APP_URL' => contrexx_raw2xhtml(\Env::get('init')->getUriBy('appview', 1)), 'LOGOUT_URL' => contrexx_raw2xhtml(\Env::get('init')->getUriBy('section', 'logout')), 'PAGE_URL' => htmlspecialchars(\Env::get('init')->getPageUri()), 'PAGE_URL_ENCODED' => urlencode(\Env::get('init')->getPageUri()->toString()), 'CURRENT_URL' => contrexx_raw2xhtml(\Env::get('init')->getCurrentPageUri()), 'DATE' => showFormattedDate(), 'TIME' => date('H:i', time()), 'NAVTREE' => $objNavbar->getTrail(), 'SUBNAVBAR_FILE' => $objNavbar->getSubnavigation($themesPages['subnavbar'], $this->license, $boolShop), 'SUBNAVBAR2_FILE' => $objNavbar->getSubnavigation($themesPages['subnavbar2'], $this->license, $boolShop), 'SUBNAVBAR3_FILE' => $objNavbar->getSubnavigation($themesPages['subnavbar3'], $this->license, $boolShop), 'NAVBAR_FILE' => $objNavbar->getNavigation($themesPages['navbar'], $this->license, $boolShop), 'NAVBAR2_FILE' => $objNavbar->getNavigation($themesPages['navbar2'], $this->license, $boolShop), 'NAVBAR3_FILE' => $objNavbar->getNavigation($themesPages['navbar3'], $this->license, $boolShop), 'ONLINE_USERS' => $objCounter ? $objCounter->getOnlineUsers() : '', 'VISITOR_NUMBER' => $objCounter ? $objCounter->getVisitorNumber() : '', 'COUNTER' => $objCounter ? $objCounter->getCounterTag() : '', 'BANNER' => isset($objBanner) ? $objBanner->getBannerJS() : '', 'VERSION' => contrexx_raw2xhtml($_CONFIG['coreCmsName']), 'LANGUAGE_NAVBAR' => $objNavbar->getFrontendLangNavigation($this->resolvedPage, $this->request->getUrl()), 'LANGUAGE_NAVBAR_SHORT' => $objNavbar->getFrontendLangNavigation($this->resolvedPage, $this->request->getUrl(), true), 'ACTIVE_LANGUAGE_NAME' => \Env::get('init')->getFrontendLangName(), 'RANDOM' => md5(microtime()), 'TXT_SEARCH' => $_CORELANG['TXT_SEARCH'], 'MODULE_INDEX' => MODULE_INDEX, 'LOGIN_URL' => '<a href="' . contrexx_raw2xhtml(\Env::get('init')->getUriBy('section', 'Login')) . '" class="start-frontend-editing">' . $_CORELANG['TXT_FRONTEND_EDITING_LOGIN'] . '</a>', 'TXT_CORE_LAST_MODIFIED_PAGE' => $_CORELANG['TXT_CORE_LAST_MODIFIED_PAGE'], 'LAST_MODIFIED_PAGE' => date(ASCMS_DATE_FORMAT_DATE, $this->resolvedPage->getUpdatedAt()->getTimestamp()), 'CONTACT_EMAIL' => isset($_CONFIG['contactFormEmail']) ? contrexx_raw2xhtml($_CONFIG['contactFormEmail']) : '', 'CONTACT_NAME' => isset($_CONFIG['coreAdminName']) ? contrexx_raw2xhtml($_CONFIG['coreAdminName']) : '', 'CONTACT_COMPANY' => isset($_CONFIG['contactCompany']) ? contrexx_raw2xhtml($_CONFIG['contactCompany']) : '', 'CONTACT_ADDRESS' => isset($_CONFIG['contactAddress']) ? contrexx_raw2xhtml($_CONFIG['contactAddress']) : '', 'CONTACT_ZIP' => isset($_CONFIG['contactZip']) ? contrexx_raw2xhtml($_CONFIG['contactZip']) : '', 'CONTACT_PLACE' => isset($_CONFIG['contactPlace']) ? contrexx_raw2xhtml($_CONFIG['contactPlace']) : '', 'CONTACT_COUNTRY' => isset($_CONFIG['contactCountry']) ? contrexx_raw2xhtml($_CONFIG['contactCountry']) : '', 'CONTACT_PHONE' => isset($_CONFIG['contactPhone']) ? contrexx_raw2xhtml($_CONFIG['contactPhone']) : '', 'CONTACT_FAX' => isset($_CONFIG['contactFax']) ? contrexx_raw2xhtml($_CONFIG['contactFax']) : '', 'GOOGLE_MAPS_API_KEY' => isset($_CONFIG['googleMapsAPIKey']) ? contrexx_raw2xhtml($_CONFIG['googleMapsAPIKey']) : '', 'FACEBOOK_LIKE_IFRAME' => '<div id="fb-root"></div>
                                                    <script type="text/javascript">
                                                        (function(d, s, id) {
                                                            var js, fjs = d.getElementsByTagName(s)[0];
                                                            if (d.getElementById(id)) return;
                                                            js = d.createElement(s); js.id = id;
                                                            js.src = "//connect.facebook.net/' . \FWLanguage::getLanguageCodeById(LANG_ID) . '_' . strtoupper(\FWLanguage::getLanguageCodeById(LANG_ID)) . '/all.js#xfbml=1";
                                                            fjs.parentNode.insertBefore(js, fjs);
                                                        }(document, \'script\', \'facebook-jssdk\'));
                                                    </script>
                                                    <div class="fb-like" data-href="' . ASCMS_PROTOCOL . '://' . $_CONFIG['domainUrl'] . contrexx_raw2xhtml(\Env::get('init')->getCurrentPageUri()) . '" data-send="false" data-layout="button_count" data-show-faces="false" data-font="segoe ui"></div>', 'GOOGLE_PLUSONE' => '<div class="g-plusone" data-href="' . ASCMS_PROTOCOL . '://' . $_CONFIG['domainUrl'] . contrexx_raw2xhtml(\Env::get('init')->getCurrentPageUri()) . '"></div>
                                                    <script type="text/javascript">
                                                        window.___gcfg = {lang: \'' . \FWLanguage::getLanguageCodeById(LANG_ID) . '\'};

                                                        (function() {
                                                            var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true;
                                                            po.src = \'https://apis.google.com/js/plusone.js\';
                                                            var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);
                                                        })();
                                                    </script>', 'TWITTER_SHARE' => '<a href="https://twitter.com/share" class="twitter-share-button"
                                                    data-url="' . ASCMS_PROTOCOL . '://' . $_CONFIG['domainUrl'] . contrexx_raw2xhtml(\Env::get('init')->getCurrentPageUri()) . '" data-lang="' . \FWLanguage::getLanguageCodeById(LANG_ID) . '">Twittern</a>
                                                    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?\'http\':\'https\';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+\'://platform.twitter.com/widgets.js\';fjs.parentNode.insertBefore(js,fjs);}}(document, \'script\', \'twitter-wjs\');</script>', 'XING_SHARE' => '<div data-type="XING/Share" data-counter="right" data-lang="' . \FWLanguage::getLanguageCodeById(LANG_ID) . '"></div>
                                                    <script>
                                                        ;(function (d, s) {
                                                            var x = d.createElement(s),
                                                                s = d.getElementsByTagName(s)[0];
                                                            x.src = "https://www.xing-share.com/js/external/share.js";
                                                            s.parentNode.insertBefore(x, s);
                                                        })(document, "script");
                                                    </script>', 'GOOGLE_ANALYTICS' => '<script type="text/javascript">
                                                        var _gaq = _gaq || [];
                                                        _gaq.push([\'_setAccount\', \'' . (isset($_CONFIG['googleAnalyticsTrackingId']) ? contrexx_raw2xhtml($_CONFIG['googleAnalyticsTrackingId']) : '') . '\']);
                                                        _gaq.push([\'_trackPageview\']);

                                                        (function() {
                                                            var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;
                                                            ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';
                                                            var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);
                                                        })();
                                                    </script>'));
        }
Пример #2
0
/**
 * Show current voting
 */
function votingShowCurrent($page_content)
{
    global $objDatabase, $_CONFIG, $_ARRAYLANG, $_COOKIE;
    $paging = '';
    $objTpl = new \Cx\Core\Html\Sigma('.');
    \Cx\Core\Csrf\Controller\Csrf::add_placeholder($objTpl);
    $objTpl->setErrorHandling(PEAR_ERROR_DIE);
    $objTpl->setTemplate($page_content);
    if (!isset($_GET['vid'])) {
        $_GET['vid'] = '';
    }
    if (!isset($_POST['votingemail'])) {
        $_POST['votingemail'] = '';
    }
    $votingId = intval($_GET['vid']);
    $msg = '';
    $voted = false;
    if ($_POST["votingoption"]) {
        $voteId = intval($_POST["votingoption"]);
        $query = "SELECT voting_system_id from " . DBPREFIX . "voting_results WHERE id=" . $voteId;
        $objResult = $objDatabase->SelectLimit($query, 1);
        if (!$objResult->EOF) {
            $votingId = $objResult->fields["voting_system_id"];
        }
        $objVoting = $objDatabase->SelectLimit("SELECT submit_check FROM `" . DBPREFIX . "voting_system` WHERE `id`=" . $votingId, 1);
        if ($objVoting !== false && $objVoting->RecordCount() == 1) {
            if ($objVoting->fields['submit_check'] == 'email') {
                $email = contrexx_addslashes($_POST['votingemail']);
                $objValidator = new \FWValidator();
                if ($objValidator->isEmail($email)) {
                    if (!_alreadyVotedWithEmail($votingId, $email)) {
                        if (($msg = VotingSubmitEmail($votingId, $voteId, $email)) === true) {
                            $msg = '';
                            $voted = true;
                        } else {
                            $msg = $_ARRAYLANG['TXT_VOTING_NONEXISTENT_EMAIL'] . '<br /><br />';
                        }
                    } else {
                        $msg = $_ARRAYLANG['TXT_VOTING_ALREADY_VOTED'] . '<br /><br />';
                    }
                } else {
                    $msg = $_ARRAYLANG['TXT_VOTING_INVALID_EMAIL_ERROR'] . '<br /><br />';
                }
            } else {
                VotingSubmit();
                $voted = true;
            }
        }
    }
    if ($_GET['vid'] != '' && $_GET['act'] != 'delete') {
        $query = "SELECT\n\t\t\tid,                                 status,\n\t\t\tdate as datesec,                    question,\n\t\t\tvotes,                              submit_check,\n\t\t\tadditional_nickname,                additional_forename,\n\t\t\tadditional_surname,                 additional_phone,\n\t\t\tadditional_street,                  additional_zip,\n            additional_city,                    additional_email,\n            additional_comment\n\n\t\t\tFROM " . DBPREFIX . "voting_system where id=" . intval($_GET['vid']);
    } else {
        $query = "SELECT\n\t\t\tid,                                 status,\n\t\t\tdate as datesec,                    question,\n\t\t\tvotes,                              submit_check,\n\t\t\tadditional_nickname,                additional_forename,\n\t\t\tadditional_surname,                 additional_phone,\n\t\t\tadditional_street,                  additional_zip,\n\t\t   \tadditional_city,                    additional_email,\n            additional_comment\n\n\t\t\tFROM " . DBPREFIX . "voting_system where status=1";
    }
    $objResult = $objDatabase->Execute($query);
    if ($objResult->RecordCount() == 0) {
        // Only show old records when no voting is set available
        $objTpl->setVariable(array('VOTING_TITLE' => $_ARRAYLANG['TXT_VOTING_NOT_AVAILABLE'], 'VOTING_DATE' => '', 'VOTING_OLDER_TEXT' => '', 'VOTING_OLDER_DATE' => '', 'VOTING_PAGING' => '', 'TXT_DATE' => '', 'TXT_TITLE' => '', 'VOTING_RESULTS_TEXT' => '', 'VOTING_RESULTS_TOTAL_VOTES' => '', 'VOTING_OLDER_TITLE' => $_ARRAYLANG['TXT_VOTING_OLDER'], 'TXT_SUBMIT' => ''));
        /** start paging **/
        $query = "SELECT id, date as datesec, title, votes FROM " . DBPREFIX . "voting_system order by id desc";
        $objResult = $objDatabase->SelectLimit($query, 5);
        $count = $objResult->RecordCount();
        $pos = intval($_GET[pos]);
        if ($count > intval($_CONFIG['corePagingLimit'])) {
            $paging = getPaging($count, $pos, "&section=Voting", "<b>" . $_ARRAYLANG['TXT_VOTING_ENTRIES'] . "</b>", true);
        }
        /** end paging **/
        $query = "SELECT id, date as datesec, title, votes FROM " . DBPREFIX . "voting_system order by id desc ";
        $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos);
        while (!$objResult->EOF) {
            $votingid = $objResult->fields['id'];
            $votingTitle = stripslashes($objResult->fields['title']);
            $votingVotes = $objResult->fields['votes'];
            $votingDate = strtotime($objResult->fields['datesec']);
            if ($i % 2 == 0) {
                $class = "row2";
            } else {
                $class = "row1";
            }
            $objTpl->setVariable(array('VOTING_OLDER_TEXT' => '<a href="index.php?section=Voting&vid=' . $votingid . '" title="' . $votingTitle . '">' . $votingTitle . '</a>', 'VOTING_OLDER_DATE' => showFormattedDate($votingDate), 'VOTING_VOTING_ID' => $votingid, 'VOTING_LIST_CLASS' => $class, 'VOTING_PAGING' => $paging));
            $objTpl->parse("votingRow");
            $i++;
            $objResult->MoveNext();
        }
    } else {
        if (!$objResult->EOF) {
            $votingId = $objResult->fields['id'];
            $votingTitle = stripslashes($objResult->fields['question']);
            $votingVotes = $objResult->fields['votes'];
            $votingDate = strtotime($objResult->fields['datesec']);
            $votingStatus = $objResult->fields['status'];
            $votingMethod = $objResult->fields['submit_check'];
            $additional_fields = _create_additional_input_fields($objResult);
            $objResult->MoveNext();
        } else {
            errorHandling();
            return false;
        }
        $images = 1;
        $query = "SELECT id, question, votes FROM " . DBPREFIX . "voting_results WHERE voting_system_id='{$votingId}' ORDER BY id";
        $objResult = $objDatabase->Execute($query);
        while (!$objResult->EOF) {
            if ($votingStatus == 1 && ($votingMethod == 'email' && !$voted || $votingMethod == 'cookie' && $_COOKIE['votingcookie'] != '1')) {
                $votingOptionText .= "<div><input type='radio' id='votingoption_" . $objResult->fields['id'] . "' name='votingoption' value='" . $objResult->fields['id'] . "' " . ($_POST["votingoption"] == $objResult->fields['id'] ? 'checked="checked"' : '') . " /> ";
                $votingOptionText .= "<label for='votingoption_" . $objResult->fields['id'] . "'>" . stripslashes($objResult->fields['question']) . "</label></div>";
            }
            $objResult->MoveNext();
        }
        $votingResultText = _vote_result_html($votingId);
        if ($votingStatus == 1 && ($votingMethod == 'email' && !$voted || $votingMethod == 'cookie' && $_COOKIE['votingcookie'] != '1')) {
            $votingVotes = '';
            if ($votingMethod == 'email') {
                $objTpl->setVariable('VOTING_EMAIL', !empty($_POST['votingemail']) ? htmlentities($_POST['votingemail'], ENT_QUOTES) : '');
                $objTpl->parse('voting_email_input');
            } else {
                if ($objTpl->blockExists('voting_email_input')) {
                    $objTpl->hideBlock('voting_email_input');
                }
            }
            $submitbutton = '<input type="submit" value="' . $_ARRAYLANG['TXT_SUBMIT'] . '" name="Submit" />';
        } else {
            if ($objTpl->blockExists('voting_email_input')) {
                $objTpl->hideBlock('voting_email_input');
            }
            if ($objTpl->blockExists('additional_fields')) {
                $objTpl->hideBlock('additional_fields');
            }
            $votingVotes = $_ARRAYLANG['TXT_VOTING_TOTAL'] . ":\t" . $votingVotes;
            $submitbutton = '';
        }
        if (sizeof($additional_fields)) {
            $objTpl->parse('additional_fields');
            foreach ($additional_fields as $field) {
                list($name, $label, $tag) = $field;
                $objTpl->setVariable(array('VOTING_ADDITIONAL_INPUT_LABEL' => $label, 'VOTING_ADDITIONAL_INPUT' => $tag, 'VOTING_ADDITIONAL_NAME' => $name));
                $objTpl->parse('additional_elements');
            }
        } else {
            $objTpl->hideBlock('additional_fields');
        }
        $objTpl->setVariable(array('VOTING_MSG' => $msg, 'VOTING_TITLE' => $votingTitle, 'VOTING_DATE' => showFormattedDate($votingDate), 'VOTING_OPTIONS_TEXT' => $votingOptionText, 'VOTING_RESULTS_TEXT' => $votingResultText, 'VOTING_RESULTS_TOTAL_VOTES' => $votingVotes, 'VOTING_OLDER_TITLE' => $_ARRAYLANG['TXT_VOTING_OLDER'], 'TXT_DATE' => $_ARRAYLANG['TXT_DATE'], 'TXT_TITLE' => $_ARRAYLANG['TXT_TITLE'], 'TXT_VOTES' => $_ARRAYLANG['TXT_VOTES'], 'TXT_SUBMIT' => $submitbutton));
        // show other Poll entries
        /** start paging **/
        $query = "SELECT id, date as datesec, title, votes FROM " . DBPREFIX . "voting_system WHERE id<>{$votingId} order by id desc";
        $objResult = $objDatabase->SelectLimit($query, 5);
        $count = $objResult->RecordCount();
        $pos = intval($_GET[pos]);
        if ($count > intval($_CONFIG['corePagingLimit'])) {
            $paging = getPaging($count, $pos, "&section=Voting", "<b>" . $_ARRAYLANG['TXT_VOTING_ENTRIES'] . "</b>", true);
        }
        /** end paging **/
        $query = "SELECT id, date as datesec, title, votes FROM " . DBPREFIX . "voting_system WHERE id<>{$votingId} order by id desc ";
        $objResult = $objDatabase->SelectLimit($query, $_CONFIG['corePagingLimit'], $pos);
        $objTpl->setVariable(array('VOTING_OLDER_TEXT' => '', 'VOTING_OLDER_DATE' => '', 'VOTING_VOTING_ID' => '', 'VOTING_PAGING' => '', 'TXT_DATE' => '', 'TXT_TITLE' => ''));
        while (!$objResult->EOF) {
            $votingid = $objResult->fields['id'];
            $votingTitle = stripslashes($objResult->fields['title']);
            $votingVotes = $objResult->fields['votes'];
            $votingDate = strtotime($objResult->fields['datesec']);
            if ($i % 2 == 0) {
                $class = "row2";
            } else {
                $class = "row1";
            }
            $objTpl->setVariable(array('VOTING_OLDER_TEXT' => '<a href="index.php?section=Voting&vid=' . $votingid . '" title="' . $votingTitle . '">' . $votingTitle . '</a>', 'VOTING_OLDER_DATE' => showFormattedDate($votingDate), 'VOTING_VOTING_ID' => $votingid, 'VOTING_LIST_CLASS' => $class, 'VOTING_PAGING' => $paging));
            $objTpl->parse("votingRow");
            $i++;
            $objResult->MoveNext();
        }
    }
    return $objTpl->get();
}
Пример #3
0
 function votingCode()
 {
     global $objDatabase, $_ARRAYLANG;
     $this->_objTpl->loadTemplateFile('voting_code.html');
     $query = "SELECT id,\n                        status,\n                        date as datesec,\n                        question,\n                        votes\n                   FROM " . DBPREFIX . "voting_system\n                  WHERE id=" . intval($_GET['votingid']);
     $objResult = $objDatabase->Execute($query);
     if (!$objResult->EOF) {
         $votingId = $objResult->fields['id'];
         $votingTitle = stripslashes($objResult->fields['question']);
         // TODO: Never used
         //            $votingVotes=$objResult->fields['votes'];
         $votingDate = strtotime($objResult->fields['datesec']);
         // TODO: Never used
         //            $votingStatus=$objResult->fields['status'];
     } else {
         $this->errorHandling();
         return false;
     }
     $query = "SELECT id, question, votes FROM " . DBPREFIX . "voting_results WHERE voting_system_id='{$votingId}' ORDER BY id";
     $objResult = $objDatabase->Execute($query);
     while (!$objResult->EOF) {
         $votingResultText .= '<input type="radio" name="votingoption" value="' . $objResult->fields['id'] . '" />';
         $votingResultText .= $objResult->fields['question'] . "<br />\n";
         $objResult->MoveNext();
     }
     $submitbutton = '<input type="submit" value="' . $_ARRAYLANG['TXT_SUBMIT'] . '" name="Submit" />';
     $this->_objTpl->setVariable(array('VOTING_TITLE' => htmlentities($votingTitle, ENT_QUOTES, CONTREXX_CHARSET) . " - " . showFormattedDate($votingDate), 'VOTING_CODE' => $_ARRAYLANG['TXT_VOTING_CODE'], 'VOTING_RESULTS_TEXT' => htmlentities($votingResultText, ENT_QUOTES, CONTREXX_CHARSET), 'TXT_SUBMIT' => htmlentities($submitbutton, ENT_QUOTES, CONTREXX_CHARSET), 'TXT_SELECT_ALL' => $_ARRAYLANG['TXT_SELECT_ALL']));
     return true;
 }