From 51675e7a9bf4d5055ed45b37bac964f788800399 Mon Sep 17 00:00:00 2001 From: Michael Save Date: Fri, 13 Apr 2012 00:18:19 +1000 Subject: code cleanup --- inc/template.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index fc9f167d..8d679d25 100644 --- a/inc/template.php +++ b/inc/template.php @@ -4,7 +4,7 @@ * Copyright (c) 2010-2012 Tinyboard Development Group */ -if(realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) { +if (realpath($_SERVER['SCRIPT_FILENAME']) == str_replace('\\', '/', __FILE__)) { // You cannot request this file directly. exit; } @@ -36,15 +36,15 @@ function load_twig() { function Element($templateFile, array $options) { global $config, $debug, $twig; - if(!$twig) + if (!$twig) load_twig(); - if(function_exists('create_pm_header') && ((isset($options['mod']) && $options['mod']) || isset($options['__mod']))) { + if (function_exists('create_pm_header') && ((isset($options['mod']) && $options['mod']) || isset($options['__mod']))) { $options['pm'] = create_pm_header(); } - if(isset($options['body']) && $config['debug']) { - if(isset($debug['start'])) { + if (isset($options['body']) && $config['debug']) { + if (isset($debug['start'])) { $debug['time'] = '~' . round((microtime(true) - $debug['start']) * 1000, 2) . 'ms'; unset($debug['start']); } @@ -57,10 +57,10 @@ function Element($templateFile, array $options) { } // Read the template file - if(@file_get_contents("{$config['dir']['template']}/${templateFile}")) { + if (@file_get_contents("{$config['dir']['template']}/${templateFile}")) { $body = $twig->render($templateFile, $options); - if($config['minify_html'] && preg_match('/\.html$/', $templateFile)) { + if ($config['minify_html'] && preg_match('/\.html$/', $templateFile)) { $body = trim(preg_replace("/[\t\r\n]/", '', $body)); } -- cgit v1.3