Index: /branches/eam_branches/ipp-20120905/dvodist/INSTALL
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/INSTALL	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/INSTALL	(revision 34609)
@@ -5,2 +5,9 @@
  psconfigure --htdocs /data/ippc17.0/www/dvodist
  make php
+
+pikake test examples:
+psconfigure --htdocs /var/www/ --rootdir /ippdata
+make ippdata
+
+psconfigure --htdocs /var/www/ --rootdir /dvodist
+make dvodist
Index: /branches/eam_branches/ipp-20120905/dvodist/Makefile.in
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/Makefile.in	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/Makefile.in	(revision 34609)
@@ -73,5 +73,5 @@
 	@if [ ! -d $(TGT-UTIL) ]; then mkdir -p $(TGT-UTIL) || exit; fi
 	rm -f $(TGT-UTIL)/$*.php || exit
-	$(GENERATE) --htdocs @HTDOCS@ $(SRC-UTIL)/$*.mkd $(TGT-UTIL)/$*.php || exit
+	$(GENERATE) --htdocs @HTDOCS@ --rootdir @ROOTDIR@ $(SRC-UTIL)/$*.mkd $(TGT-UTIL)/$*.php || exit
 
 $(TGT-UTIL)/%: $(SRC-UTIL)/%
@@ -84,5 +84,5 @@
 	@if [ ! -d $(TGT-DVODIST) ]; then mkdir -p $(TGT-DVODIST) || exit; fi
 	rm -f $(TGT-DVODIST)/$*.php || exit
-	$(GENERATE) --htdocs @HTDOCS@ $(SRC-DVODIST)/$*.mkd $(TGT-DVODIST)/$*.php || exit
+	$(GENERATE) --htdocs @HTDOCS@ --rootdir @ROOTDIR@ $(SRC-DVODIST)/$*.mkd $(TGT-DVODIST)/$*.php || exit
 
 # non-generated php code is copied directly
@@ -96,5 +96,5 @@
 	@if [ ! -d $(TGT-IPPDATA) ]; then mkdir -p $(TGT-IPPDATA) || exit; fi
 	rm -f $(TGT-IPPDATA)/$*.php || exit
-	$(GENERATE) --htdocs @HTDOCS@ $(SRC-IPPDATA)/$*.mkd $(TGT-IPPDATA)/$*.php || exit
+	$(GENERATE) --htdocs @HTDOCS@ --rootdir @ROOTDIR@ $(SRC-IPPDATA)/$*.mkd $(TGT-IPPDATA)/$*.php || exit
 
 # non-generated php code is copied directly
Index: /branches/eam_branches/ipp-20120905/dvodist/configure.tcsh
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/configure.tcsh	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/configure.tcsh	(revision 34609)
@@ -10,4 +10,5 @@
 
 set htdocs  = ""
+set rootdir = ""
 set dbhost  = ""
 set dbuser  = ""
@@ -52,4 +53,12 @@
    endif
    breaksw;
+  case --rootdir*
+   if ("$1" == "--rootdir") then
+     shift
+     set rootdir = $1
+   else
+     set rootdir = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   breaksw;
   case --dbhost*
    if ("$1" == "--dbhost") then
@@ -137,17 +146,19 @@
 
 echo
-echo "prefix: $prefix"
-echo "bindir: $bindir"
-echo "libdir: $libdir"
-echo "datadir:$datadir"
-echo "site:   $site"
-echo "htdocs: $htdocs"
-echo "dbhost: $dbhost"
-echo "dbuser: $dbuser"
-echo "dbpass: $dbpass"
-echo "DBI:    $DBI"
+echo "prefix:  $prefix"
+# echo "bindir:  $bindir"
+# echo "libdir:  $libdir"
+# echo "datadir: $datadir"
+# echo "site:    $site"
+echo "htdocs:  $htdocs"
+echo "rootdir: $rootdir"
+# echo "dbhost:  $dbhost"
+# echo "dbuser:  $dbuser"
+# echo "dbpass:  $dbpass"
+# echo "DBI:     $DBI"
 echo
 
 if ("$htdocs" == "") goto usage
+if ("$rootdir" == "") goto usage
 
 # unless we need a db interface, skip this
@@ -185,6 +196,7 @@
 if (-e Makefile) mv -f Makefile Makefile~
 cat Makefile.in | sed "s|@HTDOCS@|$htdocs|" > tmp.1
-cat tmp.1       | sed "s|@BINDIR@|$bindir|" > Makefile
-rm -f tmp.1
+cat tmp.1       | sed "s|@ROOTDIR@|$rootdir|" > tmp.2
+cat tmp.2       | sed "s|@BINDIR@|$bindir|" > Makefile
+rm -f tmp.1 tmp.2
 
 ## # convert raw/site.php.in to raw/site.php
@@ -213,9 +225,8 @@
 USAGE: configure [OPTION]
 
-set the WWW installation directory root with --htdocs
+set the internal WWW installation directory root with --htdocs
+set the external WWW installation directory root with --rootdir
 set the IPP installation directory root with --prefix
 
-set the database host, user, password with: --dbhost, --dbuser, -dbpass
- 
 either --prefix or both --bindir and --libdir and [--datadir or --site] are required
 
Index: /branches/eam_branches/ipp-20120905/dvodist/dvodist/docs.mkd
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/dvodist/docs.mkd	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/dvodist/docs.mkd	(revision 34609)
@@ -1,3 +1,3 @@
-<?php include "@HTDOCS@/www-util/ipp.page.php"; ?>
+<?php include "@HTDOCS@/www-util/dvodist.page.php"; ?>
 
 # DVO Documentation
Index: /branches/eam_branches/ipp-20120905/dvodist/dvodist/help.mkd
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/dvodist/help.mkd	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/dvodist/help.mkd	(revision 34609)
@@ -1,3 +1,3 @@
-<?php include "@HTDOCS@/www-util/ipp.page.php"; ?>
+<?php include "@HTDOCS@/www-util/dvodist.page.php"; ?>
 
 # DVO Distribution Help
Index: /branches/eam_branches/ipp-20120905/dvodist/dvodist/test.mkd
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/dvodist/test.mkd	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/dvodist/test.mkd	(revision 34609)
@@ -1,3 +1,3 @@
-<?php include "@HTDOCS@/www-util/ipp.page.php"; ?>
+<?php include "@HTDOCS@/www-util/dvodist.page.php"; ?>
 
 # DVO Distribution Help
Index: /branches/eam_branches/ipp-20120905/dvodist/ippdata/docs.mkd
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/ippdata/docs.mkd	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/ippdata/docs.mkd	(revision 34609)
@@ -1,3 +1,3 @@
-<?php include "@HTDOCS@/www-util/ipp.page.php"; ?>
+<?php include "@HTDOCS@/www-util/ippdata.page.php"; ?>
 
 # DVO Documentation
Index: /branches/eam_branches/ipp-20120905/dvodist/ippdata/help.mkd
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/ippdata/help.mkd	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/ippdata/help.mkd	(revision 34609)
@@ -1,3 +1,3 @@
-<?php include "@HTDOCS@/www-util/ipp.page.php"; ?>
+<?php include "@HTDOCS@/www-util/ippdata.page.php"; ?>
 
 # DVO Distribution Help
Index: /branches/eam_branches/ipp-20120905/dvodist/ippdata/test.mkd
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/ippdata/test.mkd	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/ippdata/test.mkd	(revision 34609)
@@ -1,3 +1,3 @@
-<?php include "@HTDOCS@/www-util/ipp.page.php"; ?>
+<?php include "@HTDOCS@/www-util/ippdata.page.php"; ?>
 
 # DVO Distribution Help
Index: /branches/eam_branches/ipp-20120905/dvodist/src/generate
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/src/generate	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/src/generate	(revision 34609)
@@ -5,4 +5,5 @@
 
 set htdocs  = ""
+set rootdir  = ""
 set args    = ""
 set VERBOSE = 0
@@ -16,4 +17,12 @@
    else
      set htdocs = `echo $1 | tr = ' ' | awk '{print $2}'`
+   endif
+   breaksw;
+  case --rootdir*
+   if ("$1" == "--rootdir") then
+     shift
+     set rootdir = $1
+   else
+     set rootdir = `echo $1 | tr = ' ' | awk '{print $2}'`
    endif
    breaksw;
@@ -36,12 +45,14 @@
 if ($VERBOSE) then
   echo
-  echo "htdocs: $htdocs"
-  echo "input : $args[1]"
-  echo "output: $args[2]"
+  echo "htdocs : $htdocs"
+  echo "rootdir: $rootdir"
+  echo "input  : $args[1]"
+  echo "output : $args[2]"
 endif
 
 if ("$htdocs" == "") goto usage
+if ("$rootdir" == "") goto usage
 
-cat $args[1] | sed "s|@HTDOCS@|$htdocs|" > $args[2]
+cat $args[1] | sed "s|@HTDOCS@|$htdocs|" | sed "s|@ROOTDIR@|$rootdir|" > $args[2]
 exit 0
 
@@ -59,9 +70,11 @@
   replace install-time options in scripts
   
-  set the WWW installation directory root with --htdocs
-  
+  set the WWW installation directory root with --htdocs (top on server)
+  set the WWW top-level directory with --rootdir (top seen by client)
+    
   switches:
     -h, --help              display this help and exit
-    --htdocs (required)     set the top-level directory
+    --htdocs (required)     set the top-level directory (internal)
+    --rootdir (required)    set the top-level directory (external)
 
 EOF
Index: /branches/eam_branches/ipp-20120905/dvodist/www-util/dvodist.page.mkd
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/www-util/dvodist.page.mkd	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/www-util/dvodist.page.mkd	(revision 34609)
@@ -14,5 +14,5 @@
   $rootdir = "";
  } else {
-  $rootdir = "/dvodist/dvodist";
+  $rootdir = "@ROOTDIR@";
  }
 
Index: /branches/eam_branches/ipp-20120905/dvodist/www-util/ipp.php
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/www-util/ipp.php	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/www-util/ipp.php	(revision 34609)
@@ -1,6 +1,5 @@
 <?php
 
-global $realroot;
-$realroot = "/dvodist";
+global $rootdir;
 
 function head ($title) {
@@ -77,9 +76,9 @@
     } 
 
-    global $realroot;
+    global $rootdir;
 
     // hi-lite the current page (use select-style, not style)
     $thisname = $_SERVER[SCRIPT_NAME]; 
-    $page = $realroot . $base;
+    $page = $rootdir . $base;
     if ($page == $thisname) {
       $style = trim($line[1]);
@@ -121,4 +120,6 @@
 
 function dirlist ($source) {
+  if (!file_exists($source)) return;
+
   $file = fopen ($source, "r");
   echo "<table class=\"dirlist\">\n";
@@ -139,10 +140,26 @@
     // }
 
-    if (count($line) != 4) continue;
-
-    $name  = trim($line[0]);
-    $type  = trim($line[1]);
-    $style = trim($line[2]);
-    $info  = trim($line[3]);
+    if ((count($line) != 4) && (count($line) != 5)) continue;
+
+    // support both the old and new style tables:
+    // old: name | type | style | info
+    // new: name | link | type | style | info
+
+    if (count($line) == 4) {
+      echo "count = 4<br>\n";
+      $name  = trim($line[0]);
+      $type  = trim($line[1]);
+      $style = trim($line[2]);
+      $info  = trim($line[3]);
+      $link  = $name;
+    }
+    if (count($line) == 5) {
+      echo "count = 5<br>\n";
+      $name  = trim($line[0]);
+      $link  = trim($line[1]);
+      $type  = trim($line[2]);
+      $style = trim($line[3]);
+      $info  = trim($line[4]);
+    }
 
     switch ($type) { 
@@ -172,10 +189,25 @@
     if (ereg ('^[:blank:]*#', $line[0])) continue;
     if (count($line) < 2) continue;
-    if (count($line) != 4) continue;
-
-    $name  = trim($line[0]);
-    $type  = trim($line[1]);
-    $style = trim($line[2]);
-    $info  = trim($line[3]);
+
+    if ((count($line) != 4) && (count($line) != 5)) continue;
+
+    // support both the old and new style tables:
+    // old: name | type | style | info
+    // new: name | link | type | style | info
+
+    if (count($line) == 4) {
+      $name  = trim($line[0]);
+      $type  = trim($line[1]);
+      $style = trim($line[2]);
+      $info  = trim($line[3]);
+      $link  = $name;
+    }
+    if (count($line) == 5) {
+      $name  = trim($line[0]);
+      $link  = trim($line[1]);
+      $type  = trim($line[2]);
+      $style = trim($line[3]);
+      $info  = trim($line[4]);
+    }
 
     switch ($type) { 
@@ -195,4 +227,6 @@
 
 function verbatim ($source) {
+  if (!file_exists($source)) return;
+
   $file = fopen ($source, "r");
 
@@ -218,4 +252,6 @@
 // lines which start with @ are processed by 'dirlist', all others are processed by Markdown
 function do_markdown ($source) {
+  if (!file_exists($source)) return;
+
   $file = fopen ($source, "r");
 
Index: /branches/eam_branches/ipp-20120905/dvodist/www-util/ippdata.page.mkd
===================================================================
--- /branches/eam_branches/ipp-20120905/dvodist/www-util/ippdata.page.mkd	(revision 34608)
+++ /branches/eam_branches/ipp-20120905/dvodist/www-util/ippdata.page.mkd	(revision 34609)
@@ -14,5 +14,5 @@
   $rootdir = "";
  } else {
-  $rootdir = "/dvodist/ippdata";
+  $rootdir = "@ROOTDIR@";
  }
 
