Index: trunk/dvodist/www-util/ipp.php
===================================================================
--- trunk/dvodist/www-util/ipp.php	(revision 35238)
+++ trunk/dvodist/www-util/ipp.php	(revision 35415)
@@ -1,5 +1,3 @@
 <?php
-
-global $rootdir;
 
 function head ($title) {
@@ -22,7 +20,25 @@
   echo "<body>\n";
 
+  echo "<!-- Start eXTReMe Pro Tracker Code V3/7\n";
+  echo "Login:    emagnier\n";
+  echo "Help:     https://www.extremetracking.com\n";
+  echo "Installation instructions:\n";
+  echo "Copy and paste this code between the two body tags into the\n";
+  echo "*source* of your pages or in your footer/template. Best is\n";
+  echo "to use a normal text editor such as notepad. -->\n";
+  echo "<script type=\"text/javascript\"><!--\n";
+  echo "EXd=document;location.protocol==\"https:\"?EXp=\"https\":EXp=\"http\";EXs=\"src\";\n";
+  echo "EXd.write(\"<img \"+EXs+\"=\"+EXp+\"://nht-2.extreme-dm.com/n2.g?login=emagnier\",\n";
+  echo "\"&url=\"+escape(EXd.URL)+\"&jv=\"+navigator.javaEnabled()+\"&\",\n";
+  echo "\"d=\"+screen.width+\"x\"+screen.height+\"&c=\"+screen.colorDepth+\"\",\n";
+  echo "\"&l=\"+escape(EXd.referrer)+\" width=0 height=0>\");//-->\n";
+  echo "</script><noscript><img height=\"1\" width=\"1\" alt=\"\"\n";
+  echo "src=\"http://nht-2.extreme-dm.com/n2.g?login=emagnier&amp;url=nojs\">\n";
+  echo "</noscript>\n";
+  echo "<!-- End eXTReMe Pro Tracker Code -->\n";
+
   if (! $project) { $project = "none"; }
 
-  // echo "<p style=\"font-size:50%\">host: $WWWHOST, db: $DBHOST</p>\n";
+  // echo "<p style=\"font-size:50%\">host: $root</p>\n";
   echo "<table class=page cellspacing=10px><tr><td valign=top>\n";
   echo "<table class=menu cellspacing=0px>\n";
@@ -76,9 +92,7 @@
     } 
 
-    global $rootdir;
-
     // hi-lite the current page (use select-style, not style)
     $thisname = $_SERVER[SCRIPT_NAME]; 
-    $page = $rootdir . $base;
+    $page = $root . $base;
     if ($page == $thisname) {
       $style = trim($line[1]);
@@ -92,5 +106,5 @@
       break;
     case 'picture':
-      // prepend the rootdir if needed (reference to /)
+      // prepend the root if needed (reference to /)
       if ($name[0] == '/') {
 	$name = $root . $name;
@@ -99,5 +113,5 @@
       break;
     case 'piclink':
-      // prepend the rootdir if needed (reference to /)
+      // prepend the root if needed (reference to /)
       if ($name[0] == '/') {
 	$name = $root . $name;
@@ -249,5 +263,6 @@
 
 // lines which start with @ are processed by 'dirlist', all others are processed by Markdown
-function do_markdown ($source) {
+function do_markdown ($source, $root) {
+
   if (!file_exists($source)) return;
 
@@ -258,4 +273,7 @@
   $to_dirlist = "";
   while ($line = fgets ($file, 1024)) {
+    // replace @WWWHOST@ with $root
+    $line = str_replace ("@WWWHOST@", $root, $line);
+
     // echo "line: $line";
     if (!strncmp($line, "@", 1)) {
