From: yoffy Date: Sun, 23 Nov 2003 09:55:54 +0000 (+0000) Subject: ・プラグインを使用しない外部板の URL がうまく扱えなくなっていたので修正。 X-Git-Tag: v1_64_1_820~1586 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b14bfb6b27856497ddc3799e55fbc3b700f0cf96;p=gikonavigoeson%2Fgikonavi.git ・プラグインを使用しない外部板の URL がうまく扱えなくなっていたので修正。 --- diff --git a/GikoSystem.pas b/GikoSystem.pas index ca24c5c..2f12984 100644 --- a/GikoSystem.pas +++ b/GikoSystem.pas @@ -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ƒRƒ“ƒXƒgƒ‰ƒNƒ^ *************************************************************************) @@ -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); //‚Qs–Ú‚©‚çi‚Ps–ڂ̓o[ƒWƒ‡ƒ“j - 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ƒ`ƒFƒbƒN 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;