Example #1
0
                define('FORUM_PAGE_TYPE', 'menu-page');
            } else {
                define('FORUM_PAGE_TYPE', 'basic-page');
            }
        }
    }
}
$gen_elements['<!-- forum_page -->'] = 'id="brd-' . FORUM_PAGE . '" class="brd-page ' . FORUM_PAGE_TYPE . '"';
// Skip link
$gen_elements['<!-- forum_skip -->'] = '<p id="brd-access"><a href="#brd-main">' . $lang_common['Skip to content'] . '</a></p>';
// Forum Title
$gen_elements['<!-- forum_title -->'] = '<p id="brd-title"><a href="' . forum_link($forum_url['index']) . '">' . forum_htmlencode($forum_config['o_board_title']) . '</a></p>';
// Forum Description
$gen_elements['<!-- forum_desc -->'] = $forum_config['o_board_desc'] != '' ? '<p id="brd-desc">' . forum_htmlencode($forum_config['o_board_desc']) . '</p>' : '';
// Main Navigation
$gen_elements['<!-- forum_navlinks -->'] = '<ul>' . "\n\t\t" . generate_navlinks() . "\n\t" . '</ul>';
// Announcement
$gen_elements['<!-- forum_announcement -->'] = $forum_config['o_announcement'] == '1' && $forum_user['g_read_board'] == '1' ? '<div id="brd-announcement" class="gen-content">' . ($forum_config['o_announcement_heading'] != '' ? "\n\t" . '<h1 class="hn"><span>' . $forum_config['o_announcement_heading'] . '</span></h1>' : '') . "\n\t" . '<div class="content">' . $forum_config['o_announcement_message'] . '</div>' . "\n" . '</div>' . "\n" : '';
// Flash messages
$gen_elements['<!-- forum_messages -->'] = '<div id="brd-messages" class="brd">' . $forum_flash->show(true) . '</div>' . "\n";
// Maintenance Warning
$gen_elements['<!-- forum_maint -->'] = $forum_user['g_id'] == FORUM_ADMIN && $forum_config['o_maintenance'] == '1' ? '<p id="maint-alert" class="warn">' . sprintf($lang_common['Maintenance warning'], '<a href="' . forum_link($forum_url['admin_settings_maintenance']) . '">' . $lang_common['Maintenance mode'] . '</a>') . '</p>' : '';
($hook = get_hook('hd_gen_elements')) ? eval($hook) : null;
$tpl_main = str_replace(array_keys($gen_elements), array_values($gen_elements), $tpl_main);
unset($gen_elements);
// END SUBST OF COMMON ELEMENTS
// START SUBST VISIT ELEMENTS
$visit_elements = array();
if ($forum_user['is_guest']) {
    $visit_elements['<!-- forum_welcome -->'] = '<p id="welcome"><span>' . $lang_common['Not logged in'] . '</span> <span>' . $lang_common['Login nag'] . '</span></p>';
} else {
Example #2
0
if (isset($focus_element)) {
    $tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\'' . $focus_element[0] . '\').' . $focus_element[1] . '.focus();', $tpl_main);
    $tpl_main = str_replace('<body>', '<body onload="document.getElementById(\'' . $focus_element[0] . '\').' . $focus_element[1] . '.focus()">', $tpl_main);
}
// END SUBST - <body>
// START SUBST - <pun_page>
$tpl_main = str_replace('<pun_page>', htmlspecialchars(basename($_SERVER['PHP_SELF'], '.php')), $tpl_main);
// END SUBST - <pun_title>
// START SUBST - <pun_title>
$tpl_main = str_replace('<pun_title>', '<h1><span>' . pun_htmlspecialchars($pun_config['o_board_title']) . '</span></h1>', $tpl_main);
// END SUBST - <pun_title>
// START SUBST - <pun_desc>
$tpl_main = str_replace('<pun_desc>', '<p><span>' . $pun_config['o_board_desc'] . '</span></p>', $tpl_main);
// END SUBST - <pun_desc>
// START SUBST - <pun_navlinks>
$tpl_main = str_replace('<pun_navlinks>', '<div id="brdmenu" class="inbox">' . "\n\t\t\t" . generate_navlinks() . "\n\t\t" . '</div>', $tpl_main);
// END SUBST - <pun_navlinks>
// START SUBST - <pun_status>
if ($pun_user['is_guest']) {
    $tpl_temp = '<div id="brdwelcome" class="inbox">' . "\n\t\t\t" . '<p>' . $lang_common['Not logged in'] . '</p>' . "\n\t\t" . '</div>';
} else {
    $tpl_temp = '<div id="brdwelcome" class="inbox">' . "\n\t\t\t" . '<ul class="conl">' . "\n\t\t\t\t" . '<li>' . $lang_common['Logged in as'] . ' <strong>' . pun_htmlspecialchars($pun_user['username']) . '</strong></li>' . "\n\t\t\t\t" . '<li>' . $lang_common['Last visit'] . ': ' . format_time($pun_user['last_visit']) . '</li>';
    if ($pun_user['g_id'] < PUN_GUEST) {
        $result_header = $db->query('SELECT COUNT(id) FROM ' . $db->prefix . 'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());
        if ($db->result($result_header)) {
            $tpl_temp .= "\n\t\t\t\t" . '<li class="reportlink"><strong><a href="admin_reports.php">There are new reports</a></strong></li>';
        }
        if ($pun_config['o_maintenance'] == '1') {
            $tpl_temp .= "\n\t\t\t\t" . '<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>';
        }
    }