From 28c000fe7c68d84f9cac68e75763e736dabc11b5 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Thu, 7 Aug 2003 01:42:11 +0000 Subject: [PATCH] oops forgot about modified time update git-svn-id: file:///svn/phpbb/trunk@4348 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_styles.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/phpBB/adm/admin_styles.php b/phpBB/adm/admin_styles.php index 647e0504cd..aa2a7d05c1 100644 --- a/phpBB/adm/admin_styles.php +++ b/phpBB/adm/admin_styles.php @@ -1284,6 +1284,20 @@ switch ($mode) adm_page_footer(); } + if ($template_storedb) + { + $sql = 'SELECT template_filename, template_mtime + FROM ' . STYLES_TPLDATA_TABLE . " + WHERE template_id = $template_id"; + $result = $db->sql_query($sql); + + $filemtime = array(); + while ($row = $db->sql_fetchrow($result)) + { + $filemtime[$row['template_filename']] = $row['template_mtime']; + } + $db->sql_freeresult($result); + } // Open the cache directory and grab a list of the relevant cached templates. // We also grab some other details such as when the compiled template was @@ -1301,7 +1315,7 @@ switch ($mode) $filename = preg_replace('#^' . $cache_prefix . '_(.*?)\.html\.' . $phpEx . '$#i', '\1', $file); $tplcache_ary[$filename]['cache'] = filemtime("{$phpbb_root_path}cache/$file"); $tplcache_ary[$filename]['size'] = filesize("{$phpbb_root_path}cache/$file"); - $tplcache_ary[$filename]['src'] = filemtime("{$phpbb_root_path}styles/$template_path/template/$filename.html"); + $tplcache_ary[$filename]['src'] = (!$template_storedb) ? filemtime("{$phpbb_root_path}styles/$template_path/template/$filename.html") : $filemtime[$filename . '.html'] ; } } closedir($dp); @@ -1449,7 +1463,7 @@ function viewsource(url) } $sql = 'UPDATE ' . STYLES_TPLDATA_TABLE . " - SET template_data = '" . $db->sql_escape($tpldata) . "' + SET template_data = '" . $db->sql_escape($tpldata) . "', template_mtime = " . time() . " WHERE template_id = $template_id AND template_filename = '" . $db->sql_escape($tplname) . "'"; $db->sql_query($sql);