diff -r 000000000000 -r f9ffdbd96607 punbb/header.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/punbb/header.php Wed Jul 11 21:01:48 2007 -0400 @@ -0,0 +1,225 @@ + +while (preg_match('##', $tpl_main, $cur_include)) +{ + if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2])) + error('Unable to process user include '.htmlspecialchars($cur_include[0]).' from template main.tpl. There is no such file in folder /include/user/'); + + ob_start(); + include PUN_ROOT.'include/user/'.$cur_include[1].'.'.$cur_include[2]; + $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_common['lang_direction'], $tpl_main); +// END SUBST - + + +// START SUBST - +$tpl_main = str_replace('', $lang_common['lang_encoding'], $tpl_main); +// END SUBST - + + +// START SUBST - +ob_start(); + +// Is this a page that we want search index spiders to index? +if (!defined('PUN_ALLOW_INDEX')) + echo ''."\n"; + +?> +<?php echo $page_title ?> + +'."\n"; + +if (isset($required_fields)) +{ + // Output JavaScript to validate form (make sure required fields are filled out) + +?> + +'; + +$tpl_temp = trim(ob_get_contents()); +$tpl_main = str_replace('', $tpl_temp, $tpl_main); +ob_end_clean(); +// END SUBST - + + +// START SUBST - +if (isset($focus_element)) +{ + $tpl_main = str_replace('', '', $tpl_main); +} +// END SUBST - + + +// START SUBST - +$tpl_main = str_replace('', htmlspecialchars(basename($_SERVER['PHP_SELF'], '.php')), $tpl_main); +// END SUBST - + + +// START SUBST - +$tpl_main = str_replace('', '

'.pun_htmlspecialchars($pun_config['o_board_title']).'

', $tpl_main); +// END SUBST - + + +// START SUBST - +$tpl_main = str_replace('', '

'.$pun_config['o_board_desc'].'

', $tpl_main); +// END SUBST - + + +// START SUBST - +$tpl_main = str_replace('','
'."\n\t\t\t". generate_navlinks()."\n\t\t".'
', $tpl_main); +// END SUBST - + + +// START SUBST - +if ($pun_user['is_guest']) + $tpl_temp = '
'."\n\t\t\t".'

'.$lang_common['Not logged in'].'

'."\n\t\t".'
'; +else +{ + $tpl_temp = '
'."\n\t\t\t".'
    '."\n\t\t\t\t".'
  • '.$lang_common['Logged in as'].' '.pun_htmlspecialchars($pun_user['username']).'
  • '."\n\t\t\t\t".'
  • '.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'
  • '; + + 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".''; + + if ($pun_config['o_maintenance'] == '1') + $tpl_temp .= "\n\t\t\t\t".''; + } + + if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php'))) + $tpl_temp .= "\n\t\t\t".'
'."\n\t\t\t".''."\n\t\t\t".'
'."\n\t\t".'
'; + else + $tpl_temp .= "\n\t\t\t".''."\n\t\t\t".'
'."\n\t\t".''; +} + +$tpl_main = str_replace('', $tpl_temp, $tpl_main); +// END SUBST - + + +// START SUBST - +if ($pun_config['o_announcement'] == '1') +{ + ob_start(); + +?> +
+

+
+
+
+
+
+
+', $tpl_temp, $tpl_main); + ob_end_clean(); +} +else + $tpl_main = str_replace('', '', $tpl_main); +// END SUBST - + + +// START SUBST - +ob_start(); + + +define('PUN_HEADER', 1);