aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Smith <toonarmy@phpbb.com>2008-09-04 11:39:25 +0000
committerChris Smith <toonarmy@phpbb.com>2011-09-20 21:06:51 +0100
commit9e4349e7faac65403de02fd090a837fee92b764a (patch)
tree7727f53d3d756508e0baf78c5c3713355b52525b
parent57451a2014bba889ea8fe3c8053c6442948cc728 (diff)
downloadforums-9e4349e7faac65403de02fd090a837fee92b764a.tar
forums-9e4349e7faac65403de02fd090a837fee92b764a.tar.gz
forums-9e4349e7faac65403de02fd090a837fee92b764a.tar.bz2
forums-9e4349e7faac65403de02fd090a837fee92b764a.tar.xz
forums-9e4349e7faac65403de02fd090a837fee92b764a.zip
[feature/remove-db-styles] Removed database storage of style components.
The bulk of database storage of templates is removed, rendering template stored in the database as useless. Theme database storage is reduced to a skeleton for full removal soon. This commit was cherry picked from the old feature/ascraeus-experiment branch the old commit hash is 0dbe7e3b6cd450342d3c566eb2caf36ca1b5db8e. PHPBB3-9741
-rw-r--r--phpBB/adm/index.php3
-rw-r--r--phpBB/adm/style/acp_styles.html7
-rw-r--r--phpBB/includes/acp/acp_styles.php376
-rw-r--r--phpBB/includes/constants.php1
-rw-r--r--phpBB/includes/session.php4
-rw-r--r--phpBB/install/index.php3
-rw-r--r--phpBB/install/install_update.php3
-rw-r--r--phpBB/install/schemas/schema_data.sql2
-rw-r--r--phpBB/language/en/acp/styles.php4
9 files changed, 30 insertions, 373 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index 2444a1b597..4f4d9ccedd 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -56,9 +56,6 @@ $template->set_custom_template($phpbb_admin_path . 'style', 'admin');
$template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets');
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
-// the acp template is never stored in the database
-$user->theme['template_storedb'] = false;
-
// Instantiate new module
$module = new p_master();
diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html
index d503f323e0..4076cf1ba6 100644
--- a/phpBB/adm/style/acp_styles.html
+++ b/phpBB/adm/style/acp_styles.html
@@ -362,13 +362,6 @@
<dd><!-- IF S_INSTALL --><strong id="theme_id">{THEME_NAME}</strong><!-- ELSE --><select id="theme_id" name="theme_id">{S_THEME_OPTIONS}</select><!-- ENDIF --></dd>
</dl>
<!-- ENDIF -->
- <!-- IF (S_TEMPLATE or S_THEME) and (S_LOCATION or not S_INSTALL) -->
- <dl>
- <dt><label for="store_db">{L_LOCATION}:</label><br /><span><!-- IF S_STORE_DB_DISABLED -->{L_LOCATION_DISABLED_EXPLAIN}<!-- ELSE -->{L_LOCATION_EXPLAIN}<!-- ENDIF --></span></dt>
- <dd><label><input type="radio" class="radio" name="store_db" value="0"<!-- IF not S_STORE_DB --> id="store_db" checked="checked"<!-- ENDIF --> <!-- IF S_STORE_DB_DISABLED -->disabled="disabled" <!-- ENDIF --> /> {L_STORE_FILESYSTEM}</label>
- <label><input type="radio" class="radio" name="store_db" value="1"<!-- IF S_STORE_DB --> id="store_db" checked="checked"<!-- ENDIF --> <!-- IF S_STORE_DB_DISABLED -->disabled="disabled" <!-- ENDIF -->/> {L_STORE_DATABASE}</label></dd>
- </dl>
- <!-- ENDIF -->
<!-- IF S_STYLE -->
</fieldset>
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 82878cfadb..8bd75c6ab9 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -207,7 +207,7 @@ version = {VERSION}
switch ($action)
{
- // Refresh template data stored in db and clear cache
+ // Clear cache
case 'refresh':
$sql = 'SELECT *
@@ -224,49 +224,13 @@ version = {VERSION}
if (confirm_box(true))
{
- $template_refreshed = '';
-
- // Only refresh database if the template is stored in the database
- if ($template_row['template_storedb'] && file_exists("{$phpbb_root_path}styles/{$template_row['template_path']}/template/"))
- {
- $filelist = array('' => array());
-
- $sql = 'SELECT template_filename, template_mtime
- FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = $style_id";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
-// if (@filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/" . $row['template_filename']) > $row['template_mtime'])
-// {
- // get folder info from the filename
- if (($slash_pos = strrpos($row['template_filename'], '/')) === false)
- {
- $filelist[''][] = $row['template_filename'];
- }
- else
- {
- $filelist[substr($row['template_filename'], 0, $slash_pos + 1)][] = substr($row['template_filename'], $slash_pos + 1, strlen($row['template_filename']) - $slash_pos - 1);
- }
-// }
- }
- $db->sql_freeresult($result);
-
- $this->store_templates('update', $style_id, $template_row['template_path'], $filelist);
- unset($filelist);
-
- $template_refreshed = $user->lang['TEMPLATE_REFRESHED'] . '<br />';
- add_log('admin', 'LOG_TEMPLATE_REFRESHED', $template_row['template_name']);
- }
-
$this->clear_template_cache($template_row);
- trigger_error($template_refreshed . $user->lang['TEMPLATE_CACHE_CLEARED'] . adm_back_link($this->u_action));
+ trigger_error($user->lang['TEMPLATE_CACHE_CLEARED'] . adm_back_link($this->u_action));
}
else
{
- confirm_box(false, ($template_row['template_storedb']) ? $user->lang['CONFIRM_TEMPLATE_REFRESH'] : $user->lang['CONFIRM_TEMPLATE_CLEAR_CACHE'], build_hidden_fields(array(
+ confirm_box(false, $user->lang['CONFIRM_TEMPLATE_CLEAR_CACHE'], build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'action' => $action,
@@ -526,7 +490,7 @@ version = {VERSION}
$template_file = preg_replace('#\.{2,}#', '.', $template_file);
// Retrieve some information about the template
- $sql = 'SELECT template_storedb, template_path, template_name
+ $sql = 'SELECT template_path, template_name
FROM ' . STYLES_TEMPLATE_TABLE . "
WHERE template_id = $template_id";
$result = $db->sql_query($sql);
@@ -554,8 +518,8 @@ version = {VERSION}
$file = "{$phpbb_root_path}styles/{$template_info['template_path']}/template/$template_file";
$additional = '';
- // If the template is stored on the filesystem try to write the file else store it in the database
- if (!$safe_mode && !$template_info['template_storedb'] && file_exists($file) && phpbb_is_writable($file))
+ // Try to write the file
+ if (!$safe_mode && file_exists($file) && phpbb_is_writable($file))
{
if (!($fp = @fopen($file, 'wb')))
{
@@ -567,32 +531,8 @@ version = {VERSION}
}
else
{
- $db->sql_transaction('begin');
-
- // If it's not stored in the db yet, then update the template setting and store all template files in the db
- if (!$template_info['template_storedb'])
- {
- if ($super = $this->get_super('template', $template_id))
- {
- $this->store_in_db('template', $super['template_id']);
- }
- else
- {
- $this->store_in_db('template', $template_id);
- }
-
- add_log('admin', 'LOG_TEMPLATE_EDIT_DETAILS', $template_info['template_name']);
- $additional .= '<br />' . $user->lang['EDIT_TEMPLATE_STORED_DB'];
- }
-
- // Update the template_data table entry for this template file
- $sql = 'UPDATE ' . STYLES_TEMPLATE_DATA_TABLE . "
- SET template_data = '" . $db->sql_escape($template_data) . "', template_mtime = " . time() . "
- WHERE template_id = $template_id
- AND template_filename = '" . $db->sql_escape($template_file) . "'";
- $db->sql_query($sql);
-
- $db->sql_transaction('commit');
+ // @todo
+ trigger_error('Cannot write template file.', E_USER_ERROR);
}
// destroy the cached version of the template (filename without extension)
@@ -605,52 +545,17 @@ version = {VERSION}
}
// Generate a category array containing template filenames
- if (!$template_info['template_storedb'])
- {
- $template_path = "{$phpbb_root_path}styles/{$template_info['template_path']}/template";
+ $template_path = "{$phpbb_root_path}styles/{$template_info['template_path']}/template";
- $filelist = filelist($template_path, '', 'html');
- $filelist[''] = array_diff($filelist[''], array('bbcode.html'));
+ $filelist = filelist($template_path, '', 'html');
+ $filelist[''] = array_diff($filelist[''], array('bbcode.html'));
- if ($template_file)
- {
- if (!file_exists($template_path . "/$template_file") || !($template_data = file_get_contents($template_path . "/$template_file")))
- {
- trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
- }
- }
- else
+ if ($template_file)
{
- $sql = 'SELECT *
- FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = $template_id";
- $result = $db->sql_query($sql);
-
- $filelist = array('' => array());
- while ($row = $db->sql_fetchrow($result))
+ if (!file_exists($template_path . "/$template_file") || !($template_data = file_get_contents($template_path . "/$template_file")))
{
- $file_info = pathinfo($row['template_filename']);
-
- if (($file_info['basename'] != 'bbcode') && ($file_info['extension'] == 'html'))
- {
- if (($file_info['dirname'] == '.') || empty($file_info['dirname']))
- {
- $filelist[''][] = $row['template_filename'];
- }
- else
- {
- $filelist[$file_info['dirname'] . '/'][] = $file_info['basename'];
- }
- }
-
- if ($row['template_filename'] == $template_file)
- {
- $template_data = $row['template_data'];
- }
+ trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $db->sql_freeresult($result);
- unset($file_info);
}
if (empty($filelist['']))
@@ -821,35 +726,6 @@ version = {VERSION}
adm_page_footer();
}
- $filemtime = array();
- if ($template_row['template_storedb'])
- {
- $ids = array();
- if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id'])
- {
- $ids[] = $template_row['template_inherits_id'];
- }
- $ids[] = $template_row['template_id'];
-
- $filemtime = array();
- $file_template_db = array();
-
- foreach ($ids as $id)
- {
- $sql = 'SELECT template_filename, template_mtime
- FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = $id";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $filemtime[$row['template_filename']] = $row['template_mtime'];
- $file_template_db[$row['template_filename']] = $id;
- }
- $db->sql_freeresult($result);
- }
- }
-
// Get a list of cached template files and then retrieve additional information about them
$file_ary = $this->template_cache_filelist($template_row['template_path']);
@@ -905,10 +781,9 @@ version = {VERSION}
'FILENAME' => $file,
'FILENAME_PATH' => $file_tpl,
'FILESIZE' => get_formatted_filesize(filesize("{$phpbb_root_path}cache/$filename")),
- 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime($file_tpl) : $filemtime[$file . '.html']))
- );
+ 'MODIFIED' => $user->format_date(filemtime($file_tpl)),
+ ));
}
- unset($filemtime);
$template->assign_vars(array(
'S_CACHE' => true,
@@ -1123,7 +998,7 @@ version = {VERSION}
case 'template':
$sql_from = STYLES_TEMPLATE_TABLE;
- $sql_select = 'template_id, template_name, template_path, template_storedb';
+ $sql_select = 'template_id, template_name, template_path';
break;
case 'theme':
@@ -1491,7 +1366,7 @@ version = {VERSION}
trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $var_ary = array('style_id', 'style_name', 'style_copyright', 'template_id', 'template_name', 'template_path', 'template_copyright', 'template_storedb', 'template_inherits_id', 'bbcode_bitfield', 'theme_id', 'theme_name', 'theme_path', 'theme_copyright', 'theme_storedb', 'theme_mtime', 'theme_data');
+ $var_ary = array('style_id', 'style_name', 'style_copyright', 'template_id', 'template_name', 'template_path', 'template_copyright', 'template_inherits_id', 'bbcode_bitfield', 'theme_id', 'theme_name', 'theme_path', 'theme_copyright', 'theme_storedb', 'theme_mtime', 'theme_data');
foreach ($var_ary as $var)
{
@@ -1546,31 +1421,12 @@ version = {VERSION}
);
// This is potentially nasty memory-wise ...
- if (!$style_row['template_storedb'])
- {
- $files[] = array(
- 'src' => "styles/{$style_row['template_path']}/template/",
- 'prefix-' => "styles/{$style_row['template_path']}/",
- 'prefix+' => false,
- 'exclude' => 'template.cfg'
- );
- }
- else
- {
- $sql = 'SELECT template_filename, template_data
- FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = {$style_row['template_id']}";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $data[] = array(
- 'src' => $row['template_data'],
- 'prefix' => 'template/' . $row['template_filename']
- );
- }
- $db->sql_freeresult($result);
- }
+ $files[] = array(
+ 'src' => "styles/{$style_row['template_path']}/template/",
+ 'prefix-' => "styles/{$style_row['template_path']}/",
+ 'prefix+' => false,
+ 'exclude' => 'template.cfg'
+ );
unset($template_cfg);
}
@@ -1772,7 +1628,6 @@ version = {VERSION}
$style_active = request_var('style_active', 0);
$style_default = request_var('style_default', 0);
- $store_db = request_var('store_db', 0);
// If the admin selected the style to be the default style, but forgot to activate it... we will do it for him
if ($style_default)
@@ -1803,23 +1658,6 @@ version = {VERSION}
$error[] = $user->lang[$l_type . '_ERR_STYLE_NAME'];
}
- if ($mode === 'theme' || $mode === 'template')
- {
- // a rather elaborate check we have to do here once to avoid trouble later
- $check = "{$phpbb_root_path}styles/" . $style_row["{$mode}_path"] . (($mode === 'theme') ? '/theme/stylesheet.css' : '/template');
- if (($style_row["{$mode}_storedb"] != $store_db) && !$store_db && ($safe_mode || !phpbb_is_writable($check)))
- {
- $error[] = $user->lang['EDIT_' . strtoupper($mode) . '_STORED_DB'];
- $store_db = 1;
- }
-
- // themes which have to be parsed have to go into db
- if ($mode == 'theme')
- {
- $cfg = parse_cfg_file("{$phpbb_root_path}styles/" . $style_row["{$mode}_path"] . "/theme/theme.cfg");
- }
- }
-
if (!sizeof($error))
{
// Check length settings
@@ -1841,7 +1679,6 @@ version = {VERSION}
'template_id' => $template_id,
'theme_id' => $theme_id,
'style_active' => $style_active,
- $mode . '_storedb' => $store_db,
$mode . '_name' => $name,
$mode . '_copyright' => $copyright)
);
@@ -1867,72 +1704,9 @@ version = {VERSION}
break;
case 'theme':
-
- if ($style_row['theme_storedb'] != $store_db)
- {
- $theme_data = '';
-
- if (!$style_row['theme_storedb'])
- {
- $theme_data = $this->db_theme_data($style_row);
- }
- else if (!$store_db && !$safe_mode && phpbb_is_writable("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css"))
- {
- $store_db = 1;
- $theme_data = $style_row['theme_data'];
-
- if ($fp = @fopen("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css", 'wb'))
- {
- $store_db = (@fwrite($fp, str_replace("styles/{$style_row['theme_path']}/theme/", './', $theme_data))) ? 0 : 1;
- }
- fclose($fp);
- }
-
- $sql_ary += array(
- 'theme_mtime' => ($store_db) ? filemtime("{$phpbb_root_path}styles/{$style_row['theme_path']}/theme/stylesheet.css") : 0,
- 'theme_storedb' => $store_db,
- 'theme_data' => ($store_db) ? $theme_data : '',
- );
- }
break;
case 'template':
-
- if ($style_row['template_storedb'] != $store_db)
- {
- if ($super = $this->get_super($mode, $style_row['template_id']))
- {
- $error[] = (sprintf($user->lang["{$l_type}_INHERITS"], $super['template_name']));
- $sql_ary = array();
- }
- else
- {
- if (!$store_db && !$safe_mode && phpbb_is_writable("{$phpbb_root_path}styles/{$style_row['template_path']}/template"))
- {
- $err = $this->store_in_fs('template', $style_row['template_id']);
- if ($err)
- {
- $error += $err;
- }
- }
- else if ($store_db)
- {
- $this->store_in_db('template', $style_row['template_id']);
- }
- else
- {
- // We no longer store within the db, but are also not able to update the file structure
- // Since the admin want to switch this, we adhere to his decision. But we also need to remove the cache
- $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . "
- WHERE template_id = $style_id";
- $db->sql_query($sql);
- }
-
- $sql_ary += array(
- 'template_storedb' => $store_db,
- );
- }
- }
break;
}
@@ -1999,8 +1773,6 @@ version = {VERSION}
'S_STYLE' => ($mode == 'style') ? true : false,
'S_TEMPLATE' => ($mode == 'template') ? true : false,
'S_THEME' => ($mode == 'theme') ? true : false,
- 'S_STORE_DB' => (isset($style_row[$mode . '_storedb'])) ? $style_row[$mode . '_storedb'] : 0,
- 'S_STORE_DB_DISABLED' => (isset($style_row[$mode . '_inherits_id'])) ? $style_row[$mode . '_inherits_id'] : 0,
'S_STYLE_ACTIVE' => (isset($style_row['style_active'])) ? $style_row['style_active'] : 0,
'S_STYLE_DEFAULT' => (isset($style_row['style_default'])) ? $style_row['style_default'] : 0,
'S_SUPERTEMPLATE' => (isset($style_row[$mode . '_inherits_id']) && $style_row[$mode . '_inherits_id']) ? $super['template_name'] : 0,
@@ -2102,84 +1874,6 @@ version = {VERSION}
}
/**
- * Store template files into db
- */
- function store_templates($mode, $style_id, $template_path, $filelist)
- {
- global $phpbb_root_path, $phpEx, $db;
-
- $template_path = $template_path . '/template/';
- $includes = array();
- foreach ($filelist as $pathfile => $file_ary)
- {
- foreach ($file_ary as $file)
- {
- if (!($fp = @fopen("{$phpbb_root_path}styles/$template_path$pathfile$file", 'r')))
- {
- trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR);
- }
-
- $filesize = filesize("{$phpbb_root_path}styles/$template_path$pathfile$file");
-
- if ($filesize)
- {
- $template_data = fread($fp, $filesize);
- }
-
- fclose($fp);
-
- if (!$filesize)
- {
- // File is empty
- continue;
- }
-
- if (preg_match_all('#<!-- INCLUDE (.*?\.html) -->#is', $template_data, $matches))
- {
- foreach ($matches[1] as $match)
- {
- $includes[trim($match)][] = $file;
- }
- }
- }
- }
-
- foreach ($filelist as $pathfile => $file_ary)
- {
- foreach ($file_ary as $file)
- {
- // Skip index.
- if (strpos($file, 'index.') === 0)
- {
- continue;
- }
-
- // We could do this using extended inserts ... but that could be one
- // heck of a lot of data ...
- $sql_ary = array(
- 'template_id' => (int) $style_id,
- 'template_filename' => "$pathfile$file",
- 'template_included' => (isset($includes[$file])) ? implode(':', $includes[$file]) . ':' : '',
- 'template_mtime' => (int) filemtime("{$phpbb_root_path}styles/$template_path$pathfile$file"),
- 'template_data' => (string) file_get_contents("{$phpbb_root_path}styles/$template_path$pathfile$file"),
- );
-
- if ($mode == 'insert')
- {
- $sql = 'INSERT INTO ' . STYLES_TEMPLATE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
- }
- else
- {
- $sql = 'UPDATE ' . STYLES_TEMPLATE_DATA_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE template_id = $style_id
- AND template_filename = '" . $db->sql_escape("$pathfile$file") . "'";
- }
- $db->sql_query($sql);
- }
- }
- }
-
- /**
* Returns an array containing all template filenames for one template that are currently cached.
*
* @param string $template_path contains the name of the template's folder in /styles/
@@ -2361,7 +2055,6 @@ version = {VERSION}
trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $style_row['store_db'] = request_var('store_db', 0);
$style_row['style_active'] = request_var('style_active', 1);
$style_row['style_default'] = request_var('style_default', 0);
@@ -2379,15 +2072,14 @@ version = {VERSION}
}
else
{
- $style_row['store_db'] = $this->install_element($mode, $error, 'install', $root_path, $style_row[$mode . '_id'], $style_row[$mode . '_name'], $install_path, $style_row[$mode . '_copyright'], $style_row['store_db']);
+ $this->install_element($mode, $error, 'install', $root_path, $style_row[$mode . '_id'], $style_row[$mode . '_name'], $install_path, $style_row[$mode . '_copyright']);
}
if (!sizeof($error))
{
$cache->destroy('sql', STYLES_TABLE);
- $message = ($style_row['store_db']) ? '_ADDED_DB' : '_ADDED';
- trigger_error($user->lang[$l_type . $message] . adm_back_link($this->u_action));
+ trigger_error($user->lang[$l_type . '_ADDED'] . adm_back_link($this->u_action));
}
}
@@ -2403,7 +2095,6 @@ version = {VERSION}
'S_SUPERTEMPLATE' => (isset($installcfg['inherit_from'])) ? $installcfg['inherit_from'] : '',
'S_THEME' => ($mode == 'theme') ? true : false,
- 'S_STORE_DB' => (isset($style_row[$mode . '_storedb'])) ? $style_row[$mode . '_storedb'] : 0,
'S_STYLE_ACTIVE' => (isset($style_row['style_active'])) ? $style_row['style_active'] : 0,
'S_STYLE_DEFAULT' => (isset($style_row['style_default'])) ? $style_row['style_default'] : 0,
@@ -2440,7 +2131,6 @@ version = {VERSION}
$mode . '_copyright' => utf8_normalize_nfc(request_var('copyright', '', true)),
'template_id' => 0,
'theme_id' => 0,
- 'store_db' => request_var('store_db', 0),
'style_active' => request_var('style_active', 1),
'style_default' => request_var('style_default', 0),
);
@@ -2512,8 +2202,7 @@ version = {VERSION}
{
$cache->destroy('sql', STYLES_TABLE);
- $message = ($style_row['store_db']) ? '_ADDED_DB' : '_ADDED';
- trigger_error($user->lang[$l_type . $message] . adm_back_link($this->u_action));
+ trigger_error($user->lang[$l_type . '_ADDED'] . adm_back_link($this->u_action));
}
}
@@ -2547,7 +2236,6 @@ version = {VERSION}
'S_THEME' => ($mode == 'theme') ? true : false,
'S_BASIS' => ($basis) ? true : false,
- 'S_STORE_DB' => (isset($style_row['storedb'])) ? $style_row['storedb'] : 0,
'S_STYLE_ACTIVE' => (isset($style_row['style_active'])) ? $style_row['style_active'] : 0,
'S_STYLE_DEFAULT' => (isset($style_row['style_default'])) ? $style_row['style_default'] : 0,
'S_TEMPLATE_OPTIONS' => ($mode == 'style') ? $template_options : '',
@@ -2853,10 +2541,6 @@ version = {VERSION}
$sql_ary['bbcode_bitfield'] = $this->template_bitfield;
}
- // We set a pre-defined bitfield here which we may use further in 3.2
- $sql_ary += array(
- 'template_storedb' => $store_db,
- );
if (isset($cfg_data['inherit_from']) && $cfg_data['inherit_from'])
{
$sql_ary += array(
@@ -2885,12 +2569,6 @@ version = {VERSION}
$id = $db->sql_nextid();
- if ($mode == 'template' && $store_db)
- {
- $filelist = filelist("{$root_path}template", '', 'html');
- $this->store_templates('insert', $id, $path, $filelist);
- }
-
$db->sql_transaction('commit');
$log = ($store_db) ? 'LOG_' . $l_type . '_ADD_DB' : 'LOG_' . $l_type . '_ADD_FS';
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 8ef1a4655d..cbe488fccc 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -262,7 +262,6 @@ define('SITELIST_TABLE', $table_prefix . 'sitelist');
define('SMILIES_TABLE', $table_prefix . 'smilies');
define('STYLES_TABLE', $table_prefix . 'styles');
define('STYLES_TEMPLATE_TABLE', $table_prefix . 'styles_template');
-define('STYLES_TEMPLATE_DATA_TABLE',$table_prefix . 'styles_template_data');
define('STYLES_THEME_TABLE', $table_prefix . 'styles_theme');
define('STYLES_IMAGESET_TABLE', $table_prefix . 'styles_imageset');
define('STYLES_IMAGESET_DATA_TABLE',$table_prefix . 'styles_imageset_data');
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 206b88a73e..c66bf89b47 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -1655,7 +1655,7 @@ class user extends session
$style = ($style) ? $style : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);
}
- $sql = 'SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id
+ $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id
FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . " c
WHERE s.style_id = $style
AND t.template_id = s.template_id
@@ -1674,7 +1674,7 @@ class user extends session
WHERE user_id = {$this->data['user_id']}";
$db->sql_query($sql);
- $sql = 'SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id
+ $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id
FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . " c
WHERE s.style_id = $style
AND t.template_id = s.template_id
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 059b46650c..a4ff93e701 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -205,9 +205,6 @@ $template->set_custom_template('../adm/style', 'admin');
$template->assign_var('T_ASSETS_PATH', '../assets');
$template->assign_var('T_TEMPLATE_PATH', '../adm/style');
-// the acp template is never stored in the database
-$user->theme['template_storedb'] = false;
-
$install = new module();
$install->create('install', "index.$phpEx", $mode, $sub);
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index 5c3a38d237..926b7cad46 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -134,9 +134,6 @@ class install_update extends module
// Set custom template again. ;)
$template->set_custom_template('../adm/style', 'admin');
- // still, the acp template is never stored in the database
- $user->theme['template_storedb'] = false;
-
$template->assign_vars(array(
'S_USER_LANG' => $user->lang['USER_LANG'],
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 0d6409991f..cd4e80ba13 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -437,7 +437,7 @@ INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order)
INSERT INTO phpbb_styles (style_name, style_copyright, style_active, template_id, theme_id) VALUES ('prosilver', '&copy; phpBB Group', 1, 1, 1);
# -- phpbb_styles_template
-INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path, bbcode_bitfield, template_storedb) VALUES ('prosilver', '&copy; phpBB Group', 'prosilver', 'lNg=', 0);
+INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path, bbcode_bitfield) VALUES ('prosilver', '&copy; phpBB Group', 'prosilver', 'lNg=');
# -- phpbb_styles_theme
INSERT INTO phpbb_styles_theme (theme_name, theme_copyright, theme_path, theme_storedb, theme_data) VALUES ('prosilver', '&copy; phpBB Group', 'prosilver', 1, '');
diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php
index c450dcadeb..32c82de45d 100644
--- a/phpBB/language/en/acp/styles.php
+++ b/phpBB/language/en/acp/styles.php
@@ -60,7 +60,6 @@ $lang = array_merge($lang, array(
'CACHE_FILESIZE' => 'File size',
'CACHE_MODIFIED' => 'Modified',
'CONFIRM_TEMPLATE_CLEAR_CACHE' => 'Are you sure you wish to clear all cached versions of your template files?',
- 'CONFIRM_TEMPLATE_REFRESH' => 'Are you sure you wish to refresh all template data in the database with the contents of the template files on the filesystem? This will overwrite all modifications which have been carried out with the template editor while the template was stored in the database.',
'CONFIRM_THEME_REFRESH' => 'Are you sure you wish to refresh the theme data stored in the database with the contents of the theme on the filesystem? This will overwrite all modifications which have been carried out with the theme editor while the theme was stored in the database.',
'COPYRIGHT' => 'Copyright',
'CREATE_STYLE' => 'Create new style',
@@ -88,7 +87,6 @@ $lang = array_merge($lang, array(
'EDIT_DETAILS_THEME_EXPLAIN' => 'Here you can edit certain theme details such as its name. You may also have the option to switch storage of the stylesheet from the filesystem to the database and vice versa. This option depends on your PHP configuration and whether your stylesheet can be written to by the web server.',
'EDIT_TEMPLATE' => 'Edit template',
'EDIT_TEMPLATE_EXPLAIN' => 'Here you can edit your template set directly. Please remember that these edits are permanent and cannot be undone once submitted. If PHP can write to the template files in your styles directory any changes here will be written directly to those files. If PHP cannot write to those files they will be copied into the database and all changes will only be reflected there. Please take care when editing your template set, remember to close all replacement variable terms {XXXX} and conditional statements.',
- 'EDIT_TEMPLATE_STORED_DB' => 'The template file was unwritable so the template set is now stored in the database containing the modified file.',
'EDIT_THEME' => 'Edit theme',
'EDIT_THEME_EXPLAIN' => 'Here you can edit the selected theme, changing colours, images, etc.',
'EDIT_THEME_STORED_DB' => 'The stylesheet file was unwritable so the stylesheet is now stored in the database containing your modification.',
@@ -326,7 +324,6 @@ $lang = array_merge($lang, array(
'STYLE_USED_BY' => 'Used by (including robots)',
'TEMPLATE_ADDED' => 'Template set added and stored on filesystem.',
- 'TEMPLATE_ADDED_DB' => 'Template set added and stored in database.',
'TEMPLATE_CACHE' => 'Template cache',
'TEMPLATE_CACHE_EXPLAIN' => 'By default phpBB caches the compiled version of its templates. This decreases the load on the server each time a page is viewed and thus may reduce the page generation time. Here you can view the cache status of each file and delete individual files or the entire cache.',
'TEMPLATE_CACHE_CLEARED' => 'Template cache cleared successfully.',
@@ -356,7 +353,6 @@ $lang = array_merge($lang, array(
'TEMPLATE_LOCATION_EXPLAIN' => 'Images are always stored on the filesystem.',
'TEMPLATE_NAME' => 'Template name',
'TEMPLATE_FILE_NOT_WRITABLE'=> 'Unable to write to template file %s. Please check the permissions for the directory and the files.',
- 'TEMPLATE_REFRESHED' => 'Template refreshed successfully.',
'THEME_ADDED' => 'New theme added on filesystem.',
'THEME_ADDED_DB' => 'New theme added to database.',