root/ip/trunk/includes/functions.php
| 161 | 169 | ||
|---|---|---|---|
4114 | } | 4114 | } |
4115 | } | 4115 | } |
4116 | 4116 | ||
4117 | if (($userdata['user_level'] != ADMIN) && $config['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN')) | 4117 | if (($userdata['user_level'] != ADMIN) && $config['board_disable'] && !defined('HAS_DIED') && !defined('IN_ADMIN') && !defined('IN_LOGIN')) |
4118 | { | 4118 | { |
4119 | if($config['board_disable_mess_st']) | 4119 | if($config['board_disable_mess_st']) |
4120 | { | 4120 | { |
... | ... | ||
4143 | $template->pparse('overall_header'); | 4143 | $template->pparse('overall_header'); |
4144 | } | 4144 | } |
4145 | 4145 | ||
4146 | define('HEADER_INC_COMPLETED', true); | ||
4147 | |||
4146 | return; | 4148 | return; |
4147 | } | 4149 | } |
4148 | 4150 | ||
... | ... | ||
4799 | } | 4801 | } |
4800 | } | 4802 | } |
4801 | 4803 | ||
4804 | if (!defined('IN_ADMIN') && !defined('IN_CMS') && !defined('HEADER_INC_COMPLETED') && ($msg_code != CRITICAL_ERROR)) | ||
4805 | { | ||
4806 | if (!defined('TPL_HAS_DIED')) | ||
4807 | { | ||
4808 | $template->assign_var('HAS_DIED', true); | ||
4809 | define('TPL_HAS_DIED', true); | ||
4810 | } | ||
4811 | $header_tpl = empty($gen_simple_header) ? 'overall_header.tpl' : 'simple_header.tpl'; | ||
4812 | $template->set_filenames(array('overall_header' => $header_tpl)); | ||
4813 | $template->pparse('overall_header'); | ||
4814 | } | ||
4815 | |||
4802 | switch($msg_code) | 4816 | switch($msg_code) |
4803 | { | 4817 | { |
4804 | case GENERAL_MESSAGE: | 4818 | case GENERAL_MESSAGE: |
... | ... | ||
4891 | 4905 | ||
4892 | if ($msg_code != CRITICAL_ERROR) | 4906 | if ($msg_code != CRITICAL_ERROR) |
4893 | { | 4907 | { |
4894 | // If we have already defined the var in header, let's output it in footer as well | ||
4895 | if(defined('TPL_HAS_DIED')) | ||
4896 | { | ||
4897 | $template->assign_var('HAS_DIED', true); | ||
4898 | } | ||
4899 | |||
4900 | if (!empty($lang[$msg_text])) | 4908 | if (!empty($lang[$msg_text])) |
4901 | { | 4909 | { |
4902 | $msg_text = $lang[$msg_text]; | 4910 | $msg_text = $lang[$msg_text]; |
... | ... | ||
4917 | 4925 | ||
4918 | //echo('<br />' . htmlspecialchars($template->vars['META'])); | 4926 | //echo('<br />' . htmlspecialchars($template->vars['META'])); |
4919 | $template->assign_vars(array( | 4927 | $template->assign_vars(array( |
4920 | 'HAS_DIED' => true, | ||
4921 | 'MESSAGE_TITLE' => $msg_title, | 4928 | 'MESSAGE_TITLE' => $msg_title, |
4922 | 'MESSAGE_TEXT' => $msg_text | 4929 | 'MESSAGE_TEXT' => $msg_text |
4923 | ) | 4930 | ) |
... | ... | ||
4928 | $template->pparse('message_body'); | 4935 | $template->pparse('message_body'); |
4929 | } | 4936 | } |
4930 | 4937 | ||
4938 | // If we have already defined the var in header, let's output it in footer as well | ||
4939 | if(defined('TPL_HAS_DIED')) | ||
4940 | { | ||
4941 | $template->assign_var('HAS_DIED', true); | ||
4942 | } | ||
4943 | |||
4931 | if (!defined('IN_ADMIN')) | 4944 | if (!defined('IN_ADMIN')) |
4932 | { | 4945 | { |
4933 | $template_to_parse = defined('IN_CMS') ? 'message_body' : ''; | 4946 | $template_to_parse = defined('IN_CMS') ? 'message_body' : ''; |
Download diff