]> i-scream Git - www.i-scream.org.git/blobdiff - cgi-bin/docs.cgi
Urg - now the image is generated using SSI the things that include the
[www.i-scream.org.git] / cgi-bin / docs.cgi
index bdcd3f9721a02bd3b757ddde93c58248f82bf44a..ee22b7b9ed4c8f05aeda8a797f03484ec286a06c 100755 (executable)
@@ -98,7 +98,7 @@ END
 exit 0;
 
 # Print a file, whilst escaping HTML: -
-sub print_file ($) {
+sub print_file {
 my ($urls) = '(' . join ('|', qw{
               http
               telnet
@@ -109,32 +109,41 @@ my ($urls) = '(' . join ('|', qw{
               } )
           . ')';
 
-my ($ltrs) = '\w';
-my ($gunk) = '/#~:.?+=&%@!\-';
-my ($punc) = '.:?\-';
-my ($any) = "${ltrs}${gunk}${punc}";
-my ($filename) = @_;
-if(open(FILE, $filename)) {
-    print "          <pre>\n";
-    # Use $_ implicitly throughout.
-    while (<FILE>) {
-        # Must do the next line first!
-        s/&/&amp;/g;
-        s/</&lt;/g;
-        s/>/&gt;/g;
-        s/"/&quot;/g;
-        s/\b($urls:[$any]+?)(?=[$punc]*[^$any]|$)/<a href="$1">$1<\/a>/igox;
-        print;
+    my ($ltrs) = '\w';
+    my ($gunk) = '/#~:.?+=&%@!\-';
+    my ($punc) = '.:?\-';
+    my ($any) = "${ltrs}${gunk}${punc}";
+    my ($filename) = @_;
+    if(open(FILE, $filename)) {
+        print "          <pre>\n";
+        # Use $_ implicitly throughout.
+        while (<FILE>) {
+            # Must do the next line first!
+            s/&/&amp;/g;
+            s/</&lt;/g;
+            s/>/&gt;/g;
+            s/"/&quot;/g;
+            s/\b($urls:[$any]+?)(?=[$punc]*[^$any]|$)/<a href="$1">$1<\/a>/igox;
+            print;
+        }
+        print "\n</pre>";
+    }
+    else {
+        print "Failed to open $docname.";
     }
-    print "\n</pre>";
-}
-else {
-    print "Failed to open $docname.";
-}
 }
 
-# Print a file without escaping HTML: -
+# Print the contents of a file containing html
 sub print_html ($) {
-my ($filename) = @_;
-print `cat $filename 2>&1`;
+    my ($filename) = @_;
+    my($virtual) = '<!--#include virtual="/cgi-bin/logo.cgi" -->';
+    my(@virtualresponse) = `/web/i-scream/nwww.cgi-bin/logo.cgi`;
+    open(FILE, $filename);
+    while(<FILE>) {
+        if(/$virtual/) {
+            s/$virtual/$virtualresponse[@virtualresponse-1]/;
+        }
+        print;
+    }
+    close FILE;
 }