PHP Classes

File: testBookmarkParser.php

Recommend this page to a friend!
  Classes of L   BookmarkParser   testBookmarkParser.php   Download  
File: testBookmarkParser.php
Role: Example script
Content type: text/plain
Description: example
Class: BookmarkParser
Class for parsing IE, Netscape and Opera bookmarks
Author: By
Last change: changed img
Date: 21 years ago
Size: 1,189 bytes
 

Contents

Class file image Download
<html>
<body>
<font face="arial" size=-1>
<?php

// thanks to Erik Arvidsson and Emil Eklund at http://www.eae.net/webfx/ because I borought their images

include ("BookmarkParser.php");
   
function
myURL($data, $depth, $no) {
        echo
str_repeat("&nbsp;&nbsp;&nbsp;", $depth);
        echo
"<img src='http://webfx.eae.net/dhtml/xtree/images/file.png'>\n";
        echo
"&nbsp;<a href='" . $data["url"] . "'>". $data["descr"] ."</a>\n";
        echo
"<br>\n";
}

function
myFolder($data, $depth, $no) {
        echo
str_repeat("&nbsp;&nbsp;&nbsp;", $depth);
        echo
"<img src='http://webfx.eae.net/dhtml/xtree/images/openfoldericon.png'>&nbsp;" . $data["name"]. "\n";
        echo
"<br>\n";
}

$class = new BookmarkParser();

$class->parseNetscape("./bookmarks/bookmarks.html", 0, 'myURL', 'myFolder');
//$class->parseOpera("./bookmarks/opera6.adr", 0, 'myURL', 'myFolder');
//$class->parseInternetExplorer("./bookmarks/", 0, 'myURL', 'myFolder');

echo "<p># of urls: " . $class->urlsParsed."<br>";
echo
"# of folder: " . $class->foldersParsed."<br>";
echo
"Error Messages: " . $class->error_message;



?>
</font>
</body>
</html>