* Just put this page in your apb root directory and call it when * logged in and it'll print out a file that you can import using Netscape compatible * browsers. (Firefox, Mozilla :P) */ include_once ('apb.php'); if (empty ($APB_SETTINGS['auth_user_id'])) header ('location: index.php'); $query = 'SELECT bookmark_title AS title, bookmark_url AS url, bookmark_description AS description, group_id FROM apb_bookmarks WHERE bookmark_deleted = 0'; $data = mysql_query ($query) or die ('Error with query: ' . mysql_error ()); $bookmarks = array (); // Sort up the bookmarks by their group_id for later when we're printing groups while ($row = mysql_fetch_assoc ($data)) { $bookmarks[$row['group_id']][] = array ( 'url' => $row['url'], 'title' => $row['title'], 'description' => $row['description'], ); } // Now for the groups $group_query = 'SELECT group_id, group_parent_id, group_title, group_description FROM apb_groups WHERE group_deleted = 0'; $group_data = mysql_query ($group_query) or die ('Error with group query: ' . mysql_error ()); $groups = array (); while ($row = mysql_fetch_assoc ($group_data)) { /* We need to know the relationsship of a subgroup if there is one * so we save the subgroup in the maingroup so we can call them * on their own when we call them. */ if (!empty ($row['group_parent_id'])) $groups[$row['group_parent_id']]['childs'][] = $row['group_id']; $groups[$row['group_id']]['data'] = array ( 'title' => $row['group_title'], 'description' => ((!empty ($row['description'])) ? $row['description'] : false), 'child' => ((!empty ($row['group_parent_id'])) ? true : false), ); } /* Prints out the bookmark itself */ function print_row_data ($arr, $iter = 0) { print str_repeat ("\t", $iter); printf ("
\n"; if (!empty ($cathegory['data']['description'])) print str_repeat ("\t", $iter +1) .'
\n"; } ?>