Location: PHPKode > projects > Mozilla To Web Bookmark Tools > moz2web-tools-0.1/parse_bookmarks.php
<?
/*------------------------------------------------------------------------------
 | script name: xml_bookmark_class.php
 | script info: see README
 | version:     0.1 
 |     
 | created by:  Ralph Schindler
 | licensing:   GNU General Public Licence - 'feel free to f*ck w/ it'
 -----------------------------------------------------------------------------*/

include "xml_bookmark_class.php";

// load up the bookmark file
$contents = implode('', file("bookmarks.html"));

// send it to the parser
$bookmarks = new xml_bookmark($contents, "");

echo "<font face='Arial' size=2>";

if (!isset($nodes)) $nodes = "|" . 0 . "|";
$nodes = (string) $nodes;

foreach ($bookmarks->data as $bookmark_id => $bookmark) {

    if ( (strpos("-".$nodes, $bookmark->all_family) > 0) || ($bookmark->parent_id == 0) ) { 
        echo str_repeat("&nbsp; &nbsp; ", $bookmark->depth);
        if (isset($bookmark->href)) {
            echo "<a href=\"" . $bookmark->href . "\">";
            echo $bookmark->link_name;
            echo "</a>";
            if (isset($bookmark->description)) echo " - " . $bookmark->description . "\n";
        } else {
            echo "<A href=\"" . $PHP_SELF . "?nodes=" . $bookmark->all_family . $bookmark_id . "|\" style=\"text-decoration:none;\">+</a> ";
            echo $bookmark->link_name . "\n";
        }
        echo "<br>";
    }

}


// uncomment below to see a dump of the structure.

//echo "<pre>";
//var_dump($bookmarks);

?>
Return current item: Mozilla To Web Bookmark Tools