4 * SourceForge Exports: Export Trove category tree in XML
7 * SourceForge: Breaking Down the Barriers to Open Source Development
8 * Copyright 1999-2001 (c) VA Linux Systems
9 * http://sourceforge.net
16 require_once('../env.inc.php');
17 require_once('pre.php');
19 header("Content-Type: text/plain");
20 print("<?xml version=\"1.0\"?>
21 <!DOCTYPE trove-tree SYSTEM \"http://$sys_default_domain/export/trove_tree_0.1.dtd\">
26 * This code does special formatting to achieve more human-readable look -
27 * watch out strings ends.
32 print(' <category id="0" name="root" fullname="Trove Root" description="Root of the Trove tree"');
34 function dump_subtree($root) {
40 ", -1, 0, SYS_DB_TROVE);
42 if (db_numrows($res)==0) {
49 while ($row = db_fetch_array($res)) {
50 $indent=str_repeat(" ",$level*2);
51 print($indent.'<category id="'.$row['trove_cat_id'].'" '
52 .'name="'.$row['shortname'].'" '
53 .'fullname="'.$row['fullname'].'" '
54 .'description="'.$row['description'].'"');
55 if (dump_subtree($row['trove_cat_id'])) {
56 print($indent."</category>\n");
66 print(" </category>\n");
67 print("</trove-tree>\n");