Omega100 escribió:ok pues veré entonces donde la he fastidiado yo. y de paso intentare echarle un ojo a lo de por que se borran si consigo algo te aviso ^^
Para las secciones que se eliminan al editar una categoría, prueba haciendo esto :
Abrir :
Buscar : ( al rededor de la linea 1325 )
Código: Seleccionar todo
if ($action == 'edit')
{
$msg = '';
// We are turning a category into a link - but need to decide what to do with the subforums.
$action_sections = (sizeof($childrens)) ? request_var('action_sections', '') : '';
$sections_to_ids = (sizeof($childrens)) ? request_var('sections_to_id', 0) : 0;
if ($action_sections == 'delete' || $action_sections == 'move')
{
$childrens = $this->get_page_branch($page_id, 'childrens', 'descending', false);
$sections_ids = array();
foreach ($childrens as $_row)
{
$sections_ids[] = $_row['page_id'];
}
if ($action_sections == 'delete')
{
if (sizeof($sections_ids))
{
// Delete sectins under this category
$sql = 'DELETE FROM ' . PHPBBWEB_PAGE_TABLE . '
WHERE ' . $db->sql_in_set('page_id', $sections_ids);
$db->sql_query($sql);
// Delete attach under this deleted sections
$this->phpbbweb_delete_attachments($sections_ids);
}
$msg = $user->lang['ACP_CATEGORY_DELETED'];
}
if ($action_sections == 'move')
{
if (!$sections_to_ids)
{
trigger_error($user->lang['ACP_CATEGORY_NO_DESTINATION_FOUND'] . adm_back_link($this->u_action . '&page_id=' . $parent_id));
}
$sql = 'UPDATE ' . PHPBBWEB_PAGE_TABLE . "
SET parent_id = $sections_to_ids
WHERE " . $db->sql_in_set('page_id', $sections_ids);
$db->sql_query($sql);
$msg = $user->lang['ACP_PAGE_MOVED'];
// trigger_error($user->lang['ACP_CATEGORY_MOVED'] . adm_back_link($this->u_action . '&page_id=' . $parent_id));
}
}
if ($data['parent_id'] != $page_data['parent_id'])
{
$data['page_order'] = $this->get_new_order($parent_id, $page_type);
}
$sql = 'UPDATE ' . PHPBBWEB_PAGE_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $data) . '
WHERE page_id = ' . $page_id;
$result = $db->sql_query($sql);
// Submit Attachments
$data['attachment_data'] = $message_parser->attachment_data;
$this->phpbbweb_update_attachments($data, $page_id);
$msg = $user->lang['ACP_MESSAGE_UPDATED'] . '<br />' . $msg;
trigger_error($msg . adm_back_link($this->u_action . '&page_id=' . $parent_id));
}
Reemplazar, por :
Código: Seleccionar todo
if ($action == 'edit')
{
$msg = '';
// We are turning a category into a sectin or block - but need to decide what to do with the childs.
if ($page_type != $page_data['page_type'])
{
$action_sections = (sizeof($childrens)) ? request_var('action_sections', '') : '';
$sections_to_ids = (sizeof($childrens)) ? request_var('sections_to_id', 0) : 0;
if ($action_sections == 'delete' || $action_sections == 'move')
{
$childrens = $this->get_page_branch($page_id, 'childrens', 'descending', false);
$sections_ids = array();
foreach ($childrens as $_row)
{
$sections_ids[] = $_row['page_id'];
}
if ($action_sections == 'delete')
{
if (sizeof($sections_ids))
{
// Delete sectins under this category
$sql = 'DELETE FROM ' . PHPBBWEB_PAGE_TABLE . '
WHERE ' . $db->sql_in_set('page_id', $sections_ids);
$db->sql_query($sql);
// Delete attach under this deleted sections
$this->phpbbweb_delete_attachments($sections_ids);
}
$msg = $user->lang['ACP_CATEGORY_DELETED'];
}
if ($action_sections == 'move')
{
if (!$sections_to_ids)
{
trigger_error($user->lang['ACP_CATEGORY_NO_DESTINATION_FOUND'] . adm_back_link($this->u_action . '&page_id=' . $parent_id));
}
$sql = 'UPDATE ' . PHPBBWEB_PAGE_TABLE . "
SET parent_id = $sections_to_ids
WHERE " . $db->sql_in_set('page_id', $sections_ids);
$db->sql_query($sql);
$msg = $user->lang['ACP_PAGE_MOVED'];
}
}
}
if ($data['parent_id'] != $page_data['parent_id'])
{
$data['page_order'] = $this->get_new_order($parent_id, $page_type);
}
$sql = 'UPDATE ' . PHPBBWEB_PAGE_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $data) . '
WHERE page_id = ' . $page_id;
$result = $db->sql_query($sql);
// Submit Attachments
$data['attachment_data'] = $message_parser->attachment_data;
$this->phpbbweb_update_attachments($data, $page_id);
$msg = $user->lang['ACP_MESSAGE_UPDATED'] . '<br />' . $msg;
trigger_error($msg . adm_back_link($this->u_action . '&page_id=' . $parent_id));
}