mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
erm, we need to check if the feed module is already there
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9584 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
d843dbd046
commit
8d4ddc3b23
1 changed files with 27 additions and 11 deletions
|
@ -1070,18 +1070,34 @@ function change_database_data(&$no_updates, $version)
|
||||||
|
|
||||||
if ($category_id)
|
if ($category_id)
|
||||||
{
|
{
|
||||||
$module_data = array(
|
// Check if we actually need to add the feed module or if it is already added. ;)
|
||||||
'module_basename' => 'board',
|
$sql = 'SELECT *
|
||||||
'module_enabled' => 1,
|
FROM ' . MODULES_TABLE . "
|
||||||
'module_display' => 1,
|
WHERE module_basename = 'board'
|
||||||
'parent_id' => $category_id,
|
AND module_class = 'acp'
|
||||||
'module_class' => 'acp',
|
AND module_langname = 'ACP_FEED_SETTINGS'
|
||||||
'module_langname' => 'ACP_FEED_SETTINGS',
|
AND module_mode = 'feed'
|
||||||
'module_mode' => 'feed',
|
AND module_auth = 'acl_a_board'
|
||||||
'module_auth' => 'acl_a_board',
|
AND parent_id = {$category_id}";
|
||||||
);
|
$result = $db->sql_query($sql);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$_module->update_module_data($module_data, true);
|
if (!$row)
|
||||||
|
{
|
||||||
|
$module_data = array(
|
||||||
|
'module_basename' => 'board',
|
||||||
|
'module_enabled' => 1,
|
||||||
|
'module_display' => 1,
|
||||||
|
'parent_id' => $category_id,
|
||||||
|
'module_class' => 'acp',
|
||||||
|
'module_langname' => 'ACP_FEED_SETTINGS',
|
||||||
|
'module_mode' => 'feed',
|
||||||
|
'module_auth' => 'acl_a_board',
|
||||||
|
);
|
||||||
|
|
||||||
|
$_module->update_module_data($module_data, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$_module->remove_cache_file();
|
$_module->remove_cache_file();
|
||||||
|
|
Loading…
Add table
Reference in a new issue