/[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 by wakaba, Sat Dec 1 11:17:31 2001 UTC revision 1.12 by wakaba, Sat Dec 1 12:42:14 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-printable decoding
452          $result1=ereg_replace('(.*)"(.*)"(.*)','\1',$value);
453          $result2=ereg_replace('(.*)"(.*)"(.*)','\2',$value);
454          $result3=ereg_replace('(.*)"(.*)"(.*)','\3',$value);
455          $result2=ereg_replace('\\\\(.)','AI\1',$result2);
456          $result2=ereg_replace('(.)','OI\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    
# Line 754  function read_message($id,$bodynum=0,$gr Line 764  function read_message($id,$bodynum=0,$gr
764        return false;        return false;
765      $rawmessage=array();      $rawmessage=array();
766      $line=lieszeile($ns);      $line=lieszeile($ns);
767   $line=mb_convert_encoding($line, "EUC-JP", "ISO-2022-JP");   #$line=mb_convert_encoding($line, "EUC-JP", "ISO-2022-JP");
768      while(strcmp($line,".") != 0) {      while(strcmp($line,".") != 0) {
769        $rawmessage[]=$line;        $rawmessage[]=$line;
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      }      }
773      $message=parse_message($rawmessage);      $message=parse_message($rawmessage);
774      if (ereg('^[0-9]+$',$id)) $message->header->number=$id;      if (ereg('^[0-9]+$',$id)) $message->header->number=$id;
# Line 1177  function formatTreeGraphic($newtree) { Line 1187  function formatTreeGraphic($newtree) {
1187          break;          break;
1188        }        }
1189      $return .= '" alt="'.$alt.'"';      $return .= '" alt="'.$alt.'"';
1190      if (strcmp($k,".") == 0) $return .=(' width="12" height="9"');      if (strcmp($k,".") == 0) $return .=(' style="width: 12px; height: 9px"');
1191      $return .= ' />';      $return .= '>';
1192    }    }
1193    return($return);    return($return);
1194  }  }
# Line 1256  function showThread(&$headers,&$liste,$d Line 1266  function showThread(&$headers,&$liste,$d
1266            echo "<br>\n";            echo "<br>\n";
1267            break;            break;
1268          case 1: // html-auflistung, kein baum          case 1: // html-auflistung, kein baum
1269            echo "<li><nobr>".$thread_fontPre;            echo "<li>".$thread_fontPre;
1270            if ($thread_showDate)            if ($thread_showDate)
1271              echo formatDate($c)." ";              echo formatDate($c)." ";
1272            if ($thread_showSubject)            if ($thread_showSubject)
1273              echo formatSubject($c,$group)." ";              echo formatSubject($c,$group)." ";
1274            if ($thread_showAuthor)            if ($thread_showAuthor)
1275              echo "<i>(".formatAuthor($c).")</i>";              echo "<em>(".formatAuthor($c).")</em>";
1276            echo $thread_fontPost."</nobr></li>";            echo $thread_fontPost."</li>";
1277            break;            break;
1278          case 2:   // table          case 2:   // table
1279            echo "<tr>";            echo "<tr>";
# Line 1275  function showThread(&$headers,&$liste,$d Line 1285  function showThread(&$headers,&$liste,$d
1285            }            }
1286            if ($thread_showAuthor) {            if ($thread_showAuthor) {
1287              echo "<td></td>";              echo "<td></td>";
1288              echo '<td nowrap="nowrap">'.$thread_fontPre.formatAuthor($c);              echo '<td>'.$thread_fontPre.formatAuthor($c);
1289              echo $thread_fontPost."</td>";              echo $thread_fontPost."</td>";
1290            }            }
1291            echo "</tr>\n";            echo "</tr>\n";
1292            break;            break;
1293          case 3: // html-tree          case 3: // html-tree
1294            echo "<li><nobr>".$thread_fontPre;            echo "<li>".$thread_fontPre;
1295            if ($thread_showDate)            if ($thread_showDate)
1296              echo formatDate($c)." ";              echo formatDate($c)." ";
1297            if ($thread_showSubject)            if ($thread_showSubject)
1298              echo formatSubject($c,$group)." ";              echo formatSubject($c,$group)." ";
1299            if ($thread_showAuthor)            if ($thread_showAuthor)
1300              echo "<i>(".formatAuthor($c).")</i>";              echo "<em>(".formatAuthor($c).")</em>";
1301            echo $thread_fontPost."</nobr>\n";            echo $thread_fontPost."\n";
1302            break;            break;
1303          case 4:  // thread          case 4:  // thread
1304            echo "<nobr><tt>".$thread_fontPre;            echo "".$thread_fontPre;
1305            if ($thread_showDate)            if ($thread_showDate)
1306              echo formatDate($c)." ";              echo formatDate($c)." ";
1307            echo formatTreeText($newtree)." ";            echo formatTreeText($newtree)." ";
1308            if ($thread_showSubject)            if ($thread_showSubject)
1309              echo formatSubject($c,$group)." ";              echo formatSubject($c,$group)." ";
1310            if ($thread_showAuthor)            if ($thread_showAuthor)
1311              echo "<i>(".formatAuthor($c).")</i>";              echo "<em>(".formatAuthor($c).")</em>";
1312            echo $thread_fontPost."</tt></nobr><br>";            echo $thread_fontPost."<br>";
1313            break;            break;
1314          case 5:  // thread, graphic          case 5:  // thread, graphic
1315            echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr>\n";            echo "<table><tr>\n";
1316            if ($thread_showDate)            if ($thread_showDate)
1317              echo '<td nowrap="nowrap">'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</td>";              echo '<td>'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</td>";
1318            echo "<td>".$thread_fontPre.formatTreeGraphic($newtree).$thread_fontPost."</td>";            echo "<td>".$thread_fontPre.formatTreeGraphic($newtree).$thread_fontPost."</td>";
1319            if ($thread_showSubject)            if ($thread_showSubject)
1320              echo '<td nowrap="nowrap">'.$thread_fontPre."&nbsp;".formatSubject($c,$group)." ";              echo '<td>'.$thread_fontPre."&nbsp;".formatSubject($c,$group)." ";
1321            if ($thread_showAuthor)            if ($thread_showAuthor)
1322              echo "(".formatAuthor($c).")".$thread_fontPost."</td>";              echo "(".formatAuthor($c).")".$thread_fontPost."</td>";
1323            echo "</tr></table>";            echo "</tr></table>";
# Line 1315  function showThread(&$headers,&$liste,$d Line 1325  function showThread(&$headers,&$liste,$d
1325          case 6:  // thread, table          case 6:  // thread, table
1326            echo "<tr>";            echo "<tr>";
1327            if ($thread_showDate)            if ($thread_showDate)
1328              echo '<td nowrap="nowrap"><tt>'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</tt></td>";              echo '<td>'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</td>";
1329            echo '<td nowrap="nowrap"><tt>'.$thread_fontPre.formatTreeText($newtree)." ";            echo '<td>'.$thread_fontPre.formatTreeText($newtree)." ";
1330            if ($thread_showSubject) {            if ($thread_showSubject) {
1331              echo formatSubject($c,$group).$thread_fontPost."</tt></td>";              echo formatSubject($c,$group).$thread_fontPost."</td>";
1332              echo "<td></td>";              echo "<td></td>";
1333            }            }
1334            if ($thread_showAuthor)            if ($thread_showAuthor)
1335              echo '<td nowrap="nowrap"><tt>'.$thread_fontPre.formatAuthor($c).$thread_fontPost."</tt></td>";              echo '<td>'.$thread_fontPre.formatAuthor($c).$thread_fontPost."</td>";
1336            echo "</tr>";            echo "</tr>";
1337            break;            break;
1338          case 7:  // thread, table, graphic          case 7:  // thread, table, graphic
1339            echo "<tr>";            echo "<tr>";
1340            if ($thread_showDate)            if ($thread_showDate)
1341              echo '<td nowrap="nowrap">'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</td>";              echo '<td>'.$thread_fontPre.formatDate($c)." ".$thread_fontPost."</td>";
1342            echo "<td><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";            echo "<td><table>\n";
1343            echo "<td>".formatTreeGraphic($newtree)."</td>";            echo "<td>".formatTreeGraphic($newtree)."</td>";
1344            if ($thread_showSubject)            if ($thread_showSubject)
1345              echo '<td nowrap="nowrap">'.$thread_fontPre."&nbsp;".formatSubject($c,$group).$thread_fontPost."</td>";              echo '<td>'.$thread_fontPre."&nbsp;".formatSubject($c,$group).$thread_fontPost."</td>";
1346            echo "</table></td>";            echo "</table></td>";
1347            if ($thread_showSubject) echo "<td></td>";            if ($thread_showSubject) echo "<td></td>";
1348            if ($thread_showAuthor)            if ($thread_showAuthor)
1349              echo '<td nowrap="nowrap">'.$thread_fontPre.formatAuthor($c).$thread_fontPost."</td>";              echo '<td>'.$thread_fontPre.formatAuthor($c).$thread_fontPost."</td>";
1350            echo "</tr>";            echo "</tr>";
1351            break;            break;
1352        }        }
# Line 1675  function verschicken($subject,$from,$new Line 1685  function verschicken($subject,$from,$new
1685      fputs($ns,"post\r\n");      fputs($ns,"post\r\n");
1686      $weg=lieszeile($ns);      $weg=lieszeile($ns);
1687  //    fputs($ns,'Subject: '.quoted_printable_encode($subject)."\r\n");  //    fputs($ns,'Subject: '.quoted_printable_encode($subject)."\r\n");
1688  //    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");
1689      fputs($ns,'Subject: '.mb_encode_mimeheader($subject)."\r\n");  //    fputs($ns,'Subject: '.mb_encode_mimeheader($subject)."\r\n");
1690      fputs($ns,'From: '.$from."\r\n");      fputs($ns,'From: '.$from."\r\n");
1691      fputs($ns,'Newsgroups: '.$newsgroups."\r\n");      fputs($ns,'Newsgroups: '.$newsgroups."\r\n");
1692  //    fputs($ns,"Mime-Version: 1.0\r\n");  //    fputs($ns,"Mime-Version: 1.0\r\n");
1693  //    fputs($ns,"Content-Type: text/plain; charset=ISO-8859-1\r\n");  //    fputs($ns,"Content-Type: text/plain; charset=ISO-8859-1\r\n");
1694  //    fputs($ns,"Content-Transfer-Encoding: 8bit\r\n");  //    fputs($ns,"Content-Transfer-Encoding: 8bit\r\n");
1695      fputs($ns,"User-Agent: NewsPortal 0.24pre3\r\n");      fputs($ns,"User-Agent: ".$text_ua["user_agent"]."\r\n");
1696      if ($send_poster_host)      if ($send_poster_host)
1697        fputs($ns,'X-HTTP-Posting-Host: '.gethostbyaddr(getenv("REMOTE_ADDR"))."\r\n");        fputs($ns,'X-HTTP-Posting-Host: '.gethostbyaddr(getenv("REMOTE_ADDR"))."\r\n");
1698      if ($ref!=false) fputs($ns,'References: '.$ref."\r\n");      if ($ref!=false) fputs($ns,'References: '.$ref."\r\n");

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.12

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24