Author Topic: after change: fatal error get_categories() error  (Read 10741 times)

0 Members and 1 Guest are viewing this topic.

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
after change: fatal error get_categories() error
« on: April 24, 2005, 01:11:06 PM »
Hello
i have been modifiying  my homepage - then i got a error - so i went back like normal - but the mistake still haben


Fatal error: Call to undefined function: get_categories() in D:\web-data\foto.wombat.ch\http\index.php on line 67

64 //-----------------------------------------------------
65 //--- Show Categories ---------------------------------
66 //-----------------------------------------------------
67 $categories = get_categories(0);
68 if (!$categories)  {
69  $categories = $lang['no_categories'];
70 }
71 $site_template->register_vars("categories", $categories);
72 unset($categories);

please need quick help - the page do not work

vincent  :cry:  :cry:  :cry:
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: after change: fatal error get_categories() error
« Reply #1 on: April 24, 2005, 01:38:33 PM »
Hast du noch was in der includes/functions.php geändert, da ist die get_categories() drin?

sonst sagt mir das leider auch erstmal nichts
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: after change: fatal error get_categories() error
« Reply #2 on: April 24, 2005, 01:42:16 PM »
danke für die antwort
ja ich habe etwas geändert und es auch rückgängig gemacht so sieht es aus

Quote
function get_categories($cat_id = 0) {
  global $site_template, $site_db, $site_sess, $config, $lang;
  global $cat_cache, $cat_parent_cache, $new_image_cache, $subcat_ids;

  $cattable_width = ceil((intval($config['cat_table_width'])) / $config['cat_cells']);
  if ((substr($config['cat_table_width'],-1)) == "%") {
    $cattable_width .= "%";
  }

  if (!isset($cat_parent_cache[$cat_id])) {
    return "";
  }

  $visible_cat_cache = array();
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: after change: fatal error get_categories() error
« Reply #3 on: April 24, 2005, 01:45:08 PM »
67    // $categories = get_categories(0);

if i add the // bevor the homepage show up but have no Kategorie
clicking the on a picture
i got

Fatal error: Call to undefined function: get_category_path() in D:\web-data\foto.wombat.ch\http\details.php on line 571
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: after change: fatal error get_categories() error
« Reply #4 on: April 24, 2005, 01:57:29 PM »
Ja, fängt bei mir auch so an

Ich hänge mal beide Funktionen aus der Version 1.7 an

get_categories
Code: [Select]
function get_categories($cat_id = 0) {
  global $site_template, $site_db, $site_sess, $config, $lang;
  global $cat_cache, $cat_parent_cache, $new_image_cache, $subcat_ids;

  $cattable_width = ceil((intval($config['cat_table_width'])) / $config['cat_cells']);
  if ((substr($config['cat_table_width'],-1)) == "%") {
    $cattable_width .= "%";
  }

  if (!isset($cat_parent_cache[$cat_id])) {
    return "";
  }

  $visible_cat_cache = array();
  foreach ($cat_parent_cache[$cat_id] as $key => $val) {
    if (check_permission("auth_viewcat", $val)) {
      $visible_cat_cache[$key] = $val;
    }
  }

  if (empty($visible_cat_cache)) {
    return "";
  }

  $total = sizeof($visible_cat_cache);
  $table_columns = (intval($config['cat_cells'])) ? intval($config['cat_cells']) : 2;
  if ($total <= $table_columns) {
    $table_rows = 1;
  }
  else {
    $table_rows = $total / $table_columns;
    if ($total >= $table_columns && !is_integer($table_rows)) {
      $table_rows = intval($table_rows) + 1;
    }
  }

  $categories = "\n<table width=\"".$config['cat_table_width']."\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td valign=\"top\" width=\"".$cattable_width."\" class=\"catbgcolor\">\n";
  $categories .= "<table border=\"0\" cellpadding=\"".$config['cat_table_cellpadding']."\" cellspacing=\"".$config['cat_table_cellspacing']."\">\n";
  $count = 0;
  $count2 = 0;
  foreach ($visible_cat_cache as $key => $category_id) {
    $categories .= "<tr>\n<td valign=\"top\">\n";

    $is_new = (isset($new_image_cache[$category_id]) && $new_image_cache[$category_id] > 0) ? 1 : 0;
    $num_images = (isset($cat_cache[$category_id]['num_images'])) ? $cat_cache[$category_id]['num_images'] : 0;

    $subcat_ids = array();
    get_subcat_ids($category_id, $category_id, $cat_parent_cache);

    if (isset($subcat_ids[$category_id])) {
      foreach ($subcat_ids[$category_id] as $val) {
        if (isset($new_image_cache[$val]) && $new_image_cache[$val] > 0) {
          $is_new = 1;
        }
        if (isset($cat_cache[$val]['num_images'])) {
          $num_images += $cat_cache[$val]['num_images'];
        }
      }
    }

get_categorie_path
Code: [Select]
function get_category_path($cat_id = 0, $detail_path = 0) {
  global $site_sess, $config, $cat_cache, $url;
  $parent_id = 1;
  while ($parent_id) {
    if (!isset($cat_cache[$cat_id]['cat_parent_id'])) {
      return false;
    }
    $parent_id = $cat_cache[$cat_id]['cat_parent_id'];

    if (empty($path)) {
      if ($detail_path) {
        $cat_url = ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id;
        if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
          if (!empty($regs[1]) && $regs[1] != 1) {
            $cat_url .= "&amp;".URL_PAGE."=".$regs[1];
          }
        }
        $path = "<a href=\"".$site_sess->url($cat_url)."\" class=\"clickstream\">".$cat_cache[$cat_id]['cat_name']."</a>";
      }
      else  {
        $path = $cat_cache[$cat_id]['cat_name'];
      }
    }
    else {
      $path = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id)."\" class=\"clickstream\">".$cat_cache[$cat_id]['cat_name']."</a>".$config['category_separator'].$path;
    }
    $cat_id = $parent_id;
  } // end while
  return $path;
}

function get_category_dropdown_bits($cat_id, $cid = 0, $depth = 1) {
  global $site_db, $drop_down_cat_cache, $cat_cache;

  if (!isset($drop_down_cat_cache[$cid])) {
    return "";
  }
  $category_list = "";
  foreach ($drop_down_cat_cache[$cid] as $key => $category_id) {
    if (check_permission("auth_viewcat", $category_id)) {
      $category_list .= "<option value=\"".$category_id."\"";
      if ($cat_id == $category_id) {
        $category_list .= " selected=\"selected\"";
      }
      if ($cat_cache[$category_id]['cat_parent_id'] == 0) {
        $category_list .= " class=\"dropdownmarker\"";
      }

      if ($depth > 1) {
        $category_list .= ">".str_repeat("--", $depth - 1)." ".$cat_cache[$category_id]['cat_name']."</option>\n";
      }
      else {
        $category_list .= ">".$cat_cache[$category_id]['cat_name']."</option>\n";
      }
      $category_list .= get_category_dropdown_bits($cat_id, $category_id, $depth + 1);
    }
  }
  unset($drop_down_cat_cache[$cid]);
  return $category_list;
}

Aber das wird wohl bei dir auch stimmen?!


Die Kategorien sind aber noch in der Datenbank drin?
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: after change: fatal error get_categories() error
« Reply #5 on: April 24, 2005, 02:25:45 PM »
wie du meiner seite entnehmen kannst
sieht es nicht gut aus:

wobei der erste fehler der abschluss von functions.php ist das heisst   ?>

Parse error: parse error, unexpected $ in D:\web-data\foto.wombat.ch\http\includes\functions.php on line 1580

Warning: Cannot add header information - headers already sent by (output started at D:\web-data\foto.wombat.ch\http\includes\functions.php:1580) in D:\web-data\foto.wombat.ch\http\includes\sessions.php on line 85

Warning: Cannot add header information - headers already sent by (output started at D:\web-data\foto.wombat.ch\http\includes\functions.php:1580) in D:\web-data\foto.wombat.ch\http\includes\sessions.php on line 85

Warning: Cannot add header information - headers already sent by (output started at D:\web-data\foto.wombat.ch\http\includes\functions.php:1580) in D:\web-data\foto.wombat.ch\http\includes\sessions.php on line 85

Fatal error: Call to undefined function: get_categories() in D:\web-data\foto.wombat.ch\http\index.php on line 67
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: after change: fatal error get_categories() error
« Reply #6 on: April 24, 2005, 02:30:55 PM »
ich tappe auch im Dunkeln, habe nur das noch gefunden

http://www.4homepages.de/forum/index.php?topic=3378.0
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: after change: fatal error get_categories() error
« Reply #7 on: April 24, 2005, 02:37:21 PM »
ja hab ich ?>
danach ist nichts!
wenn ich 67    // $categories = get_categories(0);
die Slashs einfüge geht wieder etwas!

ja gemäss FTP und der strartseite sind die Kategorien noch das

my funcitons as txt file --> http://www.foto-kocher.com/muster/functions.php.txt

merci
Vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: after change: fatal error get_categories() error
« Reply #8 on: April 24, 2005, 03:51:45 PM »
backedup Functions.php file!

will have to find out which parts are not working anymore

vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: after change: fatal error get_categories() error
« Reply #9 on: April 24, 2005, 05:30:24 PM »
mit der alten functions.php geht es nun?!
Oder hast du noch was anderes geändert?
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: after change: fatal error get_categories() error
« Reply #10 on: April 24, 2005, 05:43:23 PM »
soviel ich rausgefunden habe geht es!

obwohl einige funktionen verschwunden sein müssen!

gruss und nochmals vielen dank

vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: after change: fatal error get_categories() error
« Reply #11 on: April 24, 2005, 08:16:05 PM »
Gerne doch, konnte ja aber nicht wirklich zur Lösung beitragen
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages