Example #1
0
        }
    }
} else {
    // no stories to display
    if ($page == 1) {
        if (!isset($_CONF['hide_no_news_msg']) || $_CONF['hide_no_news_msg'] == 0) {
            $display .= COM_startBlock($LANG05[1], '', COM_getBlockTemplate('_msg_block', 'header')) . $LANG05[2];
            $display .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
        }
        $display .= PLG_showCenterblock(3, $page, $topic);
        // bottom blocks
    } else {
        $topic_url = '';
        if (!empty($topic)) {
            $topic_url = COM_buildURL($_CONF['site_url'] . '/index.php?topic=' . $topic);
        }
        COM_handle404($topic_url);
    }
}
$header = '';
if ($topic) {
    // Meta Tags
    if ($_CONF['meta_tags'] > 0) {
        $result = DB_query("SELECT meta_description, meta_keywords FROM {$_TABLES['topics']} WHERE tid = '{$topic}'");
        $A = DB_fetcharray($result);
        $header .= LB . PLG_getMetaTags('homepage', '', array(array('name' => 'description', 'content' => stripslashes($A['meta_description'])), array('name' => 'keywords', 'content' => stripslashes($A['meta_keywords']))));
    }
}
$display = COM_createHTMLDocument($display, array('breadcrumbs' => $breadcrumbs, 'headercode' => $header, 'rightblock' => true));
// Output page
COM_output($display);
Example #2
0
 if (isset($_POST['aid']) && count($_POST['aid']) == $nquestions && !isset($_COOKIE['poll-' . $pid])) {
     setcookie('poll-' . $pid, implode('-', $aid), time() + $_PO_CONF['pollcookietime'], $_CONF['cookie_path'], $_CONF['cookiedomain'], $_CONF['cookiesecure']);
     $display .= POLLS_pollsave($pid, $aid);
     $display = COM_createHTMLDocument($display);
 } elseif (!empty($pid)) {
     $result = DB_query("SELECT topic, meta_description, meta_keywords FROM {$_TABLES['polltopics']} WHERE pid = '{$pid}'" . COM_getPermSQL('AND'));
     $A = DB_fetchArray($result);
     $polltopic = $A['topic'];
     if (empty($polltopic)) {
         // 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);
Example #3
0
     $story_template->set_var('printable_url', $printable);
     COM_setLangIdAndAttribute($story_template);
     $story_template->parse('output', 'article');
     $display = $story_template->finish($story_template->get_var('output'));
 } else {
     // Set page title
     $pagetitle = $story->DisplayElements('page_title');
     if (empty($pagetitle)) {
         $pagetitle = $story->DisplayElements('title');
     }
     $headercode = '';
     $permalink = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $story->getSid());
     $headercode .= '<link rel="canonical" href="' . $permalink . '"' . XHTML . '>';
     // Meta Tags
     if ($_CONF['meta_tags'] > 0) {
         $headercode .= LB . PLG_getMetaTags('article', $story->getSid(), array(array('name' => 'description', 'content' => $story->DisplayElements('meta_description')), array('name' => 'keywords', 'content' => $story->DisplayElements('meta_keywords'))));
     }
     if ($story->DisplayElements('trackbackcode') == 0) {
         if ($_CONF['trackback_enabled']) {
             $trackbackurl = TRB_makeTrackbackUrl($story->getSid());
             $headercode .= LB . '<!--' . LB . TRB_trackbackRdf($permalink, $pagetitle, $trackbackurl) . LB . '-->' . LB;
         }
         if ($_CONF['pingback_enabled']) {
             header('X-Pingback: ' . $_CONF['site_url'] . '/pingback.php');
         }
     }
     if (isset($_GET['msg'])) {
         $msg = COM_applyFilter($_GET['msg'], true);
         if ($msg > 0) {
             $plugin = '';
             if (isset($_GET['plugin'])) {