Diff for /cdn/www/annotate.html between versions 1.5 and 1.18

version 1.5, 2003/03/23 17:42:48 version 1.18, 2003/03/23 19:45:26
Line 1 Line 1
 <?php  <?php
   
 $author = 'tsetse@chrisneale.co.uk';  
 $post_to_list = 0;  
   
 // $Id$  // $Id$
   
 function cleanse ($message, $name = false) {  function cleanse ($message, $name = false) {
   
 // censor before sending to author/NG  // censor before sending to author/NG
   
    if ( ! $name )     if ( ! $name )
    {     {
      $message = str_replace("\r\n", "[r[n ", $message); // kludge around       $message = str_replace("\r\n", "[r[n ", $message); // kludge around
    }     }
   
    $message = ' ' . $message;     $message = ' ' . $message;
    $replacements = array('"', "'", '*', '#', '&', '$', '', '?', '%', '@', '+', 'X', 'x', );     $replacements = array('"', "'", '*', '#', '&', '$', '', '?', '%', '@', '+', 'X', 'x', );
    srand ((float)microtime()*1000000);     srand ((float)microtime()*1000000);
    shuffle($replacements);     shuffle($replacements);
   
    $cursed = array("m[0ou]th[3e]r[\ ]?f[cu]+[c]?k[3e]r",     $cursed = array("m[0ou]th[3e]r[\ ]?f[cu]+[c]?k[3e]r",
                    "f[\ \.]*[cu]+[\ \.]*[c]?[\ \.]*k",                     "f[\ \.]*[cu]+[\ \.]*[c]?[\ \.]*k",
                    "[4a]+[5s$]+[5s$]hole",                     "[4a]+[5s$]+[5s$]hole",
Line 36  function cleanse ($message, $name = fals Line 33  function cleanse ($message, $name = fals
   
   for ($i=0; $cursed[$i] != ''; $i++) {    for ($i=0; $cursed[$i] != ''; $i++) {
     // whitespace, however currently turns '\n' to ' '      // whitespace, however currently turns '\n' to ' '
    $cursed[$i] = '[\ ]+' . $cursed[$i];     $cursed[$i] = '[\ ]+' . $cursed[$i];
     shuffle($replacements);      shuffle($replacements);
    $repstring = $replacements[0] . $replacements[2] . $replacements[5] .     $repstring = $replacements[0] . $replacements[2] . $replacements[5] .
                  $replacements[1] . $replacements[3];                   $replacements[1] . $replacements[3];
   
     if ($i == 0)      if ($i == 0)
Line 60  function cleanse ($message, $name = fals Line 57  function cleanse ($message, $name = fals
     $message = str_replace("[r[n ", "\r\n", $message); // losing \r\n to [\ ] or [[:space:]]      $message = str_replace("[r[n ", "\r\n", $message); // losing \r\n to [\ ] or [[:space:]]
   
   }    }
  
   return $message;    return $message;
   
 }  }
Line 90  function findBugs($text) Line 87  function findBugs($text)
   
 function slash($_page)  function slash($_page)
 {  {
  
// if no leading slash - add one  // if no leading slash - add one
   
   if ( !ereg('^/', $_page) )    if ( !ereg('^/', $_page) )
   {    {
Line 128  function findLinks($text) Line 125  function findLinks($text)
   
 // find and 'linkify' links  // find and 'linkify' links
   
  $text    = eregi_replace("((http|https|ftp):\/\/[^[:space:]<>]{1,})",   $text    = eregi_replace("((http|https|ftp):\/\/[^[:space:]<>]{1,})",
                            "<a href=\"\\1\">\\1</a>",$text);                             "<a href=\"\\1\">\\1</a>",$text);
 /*  /*
   
Line 140  $regExp = "^[\+\&_\.0-9a-z-]+@([0-9a-z]+ Line 137  $regExp = "^[\+\&_\.0-9a-z-]+@([0-9a-z]+
   
 */  */
   
  $text    = eregi_replace("(mailto:[^[:space:]<>]{1,})",   $text    = eregi_replace("(mailto:[^[:space:]<>]{1,})",
                            "<a href=\"\\1\">\\1</a>",$text);                             "<a href=\"\\1\">\\1</a>",$text);
   
 // tidy email references  // tidy email references
   $text = str_replace('>mailto:', '>', $text);    $text = str_replace('>mailto:', '>', $text);
  
   return $text;    return $text;
   
 }  }
Line 154  $regExp = "^[\+\&_\.0-9a-z-]+@([0-9a-z]+ Line 151  $regExp = "^[\+\&_\.0-9a-z-]+@([0-9a-z]+
 function htmlise($text)  function htmlise($text)
 {  {
   
  $text = htmlspecialchars(str_replace("\\", "", $text));    $text = htmlspecialchars(str_replace("\\", "", $text));
   
   $text = findLinks($text);    $text = findLinks($text);
   
Line 165  function htmlise($text) Line 162  function htmlise($text)
   $text = ereg_replace("\r\n\r\n", "\n<p/>", $text);    $text = ereg_replace("\r\n\r\n", "\n<p/>", $text);
   
   $text = ereg_replace("\r\n", "\n<br/>", $text);    $text = ereg_replace("\r\n", "\n<br/>", $text);
  
   
   return $text;    return $text;
 }  }
  
 ?><!-- ********************* START NOTES ******************** -->  ?><!-- ********************* START NOTES ******************** -->
   
 <div id="NOTESheader"><a name="NOTES"><strong>User Notes:</strong></a> <a href="http://<?php echo HOST; ?>/docs/notes.html">[?]</a></div>  <div id="NOTESheader"><a name="NOTES"><strong>User Notes:</strong></a> <a href="http://<?php echo HOST; ?>/docs/notes.html">[?]</a></div>
Line 177  function htmlise($text) Line 174  function htmlise($text)
 <div id="NOTESnotes"><acronym class="cdn" title="HyperText Markup Language">HTML</acronym> is not allowed in posts.<br/>  <div id="NOTESnotes"><acronym class="cdn" title="HyperText Markup Language">HTML</acronym> is not allowed in posts.<br/>
 <acronym class="cdn" title="Uniform Resource Locator">URL</acronym>s in the text that use mailto:, https://, http:// and ftp:// will be converted into hyperlinks.</div>  <acronym class="cdn" title="Uniform Resource Locator">URL</acronym>s in the text that use mailto:, https://, http:// and ftp:// will be converted into hyperlinks.</div>
   
<p id="NOTESdisclaimer">If you do not get a response to a question posted in this forum, please try sending a message to the project's <a href="http://www.<?php echo HOST; ?>/mailman/listinfo/<?php echo PROJECT_DIR; <p id="NOTESdisclaimer">If you do not get a response to a question posted in this forum, please try sending a message to the project's <a href="http://www.<?php echo HOST; ?>/mailman/listinfo/<?php echo PROJECT_DIR;
 ?>">mailing list</a> or to the <a href="http://www.<?php echo HOST; ?>/contact.html">project owner</a> directly.</p>  ?>">mailing list</a> or to the <a href="http://www.<?php echo HOST; ?>/contact.html">project owner</a> directly.</p>
   
 <p />  <p />
Line 217  if ( $_POST['message'] && $_POST['name'] Line 214  if ( $_POST['message'] && $_POST['name']
           $file = implode('', file($readfile));            $file = implode('', file($readfile));
         }          }
   
            $_NOTES = explode('NOTE-date', $file);
   
         // count NOTEheader instances in file          // count NOTEheader instances in file
         $noOfNotes = substr_count($file, 'NOTEheader');         $noOfNotes = count($_NOTES);
   
         // find the last #n entry ...          // find the last #n entry ...
         $_Notes_ = strrpos($file, THIS_PAGE + strlen(THIS_PAGE));         $_Notes_ = strrpos($_NOTES[$noOfNotes-1], THIS_PAGE - strlen(THIS_PAGE));
   
          $NOTE_date_ = substr($file, $_Notes_);           $NOTE_date_ = substr($file, $_Notes_);
         $NOTE_date = substr($file, strpos($NOTE_date_, '['), strpos($NOTE_date_, ']'));         $NOTE_date_ = substr($file, strpos($NOTE_date_, '[') + 1, strpos($NOTE_date_, ']'));
   
         // increment count          // increment count
        // $NOTE_date = $noOfNotes + 1;         $NOTE_date = intval($NOTE_date_) + 1;
         $NOTE_date = (int)$NOTE_date; // + 1;
          $message .= "\ns" . $NOTE_date_ . ' i' . intval($NOTE_date_);
   
          $author_prepend .= THIS_PAGE . $NOTE_date;           $author_prepend .= THIS_PAGE . $NOTE_date;
   
Line 241  if ( $_POST['message'] && $_POST['name'] Line 241  if ( $_POST['message'] && $_POST['name']
   
           if ( isset($author) )            if ( isset($author) )
           {            {
            $extra = 'Bcc: ' . base64_decode($author) . "\n";            $extra = 'Bcc: ' . base64_decode($_POST['author']) . "\n";
           }            }
         }          }
         elseif ( isset($author) )          elseif ( isset($author) )
         {          {
          $mailto = base64_decode($author);          $mailto = base64_decode($_POST['author']);
         }          }
   
   

Removed from v.1.5  
changed lines
  Added in v.1.18


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>