1<?php
2/**
3 *  Xoops footer
4 *
5 * You may not change or alter any portion of this comment or credits
6 * of supporting developers from this source code or any supporting source code
7 * which is considered copyrighted (c) material of the original comment or credit authors.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
13 * @license             GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
14 * @package             kernel
15 * @since               2.0.0
16 */
17
18defined('XOOPS_ROOT_PATH') || exit('Restricted access');
19
20$xoopsPreload = XoopsPreload::getInstance();
21$xoopsPreload->triggerEvent('core.footer.start');
22
23if (!defined('XOOPS_FOOTER_INCLUDED')) {
24    define('XOOPS_FOOTER_INCLUDED', 1);
25
26    $xoopsLogger = XoopsLogger::getInstance();
27    $xoopsLogger->stopTime('Module display');
28
29    if ($xoopsOption['theme_use_smarty'] == 0) {
30        // the old way
31        $footer = htmlspecialchars($xoopsConfigMetaFooter['footer']) . '<br><div class="txtcenter small">Powered by XOOPS &copy; <a href="http://xoops.org" rel="external" title="The XOOPS Project">The XOOPS Project</a></div>';
32        if (isset($GLOBALS['xoopsOption']['template_main'])) {
33            $xoopsTpl->caching = 0;
34            $xoopsTpl->display('db:' . $GLOBALS['xoopsOption']['template_main']);
35        }
36        if (!isset($xoopsOption['show_rblock'])) {
37            $xoopsOption['show_rblock'] = 0;
38        }
39        themefooter($xoopsOption['show_rblock'], $footer);
40        xoops_footer();
41    } else {
42        // RMV-NOTIFY
43        include_once $GLOBALS['xoops']->path('include/notification_select.php');
44        if (!headers_sent()) {
45            header('Content-Type:text/html; charset=' . _CHARSET);
46            header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
47            //header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
48            header('Cache-Control: private, no-cache');
49            header('Pragma: no-cache');
50        }
51
52        //@internal: using global $xoTheme dereferences the variable in old versions, this does not
53        if (!isset($xoTheme)) {
54            $xoTheme = $GLOBALS['xoTheme'];
55        }
56
57        if (isset($GLOBALS['xoopsOption']['template_main']) && $GLOBALS['xoopsOption']['template_main'] != $xoTheme->contentTemplate) {
58            trigger_error("xoopsOption['template_main'] should be defined before including header.php", E_USER_WARNING);
59            if (false === strpos($GLOBALS['xoopsOption']['template_main'], ':')) {
60                $xoTheme->contentTemplate = 'db:' . $GLOBALS['xoopsOption']['template_main'];
61            } else {
62                $xoTheme->contentTemplate = $GLOBALS['xoopsOption']['template_main'];
63            }
64        }
65
66        $xoTheme->render();
67    }
68    $xoopsLogger->stopTime();
69}
70
71$xoopsPreload->triggerEvent('core.footer.end');
72