/[suikacvs]/messaging/newsportal/newsportal.php
Suika

Diff of /messaging/newsportal/newsportal.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.28 by wakaba, Sun Dec 2 01:34:45 2001 UTC revision 1.29 by wakaba, Sun Dec 2 01:58:09 2001 UTC
# Line 57  class headerType { Line 57  class headerType {
57    var $isAnswer;    var $isAnswer;
58    var $username;    var $username;
59    var $user_agent;    var $user_agent;
60      var $field;
61    var $isReply;    var $isReply;
62  }  }
63    
# Line 479  function parse_header($hdr,$number="") { Line 480  function parse_header($hdr,$number="") {
480    $header = new headerType;    $header = new headerType;
481    $header->isAnswer=false;    $header->isAnswer=false;
482    for ($count=0;$count<count($hdr);$count++) {    for ($count=0;$count<count($hdr);$count++) {
483      $variable=substr($hdr[$count],0,strpos($hdr[$count]," "));      $variable=substr($hdr[$count],0,strpos($hdr[$count],":"));
484      $value=trim(substr($hdr[$count],strpos($hdr[$count]," ")+1));      $value=trim(substr($hdr[$count],strpos($hdr[$count],":")+1));
485        $header->field[$variable][] = $value;
486        switch (strtolower($variable)) {        switch (strtolower($variable)) {
487          case "from:":          case "from": cs
488            $fromline=address_decode(headerDecode($value),"nirgendwo");            $fromline=address_decode(headerDecode($value),"nirgendwo");
489            if (!isset($fromline[0]["host"])) $fromline[0]["host"]="";            if (!isset($fromline[0]["host"])) $fromline[0]["host"]="";
490            $header->from=$fromline[0]["mailbox"]."@".$fromline[0]["host"];            $header->from=$fromline[0]["mailbox"]."@".$fromline[0]["host"];
# Line 493  function parse_header($hdr,$number="") { Line 495  function parse_header($hdr,$number="") {
495              $header->name=$fromline[0]["personal"];              $header->name=$fromline[0]["personal"];
496            }            }
497            break;            break;
498          case "message-id:":          case "message-id":
499            $header->id=$value;            $header->id=$value;
500            break;            break;
501          case "subject:":          case "subject":
502            $header->subject = decode_unstructured_body($value);            $header->subject = decode_unstructured_body($value);
503            break;            break;
504          case "newsgroups:":          case "newsgroups":
505            $header->newsgroups=$value;            $header->newsgroups=$value;
506            break;            break;
507          case "organization:":          case "organization":
508            $header->organization = decode_unstructured_body($value);            $header->organization = decode_unstructured_body($value);
509            break;            break;
510          case "content-transfer-encoding:":          case "content-transfer-encoding":
511            $header->content_transfer_encoding=trim(strtolower($value));            $header->content_transfer_encoding=trim(strtolower($value));
512            break;            break;
513          case "content-type:":          case "content-type":
514            $header->content_type=array();            $header->content_type=array();
515            $subheader=split(";",$value);            $subheader=split(";",$value);
516            $header->content_type[0]=strtolower(trim($subheader[0]));            $header->content_type[0]=strtolower(trim($subheader[0]));
# Line 533  function parse_header($hdr,$number="") { Line 535  function parse_header($hdr,$number="") {
535              }              }
536            }            }
537            break;            break;
538          case "references:":          case "references":
539            $ref=ereg_replace("> *<", "> <", trim($value));            $ref=ereg_replace("> *<", "> <", trim($value));
540            while (strpos($ref,"> <") != false) {            while (strpos($ref,"> <") != false) {
541              $header->references[]=substr($ref,0,strpos($ref," "));              $header->references[]=substr($ref,0,strpos($ref," "));
# Line 541  function parse_header($hdr,$number="") { Line 543  function parse_header($hdr,$number="") {
543            }            }
544            $header->references[]=trim($ref);            $header->references[]=trim($ref);
545            break;            break;
546          case "date:":          case "date":
547            $header->date=getTimestamp(trim($value));            $header->date=getTimestamp(trim($value));
548            break;            break;
549          case "followup-to:":          case "followup-to":
550            $header->followup=trim($value);            $header->followup=trim($value);
551            break;            break;
552          case "x-newsreader:":          case "x-newsreader":
553          case "x-mailer:":          case "x-mailer":
554          case "user-agent:":          case "user-agent":
555            $header->user_agent= decode_structured_body($value);            $header->user_agent= decode_structured_body($value);
556            break;            break;
         case "x-moe:":  
           $header->x_moe= decode_structured_body($value);  
           break;  
         case "x-face:":  
 //          echo "<p>-".base64_decode($value)."-</p>";  
           break;  
557        }        }
558    }    }
559    if (!isset($header->content_type[0]))    if (!isset($header->content_type[0]))
# Line 1537  function show_header($head,$group) { Line 1533  function show_header($head,$group) {
1533        echo "<!-- User-Agent: ".htmlspecialchars($head->user_agent)." -->\n";        echo "<!-- User-Agent: ".htmlspecialchars($head->user_agent)." -->\n";
1534      }      }
1535    }    }
1536    if (isset($head->x_moe)) {    if (isset($head->field["x-moe"])) {
1537      if ((isset($article_show["X-Moe"])) && ($article_show["X-Moe"])) {      if ((isset($article_show["X-Moe"])) && ($article_show["X-Moe"])) {
1538        echo "<span class=\"field x-moe\"><span class=\"name\">".$text_header["X-Moe"]        echo "<span class=\"field x-moe\"><span class=\"name\">".$text_header["X-Moe"]
1539            ."</span> <span class=\"body\">"            ."</span> <span class=\"body\">"
1540            .htmlspecialchars($head->x_moe)."</span>\n";            .htmlspecialchars(decode_structured_body(
1541                                  join(', ', $head->field["x-moe"])))
1542              ."</span>\n";
1543      }      }
1544    }    }
1545    if ((isset($attachment_show)) && ($attachment_show==true) &&    if ((isset($attachment_show)) && ($attachment_show==true) &&

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24