function FindBoardFromURL(inURL: string): TBoard;
function FindThreadFromURL( inURL : string ) : TThreadItem;
function FindThreadItem(BBSID: string; FileName: string): TThreadItem;
+ function FindCategoryFromTitle( inTitle : string ) : TCategory;
function GetLogFolder: string;
property Items[index: integer]: TCategory read GetCategory write SetCategory;
Result := Board.Find(FileName);
end;
+function TBBS.FindCategoryFromTitle( inTitle : string ) : TCategory;
+var
+ i : Integer;
+begin
+
+ for i := Count - 1 downto 0 do begin
+ if Items[ i ].Title = inTitle then begin
+ Result := Items[ i ];
+ Exit;
+ end;
+ end;
+
+ Result := nil;
+
+end;
+
(*************************************************************************
*\83\8d\83O\83t\83H\83\8b\83_\8eæ\93¾
*
i: Integer;
begin
Result := 0;
- if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
- begin
- for i := 0 to Count - 1 do begin
- if Items[i].NewArrival then
- inc(Result);
- end;
- end else begin
- for i := 0 to Count - 1 do begin
- if Items[i].NewArrival then
- begin
- if Items[i].ShortTitle = '' then
- Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
- if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
- inc(Result);
- end;
- end;
- end;
+ if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
+ begin
+ for i := 0 to Count - 1 do begin
+ if Items[i].NewArrival then
+ inc(Result);
+ end;
+ end else begin
+ for i := 0 to Count - 1 do begin
+ if Items[i].NewArrival then
+ begin
+ if Items[i].ShortTitle = '' then
+ Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
+ if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
+ inc(Result);
+ end;
+ end;
+ end;
end;
function TBoard.GetLogThreadCount: Integer;
i: Integer;
begin
Result := 0;
- if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
- begin
- for i := 0 to Count - 1 do begin
- if Items[i].IsLogFile then
- inc(Result);
- end;
- end else begin
- for i := 0 to Count - 1 do begin
- if Items[i].IsLogFile then
- begin
- if Items[i].ShortTitle = '' then
- Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
- if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
- inc(Result);
- end;
- end;
- end;
+ if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
+ begin
+ for i := 0 to Count - 1 do begin
+ if Items[i].IsLogFile then
+ inc(Result);
+ end;
+ end else begin
+ for i := 0 to Count - 1 do begin
+ if Items[i].IsLogFile then
+ begin
+ if Items[i].ShortTitle = '' then
+ Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
+ if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
+ inc(Result);
+ end;
+ end;
+ end;
end;
function TBoard.GetUserThreadCount: Integer;
i: Integer;
begin
Result := 0;
- if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
- Result := Count
- else
- for i := 0 to Count - 1 do begin
- if Items[i].ShortTitle = '' then
- Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
- if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
- inc(Result);
- end;
+ if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
+ Result := Count
+ else
+ for i := 0 to Count - 1 do begin
+ if Items[i].ShortTitle = '' then
+ Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
+ if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
+ inc(Result);
+ end;
end;
function TBoard.GetNewThread(Index: Integer): TThreadItem;
begin
Result := nil;
Cnt := 0;
- if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
- begin
- for i := 0 to Count - 1 do begin
- if Items[i].NewArrival then
- begin
- if Index = Cnt then begin
- Result := Items[i];
- Exit;
- end;
- inc(Cnt);
- end;
- end;
- end else begin
- for i := 0 to Count - 1 do begin
- if Items[i].NewArrival then
- begin
- if Items[i].ShortTitle = '' then
- Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
- if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
- if Index = Cnt then begin
- Result := Items[i];
- Exit;
- end;
- inc(Cnt);
- end;
- end;
- end;
- end;
+ if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
+ begin
+ for i := 0 to Count - 1 do begin
+ if Items[i].NewArrival then
+ begin
+ if Index = Cnt then begin
+ Result := Items[i];
+ Exit;
+ end;
+ inc(Cnt);
+ end;
+ end;
+ end else begin
+ for i := 0 to Count - 1 do begin
+ if Items[i].NewArrival then
+ begin
+ if Items[i].ShortTitle = '' then
+ Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
+ if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
+ if Index = Cnt then begin
+ Result := Items[i];
+ Exit;
+ end;
+ inc(Cnt);
+ end;
+ end;
+ end;
+ end;
end;
function TBoard.GetLogThread(Index: Integer): TThreadItem;
i: Integer;
Cnt: Integer;
begin
- Cnt := 0;
- if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
- begin
- for i := 0 to Count - 1 do begin
- if Items[i].IsLogFile then
- begin
- if Index = Cnt then begin
- Result := Items[i];
- Exit;
- end;
- inc(Cnt);
- end;
- end;
- end else begin
- for i := 0 to Count - 1 do begin
- if Items[i].IsLogFile then
- begin
- if Items[i].ShortTitle = '' then
- Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
- if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
- if Index = Cnt then begin
- Result := Items[i];
- Exit;
- end;
- inc(Cnt);
- end;
- end;
- end;
- end;
- Result := nil;
+ Cnt := 0;
+ if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
+ begin
+ for i := 0 to Count - 1 do begin
+ if Items[i].IsLogFile then
+ begin
+ if Index = Cnt then begin
+ Result := Items[i];
+ Exit;
+ end;
+ inc(Cnt);
+ end;
+ end;
+ end else begin
+ for i := 0 to Count - 1 do begin
+ if Items[i].IsLogFile then
+ begin
+ if Items[i].ShortTitle = '' then
+ Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
+ if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
+ if Index = Cnt then begin
+ Result := Items[i];
+ Exit;
+ end;
+ inc(Cnt);
+ end;
+ end;
+ end;
+ end;
+ Result := nil;
end;
function TBoard.GetUserThread(Index: Integer): TThreadItem;
begin
Result := nil;
Cnt := 0;
- if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
- begin
- for i := 0 to Count - 1 do begin
- if Index = Cnt then
- begin
- Result := Items[ i ];
- Exit;
- end;
- inc( Cnt );
- end;
- end else begin
- for i := 0 to Count - 1 do begin
- if Items[i].ShortTitle = '' then
- Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
- if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
- if Index = Cnt then begin
- Result := Items[i];
- Exit;
- end;
- inc(Cnt);
- end;
- end;
+ if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
+ begin
+ for i := 0 to Count - 1 do begin
+ if Index = Cnt then
+ begin
+ Result := Items[ i ];
+ Exit;
+ end;
+ inc( Cnt );
+ end;
+ end else begin
+ for i := 0 to Count - 1 do begin
+ if Items[i].ShortTitle = '' then
+ Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
+ if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
+ if Index = Cnt then begin
+ Result := Items[i];
+ Exit;
+ end;
+ inc(Cnt);
+ end;
+ end;
end;
end;
boardURL := tmpThread.BoardPlugIn.GetBoardURL( DWORD( tmpThread ) );
Board := BBSsFindBoardFromURL( boardURL );
if Board = nil then begin
- Board := TBoard.Create( tmpThread.BoardPlugIn, boardURL );
- category := TCategory.Create;
- category.Title := '(\96¼\8fÌ\95s\96¾)';
- category.Add( Board );
- // \81¦\8c\83\82µ\82\95Û\97¯\92\86
- BBSs[ 0 ].Add( category );
-
- if FTreeType = gtt2ch then begin
- // \94Â\83\8a\83X\83g\82É\93o\98^\82³\82ê\82Ä\82¢\82È\82¢\82Ì\82Å\83c\83\8a\81[\82É\92Ç\89Á
- // SetBoardTreeNode; 1 \8ds\82Å\8dÏ\82Ü\82¹\82Ä\82à\82æ\82µ
- categoryNode := TreeView.Items.AddChild(
- TreeView.Items.GetFirstNode, category.Title );
- categoryNode.Data := category;
- categoryNode.ImageIndex := ITEM_ICON_CATEGORY1;
- categoryNode.SelectedIndex := ITEM_ICON_CATEGORY2;
-
- Board.BeginUpdate;
- boardNode :=
- TreeView.Items.AddChild( categoryNode, Board.Title );
- boardNode.Data := Board;
- boardNode.ImageIndex := ITEM_ICON_BOARD1;
- boardNode.SelectedIndex := ITEM_ICON_BOARD2;
- Board.EndUpdate;
- end;
+ // \81¦\8dì\82Á\82Ä\82à\92Ç\89Á\82·\82é\82Æ\82±\82ë\82ª\96³\82¢\82Ì\82Å\8c\83\82µ\82\95Û\97¯
+ GikoSys.OpenBrowser(URL, gbtUserApp);
+ Exit;
+ {
+ Board := GikoSys.GetUnknownBoard( tmpThread.BoardPlugIn, boardURL );
+ if (FTreeType = gtt2ch) and (FActiveBBS = BBSs[ 1 ]) then
+ ShowBBSTree( BBSs[ 1 ] );
+ }
end else begin
if not Board.IsThreadDatRead then
GikoSys.ReadSubjectFile( Board );
Board := BBSsFindBoardFromURL( boardURL );
if Board = nil then
Board := BBSsFindBoardFromBBSID( BBSID );
- if Board = nil then
+ if Board = nil then begin
// \81¦\8dì\82Á\82Ä\82à\92Ç\89Á\82·\82é\82Æ\82±\82ë\82ª\96³\82¢\82Ì\82Å\8c\83\82µ\82\95Û\97¯
- Board := TBoard.Create( nil, boardURL );
+ GikoSys.OpenBrowser(URL, gbtUserApp);
+ Exit;
+ //Board := GikoSys.GetUnknownBoard( nil, boardURL );
+ //if (FTreeType = gtt2ch) and (FActiveBBS = BBSs[ 1 ]) then
+ // ShowBBSTree( BBSs[ 1 ] );
+ end;
if not Board.IsThreadDatRead then
GikoSys.ReadSubjectFile(Board);
ThreadItem := Board.FindThreadFromURL( URL );
{$IFEND}
{HttpApp,} YofUtils, URLMon, IdGlobal, IdURI, {Masks,}
Setting, BoardGroup, gzip, Dolib, bmRegExp, AbonUnit,
- MojuUtils;
+ MojuUtils, ExternalBoardManager, ExternalBoardPlugInMain;
type
//BBS\83^\83C\83v
function Get2chBoard2ThreadURL( inBoard : TBoard; inKey : string ) : string;
procedure ReadBoardFile;
+ function GetUnknownCategory : TCategory;
+ function GetUnknownBoard( inPlugIn : TBoardPlugIn; inURL : string ) : TBoard;
+
// \83X\83L\83\93\82ð\93Ç\82Ý\8d\9e\82Ý\81A\92l\82ð\92u\8a·\82·\82é
function LoadFromSkin( fileName: string; ThreadItem: TThreadItem; SizeByte: Integer ): string;
// \83\8c\83X\82Ì\92l\82ð\92u\8a·\82·\82é
implementation
uses
- Giko, RoundData, ExternalBoardManager, ExternalBoardPlugInMain;
+ Giko, RoundData;
const
FOLDER_INDEX_VERSION = '1.01';
end;
end;
+function TGikoSys.GetUnknownCategory : TCategory;
+const
+ UNKNOWN_CATEGORY = '(\96¼\8fÌ\95s\96¾)';
+begin
+
+ if Length( BBSs ) < 2 then begin
+ Result := nil;
+ Exit;
+ end;
+
+ Result := BBSs[ 1 ].FindCategoryFromTitle( UNKNOWN_CATEGORY );
+ if Result = nil then begin
+ Result := TCategory.Create;
+ Result.Title := UNKNOWN_CATEGORY;
+ BBSs[ 1 ].Add( Result );
+ end;
+
+end;
+
+function TGikoSys.GetUnknownBoard( inPlugIn : TBoardPlugIn; inURL : string ) : TBoard;
+var
+ category : TCategory;
+const
+ UNKNOWN_BOARD = '(\96¼\8fÌ\95s\96¾)';
+begin
+
+ category := GetUnknownCategory;
+ if category = nil then begin
+ Result := nil;
+ end else begin
+ Result := category.FindBoardFromTitle( UNKNOWN_BOARD );
+ if Result = nil then begin
+ Result := TBoard.Create( inPlugIn, inURL );
+ Result.Title := UNKNOWN_BOARD;
+ category.Add( Result );
+ end;
+ end;
+
+end;
+
initialization
GikoSys := TGikoSys.Create;