44 |
var $newsgroups; // the Newsgroups where the article belongs to |
var $newsgroups; // the Newsgroups where the article belongs to |
45 |
var $followup; |
var $followup; |
46 |
var $date; |
var $date; |
|
var $organization; |
|
47 |
var $references; |
var $references; |
48 |
var $content_transfer_encoding; |
var $content_transfer_encoding; |
49 |
var $mime_version; |
var $mime_version; |
55 |
var $answers; |
var $answers; |
56 |
var $isAnswer; |
var $isAnswer; |
57 |
var $username; |
var $username; |
58 |
var $user_agent; |
var $field; |
59 |
var $isReply; |
var $isReply; |
60 |
} |
} |
61 |
|
|
478 |
$header = new headerType; |
$header = new headerType; |
479 |
$header->isAnswer=false; |
$header->isAnswer=false; |
480 |
for ($count=0;$count<count($hdr);$count++) { |
for ($count=0;$count<count($hdr);$count++) { |
481 |
$variable=substr($hdr[$count],0,strpos($hdr[$count]," ")); |
$variable=substr($hdr[$count],0,strpos($hdr[$count],":")); |
482 |
$value=trim(substr($hdr[$count],strpos($hdr[$count]," ")+1)); |
$value=trim(substr($hdr[$count],strpos($hdr[$count],":")+1)); |
483 |
|
$header->field[strtolower($variable)][] = $value; |
484 |
switch (strtolower($variable)) { |
switch (strtolower($variable)) { |
485 |
case "from:": |
case "from": |
486 |
$fromline=address_decode(headerDecode($value),"nirgendwo"); |
$fromline=address_decode(headerDecode($value),"nirgendwo"); |
487 |
if (!isset($fromline[0]["host"])) $fromline[0]["host"]=""; |
if (!isset($fromline[0]["host"])) $fromline[0]["host"]=""; |
488 |
$header->from=$fromline[0]["mailbox"]."@".$fromline[0]["host"]; |
$header->from=$fromline[0]["mailbox"]."@".$fromline[0]["host"]; |
493 |
$header->name=$fromline[0]["personal"]; |
$header->name=$fromline[0]["personal"]; |
494 |
} |
} |
495 |
break; |
break; |
496 |
case "message-id:": |
case "message-id": |
497 |
$header->id=$value; |
$header->id=$value; |
498 |
break; |
break; |
499 |
case "subject:": |
case "subject": |
500 |
$header->subject = decode_unstructured_body($value); |
$header->subject = decode_unstructured_body($value); |
501 |
break; |
break; |
502 |
case "newsgroups:": |
case "newsgroups": |
503 |
$header->newsgroups=$value; |
$header->newsgroups=$value; |
504 |
break; |
break; |
505 |
case "organization:": |
case "content-transfer-encoding": |
|
$header->organization = decode_unstructured_body($value); |
|
|
break; |
|
|
case "content-transfer-encoding:": |
|
506 |
$header->content_transfer_encoding=trim(strtolower($value)); |
$header->content_transfer_encoding=trim(strtolower($value)); |
507 |
break; |
break; |
508 |
case "content-type:": |
case "content-type": |
509 |
$header->content_type=array(); |
$header->content_type=array(); |
510 |
$subheader=split(";",$value); |
$subheader=split(";",$value); |
511 |
$header->content_type[0]=strtolower(trim($subheader[0])); |
$header->content_type[0]=strtolower(trim($subheader[0])); |
530 |
} |
} |
531 |
} |
} |
532 |
break; |
break; |
533 |
case "references:": |
case "references": |
534 |
$ref=ereg_replace("> *<", "> <", trim($value)); |
$ref=ereg_replace("> *<", "> <", trim($value)); |
535 |
while (strpos($ref,"> <") != false) { |
while (strpos($ref,"> <") != false) { |
536 |
$header->references[]=substr($ref,0,strpos($ref," ")); |
$header->references[]=substr($ref,0,strpos($ref," ")); |
538 |
} |
} |
539 |
$header->references[]=trim($ref); |
$header->references[]=trim($ref); |
540 |
break; |
break; |
541 |
case "date:": |
case "date": |
542 |
$header->date=getTimestamp(trim($value)); |
$header->date=getTimestamp(trim($value)); |
543 |
break; |
break; |
544 |
case "followup-to:": |
case "followup-to": |
545 |
$header->followup=trim($value); |
$header->followup=trim($value); |
546 |
break; |
break; |
547 |
case "x-newsreader:": |
/* |
548 |
case "x-mailer:": |
case "x-newsreader": |
549 |
case "user-agent:": |
case "x-mailer": |
550 |
|
case "user-agent": |
551 |
$header->user_agent= decode_structured_body($value); |
$header->user_agent= decode_structured_body($value); |
552 |
break; |
break; |
553 |
case "x-moe:": |
*/ |
|
$header->x_moe= decode_structured_body($value); |
|
|
break; |
|
|
case "x-face:": |
|
|
// echo "<p>-".base64_decode($value)."-</p>"; |
|
|
break; |
|
554 |
} |
} |
555 |
} |
} |
556 |
if (!isset($header->content_type[0])) |
if (!isset($header->content_type[0])) |
1504 |
echo $text_header["newsgroups"].htmlspecialchars(str_replace(',',', ',$head->newsgroups))."<br>\n"; |
echo $text_header["newsgroups"].htmlspecialchars(str_replace(',',', ',$head->newsgroups))."<br>\n"; |
1505 |
if (isset($head->followup) && ($article_show["Followup"]) && ($head->followup != "")) |
if (isset($head->followup) && ($article_show["Followup"]) && ($head->followup != "")) |
1506 |
echo $text_header["followup"].htmlspecialchars($head->followup)."<br>\n"; |
echo $text_header["followup"].htmlspecialchars($head->followup)."<br>\n"; |
|
if ((isset($head->organization)) && ($article_show["Organization"]) && |
|
|
($head->organization != "")) |
|
|
echo $text_header["organization"]. |
|
|
html_parse(htmlspecialchars($head->organization))."<br>\n"; |
|
1507 |
if ($article_show["Date"]) |
if ($article_show["Date"]) |
1508 |
echo $text_header["date"].date($text_header["date_format"],$head->date)."<br>\n"; |
echo $text_header["date"].date($text_header["date_format"],$head->date)."<br>\n"; |
1509 |
if ($article_show["Message-ID"]) |
if ($article_show["Message-ID"]) |
1518 |
} |
} |
1519 |
echo "<br>"; |
echo "<br>"; |
1520 |
} |
} |
1521 |
if (isset($head->user_agent)) { |
$fields = array ("x-moe", "x-brother", "x-syster", "x-wife", |
1522 |
if ((isset($article_show["User-Agent"])) && |
"x-daughter", "x-respect", |
1523 |
($article_show["User-Agent"])) { |
"user-agent", "x-mailer", "x-newsreader", |
1524 |
echo $text_header["user-agent"].htmlspecialchars($head->user_agent)."<br>\n"; |
"list-id", "x-uri", "x-mail-count", "keywords"); |
1525 |
} else { |
for ($i = 0; $i < count($fields); $i++) { |
1526 |
echo "<!-- User-Agent: ".htmlspecialchars($head->user_agent)." -->\n"; |
if (count($head->field[$fields[$i]])) { |
1527 |
|
if ((isset($article_show[$fields[$i]])) && ($article_show[$fields[$i]])) { |
1528 |
|
echo "<div class=\"field ".$fields[$i]."\"><span class=\"name\">" |
1529 |
|
.$text_header[$fields[$i]]."</span> <span class=\"body\">" |
1530 |
|
.htmlspecialchars(decode_structured_body( |
1531 |
|
join(', ', $head->field[$fields[$i]]))) |
1532 |
|
."</span></div>\n"; |
1533 |
|
} |
1534 |
} |
} |
1535 |
} |
} |
1536 |
if (isset($head->x_moe)) { |
$fields = array ("x-weather", "x-copyright", "comments", "organization"); |
1537 |
if ((isset($article_show["X-Moe"])) && ($article_show["X-Moe"])) { |
for ($i = 0; $i < count($fields); $i++) { |
1538 |
echo "<span class=\"field x-moe\"><span class=\"name\">".$text_header["X-Moe"] |
if (count($head->field[$fields[$i]])) { |
1539 |
."</span> <span class=\"body\">" |
if ((isset($article_show[$fields[$i]])) && ($article_show[$fields[$i]])) { |
1540 |
.htmlspecialchars($head->x_moe)."</span>\n"; |
for ($j = 0; $j > count($head->field[$fields[$i]]); $j++) { |
1541 |
|
echo "<div class=\"field ".$fields[$i]."\"><span class=\"name\">" |
1542 |
|
.$text_header[$fields[$i]]."</span> <span class=\"body\">" |
1543 |
|
.htmlspecialchars(decode_unstructured_body( |
1544 |
|
$head->field[$fields[$i]][$j])) |
1545 |
|
."</span></div>\n"; |
1546 |
|
} |
1547 |
|
} |
1548 |
} |
} |
1549 |
} |
} |
1550 |
if ((isset($attachment_show)) && ($attachment_show==true) && |
if ((isset($attachment_show)) && ($attachment_show==true) && |
1716 |
* $body: The article itself |
* $body: The article itself |
1717 |
*/ |
*/ |
1718 |
function verschicken($subject,$from,$newsgroups,$ref,$body) { |
function verschicken($subject,$from,$newsgroups,$ref,$body) { |
1719 |
global $server,$port,$send_poster_host,$organization,$text_error; |
global $server,$port,$send_poster_host,$organization,$text_error,$text_ua; |
1720 |
global $file_footer; |
global $file_footer; |
1721 |
flush(); |
flush(); |
1722 |
$ns=OpenNNTPconnection($server,$port); |
$ns=OpenNNTPconnection($server,$port); |