Página 1 de 1
Problema con Manage attachments ACP module for phpBB3
Publicado: 12 Mar 2011, 14:54
por zoby
Hola, he ''intentado'' instalar este MOD, pero al ir a /module.php (supuestamente es el instalador), me lanza el siguiente error
Fatal error: Cannot redeclare recalc_nested_sets() (previously declared in /home/vol14/zobyhost.com/zoby_6743272/espartapsp.zobyhost.com/htdocs/includes/functions_admin.php:30) in /home/vol14/zobyhost.com/zoby_6743272/espartapsp.zobyhost.com/htdocs/includes/functions_admin.php on line 60
He buscado pero no he encontrado ningun tema relacionado con ese error
El MOD lo descargue de aquí
http://www.phpbb-es.com/foro/viewtopic.php?f=75&t=17995
Les adjunto mi /includes/functions_admin.php ?¿
Re: Problema con Manage attachments ACP module for phpBB3
Publicado: 12 Mar 2011, 16:03
por leviatan21
En lugar de adjuntar el archivo, revisalo que no tenga dos veces la función recalc_nested_sets
Re: Problema con Manage attachments ACP module for phpBB3
Publicado: 12 Mar 2011, 17:34
por zoby
leviatan21 escribió:En lugar de adjuntar el archivo, revisalo que no tenga dos veces la función recalc_nested_sets
La tiene dos veces, pero ''no contiene'' lo mismo
por la linea 30
Código: Seleccionar todo
function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = array())
y en la 50
Código: Seleccionar todo
recalc_nested_sets($new_id, $pkey, $table, $row[$pkey], $where);
Como ves, no tiene lo mismo, te pongo desde la linea 25 a la 55 para que veas mas o menos el codigo
Código: Seleccionar todo
* @param int $parent_id parent_id of the current set (default = 0)
* @param array $where contains strings to compare closer on the where statement (additional)
*
* @author EXreaction
*/
function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = array())
{
global $db;
$sql = 'SELECT *
FROM ' . $table . '
WHERE parent_id = ' . (int) $parent_id .
((!empty($where)) ? ' AND ' . implode(' AND ', $where) : '') . '
ORDER BY left_id ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
// First we update the left_id for this module
if ($row['left_id'] != $new_id)
{
$db->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', array('left_id' => $new_id)) . " WHERE $pkey = {$row[$pkey]}");
}
$new_id++;
// Then we go through any children and update their left/right id's
recalc_nested_sets($new_id, $pkey, $table, $row[$pkey], $where);
// Then we come back and update the right_id for this module
if ($row['right_id'] != $new_id)
{
$db->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', array('right_id' => $new_id)) . " WHERE $pkey = {$row[$pkey]}");
Cual de las dos ''sobra'' ?¿
Problema con Manage attachments ACP module for phpBB3
Publicado: 12 Mar 2011, 18:04
por leviatan21
busca si esta linea aparece mas de una vez :
Problema con Manage attachments ACP module for phpBB3
Publicado: 12 Mar 2011, 20:16
por zoby
leviatan21 escribió:busca si esta linea aparece mas de una vez :
Solo aparece una vez, la que te he dicho antes (linea 30)
Problema con Manage attachments ACP module for phpBB3
Publicado: 12 Mar 2011, 20:46
por leviatan21
zoby escribió:Solo aparece una vez, la que te he dicho antes (linea 30)
entonces no entiendo el error, porque dice linea 30 y 60 :
zoby escribió:Fatal error: Cannot redeclare recalc_nested_sets() (previously declared in
/home/vol14/zobyhost.com/zoby_6743272/espartapsp.zobyhost.com/htdocs/includes/functions_admin.php:30)
in
/home/vol14/zobyhost.com/zoby_6743272/espartapsp.zobyhost.com/htdocs/includes/functions_admin.php on line 60
Problema con Manage attachments ACP module for phpBB3
Publicado: 12 Mar 2011, 20:58
por zoby
leviatan21 escribió:zoby escribió:Solo aparece una vez, la que te he dicho antes (linea 30)
entonces no entiendo el error, porque dice linea 30 y 60 :
zoby escribió:Fatal error: Cannot redeclare recalc_nested_sets() (previously declared in
/home/vol14/zobyhost.com/zoby_6743272/espartapsp.zobyhost.com/htdocs/includes/functions_admin.php:30)
in
/home/vol14/zobyhost.com/zoby_6743272/espartapsp.zobyhost.com/htdocs/includes/functions_admin.php on line 60
Yo tampoco lo entiendo, ''repasemos el codigo''
Código: Seleccionar todo
function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = array())
{
global $db;
$sql = 'SELECT *
FROM ' . $table . '
WHERE parent_id = ' . (int) $parent_id .
((!empty($where)) ? ' AND ' . implode(' AND ', $where) : '') . '
ORDER BY left_id ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
// First we update the left_id for this module
if ($row['left_id'] != $new_id)
{
$db->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', array('left_id' => $new_id)) . " WHERE $pkey = {$row[$pkey]}");
}
$new_id++;
// Then we go through any children and update their left/right id's
recalc_nested_sets($new_id, $pkey, $table, $row[$pkey], $where);
// Then we come back and update the right_id for this module
if ($row['right_id'] != $new_id)
{
$db->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', array('right_id' => $new_id)) . " WHERE $pkey = {$row[$pkey]}");
}
$new_id++;
}
$db->sql_freeresult($result);
}
En la 30, empieza la función recalc_nested_sets(, despues se abre un [ que se cierra en la linea 60, luego vienen algunas funciones mas (no se para que sirven, pero tampoco es ese el tema)
No hay nada que se pueda hacer ?¿

Problema con Manage attachments ACP module for phpBB3
Publicado: 12 Mar 2011, 21:17
por Elpingo
Yo tengo instalado ese MOD y no me dio ese error, tengo exactamente igual que vos el código en includes/functions_admin.php
Perdón que no ayude mucho pero es raro que de el error.
Re: Problema con Manage attachments ACP module for phpBB3
Publicado: 13 Mar 2011, 03:26
por leviatan21
Al única manera de entender ese tipo de error, es que alguno de los otros archivos necesarios para ejecutar ese instalador esté modificado por otro MOD y que se incluya al functions_admin.php
y viendo rápidamente el código, no entiendo para que se incluye
Re: Problema con Manage attachments ACP module for phpBB3
Publicado: 13 Mar 2011, 06:40
por zoby
leviatan21 escribió:Al única manera de entender ese tipo de error, es que alguno de los otros archivos necesarios para ejecutar ese instalador esté modificado por otro MOD y que se incluya al functions_admin.php
y viendo rápidamente el código, no entiendo para que se incluye
Entonces, para saber que MOD causa el conflicto, comparo mi functions_admin.php, con uno original, sin cambios, para ver que es lo que los MODs han cambiado, y ''saber que MODss lo han cambiado'' ?¿

Problema con Manage attachments ACP module for phpBB3 Tema Solucionado
Publicado: 13 Mar 2011, 07:01
por leviatan21
Lo primero que se me ocurre es que si no hace falta (porque yo no le veo motivo) eliminar la linea que incluye al archivo
functions_admin.php
Abrir :
Buscar y eliminar :
Código: Seleccionar todo
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
Problema con Manage attachments ACP module for phpBB3
Publicado: 13 Mar 2011, 07:28
por zoby
leviatan21 escribió:Lo primero que se me ocurre es que si no hace falta (porque yo no le veo motivo) eliminar la linea que incluye al archivo
functions_admin.php
Abrir :
Buscar y eliminar :
Código: Seleccionar todo
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
Muchas Gracias Gabriel, funciono perfecto
Marco como solucionado
