3 $main_links = "/web/index.links";
4 $local_links = "index.links";
6 if (is_readable ($local_links)) {
7 $links = @file ($local_links)
8 or die ("Unable to open local links file ($local_links)");
10 $links = @file ($main_links)
11 or die ("Unable to open main links file ($main_links)");
14 print "<div id=menu>\n";
16 foreach ($links as $link) {
17 $link_desc = explode ("|", chop ($link));
18 print "<a href=\"" . $link_desc[0] . "\">" . $link_desc[1] . "</a><br>\n";
23 function search_box () {
26 <!-- Start: Search my site with Google -->
27 <form method="get" action="https://www.google.com/search" name="search">
29 <input type="text" name="q" size="15" id="q" maxlength=255 value=""
30 onclick="document.search.q.value='';">
31 <input type="hidden" name="domains" value="defaria.com">
32 <input type="hidden" name="sitesearch" value="defaria.com">
35 <!-- End: Search my site with Google -->
41 function navigation_bar ($validated = "no") {
42 print "<div class=leftbar>\n";
46 <script src="/maps/JavaScript/CheckAddress.js" type="text/javascript"></script>
47 <div id="emailsearch">
48 <form "method"=post action="javascript://" name="address" onsubmit="checkaddress(this,'andrew');">
49 <a href="/maps/doc">Can you email me?</a>
50 Type in your email address and hit enter to see.
51 <input type="text" class="searchfield" id="emailsearchfield" name="email"
52 size="18" maxlength="255" value="" onclick="document.address.email.value = '';">
59 function copyright ($start_year = "",
60 $author = "Andrew DeFaria",
61 $email = "Andrew@DeFaria.com",
64 $current_year = $today ["year"];
66 $this_file = $_SERVER['PHP_SELF'];
68 // Handle user home web pages
69 if (preg_match ("/\/\~/", $this_file)) {
70 $this_file= preg_replace ("/\/\~(\w+)\/(\s*)/", "/home/$1/web$2/", $this_file);
72 $this_file = "/web" . $this_file;
75 $mod_time = date ("F d Y @ g:i a", filemtime ($this_file));
78 <div class="copyright">
79 Last modified: $mod_time<br>
83 if ($start_year != "") {
88 $current_year - All rights reserved<br>
89 <a href="$home/"><img src="/Icons/HomeSmall.gif" alt="Home"> $author</a> <<a
90 href="mailto:$email">$email</a>>
95 function display_code ($file) {
97 or die ("Unable to open file ($file)");
99 print "<div class=code>\n<table id=listing cellspacing=0 cellpadding=2 border=0>\n";
103 foreach ($code as $line_of_code) {
104 print "<tr>\n <td align=right id=line-number><a name=line_$line_number></a>" .
105 $line_number++ . "</td>\n";
106 print " <td id=code><tt>\n";
107 for ($i = 0; $i < strlen ($line_of_code); $i++) {
108 if ($line_of_code [$i] == " ") {
110 } else if ($line_of_code [$i] == "\t") {
111 echo " ";
112 } else if ($line_of_code [$i] != "\n") {
113 echo $line_of_code [$i];
116 print "</tt></td>\n</tr>\n";
119 print "</table>\n</div>";