mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
some fixes
git-svn-id: file:///svn/phpbb/trunk@7286 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user