Jump to content

Reymanx3x

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Reymanx3x's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry, thread can be closed! The error was, that I forgot to forward the third argument of the function "scanImages" in the inner self-call: if($child->id == $picid){ $image = array(); $image[] = '"' . $child->id . '"'; $image[] = '"' . $child->name . '"'; $image[] = '"' . $misc->clean_path($child->file) . '"'; $image[] = '"' . $child->file_name . '"'; $image[] = '"' . $child->file_type . '"'; $image[] = '"' . $path . '"'; $images[] = implode("\t", $image); } break; case "14": scanImages($child->id,$path."/".$child->name); break; default: }; Thanks to everybody!
  2. Probably you need the whole code of the function: function scanImages($id,$path,$picid) { global $server, $images, $misc; $childs = $server->children($id, "O.sort_order", "", 0); for ($i = 0; $i < count($childs->results); $i++) { $child = $server->object($childs->results[$i]); switch ($child->type) { case "183": if($child->id == $picid){ $image = array(); $image[] = '"' . $child->id . '"'; $image[] = '"' . $child->name . '"'; $image[] = '"' . $misc->clean_path($child->file) . '"'; $image[] = '"' . $child->file_name . '"'; $image[] = '"' . $child->file_type . '"'; $image[] = '"' . $path . '"'; $images[] = implode("\t", $image); } break; case "14": scanImages($child->id,$path."/".$child->name); break; default: }; }; } scanImages(181,"Bilder", 20167);
  3. Hey guys! I have the following strange problem: Listing 1: echo $n; // Result is 20167 ! if($child->id == $n){ $image = array(); $image[] = '"' . $child->id . '"'; $image[] = '"' . $child->name . '"'; $image[] = '"' . $misc->clean_path($child->file) . '"'; $image[] = '"' . $child->file_name . '"'; $image[] = '"' . $child->file_type . '"'; $image[] = '"' . $path . '"'; $images[] = implode("\t", $image); } The if-statement is not true... so probably there's no $child->id with value 20167.... but watch this: Listing 2: if($child->id == 20167){ $image = array(); $image[] = '"' . $child->id . '"'; $image[] = '"' . $child->name . '"'; $image[] = '"' . $misc->clean_path($child->file) . '"'; $image[] = '"' . $child->file_name . '"'; $image[] = '"' . $child->file_type . '"'; $image[] = '"' . $path . '"'; $images[] = implode("\t", $image); } Now with the hard coded value 20167 the statement is true and gives one result.... Strange, isn't it? I placed the following three functions/test direct before the if-statement: var_dump($n); Result: NULL echo $n Result: 20167 echo "{$n}"; Result: I tested one function at a time. How can this happen? Thanks to all! :-)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.