OSDN Git Service

・プラグインを使用しない外部板の URL がうまく扱えなくなっていたので修正。
authoryoffy <yoffy>
Sun, 23 Nov 2003 09:55:54 +0000 (09:55 +0000)
committeryoffy <yoffy>
Sun, 23 Nov 2003 09:55:54 +0000 (09:55 +0000)
GikoSystem.pas

index ca24c5c..2f12984 100644 (file)
@@ -217,6 +217,10 @@ const
        DEFAULT_NGWORD_FILE_NAME : String = 'NGword.txt';
        NGWORDs_DIR_NAME : String               = 'NGwords';
 
+       READ_PATH: string =                     '/test/read.cgi/';
+       OLD_READ_PATH: string =         '/test/read.cgi?';
+       KAKO_PATH: string =                     '/kako/';
+
 (*************************************************************************
  *GikoSys\83R\83\93\83X\83g\83\89\83N\83^
  *************************************************************************)
@@ -516,11 +520,14 @@ begin
 
        sl := TStringList.Create;
        try
+               if Pos( 'giko', board.URL ) > 0 then begin
+                       messagebox( 0, '', '', MB_OK );
+               end;
                if FileExists(FileName) then
                        sl.LoadFromFile(FileName);
 
                //\82Q\8ds\96Ú\82©\82ç\81i\82P\8ds\96Ú\82Í\83o\81[\83W\83\87\83\93\81j
-               for i := sl.Count - 1 downto 0 do begin
+               for i := sl.Count - 1 downto 1 do begin
                        Rec := ParseIndexLine(sl[i]);
 
                        if usePlugIn then
@@ -531,7 +538,7 @@ begin
                                ThreadItem := TThreadItem.Create(
                                        nil,
                                        Get2chBoard2ThreadURL( Board, ChangeFileExt( Rec.FFileName, '' ) ) );
-                               
+
                                //IsLogFile\83`\83F\83b\83N
                                ThreadItem.IsLogFile := False;
                                if FileList.Count <> 0 then begin
@@ -2341,10 +2348,6 @@ begin
 end;
 
 function TGikoSys.Parse2chURL(const url: string; const path: string; const document: string; var BBSID: string; var BBSKey: string): Boolean;
-const
-       READ_PATH: string =                     '/test/read.cgi/';
-       OLD_READ_PATH: string =         '/test/read.cgi?';
-       KAKO_PATH: string =                     '/kako/';
 var
        Index: Integer;
        s: string;
@@ -2682,34 +2685,38 @@ function        TGikoSys.Get2chBrowsableThreadURL(
 var
        Protocol, Host, Path, Document, Port, Bookmark : string;
        BBSID, BBSKey : string;
-const
-       KAKO_PATH       = '/kako/';
 begin
 
        if Pos( KAKO_PATH, inURL ) > 0 then begin
                Result := inURL;
        end else begin
                ParseURI( inURL, Protocol, Host, Path, Document, Port, Bookmark );
-               Parse2chURL( inURL, Path, Document, BBSID, BBSKey );
 
-               Result := Protocol + '://' + Host + '/test/read.cgi/' + BBSID + '/' + BBSKey + '/l50';
+               if Is2chHost( Host ) then begin
+                       Parse2chURL( inURL, Path, Document, BBSID, BBSKey );
+                       Result := Protocol + '://' + Host + Path + READ_PATH + BBSID + '/' + BBSKey + '/l50';
+               end else begin
+                       Parse2chURL( inURL, Path, Document, BBSID, BBSKey );
+                       Result := Protocol + '://' + Host + Path + OLD_READ_PATH + 'bbs=' + BBSID + '&key=' + BBSKey + '&ls=50';
+               end;
        end;
 
 end;
 
 function       TGikoSys.Get2chBoard2ThreadURL(
        inBoard : TBoard;
-       inKey           : string
+       inKey           : string
 ) : string;
 var
-       url : string;
-       Protocol, Host, Path, Document, Port, Bookmark : string;
+       url                     : string;
+       server  : string;
 begin
 
-       url := inBoard.URL;
-       ParseURI( url, Protocol, Host, Path, Document, Port, Bookmark );
-
-       Result := Protocol + '://' + Host + '/test/read.cgi/' + inBoard.BBSID + '/' + inKey + '/l50';
+       server := UrlToServer( inBoard.URL );
+       if Is2chHost( server ) then
+               Result := server + 'test/read.cgi/' + inBoard.BBSID + '/' + inKey + '/l50'
+       else
+               Result := server + 'test/read.cgi?bbs=' + inBoard.BBSID + '&key=' + inKey + '&ls=50';
 
 end;