Warning: The author of this contribution does not provide support for it anymore.

Info Boxes Advanced

Fatal error: functions_admin.php - Info Boxes Advanced

Fatal error: functions_admin.php

by Solidjeuh » Tue Jan 01, 2013 6:51 pm

Version: 1_0_4

I get this error when I want to create a new subject:

Code: Select all

Fatal error: Cannot redeclare recalc_nested_sets() (previously declared in /home/andy/public_html/includes/functions_admin.php:30) in /home/andy/public_html/includes/functions_admin.php on line 60


This is the code I have in functions_admin.php:

Code: Select all

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);
}
I don't suffer from insanity. I enjoy every minute of it.
User avatar
Solidjeuh
Registered User
Posts: 522
Joined: Wed Oct 06, 2010 11:20 pm
Location: Aalst / Belgium
Name: Andy Dm
Contact:

Re: Fatal error: functions_admin.php

by Steve » Thu Jan 03, 2013 3:41 pm

Open the file includes/hooks/hook_info_boxes.php

find:

Code: Select all

?>

replace with:

Code: Select all

//End of File


Then purge the cache
phpBB is fun!! :)
Topic/Post Reactions|phpBB Vehicle Showroom + Market Place + Tracks + 1/4 Mile | Calendar
All coming back for testing soon. (dated 6/11/2019)
User avatar
Steve
Registered User
Posts: 1006
Joined: Tue Apr 07, 2009 7:48 pm
Location: UK ,up north!!
Name: Steven Clark
Contact:

Re: Fatal error: functions_admin.php

by Solidjeuh » Thu Jan 03, 2013 4:04 pm

Still the same error ... :)

Fatal error: Cannot redeclare recalc_nested_sets() (previously declared in /home/andy/public_html/includes/functions_admin.php:30) in /home/andy/public_html/includes/functions_admin.php on line 60
I don't suffer from insanity. I enjoy every minute of it.
User avatar
Solidjeuh
Registered User
Posts: 522
Joined: Wed Oct 06, 2010 11:20 pm
Location: Aalst / Belgium
Name: Andy Dm
Contact:

Re: Fatal error: functions_admin.php

by Steve » Tue Jan 08, 2013 7:10 pm

Ok try this,
Open the file includes/hooks/hook_info_boxes.php

find and delete:

Code: Select all

define('INFO_BOXES_TABLE', $table_prefix . 'info_boxes');


Open includes/constants.php

find:

Code: Select all


// Additional tables

after add:

Code: Select all

define('INFO_BOXES_TABLE', $table_prefix . 'info_boxes');
phpBB is fun!! :)
Topic/Post Reactions|phpBB Vehicle Showroom + Market Place + Tracks + 1/4 Mile | Calendar
All coming back for testing soon. (dated 6/11/2019)
User avatar
Steve
Registered User
Posts: 1006
Joined: Tue Apr 07, 2009 7:48 pm
Location: UK ,up north!!
Name: Steven Clark
Contact: