while (preg_match('##', $tpl_main, $cur_include))
{
if (!file_exists(FORUM_ROOT.'include/user/'.$cur_include[1]))
error('Unable to process user include <!-- forum_include "'.forum_htmlencode($cur_include[1]).'" --> from template main.tpl. There is no such file in folder /include/user/', __FILE__, __LINE__);
ob_start();
include FORUM_ROOT.'include/user/'.$cur_include[1];
$tpl_temp = ob_get_contents();
$tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
ob_end_clean();
}
// END SUBST -
// START SUBST -
$tpl_main = str_replace('', 'lang="'.$lang_common['lang_identifier'].'" dir="'.$lang_common['lang_direction'].'"', $tpl_main);
// END SUBST -
// START SUBST -
// Is this a page that we want search index spiders to index?
if (!defined('FORUM_ALLOW_INDEX'))
$forum_head['robots'] = '';
else
$forum_head['descriptions'] = '';
// Should we output a MicroID? http://microid.org/
if (strpos(FORUM_PAGE, 'profile') === 0)
$forum_head['microid'] = '';
$forum_head['title'] = ''.generate_crumbs(true).'';
// Should we output feed links?
if (FORUM_PAGE == 'index')
{
$forum_head['rss'] = '';
$forum_head['atom'] = '';
}
else if (FORUM_PAGE == 'viewforum')
{
$forum_head['rss'] = '';
$forum_head['atom'] = '';
}
else if (FORUM_PAGE == 'viewtopic')
{
$forum_head['rss'] = '';
$forum_head['atom'] = '';
}
// If there are other page navigation links (first, next, prev and last)
if (!empty($forum_page['nav']))
$forum_head['nav'] = implode("\n", $forum_page['nav']);
$forum_head['search'] = '';
$forum_head['author'] = '';
ob_start();
// Include stylesheets
require FORUM_ROOT.'style/'.$forum_user['style'].'/'.$forum_user['style'].'.php';
$head_temp = forum_trim(ob_get_contents());
$num_temp = 0;
foreach (explode("\n", $head_temp) as $style_temp)
$forum_head['style'.$num_temp++] = $style_temp;
ob_end_clean();
($hook = get_hook('hd_head')) ? eval($hook) : null;
// Render CSS from forum_loader
$tmp_head = implode("\n", $forum_head).$forum_loader->render_css();
$tpl_main = str_replace('', $tmp_head, $tpl_main);
unset($forum_head, $tmp_head);
// END SUBST -
// START SUBST OF COMMON ELEMENTS
// Setup array of general elements
$gen_elements = array();
// Forum page id and classes
if (!defined('FORUM_PAGE_TYPE'))
{
if (substr(FORUM_PAGE, 0, 5) == 'admin')
define('FORUM_PAGE_TYPE', 'admin-page');
else
{
if (!empty($forum_page['page_post']))
define('FORUM_PAGE_TYPE', 'paged-page');
else if (!empty($forum_page['main_menu']))
define('FORUM_PAGE_TYPE', 'menu-page');
else
define('FORUM_PAGE_TYPE', 'basic-page');
}
$gen_elements[''] = 'id="brd-'.FORUM_PAGE.'" class="brd-page '.FORUM_PAGE_TYPE.'"';
// Skip link
$gen_elements[''] = '
' : '';
$tpl_main = str_replace(array_keys($visit_elements), array_values($visit_elements), $tpl_main);
unset($visit_elements);
// END SUBST VISIT ELEMENTS
// START SUBST -
$admod_links = array();
// We only need to run this query for mods/admins if there will actually be reports to look at
if ($forum_user['is_admmod'] && $forum_config['o_report_method'] != 1)
{
$query = array(
'SELECT' => 'COUNT(r.id)',
'FROM' => 'reports AS r',
'WHERE' => 'r.zapped IS NULL',
);
($hook = get_hook('hd_qr_get_unread_reports_count')) ? eval($hook) : null;
$result_header = $forum_db->query_build($query) or error(__FILE__, __LINE__);
if ($forum_db->result($result_header))
$admod_links['reports'] = ''.$lang_common['New reports'].'';
}
if ($forum_user['g_id'] == FORUM_ADMIN)
{
$alert_items = array();
// Warn the admin that maintenance mode is enabled
if ($forum_config['o_maintenance'] == '1')
$alert_items['maintenance'] = '
'.$lang_common['Maintenance alert'].'
';
if ($forum_config['o_check_for_updates'] == '1')
{
if ($forum_updates['fail'])
$alert_items['update_fail'] = '
';
else if (isset($forum_updates['version']) && isset($forum_updates['hotfix']))
$alert_items['update_version_hotfix'] = '
'.$lang_common['Updates'].' '.sprintf($lang_common['Updates version n hf'], $forum_updates['version'], forum_link($forum_url['admin_extensions_hotfixes'])).'
';
else if (isset($forum_updates['version']))
$alert_items['update_version'] = '
';
}
// Warn the admin that their version of the database is newer than the version supported by the code
// NOTE: Why is it done on any page, but shown in admin section only.
if ($forum_config['o_database_revision'] > FORUM_DB_REVISION)
$alert_items['newer_database'] = '