aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_template.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-04-06 14:03:20 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-04-06 14:03:20 +0000
commitba536c6270a1cd448e5a4add56686fd3fdc9d711 (patch)
tree936479ce8d398a82986f59cf172ed8563c4aefd1 /phpBB/includes/functions_template.php
parent088c6e1c3eb8cc044c328dd0988da7a9862ef7d5 (diff)
downloadforums-ba536c6270a1cd448e5a4add56686fd3fdc9d711.tar
forums-ba536c6270a1cd448e5a4add56686fd3fdc9d711.tar.gz
forums-ba536c6270a1cd448e5a4add56686fd3fdc9d711.tar.bz2
forums-ba536c6270a1cd448e5a4add56686fd3fdc9d711.tar.xz
forums-ba536c6270a1cd448e5a4add56686fd3fdc9d711.zip
some fixes
git-svn-id: file:///svn/phpbb/trunk@7286 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_template.php')
-rw-r--r--phpBB/includes/functions_template.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php
index 4e5b46c3f7..f37148658b 100644
--- a/phpBB/includes/functions_template.php
+++ b/phpBB/includes/functions_template.php
@@ -54,7 +54,7 @@ class template_compile
* Load template source from file
* @access private
*/
- function _tpl_load_file($handle)
+ function _tpl_load_file($handle, $store_in_db = false)
{
// Try and open template for read
if (!file_exists($this->template->files[$handle]))
@@ -66,6 +66,23 @@ class template_compile
// Actually compile the code now.
$this->compile_write($handle, $this->template->compiled_code[$handle]);
+
+ // Store in database if required...
+ if ($store_in_db)
+ {
+ global $db, $user;
+
+ $sql_ary = array(
+ 'template_id' => $user->theme['template_id'],
+ 'template_filename' => $this->template->filename[$handle],
+ 'template_included' => '',
+ 'template_mtime' => time(),
+ 'template_data' => trim(@file_get_contents($this->template->files[$handle])),
+ );
+
+ $sql = 'INSERT INTO ' . STYLES_TEMPLATE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+ $db->sql_query($sql);
+ }
}
/**