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
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 FindBoardFromURL(inURL: string): TBoard;
101 function FindThreadItem(BBSID: string; FileName: string): TThreadItem;
102 function GetLogFolder: string;
104 property Items[index: integer]: TCategory read GetCategory write SetCategory;
105 property Title: string read FTitle write FTitle;
106 property NodeExpand: Boolean read FExpand write FExpand;
108 property KubetsuChk: Boolean read FKubetsuChk write FKubetsuChk;
109 property SelectText: string read FSelectText write SetSelectText;
110 property ShortSelectText: string read FShortSelectText write FShortSelectText;
114 TCategory = class(TList)
118 FParentBBS2ch: TBBS2ch;
121 function GetBoard(index: integer): TBoard;
122 procedure SetBoard(index: integer; value: TBoard);
125 destructor Destroy; override;
127 property No: Integer read FNo write FNo;
128 property Title: string read FTitle write FTitle;
129 property Items[index: integer]: TBoard read GetBoard write SetBoard;
130 property ParentBBS2ch: TBBS2ch read FParentBBS2ch write FParentBBS2ch;
132 function Add(item: TBoard): integer;
133 procedure Delete(index: integer);
134 procedure Clear; override;
135 function FindName(key: string): TBoard;
136 function FindBBSID(BBSID: string): TBoard;
137 function FindBoardFromTitle(Title: string): TBoard;
138 function FindBoardFromURL(inURL: string): TBoard;
139 function IsMidoku: Boolean;
141 property NodeExpand: Boolean read FExpand write FExpand;
145 TBoard = class(TList)
147 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é)
149 FNo: Integer; //
\94Ô
\8d\86
150 FTitle: string; //
\83{
\81[
\83h
\83^
\83C
\83g
\83\8b
151 FBBSID: string; //BBSID
152 FURL: string; //
\83{
\81[
\83hURL
153 FRound: Boolean; //
\83X
\83\8c\83b
\83h
\88ê
\97\97\8f\84\89ñ
\97\
\96ñ
154 FRoundName: string; //
\8f\84\89ñ
\96¼
155 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
156 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
157 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
158 FIsThreadDatRead: Boolean; //
\83X
\83\8c\83b
\83h
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
159 FUnRead: Integer; //
\83X
\83\8c\83b
\83h
\96¢
\93Ç
\90\94
160 FParentCategory: TCategory; //
\90e
\83J
\83e
\83S
\83\8a
161 FModified: Boolean; //
\8fC
\90³
\83t
\83\89\83O
162 FBoolData: Boolean; //
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
163 FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
164 FPON: string; //
\8f\91\82«
\8d\9e\82Ý
\97pPON
165 FKotehanName: string; //
\83R
\83e
\83n
\83\93\96¼
\91O
166 FKotehanMail: string; //
\83R
\83e
\83n
\83\93\83\81\81[
\83\8b
171 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\94Â
\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
172 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\88ê
\97\97\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
173 FIsLogFile : Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
174 FIntData : Integer; //
\8dD
\82«
\82É
\82¢
\82¶
\82Á
\82Ä
\82æ
\82µ
\81B
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
175 FListData : TList; //
\8dD
\82«
\82É
\82¢
\82¶
\82Á
\82Ä
\82æ
\82µ
\81B
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
177 function GetThreadItem(index: integer): TThreadItem;
178 procedure SetThreadItem(index: integer; value: TThreadItem);
179 procedure SetRound(b: Boolean);
180 procedure SetRoundName(s: string);
181 procedure SetLastModified(d: TDateTime);
182 procedure SetLastGetTime(d: TDateTime);
183 procedure SetUnRead(i: Integer);
184 procedure SetKotehanName(s: string);
185 procedure SetKotehanMail(s: string);
187 constructor Create; overload;
188 constructor Create( inPlugIn : TBoardPlugIn; inURL : string = '' ); overload;
189 destructor Destroy; override;
191 property Context: DWORD read FContext write FContext;
193 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
194 property No: Integer read FNo write FNo;
195 property Title: string read FTitle write FTitle;
196 property BBSID: string read FBBSID write FBBSID;
197 property URL: string read FURL write FURL;
198 property Round: Boolean read FRound write SetRound;
199 property RoundName: string read FRoundName write SetRoundName;
200 property RoundDate: TDateTime read FRoundDate write FRoundDate;
201 property LastModified: TDateTime read FLastModified write SetLastModified;
202 property LastGetTime: TDateTime read FLastGetTime write SetLastGetTime;
203 property UnRead: Integer read FUnRead write SetUnRead;
204 property Modified: Boolean read FModified write FModified;
205 property IsThreadDatRead: Boolean read FIsThreadDatRead write FIsThreadDatRead;
206 property ParentCategory: TCategory read FParentCategory write FParentCategory;
208 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
209 property FilePath : string read FFilePath write FFilePath;
210 property IsLogFile : Boolean read FIsLogFile write FIsLogFile;
211 property IntData : Integer read FIntData write FIntData;
212 property ListData : TList read FListData write FListData;
213 function IsBoardPlugInAvailable : Boolean;
215 function Add(item: TThreadItem): integer;
216 procedure Insert(Index: Integer; Item: TThreadItem);
217 procedure Delete(index: integer);
218 procedure DeleteList(index: integer);
219 procedure Clear; override;
220 function Find(ItemFileName: 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);
288 function GetURLWrapper: string;
290 constructor Create; overload;
291 constructor Create( inPlugIn : TBoardPlugIn; inURL : string = '' ); overload;
292 destructor Destroy; override;
294 function GetDatURL: string;
295 function GetDatgzURL: string;
296 // function GetOldDatgzURL: string;
297 function GetOfflawCgiURL(SessionID: string): string;
298 function GetSendURL: string;
299 procedure DeleteLogFile;
300 function GetThreadFileName: string;
301 procedure BeginUpdate;
304 property Context: DWORD read FContext write FContext;
306 property No: Integer read FNo write FNo;
307 property FileName: string read FFileName write FFileName;
308 property Title: string read FTitle write FTitle;
309 property ShortTitle: string read FShortTitle write FShortTitle;
310 property RoundDate: TDateTime read FRoundDate write FRoundDate;
311 property LastModified: TDateTime read FLastModified write SetLastModified;
312 property Count: Integer read FCount write FCount;
313 property AllResCount: Integer read FAllResCount write FAllResCount;
314 property NewResCount: Integer read FNewResCount write FNewResCount;
315 property Size: Integer read FSize write FSize;
316 property Round: Boolean read FRound write SetRound;
317 property RoundName: string read FRoundName write SetRoundName;
319 property IsLogFile: Boolean read FIsLogFile write FIsLogFile;
320 property ParentBoard: TBoard read FParentBoard write FParentBoard;
321 property Kokomade: Integer read FKokomade write SetKokomade;
322 property NewReceive: Integer read FNewReceive write FNewReceive;
323 property NewArrival: Boolean read FNewArrival write FNewArrival;
324 property UnRead: Boolean read FUnRead write SetUnRead;
325 property ScrollTop: Integer read FScrollTop write SetScrollTop;
326 property Expand: Boolean read FExpand write FExpand;
327 property DownloadHost: string read FDownloadHost write FDownloadHost;
328 property AgeSage: TGikoAgeSage read FAgeSage write FAgeSage;
329 // property SPID: string read FSPID write FSPID;
331 property URL : string read GetURLWrapper write FURL;
332 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
333 property FilePath : string read FFilePath write FFilePath;
334 property SizeByte : Integer read FSizeByte write FSizeByte;
335 function IsBoardPlugInAvailable : Boolean;
340 //
\8c\9f\8dõ
\8c\8b\89Ê
\83\8a\83X
\83g
341 { TSearchList = class(TList)
343 function GetThreadItem(index: integer): TThreadItem;
344 procedure SetThreadItem(index: integer; value: TThreadItem);
347 destructor Destroy; override;
349 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
351 function Add(item: TThreadItem): integer;
352 procedure Delete(index: integer);
353 procedure Clear; override;
362 GikoSystem, RoundData;
365 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
366 BBS2CH_LOG_FOLDER: string = '2ch';
368 FOLDER_INI_FILENAME: string = 'Folder.ini';
369 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
370 SUBJECT_FILENAME: string = 'subject.txt';
371 PATH_DELIM: string = '\';
372 //DEFAULT_LIST_COUNT: Integer = 100;
374 // COLUMN_CATEGORY: array[0..0] of string = ('
\83J
\83e
\83S
\83\8a\96¼');
375 // 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');
376 // 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');
378 (*************************************************************************
379 *
\8b@
\94\
\96¼
\81FTBBS
\83R
\83\93\83X
\83g
\83\89\83N
\83^
381 *************************************************************************)
382 constructor TBBS2ch.Create(LogFolder: string);
384 Title := BBS2CH_NAME;
385 FLogFolder := LogFolder;
388 (*************************************************************************
389 *
\8b@
\94\
\96¼
\81FTBBS
\83f
\83X
\83g
\83\89\83N
\83^
391 *************************************************************************)
392 destructor TBBS2ch.Destroy;
398 (*************************************************************************
401 *************************************************************************)
402 function TBBS2ch.GetCategory(index: integer): TCategory;
404 Result := TCategory(inherited Items[index]);
407 procedure TBBS2ch.SetCategory(index: integer; value: TCategory);
409 inherited Items[index] := value;
412 function TBBS2ch.Add(item: TCategory): integer;
414 Item.ParentBBS2ch := self;
415 Result := inherited Add(item);
418 procedure TBBS2ch.Delete(index: integer);
420 if Items[index] <> nil then
421 TCategory(Items[index]).Free;
423 inherited Delete(index);
426 procedure TBBS2ch.Clear;
430 for i := Count - 1 downto 0 do
434 function TBBS2ch.Find(key: string): TCategory;
439 function TBBS2ch.FindBBSID(BBSID: string): TBoard;
446 for i := 0 to Count - 1 do begin
447 Category := Items[i];
448 Board := Category.FindBBSID(BBSID);
449 if Board <> nil then begin
456 function TBBS2ch.FindBoardFromTitle(Title: string): TBoard;
463 for i := 0 to Count - 1 do begin
464 Category := Items[i];
465 Board := Category.FindBoardFromTitle(Title);
466 if Board <> nil then begin
473 function TBBS2ch.FindBoardFromURL(inURL: string): TBoard;
480 for i := 0 to Count - 1 do begin
481 Category := Items[i];
482 Board := Category.FindBoardFromURL(inURL);
483 if Board <> nil then begin
490 function TBBS2ch.FindThreadItem(BBSID: string; FileName: string): TThreadItem;
495 Board := FindBBSID(BBSID);
498 Result := Board.Find(FileName);
501 (*************************************************************************
502 *
\8b@
\94\
\96¼
\81@
\81@
\81F
\83{
\81[
\83h
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
503 *
\89Â
\8e\8b\81@
\81@
\81@
\81FPublic
504 *
\97\9a\97ð
\82P
\81@
\81@
\81F
\90V
\8bK
\8dì
\90¬
505 *************************************************************************)
506 procedure TBBS2ch.ReadBoardFile;
508 //
\8dÅ
\8f\89\82Ì
\88ê
\82Â(
\93Y
\82¦
\8e\9a 0)
\82ª BBS
\96¼
\82Å
\81A
\82»
\82Ì
\8cã
\82É
\83J
\83e
\83S
\83\8a\82ª
\91±
\82
509 TCategories = array of TCategory;
512 jbound, kbound: Integer;
515 CategoryList: TStringList;
516 BoardList: TStringList;
520 RoundItem: TRoundItem;
521 BBSList: TStringList;
522 CustomList: TStringList;
523 BoardFileList: TStringList;
525 plugInBBSs : array of TCategories;
526 plugInCategories : TCategories;
532 plugInIndex : Integer;
534 BBS_NAME_SIGNATURE = #$1B; //
\90â
\91Î
\82É
\94Â
\96¼
\82Æ
\82µ
\82Ä
\82 \82è
\93¾
\82È
\82¢
\8bL
\8d\86\82ð
\8eg
\82¤
536 ini := TMemIniFile.Create('');
537 BBSList := TStringList.Create;
538 CustomList := TStringList.Create;
539 BoardFileList := TStringList.Create;
541 //
\94Â
\83\8a\83X
\83g
\82Ì
\93Ç
\82Ý
\8d\9e\82Ý
542 //
\81¦
\96{
\93\96\82Í TBBS2ch
\82ð
\8cf
\8e¦
\94Â
\82Ì
\90\94\82¾
\82¯
\90¶
\90¬
\82·
\82é
\82×
\82«
\82¾
\82ª
543 //
\81@
\8dÅ
\8f\89\82©
\82ç BBS2ch
\82ª 1
\82Â
\91O
\92ñ
\82Å
\8dì
\82ç
\82ê
\82Ä
\82¢
\82é
\82½
\82ß
\81A
544 //
\81@
\83v
\83\89\83O
\83C
\83\93\82ª
\95Ï
\82í
\82é
\82²
\82Æ
\82É
\83_
\83~
\81[
\82Ì TCategory
\82ð
\8b²
\82ñ
\82Å
\91Î
\8f\88\82·
\82é
546 //
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é
547 if FileExists(GikoSys.GetBoardFileName) then
548 BBSList.LoadFromFile(GikoSys.GetBoardFileName);
549 //
\83J
\83X
\83^
\83\80
550 if FileExists(GikoSys.GetCustomBoardFileName) then
551 CustomList.LoadFromFile(GikoSys.GetCustomBoardFileName);
552 BBSList.AddStrings(CustomList);
553 // Board
\83t
\83H
\83\8b\83_
554 if DirectoryExists(GikoSys.Setting.GetBoardDir) then begin
555 GikoSys.GetFileList( GikoSys.Setting.GetBoardDir, '*', BoardFileList, True, True );
556 for i := BoardFileList.Count - 1 downto 0 do begin
558 CustomList.LoadFromFile( BoardFileList[ i ] );
559 BBSList.AddStrings( CustomList );
562 ini.SetStrings(BBSList);
564 //
\83v
\83\89\83O
\83C
\83\93\97p
\82Ì
\83_
\83~
\81[
\83J
\83e
\83S
\83\8a\82ð
\90¶
\90¬
566 k := Low( BoardPlugIns );
567 kbound := High( BoardPlugIns );
570 Max( 0, kbound - k + 1 ) );
571 for k := k to kbound do begin
572 SetLength( plugInBBSs[ k ], 1 );
573 if Assigned( Pointer( BoardPlugIns[ k ].Module ) ) then begin
574 // BBS
\96¼
\82Ì
\91ã
\82í
\82è
\82É
\82Æ
\82è
\82 \82¦
\82¸
\83v
\83\89\83O
\83C
\83\93\96¼
\82ð
\93ü
\82ê
\82Ä
\82¨
\82
575 //
\81¦
\8d¡
\8cã BBS
\96¼
\82ð
\93ü
\82ê
\82é
\82æ
\82¤
\82É
\89ü
\97Ç
\82·
\82é
\82±
\82Æ
576 plugInBBSs[ k ][ 0 ] := TCategory.Create;
577 BoardPlugIns[ k ].VersionInfo( agent, major, minor, release, revision );
578 plugInBBSs[ k ][ 0 ].Title := BBS_NAME_SIGNATURE + agent;
584 //
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é
\82ð
\92Ç
\89Á
585 Category := TCategory.Create;
586 Category.Title := BBS_NAME_SIGNATURE + '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
587 BBS2ch.Add( Category );
589 CategoryList := TStringList.Create;
590 BoardList := TStringList.Create;
592 ini.ReadSections(CategoryList);
593 for i := 0 to CategoryList.Count - 1 do begin
595 ini.ReadSection(CategoryList[i], BoardList);
596 Category := TCategory.Create;
597 Category.No := i + 1;
598 Category.Title := CategoryList[i];
601 for j := 0 to BoardList.Count - 1 do begin
603 inistr := ini.ReadString(CategoryList[i], BoardList[j], '');
605 //=====
\83v
\83\89\83O
\83C
\83\93
607 kbound := High( BoardPlugIns );
608 for k := Low( BoardPlugIns ) to kbound do begin
609 if Assigned( Pointer( BoardPlugIns[ k ].Module ) ) then begin
610 if BoardPlugIns[ k ].AcceptURL( inistr ) = atBoard then begin
611 Board := TBoard.Create( BoardPlugIns[ k ], inistr );
619 // exception
\82ª
\94
\90¶
\82µ
\82½
\8fê
\8d\87\82Í
\93à
\95\94\8f\88\97\9d\82É
\94C
\82¹
\82½
\82¢
\82Ì
\82Å
\82±
\82±
\82Å
\82Í
\89½
\82à
\82µ
\82È
\82¢
622 if Board = nil then begin
623 Board := TBoard.Create;
628 Board.Title := BoardList[j];
629 Board.BBSID := GikoSys.UrlToID(inistr);
630 Board.RoundDate := ZERO_DATE;
632 idx := RoundList.Find(Board);
633 if idx <> -1 then begin
634 RoundItem := RoundList.Items[idx, grtBoard];
636 Board.RoundName := RoundItem.RoundName;
641 if plugInIndex >= 0 then begin
642 k := High( plugInBBSs[ plugInIndex ] ) + 1;
643 SetLength( plugInBBSs[ plugInIndex ], k + 1 );
644 plugInBBSs[ plugInIndex ][ k ] := Category;
646 BBS2ch.Add(Category);
654 //
\83v
\83\89\83O
\83C
\83\93\97p
\82Ì
\83_
\83~
\81[
\83J
\83e
\83S
\83\8a\82ð
\96\96\94ö
\82É
\92Ç
\89Á
656 k := Low( plugInBBSs );
657 kbound := High( plugInBBSs );
658 for k := k to kbound do begin
659 j := Low( plugInBBSs[ k ] );
660 jbound := High( plugInBBSs[ k ] );
661 for j := j to jbound do begin
662 BBS2ch.Add( plugInBBSs[ k ][ j ] );
675 function TBBS2ch.GetBoardFromBBSID(BBSID: string): TBoard;
680 for i := 0 to BBS2ch.Count - 1 do begin
681 Result := BBS2ch.Items[i].FindBBSID(BBSID);
682 if Result <> nil then
687 (*************************************************************************
688 *
\83\8d\83O
\83t
\83H
\83\8b\83_
\8eæ
\93¾
690 *************************************************************************)
691 function TBBS2ch.GetLogFolder: string;
693 Result := IncludeTrailingPathDelimiter(FLogFolder)
694 + BBS2CH_LOG_FOLDER + PATH_DELIM;
697 procedure TBBS2ch.SetSelectText(s: string);
700 ShortSelectText := GikoSys.ZenToHan(s);
703 {class function TBBS2ch.GetColumnName(Index: Integer): string;
705 Result := COLUMN_CATEGORY[Index];
708 class function TBBS2ch.GetColumnCount: Integer;
710 Result := Length(COLUMN_CATEGORY);
713 //===================
715 //===================
716 constructor TCategory.Create;
720 destructor TCategory.Destroy;
726 function TCategory.GetBoard(index: integer): TBoard;
728 Result := TBoard(inherited Items[index]);
731 procedure TCategory.SetBoard(index: integer; value: TBoard);
733 inherited Items[index] := value;
736 function TCategory.Add(item: TBoard): integer;
738 Item.ParentCategory := self;
739 Result := inherited Add(item);
742 procedure TCategory.Delete(index: integer);
744 if Items[index] <> nil then
745 TBoard(Items[index]).Free;
747 inherited Delete(index);
750 procedure TCategory.Clear;
754 for i := Count - 1 downto 0 do
758 function TCategory.FindName(key: string): TBoard;
763 function TCategory.FindBBSID(BBSID: string): TBoard;
768 for i := 0 to Count - 1 do begin
769 if Items[i].FBBSID = BBSID then begin
776 function TCategory.FindBoardFromTitle(Title: string): TBoard;
781 for i := 0 to Count - 1 do begin
782 if Items[i].FTitle = Title then begin
789 function TCategory.FindBoardFromURL(inURL: string): TBoard;
794 for i := 0 to Count - 1 do begin
795 if Items[i].URL = inURL then begin
802 function TCategory.IsMidoku: Boolean;
808 for i := 0 to Count - 1 do begin
809 if Items[i] <> nil then begin
810 for j := 0 to Items[i].Count - 1 do begin
811 if Items[i].Items[j] <> nil then begin
812 // if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].Count > Items[i].Items[j].Kokomade) then begin
813 if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].UnRead) then begin
823 {class function TCategory.GetColumnName(Index: Integer): string;
825 Result := COLUMN_BOARD[Index];
828 class function TCategory.GetColumnCount: Integer;
830 Result := Length(COLUMN_BOARD);
833 //===================
835 //===================
836 constructor TBoard.Create;
843 FRoundDate := ZERO_DATE;
844 FLastModified := ZERO_DATE;
845 FLastGetTime := ZERO_DATE;
846 FIsThreadDatRead := False;
848 // FListStyle := vsReport;
849 // FItemNoVisible := True;
856 // *************************************************************************
857 //
\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^
858 // *************************************************************************
859 constructor TBoard.Create(
860 inPlugIn : TBoardPlugIn;
867 FBoardPlugIn := inPlugIn;
870 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
871 inPlugIn.CreateBoardItem( DWORD( Self ) );
875 // *************************************************************************
876 //
\83f
\83X
\83g
\83\89\83N
\83^
877 // *************************************************************************
878 destructor TBoard.Destroy;
880 if FModified then begin
881 GikoSys.WriteThreadDat(Self);
885 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
886 if IsBoardPlugInAvailable then
887 BoardPlugIn.DisposeBoardItem( DWORD( Self ) );
893 // *************************************************************************
894 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
895 // *************************************************************************
896 function TBoard.IsBoardPlugInAvailable : Boolean;
900 if BoardPlugIn = nil then
903 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
914 function TBoard.GetThreadItem(index: integer): TThreadItem;
916 Result := TThreadItem(inherited Items[index]);
919 procedure TBoard.SetThreadItem(index: integer; value: TThreadItem);
921 inherited Items[index] := value;
924 function TBoard.Add(Item: TThreadItem): Integer;
926 Item.ParentBoard := Self;
927 Result := inherited Add(Item);
930 procedure TBoard.Insert(Index: Integer; Item: TThreadItem);
932 Item.ParentBoard := Self;
933 inherited Insert(Index, Item);
936 //Index
\82Å
\8ew
\92è
\82³
\82ê
\82½
\83X
\83\8c\83b
\83h
\83I
\83u
\83W
\83F
\83N
\83g
\82ð
\94j
\8aü
937 procedure TBoard.Delete(index: Integer);
939 if Items[index] <> nil then
940 TThreadItem(Items[index]).Free;
942 inherited Delete(index);
945 //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
946 procedure TBoard.DeleteList(index: integer);
948 inherited Delete(index);
951 procedure TBoard.Clear;
956 for i := Count - 1 downto 0 do
960 function TBoard.Find(ItemFileName: string): TThreadItem;
965 for i := 0 to Count - 1 do begin
966 if Items[i].FileName = ItemFileName then begin
973 function TBoard.GetIndex(ItemFileName: string): Integer;
978 for i := 0 to Count - 1 do begin
979 if Items[i].FileName = ItemFileName then begin
986 function TBoard.GetIndexFromURL(URL: string): Integer;
991 for i := 0 to Count - 1 do begin
992 if Items[i].URL = URL then begin
999 {function TBoard.GetMidokuCount: Integer;
1004 for i := 0 to Count- 1 do begin
1005 if Items[i] <> nil then begin
1006 if (Items[i].IsLogFile) and (Items[i].Count > Items[i].Kokomade) then
1013 procedure TBoard.LoadSettings;
1018 if Length( FilePath ) > 0 then
1019 FileName := ExtractFilePath( FilePath ) + FOLDER_INI_FILENAME
1021 FileName := ParentCategory.ParentBBS2ch.GetLogFolder
1022 + BBSID + PATH_DELIM + FOLDER_INI_FILENAME;
1024 if not FileExists(FileName) then
1026 ini := TMemIniFile.Create(FileName);
1028 // Round := ini.ReadBool('Status', 'Round', False);
1029 FRoundDate := ini.ReadDateTime('Status', 'RoundDate', ZERO_DATE);
1030 FLastModified := ini.ReadDateTime('Status', 'LastModified', ZERO_DATE);
1031 FLastGetTime := ini.ReadDateTime('Status', 'LastGetTime', ZERO_DATE);
1032 FUnRead := ini.ReadInteger('Status', 'UnRead', 0);
1033 FSPID := ini.ReadString('Cookie', 'SPID', '');
1034 FPON := ini.ReadString('Cookie', 'PON', '');
1035 FKotehanName := ini.ReadString('Kotehan', 'Name', '');
1036 FKotehanMail := ini.ReadString('Kotehan', 'Mail', '');
1037 // ListStyle := TViewStyle(Ord(ini.ReadInteger('Status', 'ListStyle', 3)));
1038 // ItemNoVisible := ini.ReadBool('Status', 'ItemNoVisible', True);
1039 // ViewType := TGikoViewType(Ord(ini.ReadInteger('Status', 'ViewType', 0)));
1047 procedure TBoard.SaveSettings;
1052 if Length( FilePath ) > 0 then
1053 FileName := ExtractFilePath( FilePath )
1055 FileName := ParentCategory.ParentBBS2ch.GetLogFolder
1056 + BBSID + PATH_DELIM;
1057 if not GikoSys.DirectoryExistsEx(FileName) then
1058 GikoSys.ForceDirectoriesEx(FileName);
1059 FileName := FileName + FOLDER_INI_FILENAME;
1060 ini := TMemIniFile.Create(FileName);
1064 // ini.WriteBool('Status', 'Round', Round);
1065 ini.WriteDateTime('Status', 'RoundDate', FRoundDate);
1066 ini.WriteDateTime('Status', 'LastModified', FLastModified);
1067 ini.WriteDateTime('Status', 'LastGetTime', FLastGetTime);
1068 ini.WriteInteger('Status', 'UnRead', FUnRead);
1069 ini.WriteString('Cookie', 'SPID', FSPID);
1070 ini.WriteString('Cookie', 'PON', FPON);
1071 ini.WriteString('Kotehan', 'Name', FKotehanName);
1072 ini.WriteString('Kotehan', 'Mail', FKotehanMail);
1073 // ini.WriteInteger('Status', 'ListStyle', Ord(ListStyle));
1074 // ini.WriteBool('Status', 'ItemNoVisible', ItemNoVisible);
1075 // ini.WriteInteger('Status', 'ViewType', Ord(ViewType));
1082 //
\83T
\83u
\83W
\83F
\83N
\83gURL
\8eæ
\93¾
1083 function TBoard.GetReadCgiURL: string;
1085 //Result := URL + SUBJECT_FILENAME;
1086 //Result := GikoSys.UrlToServer(URL)
1087 // + 'test/read.cgi/' + BBSID + '/?raw=0.0';
1088 Result := URL + SUBJECT_FILENAME;
1092 //
\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
1093 function TBoard.GetSubjectFileName: string;
1095 if Length( FilePath ) > 0 then
1098 Result := ParentCategory.ParentBBS2ch.GetLogFolder
1099 + BBSID + PATH_DELIM + SUBJECT_FILENAME;
1102 //
\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
1103 function TBoard.GetFolderIndexFileName: string;
1105 if Length( FilePath ) > 0 then
1106 Result := ExtractFilePath( FilePath ) + FOLDER_INDEX_FILENAME
1108 Result := ParentCategory.ParentBBS2ch.GetLogFolder
1109 + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME;
1112 //
\83X
\83\8c\97§
\82Ä
\91\97\90MURL
1113 function TBoard.GetSendURL: string;
1115 Result := GikoSys.UrlToServer(URL) + 'test/subbbs.cgi';
1118 procedure TBoard.SetRound(b: Boolean);
1123 RoundList.Delete(Self);
1124 if FRound = b then Exit;
1130 procedure TBoard.SetRoundName(s: string);
1132 if FRoundName = s then Exit;
1138 procedure TBoard.SetLastModified(d: TDateTime);
1140 if FLastModified = d then Exit;
1146 procedure TBoard.SetLastGetTime(d: TDateTime);
1148 if FLastGetTime = d then Exit;
1154 procedure TBoard.SetUnRead(i: Integer);
1156 if FUnRead = i then Exit;
1157 if i < 0 then i := 0;
1163 procedure TBoard.SetKotehanName(s: string);
1165 if FKotehanName = s then Exit;
1171 procedure TBoard.SetKotehanMail(s: string);
1173 if FKotehanMail = s then Exit;
1179 function TBoard.GetNewThreadCount: Integer;
1184 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1186 for i := 0 to Count - 1 do begin
1187 if Items[i].NewArrival then
1191 for i := 0 to Count - 1 do begin
1192 if Items[i].NewArrival then
1194 if Items[i].ShortTitle = '' then
1195 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1196 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
1203 function TBoard.GetLogThreadCount: Integer;
1208 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1210 for i := 0 to Count - 1 do begin
1211 if Items[i].IsLogFile then
1215 for i := 0 to Count - 1 do begin
1216 if Items[i].IsLogFile then
1218 if Items[i].ShortTitle = '' then
1219 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1220 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
1227 function TBoard.GetUserThreadCount: Integer;
1232 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1235 for i := 0 to Count - 1 do begin
1236 if Items[i].ShortTitle = '' then
1237 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1238 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
1243 function TBoard.GetNewThread(Index: Integer): TThreadItem;
1250 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1252 for i := 0 to Count - 1 do begin
1253 if Items[i].NewArrival then
1255 if Index = Cnt then begin
1263 for i := 0 to Count - 1 do begin
1264 if Items[i].NewArrival then
1266 if Items[i].ShortTitle = '' then
1267 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1268 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1269 if Index = Cnt then begin
1280 function TBoard.GetLogThread(Index: Integer): TThreadItem;
1286 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1288 for i := 0 to Count - 1 do begin
1289 if Items[i].IsLogFile then
1291 if Index = Cnt then begin
1299 for i := 0 to Count - 1 do begin
1300 if Items[i].IsLogFile then
1302 if Items[i].ShortTitle = '' then
1303 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1304 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1305 if Index = Cnt then begin
1317 function TBoard.GetUserThread(Index: Integer): TThreadItem;
1324 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1326 for i := 0 to Count - 1 do begin
1329 Result := Items[ i ];
1335 for i := 0 to Count - 1 do begin
1336 if Items[i].ShortTitle = '' then
1337 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1338 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1339 if Index = Cnt then begin
1349 procedure TBoard.BeginUpdate;
1354 procedure TBoard.EndUpdate;
1359 {class function TBoard.GetColumnName(Index: Integer): string;
1361 Result := COLUMN_THREADITEM[Index];
1364 class function TBoard.GetColumnCount: Integer;
1366 Result := Length(COLUMN_THREADITEM);
1369 //constructor TThreadItem.Create(AOwner: TComponent);
1370 constructor TThreadItem.Create;
1375 FRoundDate := ZERO_DATE;
1376 FLastModified := ZERO_DATE;
1382 FIsLogFile := False;
1383 FParentBoard := nil;
1386 FNewArrival := False;
1390 FBoardPlugIn := nil;
1393 // *************************************************************************
1394 //
\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^
1395 // *************************************************************************
1396 constructor TThreadItem.Create(
1397 inPlugIn : TBoardPlugIn;
1404 FBoardPlugIn := inPlugIn;
1407 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1408 inPlugIn.CreateThreadItem( DWORD( Self ) );
1412 // *************************************************************************
1413 //
\83f
\83X
\83g
\83\89\83N
\83^
1414 // *************************************************************************
1415 destructor TThreadItem.Destroy;
1418 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1419 if IsBoardPlugInAvailable then
1420 FBoardPlugIn.DisposeThreadItem( DWORD( Self ) );
1426 // *************************************************************************
1427 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
1428 // *************************************************************************
1429 function TThreadItem.IsBoardPlugInAvailable : Boolean;
1433 if BoardPlugIn = nil then
1436 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
1447 function TThreadItem.GetDatURL: string;
1449 Protocol, Host, Path, Document, Port, Bookmark: string;
1451 Result := ParentBoard.URL
1454 if FDownloadHost <> '' then begin
1455 GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1456 Result := Format('%s://%s%s%s', [Protocol,
1461 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1462 // + 'test/read.cgi/' + ParentBoard.BBSID + '/'
1463 // + ChangeFileExt(FileName, '') + '/?raw='
1464 // + IntToStr(ResNum) + '.' + IntToStr(ResSize);
1467 function TThreadItem.GetDatgzURL: string;
1468 function isOldKako(s: string): Boolean;
1471 if AnsiPos('piza.', s) <> 0 then
1473 else if AnsiPos('www.bbspink.', s) <> 0 then
1475 else if AnsiPos('tako.', s) <> 0 then
1479 Protocol, Host, Path, Document, Port, Bookmark: string;
1482 if FDownloadHost = '' then begin
1483 DatNo := ChangeFileExt(FileName, '');
1484 if isOldKako(ParentBoard.URL) then begin
1485 Result := Format('%s%s/%.3s/%s.dat', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1487 if Length(DatNo) > 9 then begin
1488 //http://xxx.2ch.net/xxx/kako/9999/99999/999999999.dat.gz
1489 Result := Format('%s%s/%.4s/%.5s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo, DatNo]);
1491 //http://xxx.2ch.net/xxx/kako/999/999999999.dat.gz
1492 Result := Format('%s%s/%.3s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1496 Gikosys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1497 DatNo := ChangeFileExt(Document, '');
1498 if isOldKako(DownloadHost) then begin
1499 Result := Format('%s://%s/%s/kako/%.3s/%s.dat', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1501 if Length(DatNo) > 9 then begin
1502 Result := Format('%s://%s/%s/kako/%.4s/%.5s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo, DatNo]);
1504 Result := Format('%s://%s/%s/kako/%.3s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1510 {function TThreadItem.GetOldDatgzURL: string;
1512 Protocol, Host, Path, Document, Port, Bookmark: string;
1514 Result := Format('%s%s/%.3s/%s.gz', [ParentBoard.URL,
1518 if FDownloadHost <> '' then begin
1519 ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1520 Result := Format('%s://%s%s%s', [Protocol,
1528 function TThreadItem.GetOfflawCgiURL(SessionID: string): string;
1530 // Protocol, Host, Path, Document, Port, Bookmark: string;
1532 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1533 // + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1534 // + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1535 if FDownloadHost = '' then begin
1536 Result := GikoSys.UrlToServer(ParentBoard.URL)
1537 + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1538 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1540 //http://news.2ch.net/test/offlaw.cgi/newsplus/1014038577/?raw=.196928&sid=
1541 //GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1542 Result := 'http://' + FDownloadHost
1543 + '/test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1544 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1545 // Result := Format('%s://%s%s%s', [Protocol,
1552 function TThreadItem.GetSendURL: string;
1554 Result := GikoSys.UrlToServer(ParentBoard.URL)
1558 procedure TThreadItem.DeleteLogFile;
1560 DeleteFile(GetThreadFileName);
1561 if FileExists(ChangeFileExt(GetThreadFileName,'.NG')) = true then
1562 DeleteFile(ChangeFileExt(GetThreadFileName,'.NG'));
1563 FRoundDate := ZERO_DATE;
1564 FLastModified := ZERO_DATE;
1566 FIsLogFile := False;
1569 FNewArrival := False;
1573 FDownloadHost := '';
1574 FAgeSage := gasNone;
1581 function TThreadItem.GetThreadFileName: string;
1583 if Length( FilePath ) > 0 then
1586 Result := ParentBoard.ParentCategory.ParentBBS2ch.GetLogFolder
1587 + ParentBoard.BBSID + PATH_DELIM + FileName;
1590 procedure TThreadItem.SetLastModified(d: TDateTime);
1592 if FLastModified = d then Exit;
1594 if FUpdate and (ParentBoard <> nil) then
1595 ParentBoard.FModified := True;
1598 {procedure TThreadItem.SetRoundNo(i: Integer);
1600 if FRoundNo = i then Exit;
1602 if FUpdate and (ParentBoard <> nil) then
1603 ParentBoard.FModified := True;
1606 procedure TThreadItem.SetRound(b: Boolean);
1611 RoundList.Delete(Self);
1612 if FRound = b then Exit;
1614 if FUpdate and (ParentBoard <> nil) then
1615 ParentBoard.FModified := True;
1618 procedure TThreadItem.SetRoundName(s: string);
1620 if FRoundName = s then Exit;
1622 if FUpdate and (ParentBoard <> nil) then
1623 ParentBoard.FModified := True;
1626 procedure TThreadItem.SetKokomade(i: Integer);
1628 if FKokomade = i then Exit;
1630 if FUpdate and (ParentBoard <> nil) then
1631 ParentBoard.FModified := True;
1634 procedure TThreadItem.SetUnRead(b: Boolean);
1636 if FUnRead = b then Exit;
1638 if FUpdate and (ParentBoard <> nil) then
1639 ParentBoard.FModified := True;
1642 procedure TThreadItem.SetScrollTop(i: Integer);
1644 if FScrollTop = i then Exit;
1646 if FUpdate and (ParentBoard <> nil) then
1647 ParentBoard.FModified := True;
1650 procedure TThreadItem.BeginUpdate;
1655 procedure TThreadItem.EndUpdate;
1660 function TThreadItem.GetURLWrapper: string;
1664 Result := GikoSys.GetURL( ParentBoard.BBSID, FileName )
1671 BBS2ch := TBBS2ch.Create;
1674 if BBS2ch <> nil then