6 SysUtils, Classes, ComCtrls, IniFiles, {HTTPApp,} YofUtils, IdGlobal;
9 //
\83\8a\83X
\83g
\82Ì
\95\
\8e¦
\83A
\83C
\83e
\83\80\91I
\91ð
10 TGikoViewType = (gvtAll, gvtLog, gvtNew, gvtUser);
11 //
\83\8a\83X
\83g
\82Ì
\8eæ
\93¾
\8c\8f\90\94
12 //TGikoListCount = (glc50, glc100, glc200, glc500, glc1000, glcAll);
13 //
\8f\84\89ñ
\94Ô
\8d\86
14 //TGikoRoundNo = (grnNone, grn1, grn2, grn3, grn4, grn5, grnOnce);
15 //
\83\8a\83X
\83g
\82Ì
\8fã
\82°
\89º
\82°
16 TGikoAgeSage = (gasNone, gasAge, gasSage, gasNew);
20 FItemList: TList; //
\8eq
\83A
\83C
\83e
\83\80\83\8a\83X
\83g
21 FLeaf: Boolean; //
\89º
\82É
\83t
\83H
\83\8b\83_
\82ð
\8e\9d\82Â
\82±
\82Æ
\82ª
\8fo
\97\88\82é
\82©
23 function Add(Item: TFolder): Integer;
25 procedure Delete(Index: Integer);
26 procedure Exchange(Index1, Index2: Integer);
27 procedure Insert(Index: Integer; Item: TFolder);
28 procedure Move(CurIndex, NewIndex: Integer);
29 function Remove(Item: TFolder): Integer;
30 procedure Sort(Compare: TListSortCompare);
31 property Capacity: Integer read FCapacity write SetCapacity;
32 property Count: Integer read FCount write SetCount;
33 property Items[Index: Integer]: TFolder read Get write Put; default;
35 property Leaf: Boolean read FLeaf;
40 TCategory class(TFolder)
42 TBoard = class(TFolder)
44 TThreadItem = class(TFolder)
51 TBoard2ch = class(TBoard)
53 TThreadItem2ch = class(TThreadItem)
61 // ICategory = interface
65 // IThreadItem = interface
72 //
\82Æ
\82è
\82 \82¦
\82¸
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é
\82Ì
\83\8b\81[
\83g
73 TBBS2ch = class(TList)
78 FKubetsuChk: Boolean; //
\8di
\8d\9e\82Ý
\8e\9e\91å
\95¶
\8e\9a\8f¬
\95¶
\8e\9a\8bæ
\95Ê
79 FSelectText: string; //
\8di
\8d\9e\82Ý
\95¶
\8e\9a\97ñ
80 FShortSelectText: string;
82 function GetCategory(index: integer): TCategory;
83 procedure SetCategory(index: integer; value: TCategory);
84 procedure SetSelectText(s: string);
86 constructor Create(LogFolder: string);
87 destructor Destroy; override;
89 procedure ReadBoardFile;
91 function GetBoardFromBBSID(BBSID: string): TBoard;
93 function Add(item: TCategory): integer;
94 procedure Delete(index: integer);
95 procedure Clear; override;
96 function Find(key: string): TCategory;
97 function FindBBSID(BBSID: string): TBoard;
98 function FindBoardFromTitle(Title: string): TBoard;
99 function FindThreadItem(BBSID: string; FileName: string): TThreadItem;
100 function GetLogFolder: string;
102 property Items[index: integer]: TCategory read GetCategory write SetCategory;
103 property Title: string read FTitle write FTitle;
104 property NodeExpand: Boolean read FExpand write FExpand;
106 property KubetsuChk: Boolean read FKubetsuChk write FKubetsuChk;
107 property SelectText: string read FSelectText write SetSelectText;
108 property ShortSelectText: string read FShortSelectText write FShortSelectText;
112 TCategory = class(TList)
116 FParentBBS2ch: TBBS2ch;
119 function GetBoard(index: integer): TBoard;
120 procedure SetBoard(index: integer; value: TBoard);
123 destructor Destroy; override;
125 property No: Integer read FNo write FNo;
126 property Title: string read FTitle write FTitle;
127 property Items[index: integer]: TBoard read GetBoard write SetBoard;
128 property ParentBBS2ch: TBBS2ch read FParentBBS2ch write FParentBBS2ch;
130 function Add(item: TBoard): integer;
131 procedure Delete(index: integer);
132 procedure Clear; override;
133 function FindName(key: string): TBoard;
134 function FindBBSID(BBSID: string): TBoard;
135 function FindBoardFromTitle(Title: string): TBoard;
136 function IsMidoku: Boolean;
138 property NodeExpand: Boolean read FExpand write FExpand;
142 TBoard = class(TList)
144 FNo: Integer; //
\94Ô
\8d\86
145 FTitle: string; //
\83{
\81[
\83h
\83^
\83C
\83g
\83\8b
146 FBBSID: string; //BBSID
147 FURL: string; //
\83{
\81[
\83hURL
148 FRound: Boolean; //
\83X
\83\8c\83b
\83h
\88ê
\97\97\8f\84\89ñ
\97\
\96ñ
149 FRoundName: string; //
\8f\84\89ñ
\96¼
150 FRoundDate: TDateTime; //
\83X
\83\8c\83b
\83h
\88ê
\97\97\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e\81i
\8f\84\89ñ
\93ú
\8e\9e\81j
151 FLastModified: TDateTime; //
\83X
\83\8c\83b
\83h
\88ê
\97\97\82ª
\8dX
\90V
\82³
\82ê
\82Ä
\82¢
\82é
\93ú
\8e\9e\81i
\83T
\81[
\83o
\91¤
\93ú
\8e\9e\81j
152 FLastGetTime: TDateTime; //
\83X
\83\8c\83b
\83h
\82Ü
\82½
\82Í
\83X
\83\8c\83b
\83h
\88ê
\97\97\82ð
\8dÅ
\8cã
\82É
\8dX
\90V
\82µ
\82½
\93ú
\8e\9e\81i
\83T
\81[
\83o
\91¤
\93ú
\8e\9e\81E
\8f\91\82«
\8d\9e\82Ý
\8e\9e\82É
\8eg
\97p
\82·
\82é
\81j
153 FIsThreadDatRead: Boolean; //
\83X
\83\8c\83b
\83h
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
154 FUnRead: Integer; //
\83X
\83\8c\83b
\83h
\96¢
\93Ç
\90\94
155 FParentCategory: TCategory; //
\90e
\83J
\83e
\83S
\83\8a
156 FModified: Boolean; //
\8fC
\90³
\83t
\83\89\83O
157 FBoolData: Boolean; //
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
158 FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
159 FPON: string; //
\8f\91\82«
\8d\9e\82Ý
\97pPON
160 FKotehanName: string; //
\83R
\83e
\83n
\83\93\96¼
\91O
161 FKotehanMail: string; //
\83R
\83e
\83n
\83\93\83\81\81[
\83\8b
166 function GetThreadItem(index: integer): TThreadItem;
167 procedure SetThreadItem(index: integer; value: TThreadItem);
168 procedure SetRound(b: Boolean);
169 procedure SetRoundName(s: string);
170 procedure SetLastModified(d: TDateTime);
171 procedure SetLastGetTime(d: TDateTime);
172 procedure SetUnRead(i: Integer);
173 procedure SetKotehanName(s: string);
174 procedure SetKotehanMail(s: string);
177 destructor Destroy; override;
179 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
180 property No: Integer read FNo write FNo;
181 property Title: string read FTitle write FTitle;
182 property BBSID: string read FBBSID write FBBSID;
183 property URL: string read FURL write FURL;
184 property Round: Boolean read FRound write SetRound;
185 property RoundName: string read FRoundName write SetRoundName;
186 property RoundDate: TDateTime read FRoundDate write FRoundDate;
187 property LastModified: TDateTime read FLastModified write SetLastModified;
188 property LastGetTime: TDateTime read FLastGetTime write SetLastGetTime;
189 property UnRead: Integer read FUnRead write SetUnRead;
190 property Modified: Boolean read FModified write FModified;
191 property IsThreadDatRead: Boolean read FIsThreadDatRead write FIsThreadDatRead;
192 property ParentCategory: TCategory read FParentCategory write FParentCategory;
194 function Add(item: TThreadItem): integer;
195 procedure Insert(Index: Integer; Item: TThreadItem);
196 procedure Delete(index: integer);
197 procedure DeleteList(index: integer);
198 procedure Clear; override;
199 function Find(ItemFileName: string): TThreadItem;
200 function GetIndex(ItemFileName: string): Integer;
201 procedure LoadSettings;
202 procedure SaveSettings;
203 function GetReadCgiURL: string;
204 function GetSubjectFileName: string;
205 function GetFolderIndexFileName: string;
206 function GetSendURL: string;
208 function GetNewThreadCount: Integer;
209 function GetLogThreadCount: Integer;
210 function GetUserThreadCount: Integer;
211 function GetNewThread(Index: Integer): TThreadItem;
212 function GetLogThread(Index: Integer): TThreadItem;
213 function GetUserThread(Index: Integer): TThreadItem;
215 procedure BeginUpdate;
217 property NodeExpand: Boolean read FExpand write FExpand;
218 property BoolData: Boolean read FBoolData write FBoolData;
219 property SPID: string read FSPID write FSPID;
220 property PON: string read FPON write FPON;
221 property KotehanName: string read FKotehanName write SetKotehanName;
222 property KotehanMail: string read FKotehanMail write SetKotehanMail;
226 TThreadItem = class(TObject)
228 FNo: Integer; //
\94Ô
\8d\86
229 FFileName: string; //
\83X
\83\8c\83b
\83h
\83t
\83@
\83C
\83\8b\96¼
230 FTitle: string; //
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b
231 FShortTitle: string; //
\92Z
\82¢
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b\81i
\8c\9f\8dõ
\97p
\81j
232 FRoundDate: TDateTime; //
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e\81i
\8f\84\89ñ
\93ú
\8e\9e\81j
233 FLastModified: TDateTime; //
\83X
\83\8c\83b
\83h
\82ª
\8dX
\90V
\82³
\82ê
\82Ä
\82¢
\82é
\93ú
\8e\9e\81i
\83T
\81[
\83o
\91¤
\93ú
\8e\9e\81j
234 FCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83\8d\81[
\83J
\83\8b\81j
235 FAllResCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83T
\81[
\83o
\81j
236 FNewResCount: Integer; //
\83X
\83\8c\83b
\83h
\90V
\92\85\90\94
237 FSize: Integer; //
\83X
\83\8c\83b
\83h
\83T
\83C
\83Y
238 FRound: Boolean; //
\8f\84\89ñ
\83t
\83\89\83O
239 FRoundName: string; //
\8f\84\89ñ
\96¼
240 FIsLogFile: Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
241 FParentBoard: TBoard; //
\90e
\83{
\81[
\83h
242 FKokomade: Integer; //
\83R
\83R
\82Ü
\82Å
\93Ç
\82ñ
\82¾
\94Ô
\8d\86
243 FNewReceive: Integer; //
\83R
\83R
\82©
\82ç
\90V
\8bK
\8eó
\90M
244 FNewArrival: Boolean; //
\90V
\92\85
245 FUnRead: Boolean; //
\96¢
\93Ç
\83t
\83\89\83O
246 FScrollTop: Integer; //
\83X
\83N
\83\8d\81[
\83\8b\88Ê
\92u
247 FDownloadHost: string; //
\8d¡
\82Ì
\83z
\83X
\83g
\82Æ
\88á
\82¤
\8fê
\8d\87\82Ì
\83z
\83X
\83g
248 FAgeSage: TGikoAgeSage; //
\83A
\83C
\83e
\83\80\82Ì
\8fã
\82°
\89º
\82°
249 // FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
254 procedure SetLastModified(d: TDateTime);
255 procedure SetRound(b: Boolean);
256 procedure SetRoundName(s: string);
257 procedure SetKokomade(i: Integer);
258 procedure SetUnRead(b: Boolean);
259 procedure SetScrollTop(i: Integer);
262 destructor Destroy; override;
264 function GetDatURL: string;
265 function GetDatgzURL: string;
266 // function GetOldDatgzURL: string;
267 function GetOfflawCgiURL(SessionID: string): string;
268 function GetSendURL: string;
269 procedure DeleteLogFile;
270 function GetThreadFileName: string;
271 procedure BeginUpdate;
274 property No: Integer read FNo write FNo;
275 property FileName: string read FFileName write FFileName;
276 property Title: string read FTitle write FTitle;
277 property ShortTitle: string read FShortTitle write FShortTitle;
278 property RoundDate: TDateTime read FRoundDate write FRoundDate;
279 property LastModified: TDateTime read FLastModified write SetLastModified;
280 property Count: Integer read FCount write FCount;
281 property AllResCount: Integer read FAllResCount write FAllResCount;
282 property NewResCount: Integer read FNewResCount write FNewResCount;
283 property Size: Integer read FSize write FSize;
284 property Round: Boolean read FRound write SetRound;
285 property RoundName: string read FRoundName write SetRoundName;
287 property IsLogFile: Boolean read FIsLogFile write FIsLogFile;
288 property ParentBoard: TBoard read FParentBoard write FParentBoard;
289 property Kokomade: Integer read FKokomade write SetKokomade;
290 property NewReceive: Integer read FNewReceive write FNewReceive;
291 property NewArrival: Boolean read FNewArrival write FNewArrival;
292 property UnRead: Boolean read FUnRead write SetUnRead;
293 property ScrollTop: Integer read FScrollTop write SetScrollTop;
294 property Expand: Boolean read FExpand write FExpand;
295 property DownloadHost: string read FDownloadHost write FDownloadHost;
296 property AgeSage: TGikoAgeSage read FAgeSage write FAgeSage;
297 // property SPID: string read FSPID write FSPID;
302 //
\8c\9f\8dõ
\8c\8b\89Ê
\83\8a\83X
\83g
303 { TSearchList = class(TList)
305 function GetThreadItem(index: integer): TThreadItem;
306 procedure SetThreadItem(index: integer; value: TThreadItem);
309 destructor Destroy; override;
311 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
313 function Add(item: TThreadItem): integer;
314 procedure Delete(index: integer);
315 procedure Clear; override;
324 GikoSystem, RoundData;
327 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
328 BBS2CH_LOG_FOLDER: string = '2ch';
330 FOLDER_INI_FILENAME: string = 'Folder.ini';
331 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
332 SUBJECT_FILENAME: string = 'subject.txt';
333 PATH_DELIM: string = '\';
334 //DEFAULT_LIST_COUNT: Integer = 100;
336 // COLUMN_CATEGORY: array[0..0] of string = ('
\83J
\83e
\83S
\83\8a\96¼');
337 // COLUMN_BOARD: array[0..3] of string = ('
\94Â
\96¼', '
\8eæ
\93¾
\90\94', '
\8f\84\89ñ
\97\
\96ñ', '
\91O
\89ñ
\8f\84\89ñ
\93ú
\8e\9e');
338 // 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');
340 (*************************************************************************
341 *
\8b@
\94\
\96¼
\81FTBBS
\83R
\83\93\83X
\83g
\83\89\83N
\83^
343 *************************************************************************)
344 constructor TBBS2ch.Create(LogFolder: string);
346 Title := BBS2CH_NAME;
347 FLogFolder := LogFolder;
350 (*************************************************************************
351 *
\8b@
\94\
\96¼
\81FTBBS
\83f
\83X
\83g
\83\89\83N
\83^
353 *************************************************************************)
354 destructor TBBS2ch.Destroy;
360 (*************************************************************************
363 *************************************************************************)
364 function TBBS2ch.GetCategory(index: integer): TCategory;
366 Result := TCategory(inherited Items[index]);
369 procedure TBBS2ch.SetCategory(index: integer; value: TCategory);
371 inherited Items[index] := value;
374 function TBBS2ch.Add(item: TCategory): integer;
376 Item.ParentBBS2ch := self;
377 Result := inherited Add(item);
380 procedure TBBS2ch.Delete(index: integer);
382 if Items[index] <> nil then
383 TCategory(Items[index]).Free;
385 inherited Delete(index);
388 procedure TBBS2ch.Clear;
392 for i := Count - 1 downto 0 do
396 function TBBS2ch.Find(key: string): TCategory;
401 function TBBS2ch.FindBBSID(BBSID: string): TBoard;
408 for i := 0 to Count - 1 do begin
409 Category := Items[i];
410 Board := Category.FindBBSID(BBSID);
411 if Board <> nil then begin
418 function TBBS2ch.FindBoardFromTitle(Title: string): TBoard;
425 for i := 0 to Count - 1 do begin
426 Category := Items[i];
427 Board := Category.FindBoardFromTitle(Title);
428 if Board <> nil then begin
435 function TBBS2ch.FindThreadItem(BBSID: string; FileName: string): TThreadItem;
440 Board := FindBBSID(BBSID);
443 Result := Board.Find(FileName);
446 (*************************************************************************
447 *
\8b@
\94\
\96¼
\81@
\81@
\81F
\83{
\81[
\83h
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
448 *
\89Â
\8e\8b\81@
\81@
\81@
\81FPublic
449 *
\97\9a\97ð
\82P
\81@
\81@
\81F
\90V
\8bK
\8dì
\90¬
450 *************************************************************************)
451 procedure TBBS2ch.ReadBoardFile;
456 CategoryList: TStringList;
457 BoardList: TStringList;
461 RoundItem: TRoundItem;
462 BBSList: TStringList;
463 CustomList: TStringList;
465 ini := TMemIniFile.Create('');
466 BBSList := TStringList.Create;
467 CustomList := TStringList.Create;
469 if FileExists(GikoSys.GetBoardFileName) then
470 BBSList.LoadFromFile(GikoSys.GetBoardFileName);
471 if FileExists(GikoSys.GetCustomBoardFileName) then
472 CustomList.LoadFromFile(GikoSys.GetCustomBoardFileName);
473 BBSList.AddStrings(CustomList);
474 ini.SetStrings(BBSList);
476 CategoryList := TStringList.Create;
477 BoardList := TStringList.Create;
479 ini.ReadSections(CategoryList);
480 for i := 0 to CategoryList.Count - 1 do begin
482 ini.ReadSection(CategoryList[i], BoardList);
483 Category := TCategory.Create;
484 Category.No := i + 1;
485 Category.Title := CategoryList[i];
487 for j := 0 to BoardList.Count - 1 do begin
488 inistr := ini.ReadString(CategoryList[i], BoardList[j], '');
489 Board := TBoard.Create;
492 Board.Title := BoardList[j];
493 Board.BBSID := GikoSys.UrlToID(inistr);
495 Board.RoundDate := ZERO_DATE;
497 idx := RoundList.Find(Board);
498 if idx <> -1 then begin
499 RoundItem := RoundList.Items[idx, grtBoard];
501 Board.RoundName := RoundItem.RoundName;
506 BBS2ch.Add(Category);
519 function TBBS2ch.GetBoardFromBBSID(BBSID: string): TBoard;
524 for i := 0 to BBS2ch.Count - 1 do begin
525 Result := BBS2ch.Items[i].FindBBSID(BBSID);
526 if Result <> nil then
531 (*************************************************************************
532 *
\83\8d\83O
\83t
\83H
\83\8b\83_
\8eæ
\93¾
534 *************************************************************************)
535 function TBBS2ch.GetLogFolder: string;
537 Result := IncludeTrailingPathDelimiter(FLogFolder)
538 + BBS2CH_LOG_FOLDER + PATH_DELIM;
541 procedure TBBS2ch.SetSelectText(s: string);
544 ShortSelectText := GikoSys.ZenToHan(s);
547 {class function TBBS2ch.GetColumnName(Index: Integer): string;
549 Result := COLUMN_CATEGORY[Index];
552 class function TBBS2ch.GetColumnCount: Integer;
554 Result := Length(COLUMN_CATEGORY);
557 //===================
559 //===================
560 constructor TCategory.Create;
564 destructor TCategory.Destroy;
570 function TCategory.GetBoard(index: integer): TBoard;
572 Result := TBoard(inherited Items[index]);
575 procedure TCategory.SetBoard(index: integer; value: TBoard);
577 inherited Items[index] := value;
580 function TCategory.Add(item: TBoard): integer;
582 Item.ParentCategory := self;
583 Result := inherited Add(item);
586 procedure TCategory.Delete(index: integer);
588 if Items[index] <> nil then
589 TBoard(Items[index]).Free;
591 inherited Delete(index);
594 procedure TCategory.Clear;
598 for i := Count - 1 downto 0 do
602 function TCategory.FindName(key: string): TBoard;
607 function TCategory.FindBBSID(BBSID: string): TBoard;
612 for i := 0 to Count - 1 do begin
613 if Items[i].FBBSID = BBSID then begin
620 function TCategory.FindBoardFromTitle(Title: string): TBoard;
625 for i := 0 to Count - 1 do begin
626 if Items[i].FTitle = Title then begin
633 function TCategory.IsMidoku: Boolean;
639 for i := 0 to Count - 1 do begin
640 if Items[i] <> nil then begin
641 for j := 0 to Items[i].Count - 1 do begin
642 if Items[i].Items[j] <> nil then begin
643 // if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].Count > Items[i].Items[j].Kokomade) then begin
644 if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].UnRead) then begin
654 {class function TCategory.GetColumnName(Index: Integer): string;
656 Result := COLUMN_BOARD[Index];
659 class function TCategory.GetColumnCount: Integer;
661 Result := Length(COLUMN_BOARD);
664 //===================
666 //===================
667 constructor TBoard.Create;
674 FRoundDate := ZERO_DATE;
675 FLastModified := ZERO_DATE;
676 FLastGetTime := ZERO_DATE;
677 FIsThreadDatRead := False;
679 // FListStyle := vsReport;
680 // FItemNoVisible := True;
685 destructor TBoard.Destroy;
687 if FModified then begin
688 GikoSys.WriteThreadDat(Self);
696 function TBoard.GetThreadItem(index: integer): TThreadItem;
698 Result := TThreadItem(inherited Items[index]);
701 procedure TBoard.SetThreadItem(index: integer; value: TThreadItem);
703 inherited Items[index] := value;
706 function TBoard.Add(Item: TThreadItem): Integer;
708 Item.ParentBoard := Self;
709 Result := inherited Add(Item);
712 procedure TBoard.Insert(Index: Integer; Item: TThreadItem);
714 Item.ParentBoard := Self;
715 inherited Insert(Index, Item);
718 //Index
\82Å
\8ew
\92è
\82³
\82ê
\82½
\83X
\83\8c\83b
\83h
\83I
\83u
\83W
\83F
\83N
\83g
\82ð
\94j
\8aü
719 procedure TBoard.Delete(index: Integer);
721 if Items[index] <> nil then
722 TThreadItem(Items[index]).Free;
724 inherited Delete(index);
727 //Index
\82Å
\8ew
\92è
\82³
\82ê
\82½
\83X
\83\8c\83b
\83h
\82ð
\83\8a\83X
\83g
\82©
\82ç
\8dí
\8f\9c\81i
\83X
\83\8c\83I
\83u
\83W
\83F
\83N
\83g
\82Í
\82Ì
\82±
\82·
\81j
728 procedure TBoard.DeleteList(index: integer);
730 inherited Delete(index);
733 procedure TBoard.Clear;
738 for i := Count - 1 downto 0 do
742 function TBoard.Find(ItemFileName: string): TThreadItem;
747 for i := 0 to Count - 1 do begin
748 if Items[i].FileName = ItemFileName then begin
755 function TBoard.GetIndex(ItemFileName: string): Integer;
760 for i := 0 to Count - 1 do begin
761 if Items[i].FileName = ItemFileName then begin
768 {function TBoard.GetMidokuCount: Integer;
773 for i := 0 to Count- 1 do begin
774 if Items[i] <> nil then begin
775 if (Items[i].IsLogFile) and (Items[i].Count > Items[i].Kokomade) then
782 procedure TBoard.LoadSettings;
787 FileName := ParentCategory.ParentBBS2ch.GetLogFolder
788 + BBSID + PATH_DELIM + FOLDER_INI_FILENAME;
790 if not FileExists(FileName) then
792 ini := TMemIniFile.Create(FileName);
794 // Round := ini.ReadBool('Status', 'Round', False);
795 FRoundDate := ini.ReadDateTime('Status', 'RoundDate', ZERO_DATE);
796 FLastModified := ini.ReadDateTime('Status', 'LastModified', ZERO_DATE);
797 FLastGetTime := ini.ReadDateTime('Status', 'LastGetTime', ZERO_DATE);
798 FUnRead := ini.ReadInteger('Status', 'UnRead', 0);
799 FSPID := ini.ReadString('Cookie', 'SPID', '');
800 FPON := ini.ReadString('Cookie', 'PON', '');
801 FKotehanName := ini.ReadString('Kotehan', 'Name', '');
802 FKotehanMail := ini.ReadString('Kotehan', 'Mail', '');
803 // ListStyle := TViewStyle(Ord(ini.ReadInteger('Status', 'ListStyle', 3)));
804 // ItemNoVisible := ini.ReadBool('Status', 'ItemNoVisible', True);
805 // ViewType := TGikoViewType(Ord(ini.ReadInteger('Status', 'ViewType', 0)));
813 procedure TBoard.SaveSettings;
818 FileName := ParentCategory.ParentBBS2ch.GetLogFolder
819 + BBSID + PATH_DELIM;
820 if not GikoSys.DirectoryExistsEx(FileName) then
821 GikoSys.ForceDirectoriesEx(FileName);
822 FileName := FileName + FOLDER_INI_FILENAME;
823 ini := TMemIniFile.Create(FileName);
827 // ini.WriteBool('Status', 'Round', Round);
828 ini.WriteDateTime('Status', 'RoundDate', FRoundDate);
829 ini.WriteDateTime('Status', 'LastModified', FLastModified);
830 ini.WriteDateTime('Status', 'LastGetTime', FLastGetTime);
831 ini.WriteInteger('Status', 'UnRead', FUnRead);
832 ini.WriteString('Cookie', 'SPID', FSPID);
833 ini.WriteString('Cookie', 'PON', FPON);
834 ini.WriteString('Kotehan', 'Name', FKotehanName);
835 ini.WriteString('Kotehan', 'Mail', FKotehanMail);
836 // ini.WriteInteger('Status', 'ListStyle', Ord(ListStyle));
837 // ini.WriteBool('Status', 'ItemNoVisible', ItemNoVisible);
838 // ini.WriteInteger('Status', 'ViewType', Ord(ViewType));
845 //
\83T
\83u
\83W
\83F
\83N
\83gURL
\8eæ
\93¾
846 function TBoard.GetReadCgiURL: string;
848 //Result := URL + SUBJECT_FILENAME;
849 //Result := GikoSys.UrlToServer(URL)
850 // + 'test/read.cgi/' + BBSID + '/?raw=0.0';
851 Result := URL + SUBJECT_FILENAME;
855 //
\83T
\83u
\83W
\83F
\83N
\83g
\83t
\83@
\83C
\83\8b\96¼
\8eæ
\93¾
\81i
\83p
\83X
\81{
\83t
\83@
\83C
\83\8b\96¼
\81j
856 function TBoard.GetSubjectFileName: string;
858 Result := ParentCategory.ParentBBS2ch.GetLogFolder
859 + BBSID + PATH_DELIM + SUBJECT_FILENAME;
862 //
\83C
\83\93\83f
\83b
\83N
\83X
\83t
\83@
\83C
\83\8b\96¼(folder.idx)
\8eæ
\93¾
\81i
\83p
\83X
\81{
\83t
\83@
\83C
\83\8b\96¼
\81j
863 function TBoard.GetFolderIndexFileName: string;
865 Result := ParentCategory.ParentBBS2ch.GetLogFolder
866 + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME;
869 //
\83X
\83\8c\97§
\82Ä
\91\97\90MURL
870 function TBoard.GetSendURL: string;
872 Result := GikoSys.UrlToServer(URL) + 'test/subbbs.cgi';
875 procedure TBoard.SetRound(b: Boolean);
880 RoundList.Delete(Self);
881 if FRound = b then Exit;
887 procedure TBoard.SetRoundName(s: string);
889 if FRoundName = s then Exit;
895 procedure TBoard.SetLastModified(d: TDateTime);
897 if FLastModified = d then Exit;
903 procedure TBoard.SetLastGetTime(d: TDateTime);
905 if FLastGetTime = d then Exit;
911 procedure TBoard.SetUnRead(i: Integer);
913 if FUnRead = i then Exit;
914 if i < 0 then i := 0;
920 procedure TBoard.SetKotehanName(s: string);
922 if FKotehanName = s then Exit;
928 procedure TBoard.SetKotehanMail(s: string);
930 if FKotehanMail = s then Exit;
936 function TBoard.GetNewThreadCount: Integer;
941 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
943 for i := 0 to Count - 1 do begin
944 if Items[i].NewArrival then
948 for i := 0 to Count - 1 do begin
949 if Items[i].NewArrival then
951 if Items[i].ShortTitle = '' then
952 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
953 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
960 function TBoard.GetLogThreadCount: Integer;
965 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
967 for i := 0 to Count - 1 do begin
968 if Items[i].IsLogFile then
972 for i := 0 to Count - 1 do begin
973 if Items[i].IsLogFile then
975 if Items[i].ShortTitle = '' then
976 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
977 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
984 function TBoard.GetUserThreadCount: Integer;
989 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
992 for i := 0 to Count - 1 do begin
993 if Items[i].ShortTitle = '' then
994 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
995 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
1000 function TBoard.GetNewThread(Index: Integer): TThreadItem;
1007 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1009 for i := 0 to Count - 1 do begin
1010 if Items[i].NewArrival then
1012 if Index = Cnt then begin
1020 for i := 0 to Count - 1 do begin
1021 if Items[i].NewArrival then
1023 if Items[i].ShortTitle = '' then
1024 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1025 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1026 if Index = Cnt then begin
1037 function TBoard.GetLogThread(Index: Integer): TThreadItem;
1043 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1045 for i := 0 to Count - 1 do begin
1046 if Items[i].IsLogFile then
1048 if Index = Cnt then begin
1056 for i := 0 to Count - 1 do begin
1057 if Items[i].IsLogFile then
1059 if Items[i].ShortTitle = '' then
1060 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1061 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1062 if Index = Cnt then begin
1074 function TBoard.GetUserThread(Index: Integer): TThreadItem;
1081 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1083 for i := 0 to Count - 1 do begin
1086 Result := Items[ i ];
1092 for i := 0 to Count - 1 do begin
1093 if Items[i].ShortTitle = '' then
1094 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1095 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1096 if Index = Cnt then begin
1106 procedure TBoard.BeginUpdate;
1111 procedure TBoard.EndUpdate;
1116 {class function TBoard.GetColumnName(Index: Integer): string;
1118 Result := COLUMN_THREADITEM[Index];
1121 class function TBoard.GetColumnCount: Integer;
1123 Result := Length(COLUMN_THREADITEM);
1126 //constructor TThreadItem.Create(AOwner: TComponent);
1127 constructor TThreadItem.Create;
1132 FRoundDate := ZERO_DATE;
1133 FLastModified := ZERO_DATE;
1139 FIsLogFile := False;
1140 FParentBoard := nil;
1143 FNewArrival := False;
1148 destructor TThreadItem.Destroy;
1153 function TThreadItem.GetDatURL: string;
1155 Protocol, Host, Path, Document, Port, Bookmark: string;
1157 Result := ParentBoard.URL
1160 if FDownloadHost <> '' then begin
1161 GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1162 Result := Format('%s://%s%s%s', [Protocol,
1167 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1168 // + 'test/read.cgi/' + ParentBoard.BBSID + '/'
1169 // + ChangeFileExt(FileName, '') + '/?raw='
1170 // + IntToStr(ResNum) + '.' + IntToStr(ResSize);
1173 function TThreadItem.GetDatgzURL: string;
1174 function isOldKako(s: string): Boolean;
1177 if AnsiPos('piza.', s) <> 0 then
1179 else if AnsiPos('www.bbspink.', s) <> 0 then
1181 else if AnsiPos('tako.', s) <> 0 then
1185 Protocol, Host, Path, Document, Port, Bookmark: string;
1188 if FDownloadHost = '' then begin
1189 DatNo := ChangeFileExt(FileName, '');
1190 if isOldKako(ParentBoard.URL) then begin
1191 Result := Format('%s%s/%.3s/%s.dat', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1193 if Length(DatNo) > 9 then begin
1194 //http://xxx.2ch.net/xxx/kako/9999/99999/999999999.dat.gz
1195 Result := Format('%s%s/%.4s/%.5s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo, DatNo]);
1197 //http://xxx.2ch.net/xxx/kako/999/999999999.dat.gz
1198 Result := Format('%s%s/%.3s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1202 Gikosys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1203 DatNo := ChangeFileExt(Document, '');
1204 if isOldKako(DownloadHost) then begin
1205 Result := Format('%s://%s/%s/kako/%.3s/%s.dat', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1207 if Length(DatNo) > 9 then begin
1208 Result := Format('%s://%s/%s/kako/%.4s/%.5s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo, DatNo]);
1210 Result := Format('%s://%s/%s/kako/%.3s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1216 {function TThreadItem.GetOldDatgzURL: string;
1218 Protocol, Host, Path, Document, Port, Bookmark: string;
1220 Result := Format('%s%s/%.3s/%s.gz', [ParentBoard.URL,
1224 if FDownloadHost <> '' then begin
1225 ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1226 Result := Format('%s://%s%s%s', [Protocol,
1234 function TThreadItem.GetOfflawCgiURL(SessionID: string): string;
1236 // Protocol, Host, Path, Document, Port, Bookmark: string;
1238 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1239 // + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1240 // + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1241 if FDownloadHost = '' then begin
1242 Result := GikoSys.UrlToServer(ParentBoard.URL)
1243 + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1244 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1246 //http://news.2ch.net/test/offlaw.cgi/newsplus/1014038577/?raw=.196928&sid=
1247 //GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1248 Result := 'http://' + FDownloadHost
1249 + '/test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1250 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1251 // Result := Format('%s://%s%s%s', [Protocol,
1258 function TThreadItem.GetSendURL: string;
1260 Result := GikoSys.UrlToServer(ParentBoard.URL)
1264 procedure TThreadItem.DeleteLogFile;
1266 DeleteFile(GetThreadFileName);
1267 if FileExists(ChangeFileExt(GetThreadFileName,'.NG')) = true then
1268 DeleteFile(ChangeFileExt(GetThreadFileName,'.NG'));
1269 FRoundDate := ZERO_DATE;
1270 FLastModified := ZERO_DATE;
1272 FIsLogFile := False;
1275 FNewArrival := False;
1279 FDownloadHost := '';
1280 FAgeSage := gasNone;
1287 function TThreadItem.GetThreadFileName: string;
1289 Result := ParentBoard.ParentCategory.ParentBBS2ch.GetLogFolder
1290 + ParentBoard.BBSID + PATH_DELIM + FileName;
1293 procedure TThreadItem.SetLastModified(d: TDateTime);
1295 if FLastModified = d then Exit;
1297 if FUpdate and (ParentBoard <> nil) then
1298 ParentBoard.FModified := True;
1301 {procedure TThreadItem.SetRoundNo(i: Integer);
1303 if FRoundNo = i then Exit;
1305 if FUpdate and (ParentBoard <> nil) then
1306 ParentBoard.FModified := True;
1309 procedure TThreadItem.SetRound(b: Boolean);
1314 RoundList.Delete(Self);
1315 if FRound = b then Exit;
1317 if FUpdate and (ParentBoard <> nil) then
1318 ParentBoard.FModified := True;
1321 procedure TThreadItem.SetRoundName(s: string);
1323 if FRoundName = s then Exit;
1325 if FUpdate and (ParentBoard <> nil) then
1326 ParentBoard.FModified := True;
1329 procedure TThreadItem.SetKokomade(i: Integer);
1331 if FKokomade = i then Exit;
1333 if FUpdate and (ParentBoard <> nil) then
1334 ParentBoard.FModified := True;
1337 procedure TThreadItem.SetUnRead(b: Boolean);
1339 if FUnRead = b then Exit;
1341 if FUpdate and (ParentBoard <> nil) then
1342 ParentBoard.FModified := True;
1345 procedure TThreadItem.SetScrollTop(i: Integer);
1347 if FScrollTop = i then Exit;
1349 if FUpdate and (ParentBoard <> nil) then
1350 ParentBoard.FModified := True;
1353 procedure TThreadItem.BeginUpdate;
1358 procedure TThreadItem.EndUpdate;
1364 BBS2ch := TBBS2ch.Create;
1367 if BBS2ch <> nil then