OSDN Git Service

・TBoard および TThreadItem の作成時にプラグインを使用していなくてもパスを生成するようになった。
authoryoffy <yoffy>
Sat, 22 Nov 2003 16:34:23 +0000 (16:34 +0000)
committeryoffy <yoffy>
Sat, 22 Nov 2003 16:34:23 +0000 (16:34 +0000)
 また、2ちゃんねる以外は exboard\<ホスト名>\ の位置からパスを生成するようになった。

BoardGroup.pas

index 67e55fb..1edfba4 100644 (file)
@@ -367,6 +367,7 @@ uses
 const
        BBS2CH_NAME:                                     string = '\82Q\82¿\82á\82ñ\82Ë\82é';
        BBS2CH_LOG_FOLDER:               string = '2ch';
+       EXTERNAL_LOG_FOLDER:            string  = 'exboard';
 
        FOLDER_INI_FILENAME:     string = 'Folder.ini';
        FOLDER_INDEX_FILENAME: string   = 'Folder.idx';
@@ -793,6 +794,10 @@ constructor TBoard.Create(
        inPlugIn        : TBoardPlugIn;
        inURL                   : string
 );
+var
+       foundPos                        : Integer;
+       protocol, host, path, document, port, bookmark  : string;
+       BBSID, BBSKey   : string;
 begin
 
        Create;
@@ -802,8 +807,20 @@ begin
        BBSID                                   := GikoSys.UrlToID( inURL );
 
        // \83v\83\89\83O\83C\83\93\82É TBoardItem \82ª\8dì\90¬\82³\82ê\82½\82±\82Æ\82ð\93`\82¦\82é
-       if inPlugIn <> nil then
+       if inPlugIn = nil then begin
+    // subject.txt \82Ì\95Û\91\83p\83X\82ð\90Ý\92è
+    GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
+    if GikoSys.Is2chHost( host ) then
+      FilePath :=
+        IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
+        BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
+    else
+      FilePath :=
+        IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
+        EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
+       end else begin
                inPlugIn.CreateBoardItem( DWORD( Self ) );
+       end;
 
 end;
 
@@ -1350,6 +1367,12 @@ constructor TThreadItem.Create(
        inPlugIn        : TBoardPlugIn;
        inURL                   : string
 );
+var
+       foundPos                        : Integer;
+       protocol, host, path, document, port, bookmark  : string;
+       BBSID, BBSKey   : string;
+const
+       READ_PATH                                                       = '/test/read.cgi';
 begin
 
        Create;
@@ -1357,9 +1380,25 @@ begin
        FBoardPlugIn    := inPlugIn;
        URL                                             := inURL;
 
-       // \83v\83\89\83O\83C\83\93\82É TThreadItem \82ª\8dì\90¬\82³\82ê\82½\82±\82Æ\82ð\93`\82¦\82é
-       if inPlugIn <> nil then
+       if inPlugIn = nil then begin
+               foundPos := Pos( READ_PATH, inURL );
+               if foundPos > 0 then begin
+                       // dat \82Ì\95Û\91\83p\83X\82ð\90Ý\92è
+                       GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
+                       GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
+                       if GikoSys.Is2chHost( host ) then
+                               FilePath :=
+                                       IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
+                                       BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat'
+                       else
+                               FilePath :=
+                                       IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
+                                       EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat'
+               end;
+       end else begin
+               // \83v\83\89\83O\83C\83\93\82É TThreadItem \82ª\8dì\90¬\82³\82ê\82½\82±\82Æ\82ð\93`\82¦\82é
                inPlugIn.CreateThreadItem( DWORD( Self ) );
+       end;
 
 end;