GikoSys.ParseURI( URL, protocol, host, path, document, port, bookmark );
GikoSys.Parse2chURL( URL, path, document, BBSID, BBSKey );
- if GikoSys.Is2chHost(Host) then begin
+ if (Length( Trim(BBSKey) ) > 0) and (Length( Trim(BBSID) ) > 0) then begin
Board := BBSsFindBoardFromURL( GikoSys.Get2chThreadURL2BoardURL( URL ) );
if Board = nil then begin
GikoSys.OpenBrowser(URL, gbtAuto);
sl := TStringList.Create;
try
- if Pos( 'giko', board.URL ) > 0 then begin
- messagebox( 0, '', '', MB_OK );
- end;
if FileExists(FileName) then
sl.LoadFromFile(FileName);
ParseURI( inURL, Protocol, Host, Path, Document, Port, Bookmark );
Parse2chURL( inURL, Path, Document, BBSID, BBSKey );
- Result := Protocol + '://' + Host + '/' + BBSID + '/';
+ Result := Copy( inURL, 1, Pos( '/test/read.cgi', inURL ) ) + BBSID + '/';
end;
function TGikoSys.Get2chBrowsableThreadURL(
- inURL : string
+ inURL : string
) : string;
var
Protocol, Host, Path, Document, Port, Bookmark : string;
BBSID, BBSKey : string;
+ foundPos : Integer;
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 );
+ foundPos := Pos( '/test/read.cgi', inURL );
if Is2chHost( Host ) then begin
- Parse2chURL( inURL, Path, Document, BBSID, BBSKey );
- Result := Protocol + '://' + Host + Path + READ_PATH + BBSID + '/' + BBSKey + '/l50';
+ Result := Copy( inURL, 1, foundPos ) +
+ 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';
+ Result := Copy( inURL, 1, foundPos ) +
+ OLD_READ_PATH + 'bbs=' + BBSID + '&key=' + BBSKey + '&ls=50';
end;
end;
inKey : string
) : string;
var
- url : string;
server : string;
begin