/[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.1.1.1 by wakaba, Sat Dec 1 11:17:31 2001 UTC revision 1.14 by wakaba, Sat Dec 1 12:55:49 2001 UTC
# Line 447  function headerDecode($value) { Line 447  function headerDecode($value) {
447      else      else
448        $newvalue=headerDecode($newvalue);  // maybe there are more encoded        $newvalue=headerDecode($newvalue);  // maybe there are more encoded
449      return(mb_convert_encoding($newvalue, "EUC-JP", "auto"));      // parts      return(mb_convert_encoding($newvalue, "EUC-JP", "auto"));      // parts
450    } else {   // there wasn't anything encoded, return the original string    } else {
451      return(mb_convert_encoding($value, "EUC-JP", "auto"));      if (eregi('".*"',$value)) {  // quoted-pair
452          $newvalue=ereg_replace('(.*)"(.*)"(.*)','\1'.decode_quoted_pair('\2').'\3',$value);
453          #$result1=ereg_replace('(.*)"(.*)"(.*)','\1',$value);
454          #$result2=ereg_replace('(.*)"(.*)"(.*)','\2',$value);
455          #$result3=ereg_replace('(.*)"(.*)"(.*)','\3',$value);
456          #$result2=ereg_replace('\\\\(.)','\1',$result2);
457          #$newvalue=$result1.'"'.$result2.'"'.$result3;
458          return(mb_convert_encoding($newvalue, "EUC-JP", "auto"));
459        } else {   // there wasn't anything encoded, return the original string
460          return(mb_convert_encoding($value, "EUC-JP", "auto"));
461        }
462    }    }
463  }  }
464    
465    function decode_quoted_pair($value) {
466          return(ereg_replace('\\\\(.)','\1',$value));
467    }
468    
469  function getTimestamp($value) {  function getTimestamp($value) {
470    $months=array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12);    $months=array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12);
471    $value=str_replace("  "," ",$value);    $value=str_replace("  "," ",$value);
# Line 754  function read_message($id,$bodynum=0,$gr Line 768  function read_message($id,$bodynum=0,$gr
768        return false;        return false;
769      $rawmessage=array();      $rawmessage=array();
770      $line=lieszeile($ns);      $line=lieszeile($ns);
771   $line=mb_convert_encoding($line, "EUC-JP", "ISO-2022-JP");   #$line=mb_convert_encoding($line, "EUC-JP", "ISO-2022-JP");
772      while(strcmp($line,".") != 0) {      while(strcmp($line,".") != 0) {
773        $rawmessage[]=$line;        $rawmessage[]=$line;
774        $line=lieszeile($ns);        $line=lieszeile($ns);
775   $line=mb_convert_encoding($line, "EUC-JP", "ISO-2022-JP");   #$line=mb_convert_encoding($line, "EUC-JP", "ISO-2022-JP");
776      }      }
777      $message=parse_message($rawmessage);      $message=parse_message($rawmessage);
778      if (ereg('^[0-9]+$',$id)) $message->header->number=$id;      if (ereg('^[0-9]+$',$id)) $message->header->number=$id;
# Line 1177  function formatTreeGraphic($newtree) { Line 1191  function formatTreeGraphic($newtree) {
1191          break;          break;
1192        }        }
1193      $return .= '" alt="'.$alt.'"';      $return .= '" alt="'.$alt.'"';
1194      if (strcmp($k,".") == 0) $return .=(' width="12" height="9"');      if (strcmp($k,".") == 0) $return .=(' style="width: 12px; height: 9px"');
1195      $return .= ' />';      $return .= '>';
1196    }    }
1197    return($return);    return($return);
1198  }  }
# Line 1256  function showThread(&$headers,&$liste,$d Line 1270  function showThread(&$headers,&$liste,$d
1270            echo "<br>\n";            echo "<br>\n";
1271            break;            break;
1272          case 1: // html-auflistung, kein baum          case 1: // html-auflistung, kein baum
1273            echo "<li><nobr>".$thread_fontPre;            echo "<li>".$thread_fontPre;
1274            if ($thread_showDate)            if ($thread_showDate)
1275              echo formatDate($c)." ";              echo formatDate($c)." ";
1276            if ($thread_showSubject)            if ($thread_showSubject)
1277              echo formatSubject($c,$group)." ";              echo formatSubject($c,$group)." ";
1278            if ($thread_showAuthor)            if ($thread_showAuthor)
1279              echo "<i>(".formatAuthor($c).")</i>";              echo "<em>(".formatAuthor($c).")</em>";
1280            echo $thread_fontPost."</nobr></li>";            echo $thread_fontPost."</li>";
1281            break;            break;
1282          case 2:   // table          case 2:   // table
1283            echo "<tr>";            echo "<tr>";
# Line 1275  function showThread(&$headers,&$liste,$d Line 1289  function showThread(&$headers,&$liste,$d
1289            }            }
1290            if ($thread_showAuthor) {            if ($thread_showAuthor) {
1291              echo "<td></td>";              echo "<td></td>";
1292              echo '<td nowrap="nowrap">'.$thread_fontPre.formatAuthor($c);              echo '<td>'.$thread_fontPre.formatAuthor($c);
1293              echo $thread_fontPost."</td>";              echo $thread_fontPost."</td>";
1294            }            }
1295            echo "</tr>\n";            echo "</tr>\n";
1296            break;            break;
1297          case 3: // html-tree          case 3: // html-tree
1298            echo "<li><nobr>".$thread_fontPre;            echo "<li>".$thread_fontPre;
1299            if ($thread_showDate)            if ($thread_showDate)
1300              echo formatDate($c)." ";              echo formatDate($c)." ";
1301            if ($thread_showSubject)            if ($thread_showSubject)
1302              echo formatSubject($c,$group)." ";              echo formatSubject($c,$group)." ";
1303            if ($thread_showAuthor)            if ($thread_showAuthor)
1304              echo "<i>(".formatAuthor($c).")</i>";              echo "<em>(".formatAuthor($c).")</em>";
1305            echo $thread_fontPost."</nobr>\n";            echo $thread_fontPost."\n";
1306            break;            break;
1307          case 4:  // thread          case 4:  // thread
1308            echo "<nobr><tt>".$thread_fontPre;            echo "".$thread_fontPre;
1309            if ($thread_showDate)            if ($thread_showDate)
1310              echo formatDate($c)." ";              echo formatDate($c)." ";
1311            echo formatTreeText($newtree)." ";            echo formatTreeText($newtree)." ";
1312            if ($thread_showSubject)            if ($thread_showSubject)
1313              echo formatSubject($c,$group)." ";              echo formatSubject($c,$group)." ";
1314            if ($thread_showAuthor)            if ($thread_showAuthor)
1315              echo "<i>(".formatAuthor($c).")</i>";              echo "<em>(".formatAuthor($c).")</em>";
1316            echo $thread_fontPost."</tt></nobr><br>";            echo $thread_fontPost."<br>";
1317            break;            break;
1318          case 5:  // thread, graphic          case 5:  // thread, graphic
1319            echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr>\n";            echo "<table><tr>\n";
1320            if ($thread_showDate)            if ($thread_showDate)
1321              echo '<td nowrap="nowrap">'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</td>";              echo '<td>'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</td>";
1322            echo "<td>".$thread_fontPre.formatTreeGraphic($newtree).$thread_fontPost."</td>";            echo "<td>".$thread_fontPre.formatTreeGraphic($newtree).$thread_fontPost."</td>";
1323            if ($thread_showSubject)            if ($thread_showSubject)
1324              echo '<td nowrap="nowrap">'.$thread_fontPre."&nbsp;".formatSubject($c,$group)." ";              echo '<td>'.$thread_fontPre."&nbsp;".formatSubject($c,$group)." ";
1325            if ($thread_showAuthor)            if ($thread_showAuthor)
1326              echo "(".formatAuthor($c).")".$thread_fontPost."</td>";              echo "(".formatAuthor($c).")".$thread_fontPost."</td>";
1327            echo "</tr></table>";            echo "</tr></table>";
# Line 1315  function showThread(&$headers,&$liste,$d Line 1329  function showThread(&$headers,&$liste,$d
1329          case 6:  // thread, table          case 6:  // thread, table
1330            echo "<tr>";            echo "<tr>";
1331            if ($thread_showDate)            if ($thread_showDate)
1332              echo '<td nowrap="nowrap"><tt>'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</tt></td>";              echo '<td>'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</td>";
1333            echo '<td nowrap="nowrap"><tt>'.$thread_fontPre.formatTreeText($newtree)." ";            echo '<td>'.$thread_fontPre.formatTreeText($newtree)." ";
1334            if ($thread_showSubject) {            if ($thread_showSubject) {
1335              echo formatSubject($c,$group).$thread_fontPost."</tt></td>";              echo formatSubject($c,$group).$thread_fontPost."</td>";
1336              echo "<td></td>";              echo "<td></td>";
1337            }            }
1338            if ($thread_showAuthor)            if ($thread_showAuthor)
1339              echo '<td nowrap="nowrap"><tt>'.$thread_fontPre.formatAuthor($c).$thread_fontPost."</tt></td>";              echo '<td>'.$thread_fontPre.formatAuthor($c).$thread_fontPost."</td>";
1340            echo "</tr>";            echo "</tr>";
1341            break;            break;
1342          case 7:  // thread, table, graphic          case 7:  // thread, table, graphic
1343            echo "<tr>";            echo "<tr>";
1344            if ($thread_showDate)            if ($thread_showDate)
1345              echo '<td nowrap="nowrap">'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</td>";              echo '<td>'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</td>";
1346            echo "<td><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";            echo "<td><table>\n";
1347            echo "<td>".formatTreeGraphic($newtree)."</td>";            echo "<td>".formatTreeGraphic($newtree)."</td>";
1348            if ($thread_showSubject)            if ($thread_showSubject)
1349              echo '<td nowrap="nowrap">'.$thread_fontPre."&nbsp;".formatSubject($c,$group).$thread_fontPost."</td>";              echo '<td>'.$thread_fontPre."&nbsp;".formatSubject($c,$group).$thread_fontPost."</td>";
1350            echo "</table></td>";            echo "</table></td>";
1351            if ($thread_showSubject) echo "<td></td>";            if ($thread_showSubject) echo "<td></td>";
1352            if ($thread_showAuthor)            if ($thread_showAuthor)
1353              echo '<td nowrap="nowrap">'.$thread_fontPre.formatAuthor($c).$thread_fontPost."</td>";              echo '<td>'.$thread_fontPre.formatAuthor($c).$thread_fontPost."</td>";
1354            echo "</tr>";            echo "</tr>";
1355            break;            break;
1356        }        }
# Line 1675  function verschicken($subject,$from,$new Line 1689  function verschicken($subject,$from,$new
1689      fputs($ns,"post\r\n");      fputs($ns,"post\r\n");
1690      $weg=lieszeile($ns);      $weg=lieszeile($ns);
1691  //    fputs($ns,'Subject: '.quoted_printable_encode($subject)."\r\n");  //    fputs($ns,'Subject: '.quoted_printable_encode($subject)."\r\n");
1692  //    fputs($ns,'Subject: '.mb_convert_encoding($subject, "ISO-2022-JP", "EUC-JP")."\r\n");      fputs($ns,'Subject: '.mb_convert_encoding($subject, "ISO-2022-JP", "EUC-JP")."\r\n");
1693      fputs($ns,'Subject: '.mb_encode_mimeheader($subject)."\r\n");  //    fputs($ns,'Subject: '.mb_encode_mimeheader($subject)."\r\n");
1694      fputs($ns,'From: '.$from."\r\n");      fputs($ns,'From: '.$from."\r\n");
1695      fputs($ns,'Newsgroups: '.$newsgroups."\r\n");      fputs($ns,'Newsgroups: '.$newsgroups."\r\n");
1696  //    fputs($ns,"Mime-Version: 1.0\r\n");  //    fputs($ns,"Mime-Version: 1.0\r\n");
1697  //    fputs($ns,"Content-Type: text/plain; charset=ISO-8859-1\r\n");  //    fputs($ns,"Content-Type: text/plain; charset=ISO-8859-1\r\n");
1698  //    fputs($ns,"Content-Transfer-Encoding: 8bit\r\n");  //    fputs($ns,"Content-Transfer-Encoding: 8bit\r\n");
1699      fputs($ns,"User-Agent: NewsPortal 0.24pre3\r\n");      fputs($ns,"User-Agent: ".$text_ua["user_agent"]."\r\n");
1700      if ($send_poster_host)      if ($send_poster_host)
1701        fputs($ns,'X-HTTP-Posting-Host: '.gethostbyaddr(getenv("REMOTE_ADDR"))."\r\n");        fputs($ns,'X-HTTP-Posting-Host: '.gethostbyaddr(getenv("REMOTE_ADDR"))."\r\n");
1702      if ($ref!=false) fputs($ns,'References: '.$ref."\r\n");      if ($ref!=false) fputs($ns,'References: '.$ref."\r\n");

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.14

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24