6 Windows, SysUtils, Classes, ComCtrls, IniFiles, {HTTPApp,} YofUtils, IdGlobal,
10 //
\83\8a\83X
\83g
\82Ì
\95\
\8e¦
\83A
\83C
\83e
\83\80\91I
\91ð
11 TGikoViewType = (gvtAll, gvtLog, gvtNew, gvtUser);
12 //
\83\8a\83X
\83g
\82Ì
\8eæ
\93¾
\8c\8f\90\94
13 //TGikoListCount = (glc50, glc100, glc200, glc500, glc1000, glcAll);
14 //
\8f\84\89ñ
\94Ô
\8d\86
15 //TGikoRoundNo = (grnNone, grn1, grn2, grn3, grn4, grn5, grnOnce);
16 //
\83\8a\83X
\83g
\82Ì
\8fã
\82°
\89º
\82°
17 TGikoAgeSage = (gasNone, gasAge, gasSage, gasNew);
21 FItemList: TList; //
\8eq
\83A
\83C
\83e
\83\80\83\8a\83X
\83g
22 FLeaf: Boolean; //
\89º
\82É
\83t
\83H
\83\8b\83_
\82ð
\8e\9d\82Â
\82±
\82Æ
\82ª
\8fo
\97\88\82é
\82©
24 function Add(Item: TFolder): Integer;
26 procedure Delete(Index: Integer);
27 procedure Exchange(Index1, Index2: Integer);
28 procedure Insert(Index: Integer; Item: TFolder);
29 procedure Move(CurIndex, NewIndex: Integer);
30 function Remove(Item: TFolder): Integer;
31 procedure Sort(Compare: TListSortCompare);
32 property Capacity: Integer read FCapacity write SetCapacity;
33 property Count: Integer read FCount write SetCount;
34 property Items[Index: Integer]: TFolder read Get write Put; default;
36 property Leaf: Boolean read FLeaf;
41 TCategory class(TFolder)
43 TBoard = class(TFolder)
45 TThreadItem = class(TFolder)
52 TBoard2ch = class(TBoard)
54 TThreadItem2ch = class(TThreadItem)
62 // ICategory = interface
66 // IThreadItem = interface
73 //
\82Æ
\82è
\82 \82¦
\82¸
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é
\82Ì
\83\8b\81[
\83g
74 TBBS2ch = class(TList)
79 FKubetsuChk: Boolean; //
\8di
\8d\9e\82Ý
\8e\9e\91å
\95¶
\8e\9a\8f¬
\95¶
\8e\9a\8bæ
\95Ê
80 FSelectText: string; //
\8di
\8d\9e\82Ý
\95¶
\8e\9a\97ñ
81 FShortSelectText: string;
83 function GetCategory(index: integer): TCategory;
84 procedure SetCategory(index: integer; value: TCategory);
85 procedure SetSelectText(s: string);
87 constructor Create(LogFolder: string);
88 destructor Destroy; override;
90 procedure ReadBoardFile;
92 function GetBoardFromBBSID(BBSID: string): TBoard;
94 function Add(item: TCategory): integer;
95 procedure Delete(index: integer);
96 procedure Clear; override;
97 function Find(key: string): TCategory;
98 function FindBBSID(BBSID: string): TBoard;
99 function FindBoardFromTitle(Title: string): TBoard;
100 function FindThreadItem(BBSID: string; FileName: string): TThreadItem;
101 function GetLogFolder: string;
103 property Items[index: integer]: TCategory read GetCategory write SetCategory;
104 property Title: string read FTitle write FTitle;
105 property NodeExpand: Boolean read FExpand write FExpand;
107 property KubetsuChk: Boolean read FKubetsuChk write FKubetsuChk;
108 property SelectText: string read FSelectText write SetSelectText;
109 property ShortSelectText: string read FShortSelectText write FShortSelectText;
113 TCategory = class(TList)
117 FParentBBS2ch: TBBS2ch;
120 function GetBoard(index: integer): TBoard;
121 procedure SetBoard(index: integer; value: TBoard);
124 destructor Destroy; override;
126 property No: Integer read FNo write FNo;
127 property Title: string read FTitle write FTitle;
128 property Items[index: integer]: TBoard read GetBoard write SetBoard;
129 property ParentBBS2ch: TBBS2ch read FParentBBS2ch write FParentBBS2ch;
131 function Add(item: TBoard): integer;
132 procedure Delete(index: integer);
133 procedure Clear; override;
134 function FindName(key: string): TBoard;
135 function FindBBSID(BBSID: string): TBoard;
136 function FindBoardFromTitle(Title: string): TBoard;
137 function IsMidoku: Boolean;
139 property NodeExpand: Boolean read FExpand write FExpand;
143 TBoard = class(TList)
145 FNo: Integer; //
\94Ô
\8d\86
146 FTitle: string; //
\83{
\81[
\83h
\83^
\83C
\83g
\83\8b
147 FBBSID: string; //BBSID
148 FURL: string; //
\83{
\81[
\83hURL
149 FRound: Boolean; //
\83X
\83\8c\83b
\83h
\88ê
\97\97\8f\84\89ñ
\97\
\96ñ
150 FRoundName: string; //
\8f\84\89ñ
\96¼
151 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
152 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
153 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
154 FIsThreadDatRead: Boolean; //
\83X
\83\8c\83b
\83h
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
155 FUnRead: Integer; //
\83X
\83\8c\83b
\83h
\96¢
\93Ç
\90\94
156 FParentCategory: TCategory; //
\90e
\83J
\83e
\83S
\83\8a
157 FModified: Boolean; //
\8fC
\90³
\83t
\83\89\83O
158 FBoolData: Boolean; //
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
159 FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
160 FPON: string; //
\8f\91\82«
\8d\9e\82Ý
\97pPON
161 FKotehanName: string; //
\83R
\83e
\83n
\83\93\96¼
\91O
162 FKotehanMail: string; //
\83R
\83e
\83n
\83\93\83\81\81[
\83\8b
167 function GetThreadItem(index: integer): TThreadItem;
168 procedure SetThreadItem(index: integer; value: TThreadItem);
169 procedure SetRound(b: Boolean);
170 procedure SetRoundName(s: string);
171 procedure SetLastModified(d: TDateTime);
172 procedure SetLastGetTime(d: TDateTime);
173 procedure SetUnRead(i: Integer);
174 procedure SetKotehanName(s: string);
175 procedure SetKotehanMail(s: string);
178 destructor Destroy; override;
180 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
181 property No: Integer read FNo write FNo;
182 property Title: string read FTitle write FTitle;
183 property BBSID: string read FBBSID write FBBSID;
184 property URL: string read FURL write FURL;
185 property Round: Boolean read FRound write SetRound;
186 property RoundName: string read FRoundName write SetRoundName;
187 property RoundDate: TDateTime read FRoundDate write FRoundDate;
188 property LastModified: TDateTime read FLastModified write SetLastModified;
189 property LastGetTime: TDateTime read FLastGetTime write SetLastGetTime;
190 property UnRead: Integer read FUnRead write SetUnRead;
191 property Modified: Boolean read FModified write FModified;
192 property IsThreadDatRead: Boolean read FIsThreadDatRead write FIsThreadDatRead;
193 property ParentCategory: TCategory read FParentCategory write FParentCategory;
195 function Add(item: TThreadItem): integer;
196 procedure Insert(Index: Integer; Item: TThreadItem);
197 procedure Delete(index: integer);
198 procedure DeleteList(index: integer);
199 procedure Clear; override;
200 function Find(ItemFileName: string): TThreadItem;
201 function GetIndex(ItemFileName: string): Integer;
202 procedure LoadSettings;
203 procedure SaveSettings;
204 function GetReadCgiURL: string;
205 function GetSubjectFileName: string;
206 function GetFolderIndexFileName: string;
207 function GetSendURL: string;
209 function GetNewThreadCount: Integer;
210 function GetLogThreadCount: Integer;
211 function GetUserThreadCount: Integer;
212 function GetNewThread(Index: Integer): TThreadItem;
213 function GetLogThread(Index: Integer): TThreadItem;
214 function GetUserThread(Index: Integer): TThreadItem;
216 procedure BeginUpdate;
218 property NodeExpand: Boolean read FExpand write FExpand;
219 property BoolData: Boolean read FBoolData write FBoolData;
220 property SPID: string read FSPID write FSPID;
221 property PON: string read FPON write FPON;
222 property KotehanName: string read FKotehanName write SetKotehanName;
223 property KotehanMail: string read FKotehanMail write SetKotehanMail;
227 TThreadItem = class(TObject)
229 FContext: DWORD; //
\83v
\83\89\83O
\83C
\83\93\82ª
\8e©
\97R
\82É
\90Ý
\92è
\82µ
\82Ä
\82¢
\82¢
\92l(
\8eå
\82É
\83C
\83\93\83X
\83^
\83\93\83X
\82ª
\93ü
\82é)
231 FNo: Integer; //
\94Ô
\8d\86
232 FFileName: string; //
\83X
\83\8c\83b
\83h
\83t
\83@
\83C
\83\8b\96¼
233 FTitle: string; //
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b
234 FShortTitle: string; //
\92Z
\82¢
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b\81i
\8c\9f\8dõ
\97p
\81j
235 FRoundDate: TDateTime; //
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e\81i
\8f\84\89ñ
\93ú
\8e\9e\81j
236 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
237 FCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83\8d\81[
\83J
\83\8b\81j
238 FAllResCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83T
\81[
\83o
\81j
239 FNewResCount: Integer; //
\83X
\83\8c\83b
\83h
\90V
\92\85\90\94
240 FSize: Integer; //
\83X
\83\8c\83b
\83h
\83T
\83C
\83Y
241 FRound: Boolean; //
\8f\84\89ñ
\83t
\83\89\83O
242 FRoundName: string; //
\8f\84\89ñ
\96¼
243 FIsLogFile: Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
244 FParentBoard: TBoard; //
\90e
\83{
\81[
\83h
245 FKokomade: Integer; //
\83R
\83R
\82Ü
\82Å
\93Ç
\82ñ
\82¾
\94Ô
\8d\86
246 FNewReceive: Integer; //
\83R
\83R
\82©
\82ç
\90V
\8bK
\8eó
\90M
247 FNewArrival: Boolean; //
\90V
\92\85
248 FUnRead: Boolean; //
\96¢
\93Ç
\83t
\83\89\83O
249 FScrollTop: Integer; //
\83X
\83N
\83\8d\81[
\83\8b\88Ê
\92u
250 FDownloadHost: string; //
\8d¡
\82Ì
\83z
\83X
\83g
\82Æ
\88á
\82¤
\8fê
\8d\87\82Ì
\83z
\83X
\83g
251 FAgeSage: TGikoAgeSage; //
\83A
\83C
\83e
\83\80\82Ì
\8fã
\82°
\89º
\82°
252 // FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
256 FURL : string; //
\82±
\82Ì
\83X
\83\8c\82ð
\83u
\83\89\83E
\83U
\82Å
\95\
\8e¦
\82·
\82é
\8dÛ
\82Ì URL
257 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\83X
\83\8c\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
258 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
259 FSizeByte : Integer; // CreateHTML2
\82ð
\8eÀ
\8ds
\82µ
\82Ä
\82¢
\82é
\8dÅ
\92\86\82É
\88ê
\8e\9e\93I
\82É
\95Û
\91¶
\82³
\82ê
\82é
\92l
261 procedure SetLastModified(d: TDateTime);
262 procedure SetRound(b: Boolean);
263 procedure SetRoundName(s: string);
264 procedure SetKokomade(i: Integer);
265 procedure SetUnRead(b: Boolean);
266 procedure SetScrollTop(i: Integer);
267 function GetURLWrapper: string;
269 constructor Create; overload;
270 constructor Create( inPlugIn : TBoardPlugIn; inURL : string = '' ); overload;
271 destructor Destroy; override;
273 function GetDatURL: string;
274 function GetDatgzURL: string;
275 // function GetOldDatgzURL: string;
276 function GetOfflawCgiURL(SessionID: string): string;
277 function GetSendURL: string;
278 procedure DeleteLogFile;
279 function GetThreadFileName: string;
280 procedure BeginUpdate;
283 property Context: DWORD read FContext write FContext;
285 property No: Integer read FNo write FNo;
286 property FileName: string read FFileName write FFileName;
287 property Title: string read FTitle write FTitle;
288 property ShortTitle: string read FShortTitle write FShortTitle;
289 property RoundDate: TDateTime read FRoundDate write FRoundDate;
290 property LastModified: TDateTime read FLastModified write SetLastModified;
291 property Count: Integer read FCount write FCount;
292 property AllResCount: Integer read FAllResCount write FAllResCount;
293 property NewResCount: Integer read FNewResCount write FNewResCount;
294 property Size: Integer read FSize write FSize;
295 property Round: Boolean read FRound write SetRound;
296 property RoundName: string read FRoundName write SetRoundName;
298 property IsLogFile: Boolean read FIsLogFile write FIsLogFile;
299 property ParentBoard: TBoard read FParentBoard write FParentBoard;
300 property Kokomade: Integer read FKokomade write SetKokomade;
301 property NewReceive: Integer read FNewReceive write FNewReceive;
302 property NewArrival: Boolean read FNewArrival write FNewArrival;
303 property UnRead: Boolean read FUnRead write SetUnRead;
304 property ScrollTop: Integer read FScrollTop write SetScrollTop;
305 property Expand: Boolean read FExpand write FExpand;
306 property DownloadHost: string read FDownloadHost write FDownloadHost;
307 property AgeSage: TGikoAgeSage read FAgeSage write FAgeSage;
308 // property SPID: string read FSPID write FSPID;
310 property URL : string read GetURLWrapper write FURL;
311 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
312 property FilePath : string read FFilePath write FFilePath;
313 property SizeByte : Integer read FSizeByte write FSizeByte;
318 //
\8c\9f\8dõ
\8c\8b\89Ê
\83\8a\83X
\83g
319 { TSearchList = class(TList)
321 function GetThreadItem(index: integer): TThreadItem;
322 procedure SetThreadItem(index: integer; value: TThreadItem);
325 destructor Destroy; override;
327 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
329 function Add(item: TThreadItem): integer;
330 procedure Delete(index: integer);
331 procedure Clear; override;
340 GikoSystem, RoundData;
343 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
344 BBS2CH_LOG_FOLDER: string = '2ch';
346 FOLDER_INI_FILENAME: string = 'Folder.ini';
347 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
348 SUBJECT_FILENAME: string = 'subject.txt';
349 PATH_DELIM: string = '\';
350 //DEFAULT_LIST_COUNT: Integer = 100;
352 // COLUMN_CATEGORY: array[0..0] of string = ('
\83J
\83e
\83S
\83\8a\96¼');
353 // 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');
354 // 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');
356 (*************************************************************************
357 *
\8b@
\94\
\96¼
\81FTBBS
\83R
\83\93\83X
\83g
\83\89\83N
\83^
359 *************************************************************************)
360 constructor TBBS2ch.Create(LogFolder: string);
362 Title := BBS2CH_NAME;
363 FLogFolder := LogFolder;
366 (*************************************************************************
367 *
\8b@
\94\
\96¼
\81FTBBS
\83f
\83X
\83g
\83\89\83N
\83^
369 *************************************************************************)
370 destructor TBBS2ch.Destroy;
376 (*************************************************************************
379 *************************************************************************)
380 function TBBS2ch.GetCategory(index: integer): TCategory;
382 Result := TCategory(inherited Items[index]);
385 procedure TBBS2ch.SetCategory(index: integer; value: TCategory);
387 inherited Items[index] := value;
390 function TBBS2ch.Add(item: TCategory): integer;
392 Item.ParentBBS2ch := self;
393 Result := inherited Add(item);
396 procedure TBBS2ch.Delete(index: integer);
398 if Items[index] <> nil then
399 TCategory(Items[index]).Free;
401 inherited Delete(index);
404 procedure TBBS2ch.Clear;
408 for i := Count - 1 downto 0 do
412 function TBBS2ch.Find(key: string): TCategory;
417 function TBBS2ch.FindBBSID(BBSID: string): TBoard;
424 for i := 0 to Count - 1 do begin
425 Category := Items[i];
426 Board := Category.FindBBSID(BBSID);
427 if Board <> nil then begin
434 function TBBS2ch.FindBoardFromTitle(Title: string): TBoard;
441 for i := 0 to Count - 1 do begin
442 Category := Items[i];
443 Board := Category.FindBoardFromTitle(Title);
444 if Board <> nil then begin
451 function TBBS2ch.FindThreadItem(BBSID: string; FileName: string): TThreadItem;
456 Board := FindBBSID(BBSID);
459 Result := Board.Find(FileName);
462 (*************************************************************************
463 *
\8b@
\94\
\96¼
\81@
\81@
\81F
\83{
\81[
\83h
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
464 *
\89Â
\8e\8b\81@
\81@
\81@
\81FPublic
465 *
\97\9a\97ð
\82P
\81@
\81@
\81F
\90V
\8bK
\8dì
\90¬
466 *************************************************************************)
467 procedure TBBS2ch.ReadBoardFile;
472 CategoryList: TStringList;
473 BoardList: TStringList;
477 RoundItem: TRoundItem;
478 BBSList: TStringList;
479 CustomList: TStringList;
481 ini := TMemIniFile.Create('');
482 BBSList := TStringList.Create;
483 CustomList := TStringList.Create;
485 if FileExists(GikoSys.GetBoardFileName) then
486 BBSList.LoadFromFile(GikoSys.GetBoardFileName);
487 if FileExists(GikoSys.GetCustomBoardFileName) then
488 CustomList.LoadFromFile(GikoSys.GetCustomBoardFileName);
489 BBSList.AddStrings(CustomList);
490 ini.SetStrings(BBSList);
492 CategoryList := TStringList.Create;
493 BoardList := TStringList.Create;
495 ini.ReadSections(CategoryList);
496 for i := 0 to CategoryList.Count - 1 do begin
498 ini.ReadSection(CategoryList[i], BoardList);
499 Category := TCategory.Create;
500 Category.No := i + 1;
501 Category.Title := CategoryList[i];
503 for j := 0 to BoardList.Count - 1 do begin
504 inistr := ini.ReadString(CategoryList[i], BoardList[j], '');
505 Board := TBoard.Create;
508 Board.Title := BoardList[j];
509 Board.BBSID := GikoSys.UrlToID(inistr);
511 Board.RoundDate := ZERO_DATE;
513 idx := RoundList.Find(Board);
514 if idx <> -1 then begin
515 RoundItem := RoundList.Items[idx, grtBoard];
517 Board.RoundName := RoundItem.RoundName;
522 BBS2ch.Add(Category);
535 function TBBS2ch.GetBoardFromBBSID(BBSID: string): TBoard;
540 for i := 0 to BBS2ch.Count - 1 do begin
541 Result := BBS2ch.Items[i].FindBBSID(BBSID);
542 if Result <> nil then
547 (*************************************************************************
548 *
\83\8d\83O
\83t
\83H
\83\8b\83_
\8eæ
\93¾
550 *************************************************************************)
551 function TBBS2ch.GetLogFolder: string;
553 Result := IncludeTrailingPathDelimiter(FLogFolder)
554 + BBS2CH_LOG_FOLDER + PATH_DELIM;
557 procedure TBBS2ch.SetSelectText(s: string);
560 ShortSelectText := GikoSys.ZenToHan(s);
563 {class function TBBS2ch.GetColumnName(Index: Integer): string;
565 Result := COLUMN_CATEGORY[Index];
568 class function TBBS2ch.GetColumnCount: Integer;
570 Result := Length(COLUMN_CATEGORY);
573 //===================
575 //===================
576 constructor TCategory.Create;
580 destructor TCategory.Destroy;
586 function TCategory.GetBoard(index: integer): TBoard;
588 Result := TBoard(inherited Items[index]);
591 procedure TCategory.SetBoard(index: integer; value: TBoard);
593 inherited Items[index] := value;
596 function TCategory.Add(item: TBoard): integer;
598 Item.ParentCategory := self;
599 Result := inherited Add(item);
602 procedure TCategory.Delete(index: integer);
604 if Items[index] <> nil then
605 TBoard(Items[index]).Free;
607 inherited Delete(index);
610 procedure TCategory.Clear;
614 for i := Count - 1 downto 0 do
618 function TCategory.FindName(key: string): TBoard;
623 function TCategory.FindBBSID(BBSID: string): TBoard;
628 for i := 0 to Count - 1 do begin
629 if Items[i].FBBSID = BBSID then begin
636 function TCategory.FindBoardFromTitle(Title: string): TBoard;
641 for i := 0 to Count - 1 do begin
642 if Items[i].FTitle = Title then begin
649 function TCategory.IsMidoku: Boolean;
655 for i := 0 to Count - 1 do begin
656 if Items[i] <> nil then begin
657 for j := 0 to Items[i].Count - 1 do begin
658 if Items[i].Items[j] <> nil then begin
659 // if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].Count > Items[i].Items[j].Kokomade) then begin
660 if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].UnRead) then begin
670 {class function TCategory.GetColumnName(Index: Integer): string;
672 Result := COLUMN_BOARD[Index];
675 class function TCategory.GetColumnCount: Integer;
677 Result := Length(COLUMN_BOARD);
680 //===================
682 //===================
683 constructor TBoard.Create;
690 FRoundDate := ZERO_DATE;
691 FLastModified := ZERO_DATE;
692 FLastGetTime := ZERO_DATE;
693 FIsThreadDatRead := False;
695 // FListStyle := vsReport;
696 // FItemNoVisible := True;
701 destructor TBoard.Destroy;
703 if FModified then begin
704 GikoSys.WriteThreadDat(Self);
712 function TBoard.GetThreadItem(index: integer): TThreadItem;
714 Result := TThreadItem(inherited Items[index]);
717 procedure TBoard.SetThreadItem(index: integer; value: TThreadItem);
719 inherited Items[index] := value;
722 function TBoard.Add(Item: TThreadItem): Integer;
724 Item.ParentBoard := Self;
725 Result := inherited Add(Item);
728 procedure TBoard.Insert(Index: Integer; Item: TThreadItem);
730 Item.ParentBoard := Self;
731 inherited Insert(Index, Item);
734 //Index
\82Å
\8ew
\92è
\82³
\82ê
\82½
\83X
\83\8c\83b
\83h
\83I
\83u
\83W
\83F
\83N
\83g
\82ð
\94j
\8aü
735 procedure TBoard.Delete(index: Integer);
737 if Items[index] <> nil then
738 TThreadItem(Items[index]).Free;
740 inherited Delete(index);
743 //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
744 procedure TBoard.DeleteList(index: integer);
746 inherited Delete(index);
749 procedure TBoard.Clear;
754 for i := Count - 1 downto 0 do
758 function TBoard.Find(ItemFileName: string): TThreadItem;
763 for i := 0 to Count - 1 do begin
764 if Items[i].FileName = ItemFileName then begin
771 function TBoard.GetIndex(ItemFileName: string): Integer;
776 for i := 0 to Count - 1 do begin
777 if Items[i].FileName = ItemFileName then begin
784 {function TBoard.GetMidokuCount: Integer;
789 for i := 0 to Count- 1 do begin
790 if Items[i] <> nil then begin
791 if (Items[i].IsLogFile) and (Items[i].Count > Items[i].Kokomade) then
798 procedure TBoard.LoadSettings;
803 FileName := ParentCategory.ParentBBS2ch.GetLogFolder
804 + BBSID + PATH_DELIM + FOLDER_INI_FILENAME;
806 if not FileExists(FileName) then
808 ini := TMemIniFile.Create(FileName);
810 // Round := ini.ReadBool('Status', 'Round', False);
811 FRoundDate := ini.ReadDateTime('Status', 'RoundDate', ZERO_DATE);
812 FLastModified := ini.ReadDateTime('Status', 'LastModified', ZERO_DATE);
813 FLastGetTime := ini.ReadDateTime('Status', 'LastGetTime', ZERO_DATE);
814 FUnRead := ini.ReadInteger('Status', 'UnRead', 0);
815 FSPID := ini.ReadString('Cookie', 'SPID', '');
816 FPON := ini.ReadString('Cookie', 'PON', '');
817 FKotehanName := ini.ReadString('Kotehan', 'Name', '');
818 FKotehanMail := ini.ReadString('Kotehan', 'Mail', '');
819 // ListStyle := TViewStyle(Ord(ini.ReadInteger('Status', 'ListStyle', 3)));
820 // ItemNoVisible := ini.ReadBool('Status', 'ItemNoVisible', True);
821 // ViewType := TGikoViewType(Ord(ini.ReadInteger('Status', 'ViewType', 0)));
829 procedure TBoard.SaveSettings;
834 FileName := ParentCategory.ParentBBS2ch.GetLogFolder
835 + BBSID + PATH_DELIM;
836 if not GikoSys.DirectoryExistsEx(FileName) then
837 GikoSys.ForceDirectoriesEx(FileName);
838 FileName := FileName + FOLDER_INI_FILENAME;
839 ini := TMemIniFile.Create(FileName);
843 // ini.WriteBool('Status', 'Round', Round);
844 ini.WriteDateTime('Status', 'RoundDate', FRoundDate);
845 ini.WriteDateTime('Status', 'LastModified', FLastModified);
846 ini.WriteDateTime('Status', 'LastGetTime', FLastGetTime);
847 ini.WriteInteger('Status', 'UnRead', FUnRead);
848 ini.WriteString('Cookie', 'SPID', FSPID);
849 ini.WriteString('Cookie', 'PON', FPON);
850 ini.WriteString('Kotehan', 'Name', FKotehanName);
851 ini.WriteString('Kotehan', 'Mail', FKotehanMail);
852 // ini.WriteInteger('Status', 'ListStyle', Ord(ListStyle));
853 // ini.WriteBool('Status', 'ItemNoVisible', ItemNoVisible);
854 // ini.WriteInteger('Status', 'ViewType', Ord(ViewType));
861 //
\83T
\83u
\83W
\83F
\83N
\83gURL
\8eæ
\93¾
862 function TBoard.GetReadCgiURL: string;
864 //Result := URL + SUBJECT_FILENAME;
865 //Result := GikoSys.UrlToServer(URL)
866 // + 'test/read.cgi/' + BBSID + '/?raw=0.0';
867 Result := URL + SUBJECT_FILENAME;
871 //
\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
872 function TBoard.GetSubjectFileName: string;
874 Result := ParentCategory.ParentBBS2ch.GetLogFolder
875 + BBSID + PATH_DELIM + SUBJECT_FILENAME;
878 //
\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
879 function TBoard.GetFolderIndexFileName: string;
881 Result := ParentCategory.ParentBBS2ch.GetLogFolder
882 + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME;
885 //
\83X
\83\8c\97§
\82Ä
\91\97\90MURL
886 function TBoard.GetSendURL: string;
888 Result := GikoSys.UrlToServer(URL) + 'test/subbbs.cgi';
891 procedure TBoard.SetRound(b: Boolean);
896 RoundList.Delete(Self);
897 if FRound = b then Exit;
903 procedure TBoard.SetRoundName(s: string);
905 if FRoundName = s then Exit;
911 procedure TBoard.SetLastModified(d: TDateTime);
913 if FLastModified = d then Exit;
919 procedure TBoard.SetLastGetTime(d: TDateTime);
921 if FLastGetTime = d then Exit;
927 procedure TBoard.SetUnRead(i: Integer);
929 if FUnRead = i then Exit;
930 if i < 0 then i := 0;
936 procedure TBoard.SetKotehanName(s: string);
938 if FKotehanName = s then Exit;
944 procedure TBoard.SetKotehanMail(s: string);
946 if FKotehanMail = s then Exit;
952 function TBoard.GetNewThreadCount: Integer;
957 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
959 for i := 0 to Count - 1 do begin
960 if Items[i].NewArrival then
964 for i := 0 to Count - 1 do begin
965 if Items[i].NewArrival then
967 if Items[i].ShortTitle = '' then
968 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
969 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
976 function TBoard.GetLogThreadCount: Integer;
981 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
983 for i := 0 to Count - 1 do begin
984 if Items[i].IsLogFile then
988 for i := 0 to Count - 1 do begin
989 if Items[i].IsLogFile then
991 if Items[i].ShortTitle = '' then
992 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
993 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
1000 function TBoard.GetUserThreadCount: Integer;
1005 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1008 for i := 0 to Count - 1 do begin
1009 if Items[i].ShortTitle = '' then
1010 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1011 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
1016 function TBoard.GetNewThread(Index: Integer): TThreadItem;
1023 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1025 for i := 0 to Count - 1 do begin
1026 if Items[i].NewArrival then
1028 if Index = Cnt then begin
1036 for i := 0 to Count - 1 do begin
1037 if Items[i].NewArrival then
1039 if Items[i].ShortTitle = '' then
1040 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1041 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1042 if Index = Cnt then begin
1053 function TBoard.GetLogThread(Index: Integer): TThreadItem;
1059 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1061 for i := 0 to Count - 1 do begin
1062 if Items[i].IsLogFile then
1064 if Index = Cnt then begin
1072 for i := 0 to Count - 1 do begin
1073 if Items[i].IsLogFile then
1075 if Items[i].ShortTitle = '' then
1076 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1077 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1078 if Index = Cnt then begin
1090 function TBoard.GetUserThread(Index: Integer): TThreadItem;
1097 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1099 for i := 0 to Count - 1 do begin
1102 Result := Items[ i ];
1108 for i := 0 to Count - 1 do begin
1109 if Items[i].ShortTitle = '' then
1110 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1111 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1112 if Index = Cnt then begin
1122 procedure TBoard.BeginUpdate;
1127 procedure TBoard.EndUpdate;
1132 {class function TBoard.GetColumnName(Index: Integer): string;
1134 Result := COLUMN_THREADITEM[Index];
1137 class function TBoard.GetColumnCount: Integer;
1139 Result := Length(COLUMN_THREADITEM);
1142 //constructor TThreadItem.Create(AOwner: TComponent);
1143 constructor TThreadItem.Create;
1148 FRoundDate := ZERO_DATE;
1149 FLastModified := ZERO_DATE;
1155 FIsLogFile := False;
1156 FParentBoard := nil;
1159 FNewArrival := False;
1163 FBoardPlugIn := nil;
1166 // *************************************************************************
1167 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ð
\8ew
\92è
\82µ
\82½
\83R
\83\93\83X
\83g
\83\89\83N
\83^
1168 // *************************************************************************
1169 constructor TThreadItem.Create(
1170 inPlugIn : TBoardPlugIn;
1177 FBoardPlugIn := inPlugIn;
1180 inPlugIn.CreateThreadItem( DWORD( Self ) );
1184 destructor TThreadItem.Destroy;
1186 if Assigned( Pointer( FBoardPlugIn ) ) then
1187 FBoardPlugIn.DisposeThreadItem( DWORD( Self ) );
1192 function TThreadItem.GetDatURL: string;
1194 Protocol, Host, Path, Document, Port, Bookmark: string;
1196 Result := ParentBoard.URL
1199 if FDownloadHost <> '' then begin
1200 GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1201 Result := Format('%s://%s%s%s', [Protocol,
1206 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1207 // + 'test/read.cgi/' + ParentBoard.BBSID + '/'
1208 // + ChangeFileExt(FileName, '') + '/?raw='
1209 // + IntToStr(ResNum) + '.' + IntToStr(ResSize);
1212 function TThreadItem.GetDatgzURL: string;
1213 function isOldKako(s: string): Boolean;
1216 if AnsiPos('piza.', s) <> 0 then
1218 else if AnsiPos('www.bbspink.', s) <> 0 then
1220 else if AnsiPos('tako.', s) <> 0 then
1224 Protocol, Host, Path, Document, Port, Bookmark: string;
1227 if FDownloadHost = '' then begin
1228 DatNo := ChangeFileExt(FileName, '');
1229 if isOldKako(ParentBoard.URL) then begin
1230 Result := Format('%s%s/%.3s/%s.dat', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1232 if Length(DatNo) > 9 then begin
1233 //http://xxx.2ch.net/xxx/kako/9999/99999/999999999.dat.gz
1234 Result := Format('%s%s/%.4s/%.5s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo, DatNo]);
1236 //http://xxx.2ch.net/xxx/kako/999/999999999.dat.gz
1237 Result := Format('%s%s/%.3s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1241 Gikosys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1242 DatNo := ChangeFileExt(Document, '');
1243 if isOldKako(DownloadHost) then begin
1244 Result := Format('%s://%s/%s/kako/%.3s/%s.dat', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1246 if Length(DatNo) > 9 then begin
1247 Result := Format('%s://%s/%s/kako/%.4s/%.5s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo, DatNo]);
1249 Result := Format('%s://%s/%s/kako/%.3s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1255 {function TThreadItem.GetOldDatgzURL: string;
1257 Protocol, Host, Path, Document, Port, Bookmark: string;
1259 Result := Format('%s%s/%.3s/%s.gz', [ParentBoard.URL,
1263 if FDownloadHost <> '' then begin
1264 ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1265 Result := Format('%s://%s%s%s', [Protocol,
1273 function TThreadItem.GetOfflawCgiURL(SessionID: string): string;
1275 // Protocol, Host, Path, Document, Port, Bookmark: string;
1277 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1278 // + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1279 // + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1280 if FDownloadHost = '' then begin
1281 Result := GikoSys.UrlToServer(ParentBoard.URL)
1282 + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1283 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1285 //http://news.2ch.net/test/offlaw.cgi/newsplus/1014038577/?raw=.196928&sid=
1286 //GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1287 Result := 'http://' + FDownloadHost
1288 + '/test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1289 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1290 // Result := Format('%s://%s%s%s', [Protocol,
1297 function TThreadItem.GetSendURL: string;
1299 Result := GikoSys.UrlToServer(ParentBoard.URL)
1303 procedure TThreadItem.DeleteLogFile;
1305 DeleteFile(GetThreadFileName);
1306 if FileExists(ChangeFileExt(GetThreadFileName,'.NG')) = true then
1307 DeleteFile(ChangeFileExt(GetThreadFileName,'.NG'));
1308 FRoundDate := ZERO_DATE;
1309 FLastModified := ZERO_DATE;
1311 FIsLogFile := False;
1314 FNewArrival := False;
1318 FDownloadHost := '';
1319 FAgeSage := gasNone;
1326 function TThreadItem.GetThreadFileName: string;
1328 if Length( FilePath ) > 0 then
1331 Result := ParentBoard.ParentCategory.ParentBBS2ch.GetLogFolder
1332 + ParentBoard.BBSID + PATH_DELIM + FileName;
1335 procedure TThreadItem.SetLastModified(d: TDateTime);
1337 if FLastModified = d then Exit;
1339 if FUpdate and (ParentBoard <> nil) then
1340 ParentBoard.FModified := True;
1343 {procedure TThreadItem.SetRoundNo(i: Integer);
1345 if FRoundNo = i then Exit;
1347 if FUpdate and (ParentBoard <> nil) then
1348 ParentBoard.FModified := True;
1351 procedure TThreadItem.SetRound(b: Boolean);
1356 RoundList.Delete(Self);
1357 if FRound = b then Exit;
1359 if FUpdate and (ParentBoard <> nil) then
1360 ParentBoard.FModified := True;
1363 procedure TThreadItem.SetRoundName(s: string);
1365 if FRoundName = s then Exit;
1367 if FUpdate and (ParentBoard <> nil) then
1368 ParentBoard.FModified := True;
1371 procedure TThreadItem.SetKokomade(i: Integer);
1373 if FKokomade = i then Exit;
1375 if FUpdate and (ParentBoard <> nil) then
1376 ParentBoard.FModified := True;
1379 procedure TThreadItem.SetUnRead(b: Boolean);
1381 if FUnRead = b then Exit;
1383 if FUpdate and (ParentBoard <> nil) then
1384 ParentBoard.FModified := True;
1387 procedure TThreadItem.SetScrollTop(i: Integer);
1389 if FScrollTop = i then Exit;
1391 if FUpdate and (ParentBoard <> nil) then
1392 ParentBoard.FModified := True;
1395 procedure TThreadItem.BeginUpdate;
1400 procedure TThreadItem.EndUpdate;
1405 function TThreadItem.GetURLWrapper: string;
1409 Result := GikoSys.GetURL( ParentBoard.BBSID, FileName )
1416 BBS2ch := TBBS2ch.Create;
1419 if BBS2ch <> nil then