Index: trunk/dvodist/www-util/dvodist.page.mkd
===================================================================
--- trunk/dvodist/www-util/dvodist.page.mkd	(revision 35238)
+++ trunk/dvodist/www-util/dvodist.page.mkd	(revision 35415)
@@ -12,7 +12,7 @@
 $fromProxy = $_SERVER['HTTP_X_FORWARDED_FOR'] && ($_SERVER['REMOTE_ADDR'] == $ifaProxy);
 if ($fromProxy) {
-  $rootdir = "";
+  $rootdir = "@ROOTWWW@";
  } else {
-  $rootdir = "@ROOTDIR@";
+  $rootdir = "@ROOTWWW@@ROOTDIR@";
  }
 
@@ -20,5 +20,5 @@
 
 $script = basename($_SERVER[SCRIPT_NAME]);
-do_markdown ($script);
+do_markdown ($script, $rootdir);
 
 menu_end();
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)) {
Index: trunk/dvodist/www-util/ippdata.page.mkd
===================================================================
--- trunk/dvodist/www-util/ippdata.page.mkd	(revision 35238)
+++ trunk/dvodist/www-util/ippdata.page.mkd	(revision 35415)
@@ -7,44 +7,18 @@
 // if we come in directly, the top-level directory should be /dvodist
 // if we come in from the ippops1 proxy, we need to set the root to /
-$ifaProxy = "128.171.227.208";
+$realHost = "ipp.ifa.hawaii.edu";
 
-// is the request coming from our proxY?
-$fromProxy = $_SERVER['HTTP_X_FORWARDED_FOR'] && ($_SERVER['REMOTE_ADDR'] == $ifaProxy);
-if ($fromProxy) {
-  $rootdir = "";
- } else {
-  $rootdir = "@ROOTDIR@";
- }
+// is the request coming from our proxy?
+if ($_SERVER['SERVER_NAME'] == $realHost) {
+  $rootdir = "@ROOTWWW@";
+} else {
+  $rootdir = "@ROOTWWW@@ROOTDIR@";
+}
 
 menu("$utils/ippdata.menu.dat", 'Pan-STARRS 1 Data Distribution Server', $rootdir, "$rootdir/ipp.css", '', '');
 
 $script = basename($_SERVER[SCRIPT_NAME]);
-do_markdown ($script);
+do_markdown ($script, $rootdir);
 
 menu_end();
 ?>
-
-// generic proxy detection
-// if ( $_SERVER['HTTP_X_FORWARDED_FOR']
-//      || $_SERVER['HTTP_X_FORWARDED']
-//      || $_SERVER['HTTP_FORWARDED_FOR']
-//      || $_SERVER['HTTP_CLIENT_IP']
-//      || $_SERVER['HTTP_VIA']
-//      || in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))
-//      || @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 30))
-//   {
-//     exit('Proxy detected');
-//   }
-
-// list server info:
-// $varlist = array ('SCRIPT_NAME', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_VIA', 'REMOTE_ADDR');
-// 
-// foreach ($varlist as $name) {
-//   echo "$name : $_SERVER[$name]<br>\n";
-// }
-// 
-// echo "get list<br>\n";
-// foreach ($_GET as $key => $value) {
-//   echo "$key : $value<br>\n";
-// }
-
