Fixing more broken links.
authorMatthew Thiffault <mthiffau@csclub.uwaterloo.ca>
Wed, 11 Mar 2009 05:13:55 +0000 (01:13 -0400)
committerMatthew Thiffault <mthiffau@csclub.uwaterloo.ca>
Wed, 11 Mar 2009 05:13:55 +0000 (01:13 -0400)
directory.xml
library/index.cgi

index abf3bf2..f7e7a35 100644 (file)
@@ -8,8 +8,9 @@
  <diritem title="Office" href="office/" />
  <diritem title="Events" href="events/" />
  <diritem title="Media" href="media/" />
  <diritem title="Office" href="office/" />
  <diritem title="Events" href="events/" />
  <diritem title="Media" href="media/" />
- <diritem title="Wiki" href="http://wiki.csclub.uwaterloo.ca/" />
- <diritem title="Webmail" href="https://mail.csclub.uwaterloo.ca/" />
- <diritem title="Gallery" href="/gallery2/" />
- <diritem title="Stats" href="stats" />
+ <diritem title="Wiki" absolute="true" href="http://wiki.csclub.uwaterloo.ca/" />
+ <diritem title="Webmail" absolute="true" href="https://mail.csclub.uwaterloo.ca/" />
+ <diritem title="Gallery" absolute="true" href="/gallery2/" />
+ <diritem title="Stats" absolute="true" href="stats" />
+ <diritem title="Library" href="library/" />
 </directory>
 </directory>
index 76bd6fc..6195400 100755 (executable)
@@ -67,9 +67,12 @@ foreach $item (@items){
        chomp($fields{'href'});
        
        $fields{'title'} =~ s/"//g;
        chomp($fields{'href'});
        
        $fields{'title'} =~ s/"//g;
-       
-       print "<a class=\"diritem\" href=\"$fields{'href'}\">$fields{'title'}</a>\n";
-       
+
+       if($fields{'absolute'} =~ /true/){
+           print "<a class=\"diritem\" href=\"$fields{'href'}\">$fields{'title'}</a>\n";
+       }else{
+           print "<a class=\"diritem\" href=\"$webroot/$fields{'href'}\">$fields{'title'}</a>\n";
+       }
     }
 }
 
     }
 }
 
@@ -79,7 +82,7 @@ print "<br><br><br>\n";
 if($field{'do'} eq "home" || $field{'do'} eq ""){
 
 #isbn,title,authors,year,edition,publisher 
 if($field{'do'} eq "home" || $field{'do'} eq ""){
 
 #isbn,title,authors,year,edition,publisher 
-
+    
     print <<END;
     <center>
     <br>
     print <<END;
     <center>
     <br>