aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_styles.php
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2008-07-28 15:05:46 +0000
committerHenry Sudhof <kellanved@phpbb.com>2008-07-28 15:05:46 +0000
commitfe72c1e3cfbfa51fb9d62946f3b462b47774ba3f (patch)
tree905289e11bb4ccd782dceb69dd328da4d531591e /phpBB/includes/acp/acp_styles.php
parentc2133550d0a54968e53b961783fc97af6e343e85 (diff)
downloadforums-fe72c1e3cfbfa51fb9d62946f3b462b47774ba3f.tar
forums-fe72c1e3cfbfa51fb9d62946f3b462b47774ba3f.tar.gz
forums-fe72c1e3cfbfa51fb9d62946f3b462b47774ba3f.tar.bz2
forums-fe72c1e3cfbfa51fb9d62946f3b462b47774ba3f.tar.xz
forums-fe72c1e3cfbfa51fb9d62946f3b462b47774ba3f.zip
#30735
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8700 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_styles.php')
-rw-r--r--phpBB/includes/acp/acp_styles.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index fb146ad858..495a5a4786 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -992,8 +992,8 @@ inherit_from = {INHERIT_FROM}
$filemtime = array();
if ($template_row['template_storedb'])
{
- $ids = array();
- if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id'])
+ $ids = array();
+ if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id'])
{
$ids[] = $template_row['template_inherits_id'];
}
@@ -1040,7 +1040,7 @@ inherit_from = {INHERIT_FROM}
$file_tpl = "{$phpbb_root_path}styles/{$template_row['template_path']}/template/$tpl_file.html";
$inherited = false;
- if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id'])
+ if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id'])
{
if (!$template_row['template_storedb'])
{
@@ -2162,6 +2162,14 @@ inherit_from = {INHERIT_FROM}
$style_default = request_var('style_default', 0);
$store_db = request_var('store_db', 0);
+ $sql = "SELECT {$mode}_id
+ FROM $sql_from
+ WHERE {$mode}_id <> $style_id
+ AND {$mode}_name = '" . $db->sql_escape(strtolower($name)) . "'";
+ $result = $db->sql_query($sql);
+ $conflict = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
if ($mode == 'style' && (!$template_id || !$theme_id || !$imageset_id))
{
$error[] = $user->lang['STYLE_ERR_NO_IDS'];
@@ -2172,7 +2180,7 @@ inherit_from = {INHERIT_FROM}
$error[] = $user->lang['DEACTIVATE_DEFAULT'];
}
- if (!$name)
+ if (!$name || $conflict)
{
$error[] = $user->lang[$l_type . '_ERR_STYLE_NAME'];
}
@@ -3372,7 +3380,7 @@ inherit_from = {INHERIT_FROM}
* @visibility public
* @param string $mode The element type to check - only template is supported
* @param int $id The template id
- * @returns false if no component inherits, array with name, path and id for each subtemplate otherwise
+ * @returns false if no component inherits, array with name, path and id for each subtemplate otherwise
*/
function check_inheritance($mode, $id)
{