tree = & new folder; $this->tree->folders[0] = array ('id' => 0, 'childof' => null, 'name' => $GLOBALS['settings']['root_folder_name']); global $username, $mysql; $this->counter = 0; # collect the bookmark data $query = sprintf ("SELECT title, url, description, childof, id, favicon FROM bookmark WHERE user='%s' AND deleted!='1' ORDER BY title", $mysql->escape ($username)); if ($mysql->query ($query)) { while ($row = mysql_fetch_assoc ($mysql->result)) { if (!isset ($this->bookmarks[$row['childof']])) { $this->bookmarks[$row['childof']] = array (); } array_push ($this->bookmarks[$row['childof']], $row); } } else { message ($mysql->error); } } function make_tree ($folderid) { if (isset ($this->tree->children[$folderid])) { $this->counter++; foreach ($this->tree->children[$folderid] as $value) { $this->print_folder ($value); $this->make_tree ($value); $this->print_folder_close ($value); } $this->counter--; } $this->print_bookmarks ($folderid); } function print_folder ($folderid) { echo str_repeat (" ", $this->counter) . '
  • ' . $this->tree->folders[$folderid]['name'] . "\n"; if (isset ($this->tree->children[$folderid]) || isset ($this->bookmarks[$folderid])) { echo str_repeat (" ", $this->counter + 1) . "\n"; } echo str_repeat (" ", $this->counter) . "
  • \n"; } function print_bookmarks ($folderid) { $spacer = str_repeat (" ", $this->counter); if (isset ($this->bookmarks[$folderid])) { foreach ($this->bookmarks[$folderid] as $value) { if ($value['favicon'] && is_file ($value['favicon'])) { $icon = ''; } else { $icon = ''; } echo $spacer . '
  • ' . $icon . " " . $value['title'] . "
  • \n"; } } } } ?> Online-Bookmarks

    Back to Online-Bookmarks

    ' . "\n"; $sidebar->make_tree (0); echo "\n"; require_once (ABSOLUTE_PATH . "footer.php"); ?>