diff -NurpP --minimal tavi-0.25/action/latex.php tavi-0.25-patched/action/latex.php
--- tavi-0.25/action/latex.php	Sun Apr 27 20:23:01 2003
+++ tavi-0.25-patched/action/latex.php	Sat Dec 27 23:35:03 2003
@@ -42,6 +42,8 @@ function action_latex()
 $DisplayEngine = array(
                    'bold_start'   => 'latex_bold_start',
                    'bold_end'     => 'latex_bold_end',
+                   'small_start'  => 'latex_small_start',
+                   'small_end'    => 'latex_small_end',
                    'italic_start' => 'latex_italic_start',
                    'italic_end'   => 'latex_italic_end',
                    'tt_start'     => 'latex_tt_start',
diff -NurpP --minimal tavi-0.25/action/save.php tavi-0.25-patched/action/save.php
--- tavi-0.25/action/save.php	Tue Dec 16 15:23:08 2003
+++ tavi-0.25-patched/action/save.php	Sat Dec 27 23:35:03 2003
@@ -11,6 +11,7 @@ function action_save()
   global $pagestore, $comment, $categories, $archive;
   global $Save, $page, $document, $nextver, $REMOTE_ADDR;
   global $MaxPostLen, $UserName, $SaveMacroEngine;
+  global $SendMailTo, $ScriptBase, $WikiName;
 
   if(empty($Save))                      // Didn't click the save button.
   {
@@ -50,10 +51,24 @@ function action_save()
   $comment = str_replace("'", "\\'", $comment);
 
   $pg->text = $esc_doc;
-  $pg->hostname = gethostbyaddr($REMOTE_ADDR);
+  $HostName = gethostbyaddr($REMOTE_ADDR);
+  $pg->hostname = $HostName;
   $pg->username = $UserName;
   $pg->comment  = $comment;
 
+
+  $purl=sprintf("$ScriptBase?page=%s", urlencode($page));
+  $msg=sprintf("Just for your information,\n\n".
+	       "%s %s the page titled '%s'\n".
+	       "[%s]\nComment: %s\n\nenjoy,\n%s\n",
+                ($UserName)?$UserName:"Somebody [$HostName]",
+		($pg->exists)?"changed":"created",
+		$page, $purl, $comment, "Herbert");
+  $mtitle=sprintf("[wiki] Page '%s' was %s.", $page, ($pg->exists)?"changed":"created");
+  $headers = "From: \"$WikiName Wiki\" <wiki@13thfloor.at>\n";
+  $headers .= "Reply-To: Wiki <wiki@13thfloor.at>\n";
+  $ret = mail($SendMailTo, $mtitle, $msg, $headers);
+
   if($pg->exists)
     { $pg->version++; }
   else
diff -NurpP --minimal tavi-0.25/install/.htaccess tavi-0.25-patched/install/.htaccess
--- tavi-0.25/install/.htaccess	Wed Dec 31 19:00:00 1969
+++ tavi-0.25-patched/install/.htaccess	Sat Dec 27 23:35:03 2003
@@ -0,0 +1,3 @@
+
+php_value include_path ".:/var/www/tavi-current"
+
diff -NurpP --minimal tavi-0.25/lib/defaults.php tavi-0.25-patched/lib/defaults.php
--- tavi-0.25/lib/defaults.php	Tue Dec  2 17:33:14 2003
+++ tavi-0.25-patched/lib/defaults.php	Fri Jan 16 20:02:01 2004
@@ -22,11 +22,11 @@ $LinkPtn = $UpperPtn . $AlphaPtn . '*' .
            $UpperPtn . $AlphaPtn . '*(?:(?:\\/' . $UpperPtn . $AlphaPtn . '*)+)?';
 
 // $UrlPtn establishes the format for URLs in this wiki.
-$UrlPtn  = "(?:https?:|mailto:|ftp:|gopher:|news:|file:)" .
+$UrlPtn  = "(?:http:|mailto:|ftp:|gopher:|news:|file:)" .
            "(?:[^ |\\/\"\']*\\/)*[^ |\\t\\n\\/\"\']*[A-Za-z0-9\\/?=&~_]";
 
 // $InterWikiPtn establishes the format for InterWiki links in this wiki.
-$InterwikiPtn = "([A-Za-z0-9]+):" .
+$InterwikiPtn = "([A-Za-z0-9]+):\\/\\/" .
                 "((?:[^ |\\/\"\']*\\/)*[^ |\\t\\n\\/\"\']*[\\/=&~A-Za-z0-9])";
 // Note: To avoid side effect of using parentheses in both $LinkPtn, $UrlPtn and
 //       $InterwikiPtn the special syntax (?: is used. This hides the parentheses
@@ -180,6 +180,7 @@ $ParseEngine = array(
                  'parse_wikiname',
                  'parse_textenhance',
                  'parse_bold',
+                 'parse_small',
                  'parse_italic',
                  'parse_teletype',
                  'parse_heading',
@@ -208,6 +209,7 @@ $DiffEngine = array(
                 'parse_wikiname',
                 'parse_textenhance',
                 'parse_bold',
+                'parse_small',
                 'parse_italic',
                 'parse_teletype',
                 'parse_newline',
@@ -219,6 +221,8 @@ $DiffEngine = array(
 $DisplayEngine = array(
                    'bold_start'   => 'html_bold_start',
                    'bold_end'     => 'html_bold_end',
+                   'small_start'  => 'html_small_start',
+                   'small_end'    => 'html_small_end',
                    'italic_start' => 'html_italic_start',
                    'italic_end'   => 'html_italic_end',
                    'superscript_start' => 'html_superscript_start', 
@@ -283,7 +287,9 @@ $ViewMacroEngine = array(
                      'TitleSearch'   => 'view_macro_titlesearch',
                      'PageLinks'     => 'view_macro_outlinks',
                      'PageRefs'      => 'view_macro_refs',
-                     'RefList'       => 'view_macro_reflist'
+                     'RefList'       => 'view_macro_reflist',
+		     'RecentChanges' => 'view_macro_changes',
+		     'RecentlyAdded' => 'view_macro_additions'
                    );
 
 // $SaveMacroEngine determines what save macros will be called after a
@@ -293,4 +299,4 @@ $SaveMacroEngine = array(
                      'parse_define_sisterwiki',
                      'parse_define_links'
                    );
-?>
\ No newline at end of file
+?>
diff -NurpP --minimal tavi-0.25/parse/html.php tavi-0.25-patched/parse/html.php
--- tavi-0.25/parse/html.php	Tue Dec 16 15:25:01 2003
+++ tavi-0.25-patched/parse/html.php	Sat Dec 27 23:35:03 2003
@@ -10,6 +10,10 @@ function html_bold_start()
   { return '<strong>'; }
 function html_bold_end()
   { return '</strong>'; }
+function html_small_start()
+  { return '<small>'; }
+function html_small_end()
+  { return '</small>'; }
 function html_italic_start()
   { return '<em>'; }
 function html_italic_end()
@@ -353,7 +357,8 @@ function html_toolbar_top($path)
   return html_ref($HomePage, $HomePage) . ' | ' .
          html_ref(PARSE_RecentChanges, PARSE_RecentChanges) . ' | ' .
          (($path!="")? html_parents_top($path) . ' | ' : '') .
-         '<a href="' . $PrefsScript . '">Preferences</a>';
+         '<a href="' . $PrefsScript . '">Preferences</a>' . ' | ' .
+	 '<a href="http://tavi.sourceforge.net/FormattingRules">FormattingRules</a>';
 }
 function html_history_entry($page, $version, $time, $host, $user, $c1, $c2,
                             $comment)
@@ -457,4 +462,4 @@ function html_reflist() 
     { return ""; }
 
 }
-?>
\ No newline at end of file
+?>
diff -NurpP --minimal tavi-0.25/parse/latex.php tavi-0.25-patched/parse/latex.php
--- tavi-0.25/parse/latex.php	Tue Dec 16 15:25:01 2003
+++ tavi-0.25-patched/parse/latex.php	Sat Dec 27 23:35:03 2003
@@ -15,6 +15,10 @@ function latex_bold_start()
   { return '\textbf{'; }
 function latex_bold_end()
   { return '}'; }
+function latex_small_start()
+  { return '\small{'; }
+function latex_small_end()
+  { return '}'; }
 function latex_italic_start()
   { return '\textit{'; }
 function latex_italic_end()
diff -NurpP --minimal tavi-0.25/parse/macros.php tavi-0.25-patched/parse/macros.php
--- tavi-0.25/parse/macros.php	Tue Dec 16 15:25:01 2003
+++ tavi-0.25-patched/parse/macros.php	Sat Dec 27 23:35:03 2003
@@ -447,4 +447,84 @@ function view_macro_reflist($args) 
 {
   return parse_elements(new_entity(array("reflist", $args)));
 }
+
+// Prepare a list of recent changes.
+function view_macro_changes()
+{
+  global $pagestore, $LkTbl, $PgTbl, $MinEntries, $DayLimit;
+
+  $text = '';
+  $first = 1;
+
+  $q1 = $pagestore->dbh->query("SELECT p1.title, p2.time, p2.username, p2.author " .
+    	    	    	       "FROM $PgTbl AS p1 LEFT JOIN $PgTbl AS p2 " .
+			       "ON p1.supercede = p2.time " .
+			       "WHERE p1.supercede > p1.time " .
+	  (($DayLimit == 0)?"":"AND p2.time > subdate(now(), INTERVAL $DayLimit day) ") .
+			       "ORDER BY p2.time");
+
+  while(($result = $pagestore->dbh->result($q1)))
+  {
+    if(!$first)                         // Don't prepend newline to first one.
+      { $text = $text . "\n"; }
+    else
+      { $first = 0; }
+
+    $title = $result[0];
+    $max_len = 32;
+    
+    if(strlen($title) > $max_len)
+    { 
+    	$title = substr($title, 0, $max_len - 3) . "..."; 
+    	$spacer = "";
+    }
+    else
+      { $spacer = str_repeat (" ", $max_len - strlen($title)); }
+    $text = $text . html_timestamp($result[1]) . " " .
+    	html_ref($result[0], $title) . $spacer . " " .
+	(($result[2]) ? $result[2] : "(" . $result[3] . ")");
+  }
+
+  return html_code($text);
+}
+
+// Prepare a list of pages recently added.
+function view_macro_additions()
+{
+  global $pagestore, $LkTbl, $PgTbl, $MinEntries, $DayLimit;
+
+  $text = '';
+  $first = 1;
+
+  $q1 = $pagestore->dbh->query("SELECT title, time, username, author " .
+    	    	    	       "FROM $PgTbl " . 
+			       "GROUP BY title ".
+	  (($DayLimit == 0)?"":"HAVING min(time) > subdate(now(), INTERVAL $DayLimit day) ") .
+			       "ORDER BY time");
+  
+  while(($result = $pagestore->dbh->result($q1)))
+  {
+    if(!$first)                         // Don't prepend newline to first one.
+      { $text = $text . "\n"; }
+    else
+      { $first = 0; }
+
+    $title = $result[0];
+    $max_len = 32;
+    
+    if(strlen($title) > $max_len)
+    { 
+    	$title = substr($title, 0, $max_len - 3) . "..."; 
+    	$spacer = "";
+    }
+    else
+      { $spacer = str_repeat (" ", $max_len - strlen($title)); }
+    $text = $text . html_timestamp($result[1]) . " " .
+    	html_ref($result[0], $title) . $spacer . " " .
+	(($result[2]) ? $result[2] : "(" . $result[3] . ")");
+  }
+
+  return html_code($text);
+}
+
 ?>
diff -NurpP --minimal tavi-0.25/parse/transforms.php tavi-0.25-patched/parse/transforms.php
--- tavi-0.25/parse/transforms.php	Tue Dec  2 17:20:16 2003
+++ tavi-0.25-patched/parse/transforms.php	Fri Jan 16 19:58:28 2004
@@ -169,7 +169,9 @@ function freelink_token($link, $appearan
 
 function parse_interwiki($text)
 {
-  global $InterwikiPtn;
+  global $InterwikiPtn,$EnableInterWikiLinks;
+
+  if(!$EnableInterWikiLinks) { return $text; }
 
   return preg_replace("/(^|[^A-Za-z])($InterwikiPtn)(?=\$|[^\\/=&~A-Za-z0-9])/e",
                       "q1('\\1').interwiki_token(q1('\\3'),q1('\\4')).q1('\\5')",
@@ -190,9 +192,10 @@ function interwiki_token($prefix, $ref)
 
 function parse_hyperlink_ref($text)
 {
-  global $UrlPtn,$InterwikiPtn;
+  global $UrlPtn,$InterwikiPtn,$EnableInterWikiLinks;
 
-  return preg_replace("/\\[($UrlPtn|$InterwikiPtn)]/Ue",
+  $Ptn = ($EnableInterWikiLinks)?"$UrlPtn|$InterwikiPtn":"$UrlPtn";
+  return preg_replace("/\\[($Ptn)]/Ue",
                       "url_token(q1('\\1'), '')", $text, -1);
 }
 function image_search($text) 
@@ -205,17 +208,20 @@ function image_search($text) 
 }
 function parse_hyperlink_description($text)
 {
-  global $UrlPtn, $InterwikiPtn;
-  return preg_replace("/\\[($UrlPtn|$InterwikiPtn) ([^]]+)]/e",
+  global $UrlPtn,$InterwikiPtn,$EnableInterWikiLinks;
+
+  $Ptn = ($EnableInterWikiLinks)?"$UrlPtn|$InterwikiPtn":"$UrlPtn";
+  return preg_replace("/\\[($Ptn) ([^]]+)]/e",
                       "url_token(q1('\\1'),image_search('\\4'))", 
                       $text, -1);
 }
 
 function parse_hyperlink($text)
 {
-  global $UrlPtn, $InterwikiPtn;
+  global $UrlPtn,$InterwikiPtn,$EnableInterWikiLinks;
 
-  return preg_replace("/(^|[^A-Za-z])($UrlPtn|$InterwikiPtn)(?=\$|[^\\/?=&~A-Za-z0-9])/e",
+  $Ptn = ($EnableInterWikiLinks)?"$UrlPtn|$InterwikiPtn":"$UrlPtn";
+  return preg_replace("/(^|[^A-Za-z])($Ptn)(?=\$|[^\\/?=&~A-Za-z0-9])/e",
                       "q1('\\1').url_token(q1('\\2'), q1('\\2')).q1('\\5')", $text, -1);
 }
 
@@ -358,6 +364,12 @@ function parse_italic($text)
                       $text, -1);
 }
 
+function parse_small($text)
+{
+  return preg_replace("/%%(()|[^'].*)%%/Ue", "pair_tokens('small', q1('\\1'))",
+                      $text, -1);
+}
+
 function parse_teletype($text)
 {
   return preg_replace("/{{({*?.*}*?)}}/Ue",
@@ -698,4 +710,4 @@ function parse_table($text)
 
   return $text;
 }
-?>
\ No newline at end of file
+?>
diff -NurpP --minimal tavi-0.25/template/common.php tavi-0.25-patched/template/common.php
--- tavi-0.25/template/common.php	Tue Dec 16 15:29:27 2003
+++ tavi-0.25-patched/template/common.php	Sat Dec 27 23:35:03 2003
@@ -113,6 +113,12 @@ function template_common_epilogue($args)
 
 ?>
 <div id="footer">
+<div class="copyleft"><br>
+  Permission is granted to copy, distribute and/or modify this document
+  under the terms of the <br><a href="http://www.fsf.org/licenses/fdl.txt">
+  GNU Free Documentation License</a>, Version 1.2 or any later version 
+  published by the Free Software Foundation. 
+</div>
 <hr />
 <div id="toolbar-bottom">
 <?php
@@ -160,7 +166,7 @@ function template_common_epilogue($args)
 <form method="get" action="<?php print $FindScript; ?>">
 <div class="form">
   <input type="hidden" name="action" value="find" />
-  <?php print TMPL_Search; ?> <input type="text" name="find" size="20" />
+  <br><?php print TMPL_Search; ?> <input type="text" name="find" size="20" />
 </div>
 </form>
 <?php
diff -NurpP --minimal tavi-0.25/template/wiki.css tavi-0.25-patched/template/wiki.css
--- tavi-0.25/template/wiki.css	Tue Oct 28 11:47:34 2003
+++ tavi-0.25-patched/template/wiki.css	Sat Dec 27 23:53:25 2003
@@ -29,7 +29,14 @@ td.diff-removed
   { background-color: #ffffaf;
     color:            #000000; }
 h1
-  { margin-bottom: 0; }
+  { margin-bottom: 0px; 
+    margin-top: 16px; }
+h2
+  { margin-bottom: 6px;
+    margin-top: 12px; }
+h3
+  { margin-bottom: 4px; 
+    margin-top: 8px; }
 textarea
   { width: 100%; }
 dl, ul, ol
@@ -47,7 +54,8 @@ tt
     color:      #383838; }
 pre
   { background: transparent;
-    color:      #383838; }
+    color:      #383838; 
+    margin: 0pt; padding: 0pt; }
 
 /* Used together with TitleSearch */
 ul.oneline
@@ -64,6 +72,15 @@ div#header #logo
   { float: right; }
 div#header hr
   { clear: both; }
+div.copyleft
+  { font-size: smaller; 
+    padding-top: 16pt; }
+table.tight
+  { border-spacing: 0pt; }
+table.tight td
+  { padding: 0pt 4pt; }
+tr.rule td
+  { border-bottom: 1pt solid; }
 
 /* Some php-syntax highlighting defaults */
 pre.phpsource { border-width: 1px; border-style: solid;  border-color: #000000; 
@@ -81,4 +98,4 @@ pre.phpsource { border-width: 1px; borde
  div#header #toolbar-top    { display: none; }
  div#footer #toolbar-bottom { display: none; }
  div#footer form            { display: none; }
-}
\ No newline at end of file
+}
