6 Windows, SysUtils, Classes, ComCtrls, IniFiles, {HTTPApp,} YofUtils, IdGlobal,
7 ExternalBoardManager, ExternalBoardPlugInMain;
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
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 function Add(item: TCategory): integer;
91 procedure Delete(index: integer);
92 procedure Clear; override;
93 function Find(key: string): TCategory;
94 function FindBBSID(BBSID: string): TBoard;
95 function FindBoardFromTitle(Title: string): TBoard;
96 function FindBoardFromURL(inURL: string): TBoard;
97 function FindThreadFromURL( inURL : string ) : TThreadItem;
98 function FindThreadItem(BBSID: string; FileName: string): TThreadItem;
99 function FindCategoryFromTitle( inTitle : string ) : TCategory;
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)
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 ParenTBBS: TBBS read FParenTBBS write FParenTBBS;
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 FindBoardFromURL(inURL: string): TBoard;
137 function FindThreadFromURL( inURL : string ) : TThreadItem;
138 function IsMidoku: Boolean;
140 property NodeExpand: Boolean read FExpand write FExpand;
144 TBoard = class(TList)
146 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é)
148 FNo: Integer; //
\94Ô
\8d\86
149 FTitle: string; //
\83{
\81[
\83h
\83^
\83C
\83g
\83\8b
150 FBBSID: string; //BBSID
151 FURL: string; //
\83{
\81[
\83hURL
152 FRound: Boolean; //
\83X
\83\8c\83b
\83h
\88ê
\97\97\8f\84\89ñ
\97\
\96ñ
153 FRoundName: string; //
\8f\84\89ñ
\96¼
154 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
155 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
156 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
157 FIsThreadDatRead: Boolean; //
\83X
\83\8c\83b
\83h
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
158 FUnRead: Integer; //
\83X
\83\8c\83b
\83h
\96¢
\93Ç
\90\94
159 FParentCategory: TCategory; //
\90e
\83J
\83e
\83S
\83\8a
160 FModified: Boolean; //
\8fC
\90³
\83t
\83\89\83O
161 FBoolData: Boolean; //
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
162 FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
163 FPON: string; //
\8f\91\82«
\8d\9e\82Ý
\97pPON
164 FKotehanName: string; //
\83R
\83e
\83n
\83\93\96¼
\91O
165 FKotehanMail: string; //
\83R
\83e
\83n
\83\93\83\81\81[
\83\8b
170 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\94Â
\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
171 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\88ê
\97\97\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
172 FIsLogFile : Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
173 FIntData : Integer; //
\8dD
\82«
\82É
\82¢
\82¶
\82Á
\82Ä
\82æ
\82µ
\81B
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
174 FListData : TList; //
\8dD
\82«
\82É
\82¢
\82¶
\82Á
\82Ä
\82æ
\82µ
\81B
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
176 function GetThreadItem(index: integer): TThreadItem;
177 procedure SetThreadItem(index: integer; value: TThreadItem);
178 procedure SetRound(b: Boolean);
179 procedure SetRoundName(s: string);
180 procedure SetLastModified(d: TDateTime);
181 procedure SetLastGetTime(d: TDateTime);
182 procedure SetUnRead(i: Integer);
183 procedure SetKotehanName(s: string);
184 procedure SetKotehanMail(s: string);
187 constructor Create( inPlugIn : TBoardPlugIn; inURL : string );
188 destructor Destroy; override;
190 property Context: DWORD read FContext write FContext;
192 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
193 property No: Integer read FNo write FNo;
194 property Title: string read FTitle write FTitle;
195 property BBSID: string read FBBSID write FBBSID;
196 property URL: string read FURL write FURL;
197 property Round: Boolean read FRound write SetRound;
198 property RoundName: string read FRoundName write SetRoundName;
199 property RoundDate: TDateTime read FRoundDate write FRoundDate;
200 property LastModified: TDateTime read FLastModified write SetLastModified;
201 property LastGetTime: TDateTime read FLastGetTime write SetLastGetTime;
202 property UnRead: Integer read FUnRead write SetUnRead;
203 property Modified: Boolean read FModified write FModified;
204 property IsThreadDatRead: Boolean read FIsThreadDatRead write FIsThreadDatRead;
205 property ParentCategory: TCategory read FParentCategory write FParentCategory;
207 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
208 property FilePath : string read FFilePath write FFilePath;
209 property IsLogFile : Boolean read FIsLogFile write FIsLogFile;
210 property IntData : Integer read FIntData write FIntData;
211 property ListData : TList read FListData write FListData;
212 function IsBoardPlugInAvailable : Boolean;
214 function Add(item: TThreadItem): integer;
215 procedure Insert(Index: Integer; Item: TThreadItem);
216 procedure Delete(index: integer);
217 procedure DeleteList(index: integer);
218 procedure Clear; override;
219 function Find(ItemFileName: string): TThreadItem;
220 function FindThreadFromURL( inURL : string ) : TThreadItem;
221 function GetIndex(ItemFileName: string): Integer;
222 function GetIndexFromURL(URL: string): Integer;
223 procedure LoadSettings;
224 procedure SaveSettings;
225 function GetReadCgiURL: string;
226 function GetSubjectFileName: string;
227 function GetFolderIndexFileName: string;
228 function GetSendURL: string;
230 function GetNewThreadCount: Integer;
231 function GetLogThreadCount: Integer;
232 function GetUserThreadCount: Integer;
233 function GetNewThread(Index: Integer): TThreadItem;
234 function GetLogThread(Index: Integer): TThreadItem;
235 function GetUserThread(Index: Integer): TThreadItem;
237 procedure BeginUpdate;
239 property NodeExpand: Boolean read FExpand write FExpand;
240 property BoolData: Boolean read FBoolData write FBoolData;
241 property SPID: string read FSPID write FSPID;
242 property PON: string read FPON write FPON;
243 property KotehanName: string read FKotehanName write SetKotehanName;
244 property KotehanMail: string read FKotehanMail write SetKotehanMail;
248 TThreadItem = class(TObject)
250 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é)
252 FNo: Integer; //
\94Ô
\8d\86
253 FFileName: string; //
\83X
\83\8c\83b
\83h
\83t
\83@
\83C
\83\8b\96¼
254 FTitle: string; //
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b
255 FShortTitle: string; //
\92Z
\82¢
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b\81i
\8c\9f\8dõ
\97p
\81j
256 FRoundDate: TDateTime; //
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e\81i
\8f\84\89ñ
\93ú
\8e\9e\81j
257 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
258 FCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83\8d\81[
\83J
\83\8b\81j
259 FAllResCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83T
\81[
\83o
\81j
260 FNewResCount: Integer; //
\83X
\83\8c\83b
\83h
\90V
\92\85\90\94
261 FSize: Integer; //
\83X
\83\8c\83b
\83h
\83T
\83C
\83Y
262 FRound: Boolean; //
\8f\84\89ñ
\83t
\83\89\83O
263 FRoundName: string; //
\8f\84\89ñ
\96¼
264 FIsLogFile: Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
265 FParentBoard: TBoard; //
\90e
\83{
\81[
\83h
266 FKokomade: Integer; //
\83R
\83R
\82Ü
\82Å
\93Ç
\82ñ
\82¾
\94Ô
\8d\86
267 FNewReceive: Integer; //
\83R
\83R
\82©
\82ç
\90V
\8bK
\8eó
\90M
268 FNewArrival: Boolean; //
\90V
\92\85
269 FUnRead: Boolean; //
\96¢
\93Ç
\83t
\83\89\83O
270 FScrollTop: Integer; //
\83X
\83N
\83\8d\81[
\83\8b\88Ê
\92u
271 FDownloadHost: string; //
\8d¡
\82Ì
\83z
\83X
\83g
\82Æ
\88á
\82¤
\8fê
\8d\87\82Ì
\83z
\83X
\83g
272 FAgeSage: TGikoAgeSage; //
\83A
\83C
\83e
\83\80\82Ì
\8fã
\82°
\89º
\82°
273 // FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
277 FURL : string; //
\82±
\82Ì
\83X
\83\8c\82ð
\83u
\83\89\83E
\83U
\82Å
\95\
\8e¦
\82·
\82é
\8dÛ
\82Ì URL
278 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\83X
\83\8c\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
279 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
280 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
282 procedure SetLastModified(d: TDateTime);
283 procedure SetRound(b: Boolean);
284 procedure SetRoundName(s: string);
285 procedure SetKokomade(i: Integer);
286 procedure SetUnRead(b: Boolean);
287 procedure SetScrollTop(i: Integer);
290 constructor Create( inPlugIn : TBoardPlugIn; inURL : string );
291 destructor Destroy; override;
293 function GetDatURL: string;
294 function GetDatgzURL: string;
295 // function GetOldDatgzURL: string;
296 function GetOfflawCgiURL(SessionID: string): string;
297 function GetSendURL: string;
298 procedure DeleteLogFile;
299 function GetThreadFileName: string;
300 procedure BeginUpdate;
303 property Context: DWORD read FContext write FContext;
305 property No: Integer read FNo write FNo;
306 property FileName: string read FFileName write FFileName;
307 property Title: string read FTitle write FTitle;
308 property ShortTitle: string read FShortTitle write FShortTitle;
309 property RoundDate: TDateTime read FRoundDate write FRoundDate;
310 property LastModified: TDateTime read FLastModified write SetLastModified;
311 property Count: Integer read FCount write FCount;
312 property AllResCount: Integer read FAllResCount write FAllResCount;
313 property NewResCount: Integer read FNewResCount write FNewResCount;
314 property Size: Integer read FSize write FSize;
315 property Round: Boolean read FRound write SetRound;
316 property RoundName: string read FRoundName write SetRoundName;
318 property IsLogFile: Boolean read FIsLogFile write FIsLogFile;
319 property ParentBoard: TBoard read FParentBoard write FParentBoard;
320 property Kokomade: Integer read FKokomade write SetKokomade;
321 property NewReceive: Integer read FNewReceive write FNewReceive;
322 property NewArrival: Boolean read FNewArrival write FNewArrival;
323 property UnRead: Boolean read FUnRead write SetUnRead;
324 property ScrollTop: Integer read FScrollTop write SetScrollTop;
325 property Expand: Boolean read FExpand write FExpand;
326 property DownloadHost: string read FDownloadHost write FDownloadHost;
327 property AgeSage: TGikoAgeSage read FAgeSage write FAgeSage;
328 // property SPID: string read FSPID write FSPID;
330 property URL : string read FURL write FURL;
331 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
332 property FilePath : string read FFilePath write FFilePath;
333 property SizeByte : Integer read FSizeByte write FSizeByte;
334 function IsBoardPlugInAvailable : Boolean;
339 //
\8c\9f\8dõ
\8c\8b\89Ê
\83\8a\83X
\83g
340 { TSearchList = class(TList)
342 function GetThreadItem(index: integer): TThreadItem;
343 procedure SetThreadItem(index: integer; value: TThreadItem);
346 destructor Destroy; override;
348 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
350 function Add(item: TThreadItem): integer;
351 procedure Delete(index: integer);
352 procedure Clear; override;
355 function BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard;
356 function BBSsFindBoardFromURL( inURL : string ) : TBoard;
357 function BBSsFindBoardFromTitle( inTitle : string ) : TBoard;
358 function BBSsFindThreadFromURL( inURL : string ) : TThreadItem;
359 function ConvertDateTimeString( inDateTimeString : string) : string;
362 BBSs : array of TBBS;
367 GikoSystem, RoundData;
370 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
371 BBS2CH_LOG_FOLDER: string = '2ch';
372 EXTERNAL_LOG_FOLDER: string = 'exboard';
374 FOLDER_INI_FILENAME: string = 'Folder.ini';
375 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
376 SUBJECT_FILENAME: string = 'subject.txt';
377 PATH_DELIM: string = '\';
378 //DEFAULT_LIST_COUNT: Integer = 100;
380 // COLUMN_CATEGORY: array[0..0] of string = ('
\83J
\83e
\83S
\83\8a\96¼');
381 // 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');
382 // 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');
384 function BBSsFindBoardFromBBSID(
391 for i := Length( BBSs ) - 1 downto 0 do begin
392 Result := BBSs[ i ].FindBBSID( inBBSID );
393 if Result <> nil then
401 function BBSsFindBoardFromURL(
408 for i := Length( BBSs ) - 1 downto 0 do begin
409 Result := BBSs[ i ].FindBoardFromURL( inURL );
410 if Result <> nil then
418 function BBSsFindBoardFromTitle(
425 for i := Length( BBSs ) - 1 downto 0 do begin
426 Result := BBSs[ i ].FindBoardFromTitle( inTitle );
427 if Result <> nil then
435 function BBSsFindThreadFromURL(
443 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
444 board := BBSsFindBoardFromURL( boardURL );
448 Result := board.FindThreadFromURL( inURL );
452 (*************************************************************************
453 *
\8b@
\94\
\96¼
\81FTBBS
\83R
\83\93\83X
\83g
\83\89\83N
\83^
455 *************************************************************************)
456 constructor TBBS.Create(LogFolder: string);
459 Title := BBS2CH_NAME;
460 FLogFolder := LogFolder;
463 (*************************************************************************
464 *
\8b@
\94\
\96¼
\81FTBBS
\83f
\83X
\83g
\83\89\83N
\83^
466 *************************************************************************)
467 destructor TBBS.Destroy;
473 (*************************************************************************
476 *************************************************************************)
477 function TBBS.GetCategory(index: integer): TCategory;
479 Result := TCategory(inherited Items[index]);
482 procedure TBBS.SetCategory(index: integer; value: TCategory);
484 inherited Items[index] := value;
487 function TBBS.Add(item: TCategory): integer;
489 Item.ParenTBBS := self;
490 Result := inherited Add(item);
493 procedure TBBS.Delete(index: integer);
495 if Items[index] <> nil then
496 TCategory(Items[index]).Free;
498 inherited Delete(index);
501 procedure TBBS.Clear;
505 for i := Count - 1 downto 0 do
509 function TBBS.Find(key: string): TCategory;
514 function TBBS.FindBBSID(BBSID: string): TBoard;
518 for i := Count - 1 downto 0 do begin
519 Result := Items[ i ].FindBBSID(BBSID);
520 if Result <> nil then
526 //*************************************************************************
527 //
\83^
\83C
\83g
\83\8b\82Ì
\88ê
\92v
\82·
\82é
\94Â
\82ð
\92T
\82·
528 //*************************************************************************)
529 function TBBS.FindBoardFromTitle(Title: string): TBoard;
533 for i := Count - 1 downto 0 do begin
534 Result := Items[ i ].FindBoardFromTitle(Title);
535 if Result <> nil then
541 //*************************************************************************
542 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\94Â
\82ð
\92T
\82·
543 //*************************************************************************)
544 function TBBS.FindBoardFromURL(inURL: string): TBoard;
548 for i := Count - 1 downto 0 do begin
549 Result := Items[ i ].FindBoardFromURL( inURL );
550 if Result <> nil then
556 //*************************************************************************
557 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\83X
\83\8c\83b
\83h
\82ð
\92T
\82·
558 //*************************************************************************)
559 function TBBS.FindThreadFromURL(inURL: string): TThreadItem;
565 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
566 board := FindBoardFromURL( boardURL );
570 Result := board.FindThreadFromURL( inURL );
574 function TBBS.FindThreadItem(BBSID: string; FileName: string): TThreadItem;
579 Board := FindBBSID(BBSID);
582 Result := Board.Find(FileName);
585 function TBBS.FindCategoryFromTitle( inTitle : string ) : TCategory;
590 for i := Count - 1 downto 0 do begin
591 if AnsiCompareStr(Items[ i ].Title, inTitle) = 0 then begin
592 Result := Items[ i ];
601 (*************************************************************************
602 *
\83\8d\83O
\83t
\83H
\83\8b\83_
\8eæ
\93¾
604 *************************************************************************)
605 function TBBS.GetLogFolder: string;
607 Result := IncludeTrailingPathDelimiter(FLogFolder)
608 + BBS2CH_LOG_FOLDER + PATH_DELIM;
611 procedure TBBS.SetSelectText(s: string);
614 ShortSelectText := GikoSys.ZenToHan(s);
617 {class function TBBS.GetColumnName(Index: Integer): string;
619 Result := COLUMN_CATEGORY[Index];
622 class function TBBS.GetColumnCount: Integer;
624 Result := Length(COLUMN_CATEGORY);
627 //===================
629 //===================
630 constructor TCategory.Create;
635 destructor TCategory.Destroy;
641 function TCategory.GetBoard(index: integer): TBoard;
643 Result := TBoard(inherited Items[index]);
646 procedure TCategory.SetBoard(index: integer; value: TBoard);
648 inherited Items[index] := value;
651 function TCategory.Add(item: TBoard): integer;
653 Item.ParentCategory := self;
654 Result := inherited Add(item);
657 procedure TCategory.Delete(index: integer);
659 if Items[index] <> nil then
660 TBoard(Items[index]).Free;
662 inherited Delete(index);
665 procedure TCategory.Clear;
669 for i := Count - 1 downto 0 do
673 function TCategory.FindName(key: string): TBoard;
678 function TCategory.FindBBSID(BBSID: string): TBoard;
682 for i := Count - 1 downto 0 do begin
683 if AnsiCompareStr(Items[i].FBBSID, BBSID) = 0 then begin
691 //*************************************************************************
692 //
\83^
\83C
\83g
\83\8b\82Ì
\88ê
\92v
\82·
\82é
\94Â
\82ð
\92T
\82·
693 //*************************************************************************)
694 function TCategory.FindBoardFromTitle(Title: string): TBoard;
698 for i := Count - 1 downto 0 do begin
699 if AnsiCompareStr(Items[i].FTitle, Title) = 0 then begin
707 //*************************************************************************
708 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\94Â
\82ð
\92T
\82·
709 //*************************************************************************)
710 function TCategory.FindBoardFromURL(inURL: string): TBoard;
714 for i := Count - 1 downto 0 do begin
715 if Pos( Items[i].URL, inURL ) = 1 then begin
723 //*************************************************************************
724 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\83X
\83\8c\83b
\83h
\82ð
\92T
\82·
725 //*************************************************************************)
726 function TCategory.FindThreadFromURL(inURL: string): TThreadItem;
732 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
733 board := FindBoardFromURL( boardURL );
737 Result := board.FindThreadFromURL( inURL );
741 function TCategory.IsMidoku: Boolean;
747 for i := 0 to Count - 1 do begin
748 if Items[i] <> nil then begin
749 for j := 0 to Items[i].Count - 1 do begin
750 if Items[i].Items[j] <> nil then begin
751 // if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].Count > Items[i].Items[j].Kokomade) then begin
752 if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].UnRead) then begin
762 {class function TCategory.GetColumnName(Index: Integer): string;
764 Result := COLUMN_BOARD[Index];
767 class function TCategory.GetColumnCount: Integer;
769 Result := Length(COLUMN_BOARD);
772 //===================
774 //===================
775 procedure TBoard.Init;
782 FRoundDate := ZERO_DATE;
783 FLastModified := ZERO_DATE;
784 FLastGetTime := ZERO_DATE;
785 FIsThreadDatRead := False;
787 // FListStyle := vsReport;
788 // FItemNoVisible := True;
793 // *************************************************************************
794 //
\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^
795 // *************************************************************************
796 constructor TBoard.Create(
797 inPlugIn : TBoardPlugIn;
801 protocol, host, path, document, port, bookmark : string;
807 FBoardPlugIn := inPlugIn;
809 BBSID := GikoSys.UrlToID( inURL );
811 if inPlugIn = nil then begin
812 // subject.txt
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
813 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
814 if GikoSys.Is2chHost( host ) then
816 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
817 BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
820 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
821 EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
823 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
824 inPlugIn.CreateBoardItem( DWORD( Self ) );
829 // *************************************************************************
830 //
\83f
\83X
\83g
\83\89\83N
\83^
831 // *************************************************************************
832 destructor TBoard.Destroy;
834 if FModified then begin
835 GikoSys.WriteThreadDat(Self);
839 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
840 if IsBoardPlugInAvailable then
841 BoardPlugIn.DisposeBoardItem( DWORD( Self ) );
847 // *************************************************************************
848 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
849 // *************************************************************************
850 function TBoard.IsBoardPlugInAvailable : Boolean;
854 if BoardPlugIn = nil then
857 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
868 function TBoard.GetThreadItem(index: integer): TThreadItem;
870 Result := TThreadItem(inherited Items[index]);
873 procedure TBoard.SetThreadItem(index: integer; value: TThreadItem);
875 inherited Items[index] := value;
878 function TBoard.Add(Item: TThreadItem): Integer;
880 Item.ParentBoard := Self;
881 Result := inherited Add(Item);
884 procedure TBoard.Insert(Index: Integer; Item: TThreadItem);
886 Item.ParentBoard := Self;
887 inherited Insert(Index, Item);
890 //Index
\82Å
\8ew
\92è
\82³
\82ê
\82½
\83X
\83\8c\83b
\83h
\83I
\83u
\83W
\83F
\83N
\83g
\82ð
\94j
\8aü
891 procedure TBoard.Delete(index: Integer);
893 if Items[index] <> nil then
894 TThreadItem(Items[index]).Free;
896 inherited Delete(index);
899 //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
900 procedure TBoard.DeleteList(index: integer);
902 inherited Delete(index);
905 procedure TBoard.Clear;
910 for i := Count - 1 downto 0 do
914 function TBoard.Find(ItemFileName: string): TThreadItem;
919 for i := 0 to Count - 1 do begin
920 if AnsiCompareStr(Items[i].FileName, ItemFileName) = 0 then begin
927 function TBoard.GetIndex(ItemFileName: string): Integer;
932 for i := 0 to Count - 1 do begin
933 if Items[i].FileName = ItemFileName then begin
940 function TBoard.GetIndexFromURL(URL: string): Integer;
945 for i := 0 to Count - 1 do begin
946 if Pos( URL, Items[ i ].URL ) = 1 then begin
953 function TBoard.FindThreadFromURL( inURL : string ) : TThreadItem;
958 if not IsThreadDatRead then
959 GikoSys.ReadSubjectFile( Self );
961 for i := Count - 1 downto 0 do begin
962 if Pos( inURL, Items[ i ].URL ) = 1 then begin
963 Result := Items[ i ];
971 {function TBoard.GetMidokuCount: Integer;
976 for i := 0 to Count- 1 do begin
977 if Items[i] <> nil then begin
978 if (Items[i].IsLogFile) and (Items[i].Count > Items[i].Kokomade) then
985 procedure TBoard.LoadSettings;
991 if Length( FilePath ) > 0 then
992 FileName := ExtractFilePath( FilePath ) + FOLDER_INI_FILENAME
994 FileName := ParentCategory.ParenTBBS.GetLogFolder
995 + BBSID + PATH_DELIM + FOLDER_INI_FILENAME;
997 if not FileExists(FileName) then
999 ini := TMemIniFile.Create(FileName);
1001 // Round := ini.ReadBool('Status', 'Round', False);
1002 tmp := ini.ReadString('Status', 'RoundDate', DateTimeToStr(ZERO_DATE));
1003 FRoundDate := StrToDateTime(ConvertDateTimeString(tmp));
1004 tmp := ini.ReadString('Status', 'LastModified', DateTimeToStr(ZERO_DATE));
1005 FLastModified := StrToDateTime(ConvertDateTimeString(tmp));
1006 tmp := ini.ReadString('Status', 'LastGetTime', DateTimeToStr(ZERO_DATE));
1007 FLastGetTime := StrToDateTime(ConvertDateTimeString(tmp));
1011 FRoundDate := ini.ReadDateTime('Status', 'RoundDate', ZERO_DATE);
1013 tmp := ini.ReadString('Status', 'RoundDate', DateTimeToStr(ZERO_DATE));
1014 FRoundDate := StrToDateTime(ConvertDateTimeString(tmp));
1017 FLastModified := ini.ReadDateTime('Status', 'LastModified', ZERO_DATE);
1019 tmp := ini.ReadString('Status', 'LastModified', DateTimeToStr(ZERO_DATE));
1020 FLastModified := StrToDateTime(ConvertDateTimeString(tmp));
1023 FLastGetTime := ini.ReadDateTime('Status', 'LastGetTime', ZERO_DATE);
1025 tmp := ini.ReadString('Status', 'LastGetTime', DateTimeToStr(ZERO_DATE));
1026 FLastGetTime := StrToDateTime(ConvertDateTimeString(tmp));
1029 FUnRead := ini.ReadInteger('Status', 'UnRead', 0);
1030 FSPID := ini.ReadString('Cookie', 'SPID', '');
1031 FPON := ini.ReadString('Cookie', 'PON', '');
1032 FKotehanName := ini.ReadString('Kotehan', 'Name', '');
1033 FKotehanMail := ini.ReadString('Kotehan', 'Mail', '');
1034 // ListStyle := TViewStyle(Ord(ini.ReadInteger('Status', 'ListStyle', 3)));
1035 // ItemNoVisible := ini.ReadBool('Status', 'ItemNoVisible', True);
1036 // ViewType := TGikoViewType(Ord(ini.ReadInteger('Status', 'ViewType', 0)));
1044 procedure TBoard.SaveSettings;
1049 if Length( FilePath ) > 0 then
1050 FileName := ExtractFilePath( FilePath )
1052 FileName := ParentCategory.ParenTBBS.GetLogFolder
1053 + BBSID + PATH_DELIM;
1054 if not GikoSys.DirectoryExistsEx(FileName) then
1055 GikoSys.ForceDirectoriesEx(FileName);
1056 FileName := FileName + FOLDER_INI_FILENAME;
1057 ini := TMemIniFile.Create(FileName);
1061 // ini.WriteBool('Status', 'Round', Round);
1062 ini.WriteDateTime('Status', 'RoundDate', FRoundDate);
1063 ini.WriteDateTime('Status', 'LastModified', FLastModified);
1064 ini.WriteDateTime('Status', 'LastGetTime', FLastGetTime);
1065 ini.WriteInteger('Status', 'UnRead', FUnRead);
1066 ini.WriteString('Cookie', 'SPID', FSPID);
1067 ini.WriteString('Cookie', 'PON', FPON);
1068 ini.WriteString('Kotehan', 'Name', FKotehanName);
1069 ini.WriteString('Kotehan', 'Mail', FKotehanMail);
1070 // ini.WriteInteger('Status', 'ListStyle', Ord(ListStyle));
1071 // ini.WriteBool('Status', 'ItemNoVisible', ItemNoVisible);
1072 // ini.WriteInteger('Status', 'ViewType', Ord(ViewType));
1078 //
\82Æ
\82«
\82½
\82Ü2003 02 08 0:32:13
\82±
\82ñ
\82È
\8c`
\8e®
\82Ì
\93ú
\95t
\82ª
\82 \82é
\82Ì
\82Å
\82»
\82ê
\82ð
1079 // 2003/02/08 0:32:13
\82É
\95Ï
\8a·
\82·
\82é
1080 function ConvertDateTimeString( inDateTimeString : string) : string;
1084 if ( AnsiPos('/', inDateTimeString ) = 0 ) and
1085 ( AnsiCompareStr( DateTimeToStr(ZERO_DATE), inDateTimeString) <> 0 ) then begin
1086 for i := 0 to 1 do begin
1087 Insert('/',inDateTimeString, AnsiPos(' ', inDateTimeString) + 1 );
1088 Delete(inDateTimeString, AnsiPos(' ', inDateTimeString), 1);
1091 Result := inDateTimeString;
1093 //
\83T
\83u
\83W
\83F
\83N
\83gURL
\8eæ
\93¾
1094 function TBoard.GetReadCgiURL: string;
1096 //Result := URL + SUBJECT_FILENAME;
1097 //Result := GikoSys.UrlToServer(URL)
1098 // + 'test/read.cgi/' + BBSID + '/?raw=0.0';
1099 Result := URL + SUBJECT_FILENAME;
1103 //
\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
1104 function TBoard.GetSubjectFileName: string;
1106 if Length( FilePath ) > 0 then
1109 Result := ParentCategory.ParenTBBS.GetLogFolder
1110 + BBSID + PATH_DELIM + SUBJECT_FILENAME;
1113 //
\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
1114 function TBoard.GetFolderIndexFileName: string;
1116 if Length( FilePath ) > 0 then
1117 Result := ExtractFilePath( FilePath ) + FOLDER_INDEX_FILENAME
1119 Result := ParentCategory.ParenTBBS.GetLogFolder
1120 + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME;
1123 //
\83X
\83\8c\97§
\82Ä
\91\97\90MURL
1124 function TBoard.GetSendURL: string;
1126 Result := GikoSys.UrlToServer(URL) + 'test/subbbs.cgi';
1129 procedure TBoard.SetRound(b: Boolean);
1134 RoundList.Delete(Self);
1135 if FRound = b then Exit;
1141 procedure TBoard.SetRoundName(s: string);
1143 if FRoundName = s then Exit;
1149 procedure TBoard.SetLastModified(d: TDateTime);
1151 if FLastModified = d then Exit;
1157 procedure TBoard.SetLastGetTime(d: TDateTime);
1159 if FLastGetTime = d then Exit;
1165 procedure TBoard.SetUnRead(i: Integer);
1167 if FUnRead = i then Exit;
1168 if i < 0 then i := 0;
1174 procedure TBoard.SetKotehanName(s: string);
1176 if FKotehanName = s then Exit;
1182 procedure TBoard.SetKotehanMail(s: string);
1184 if FKotehanMail = s then Exit;
1190 function TBoard.GetNewThreadCount: Integer;
1195 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1197 for i := 0 to Count - 1 do begin
1198 if Items[i].NewArrival then
1202 for i := 0 to Count - 1 do begin
1203 if Items[i].NewArrival then
1205 if Items[i].ShortTitle = '' then
1206 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1207 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1214 function TBoard.GetLogThreadCount: Integer;
1219 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1221 for i := 0 to Count - 1 do begin
1222 if Items[i].IsLogFile then
1226 for i := 0 to Count - 1 do begin
1227 if Items[i].IsLogFile then
1229 if Items[i].ShortTitle = '' then
1230 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1231 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1238 function TBoard.GetUserThreadCount: Integer;
1243 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1246 for i := 0 to Count - 1 do begin
1247 if Items[i].ShortTitle = '' then
1248 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1249 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1254 function TBoard.GetNewThread(Index: Integer): TThreadItem;
1261 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1263 for i := 0 to Count - 1 do begin
1264 if Items[i].NewArrival then
1266 if Index = Cnt then begin
1274 for i := 0 to Count - 1 do begin
1275 if Items[i].NewArrival then
1277 if Items[i].ShortTitle = '' then
1278 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1279 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1280 if Index = Cnt then begin
1291 function TBoard.GetLogThread(Index: Integer): TThreadItem;
1297 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1299 for i := 0 to Count - 1 do begin
1300 if Items[i].IsLogFile then
1302 if Index = Cnt then begin
1310 for i := 0 to Count - 1 do begin
1311 if Items[i].IsLogFile then
1313 if Items[i].ShortTitle = '' then
1314 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1315 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1316 if Index = Cnt then begin
1328 function TBoard.GetUserThread(Index: Integer): TThreadItem;
1335 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1337 for i := 0 to Count - 1 do begin
1340 Result := Items[ i ];
1346 for i := 0 to Count - 1 do begin
1347 if Items[i].ShortTitle = '' then
1348 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1349 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1350 if Index = Cnt then begin
1360 procedure TBoard.BeginUpdate;
1365 procedure TBoard.EndUpdate;
1370 {class function TBoard.GetColumnName(Index: Integer): string;
1372 Result := COLUMN_THREADITEM[Index];
1375 class function TBoard.GetColumnCount: Integer;
1377 Result := Length(COLUMN_THREADITEM);
1380 //constructor TThreadItem.Create(AOwner: TComponent);
1381 procedure TThreadItem.Init;
1386 FRoundDate := ZERO_DATE;
1387 FLastModified := ZERO_DATE;
1393 FIsLogFile := False;
1394 FParentBoard := nil;
1397 FNewArrival := False;
1401 FBoardPlugIn := nil;
1404 // *************************************************************************
1405 //
\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^
1406 // *************************************************************************
1407 constructor TThreadItem.Create(
1408 inPlugIn : TBoardPlugIn;
1413 protocol, host, path, document, port, bookmark : string;
1414 BBSID, BBSKey : string;
1416 READ_PATH = '/test/read.cgi';
1422 FBoardPlugIn := inPlugIn;
1425 if inPlugIn = nil then begin
1426 foundPos := Pos( READ_PATH, inURL );
1427 if foundPos > 0 then begin
1428 // dat
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
1429 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
1430 GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
1431 if GikoSys.Is2chHost( host ) then
1433 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
1434 BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat'
1437 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
1438 EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat';
1439 FileName := BBSKey + '.dat';
1440 IsLogFile := FileExists( FilePath );
1441 URL := GikoSys.Get2chBrowsableThreadURL( inURL );
1444 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1445 inPlugIn.CreateThreadItem( DWORD( Self ) );
1450 // *************************************************************************
1451 //
\83f
\83X
\83g
\83\89\83N
\83^
1452 // *************************************************************************
1453 destructor TThreadItem.Destroy;
1456 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1457 if IsBoardPlugInAvailable then
1458 FBoardPlugIn.DisposeThreadItem( DWORD( Self ) );
1464 // *************************************************************************
1465 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
1466 // *************************************************************************
1467 function TThreadItem.IsBoardPlugInAvailable : Boolean;
1471 if BoardPlugIn = nil then
1474 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
1485 function TThreadItem.GetDatURL: string;
1487 Protocol, Host, Path, Document, Port, Bookmark: string;
1489 Result := ParentBoard.URL
1492 if FDownloadHost <> '' then begin
1493 GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1494 Result := Format('%s://%s%s%s', [Protocol,
1499 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1500 // + 'test/read.cgi/' + ParentBoard.BBSID + '/'
1501 // + ChangeFileExt(FileName, '') + '/?raw='
1502 // + IntToStr(ResNum) + '.' + IntToStr(ResSize);
1505 function TThreadItem.GetDatgzURL: string;
1506 function isOldKako(s: string): Boolean;
1509 if AnsiPos('piza.', s) <> 0 then
1511 else if AnsiPos('www.bbspink.', s) <> 0 then
1513 else if AnsiPos('tako.', s) <> 0 then
1517 Protocol, Host, Path, Document, Port, Bookmark: string;
1520 if FDownloadHost = '' then begin
1521 DatNo := ChangeFileExt(FileName, '');
1522 if isOldKako(ParentBoard.URL) then begin
1523 Result := Format('%s%s/%.3s/%s.dat', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1525 if Length(DatNo) > 9 then begin
1526 //http://xxx.2ch.net/xxx/kako/9999/99999/999999999.dat.gz
1527 Result := Format('%s%s/%.4s/%.5s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo, DatNo]);
1529 //http://xxx.2ch.net/xxx/kako/999/999999999.dat.gz
1530 Result := Format('%s%s/%.3s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1534 Gikosys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1535 DatNo := ChangeFileExt(Document, '');
1536 if isOldKako(DownloadHost) then begin
1537 Result := Format('%s://%s/%s/kako/%.3s/%s.dat', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1539 if Length(DatNo) > 9 then begin
1540 Result := Format('%s://%s/%s/kako/%.4s/%.5s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo, DatNo]);
1542 Result := Format('%s://%s/%s/kako/%.3s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1548 {function TThreadItem.GetOldDatgzURL: string;
1550 Protocol, Host, Path, Document, Port, Bookmark: string;
1552 Result := Format('%s%s/%.3s/%s.gz', [ParentBoard.URL,
1556 if FDownloadHost <> '' then begin
1557 ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1558 Result := Format('%s://%s%s%s', [Protocol,
1566 function TThreadItem.GetOfflawCgiURL(SessionID: string): string;
1568 // Protocol, Host, Path, Document, Port, Bookmark: string;
1570 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1571 // + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1572 // + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1573 if FDownloadHost = '' then begin
1574 Result := GikoSys.UrlToServer(ParentBoard.URL)
1575 + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1576 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1578 //http://news.2ch.net/test/offlaw.cgi/newsplus/1014038577/?raw=.196928&sid=
1579 //GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1580 Result := 'http://' + FDownloadHost
1581 + '/test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1582 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1583 // Result := Format('%s://%s%s%s', [Protocol,
1590 function TThreadItem.GetSendURL: string;
1592 Result := GikoSys.UrlToServer(ParentBoard.URL)
1596 procedure TThreadItem.DeleteLogFile;
1598 ParentBoard.BeginUpdate;
1600 DeleteFile(GetThreadFileName);
1601 if FileExists(ChangeFileExt(GetThreadFileName,'.NG')) = true then
1602 DeleteFile(ChangeFileExt(GetThreadFileName,'.NG'));
1603 FRoundDate := ZERO_DATE;
1604 FLastModified := ZERO_DATE;
1606 FIsLogFile := False;
1609 FNewArrival := False;
1613 FDownloadHost := '';
1614 FAgeSage := gasNone;
1620 ParentBoard.EndUpdate;
1621 ParentBoard.Modified := True;
1624 function TThreadItem.GetThreadFileName: string;
1626 if Length( FilePath ) > 0 then
1629 Result := ParentBoard.ParentCategory.ParenTBBS.GetLogFolder
1630 + ParentBoard.BBSID + PATH_DELIM + FileName;
1633 procedure TThreadItem.SetLastModified(d: TDateTime);
1635 if FLastModified = d then Exit;
1637 if FUpdate and (ParentBoard <> nil) then
1638 ParentBoard.FModified := True;
1641 {procedure TThreadItem.SetRoundNo(i: Integer);
1643 if FRoundNo = i then Exit;
1645 if FUpdate and (ParentBoard <> nil) then
1646 ParentBoard.FModified := True;
1649 procedure TThreadItem.SetRound(b: Boolean);
1654 RoundList.Delete(Self);
1655 if FRound = b then Exit;
1657 if FUpdate and (ParentBoard <> nil) then
1658 ParentBoard.FModified := True;
1661 procedure TThreadItem.SetRoundName(s: string);
1663 if FRoundName = s then Exit;
1665 if FUpdate and (ParentBoard <> nil) then
1666 ParentBoard.FModified := True;
1669 procedure TThreadItem.SetKokomade(i: Integer);
1671 if FKokomade = i then Exit;
1673 if FUpdate and (ParentBoard <> nil) then
1674 ParentBoard.FModified := True;
1677 procedure TThreadItem.SetUnRead(b: Boolean);
1679 if FUnRead = b then Exit;
1681 if FUpdate and (ParentBoard <> nil) then
1682 ParentBoard.FModified := True;
1685 procedure TThreadItem.SetScrollTop(i: Integer);
1687 if FScrollTop = i then Exit;
1689 if FUpdate and (ParentBoard <> nil) then
1690 ParentBoard.FModified := True;
1693 procedure TThreadItem.BeginUpdate;
1698 procedure TThreadItem.EndUpdate;
1704 BBS2ch := TBBS.Create;
1707 if BBS2ch <> nil then