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';
// COLUMN_THREADITEM: array[0..3] of string = ('\83X\83\8c\83b\83h\96¼', '\83J\83E\83\93\83g', '\8f\84\89ñ\97\\96ñ', '\91O\89ñ\8f\84\89ñ\93ú\8e\9e');
function BBSsFindBoardFromBBSID(
- inBBSID : string
+ inBBSID : string
) : TBoard;
var
- i, bound : Integer;
+ i : Integer;
begin
- bound := Length( BBSs ) - 1;
- for i := 0 to bound do begin
+ for i := Length( BBSs ) - 1 downto 0 do begin
Result := BBSs[ i ].FindBBSID( inBBSID );
if Result <> nil then
Exit;
end;
function BBSsFindBoardFromURL(
- inURL : string
+ inURL : string
) : TBoard;
var
- i, bound : Integer;
+ i : Integer;
begin
- bound := Length( BBSs ) - 1;
- for i := 0 to bound do begin
+ for i := Length( BBSs ) - 1 downto 0 do begin
Result := BBSs[ i ].FindBoardFromURL( inURL );
if Result <> nil then
Exit;
end;
function BBSsFindBoardFromTitle(
- inTitle : string
+ inTitle : string
) : TBoard;
var
- i, bound : Integer;
+ i : Integer;
begin
- bound := Length( BBSs ) - 1;
- for i := 0 to bound do begin
+ for i := Length( BBSs ) - 1 downto 0 do begin
Result := BBSs[ i ].FindBoardFromTitle( inTitle );
if Result <> nil then
Exit;
end;
function BBSsFindThreadFromURL(
- inURL : string
+ inURL : string
) : TThreadItem;
var
- i, bound : Integer;
+ i : Integer;
begin
- bound := Length( BBSs ) - 1;
- for i := 0 to bound do begin
+ for i := Length( BBSs ) - 1 downto 0 do begin
Result := BBSs[ i ].FindThreadFromURL( inURL );
if Result <> nil then
Exit;
function TBBS.FindBBSID(BBSID: string): TBoard;
var
- i: Integer;
- Category: TCategory;
- Board: TBoard;
+ i : Integer;
begin
- Result := nil;
- for i := 0 to Count - 1 do begin
- Category := Items[i];
- Board := Category.FindBBSID(BBSID);
- if Board <> nil then begin
- Result := Board;
+ for i := Count - 1 downto 0 do begin
+ Result := Items[ i ].FindBBSID(BBSID);
+ if Result <> nil then
Exit;
- end;
end;
+ Result := nil;
end;
//*************************************************************************
function TBBS.FindBoardFromTitle(Title: string): TBoard;
var
i: Integer;
- Category: TCategory;
- Board: TBoard;
begin
- Result := nil;
- for i := 0 to Count - 1 do begin
- Category := Items[i];
- Board := Category.FindBoardFromTitle(Title);
- if Board <> nil then begin
- Result := Board;
+ for i := Count - 1 downto 0 do begin
+ Result := Items[ i ].FindBoardFromTitle(Title);
+ if Result <> nil then
Exit;
- end;
end;
+ Result := nil;
end;
//*************************************************************************
//*************************************************************************)
function TBBS.FindBoardFromURL(inURL: string): TBoard;
var
- i: Integer;
- Category: TCategory;
- Board: TBoard;
+ i : Integer;
begin
- Result := nil;
- for i := 0 to Count - 1 do begin
- Category := Items[i];
- Board := Category.FindBoardFromURL(inURL);
- if Board <> nil then begin
- Result := Board;
+ for i := Count - 1 downto 0 do begin
+ Result := Items[ i ].FindBoardFromURL( inURL );
+ if Result <> nil then
Exit;
- end;
end;
+ Result := nil;
end;
//*************************************************************************
//*************************************************************************)
function TBBS.FindThreadFromURL(inURL: string): TThreadItem;
var
- i: Integer;
+ i : Integer;
begin
- for i := 0 to Count - 1 do begin
+ for i := Count - 1 downto 0 do begin
Result := Items[ i ].FindThreadFromURL( inURL );
if Result <> nil then
Exit;
function TCategory.FindBBSID(BBSID: string): TBoard;
var
- i: integer;
+ i : integer;
begin
- Result := nil;
- for i := 0 to Count - 1 do begin
+ for i := Count - 1 downto 0 do begin
if Items[i].FBBSID = BBSID then begin
Result := Items[i];
Exit;
end;
end;
+ Result := nil;
end;
//*************************************************************************
//*************************************************************************)
function TCategory.FindBoardFromTitle(Title: string): TBoard;
var
- i: integer;
+ i : integer;
begin
- Result := nil;
- for i := 0 to Count - 1 do begin
+ for i := Count - 1 downto 0 do begin
if Items[i].FTitle = Title then begin
Result := Items[i];
Exit;
end;
end;
+ Result := nil;
end;
//*************************************************************************
//*************************************************************************)
function TCategory.FindBoardFromURL(inURL: string): TBoard;
var
- i: integer;
+ i : Integer;
begin
- Result := nil;
- for i := 0 to Count - 1 do begin
+ for i := Count - 1 downto 0 do begin
if Pos( Items[i].URL, inURL ) = 1 then begin
Result := Items[i];
Exit;
end;
end;
+ Result := nil;
end;
//*************************************************************************
i : Integer;
begin
- for i := 0 to Count - 1 do begin
+ for i := Count - 1 downto 0 do begin
Result := Items[ i ].FindThreadFromURL( inURL );
if Result <> nil then
Exit;
inPlugIn : TBoardPlugIn;
inURL : string
);
+var
+ protocol, host, path, document, port, bookmark : string;
+ BBSID : string;
begin
Create;
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;
if not IsThreadDatRead then
GikoSys.ReadSubjectFile( Self );
- for i := 0 to Count - 1 do begin
+ for i := Count - 1 downto 0 do begin
if Pos( Items[ i ].URL, inURL ) = 1 then begin
Result := Items[ i ];
Exit;
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;
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';
+ FileName := BBSKey + '.dat';
+ IsLogFile := FileExists( FilePath );
+ 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;