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 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é)
147 FNo: Integer; //
\94Ô
\8d\86
148 FTitle: string; //
\83{
\81[
\83h
\83^
\83C
\83g
\83\8b
149 FBBSID: string; //BBSID
150 FURL: string; //
\83{
\81[
\83hURL
151 FRound: Boolean; //
\83X
\83\8c\83b
\83h
\88ê
\97\97\8f\84\89ñ
\97\
\96ñ
152 FRoundName: string; //
\8f\84\89ñ
\96¼
153 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
154 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
155 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
156 FIsThreadDatRead: Boolean; //
\83X
\83\8c\83b
\83h
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
157 FUnRead: Integer; //
\83X
\83\8c\83b
\83h
\96¢
\93Ç
\90\94
158 FParentCategory: TCategory; //
\90e
\83J
\83e
\83S
\83\8a
159 FModified: Boolean; //
\8fC
\90³
\83t
\83\89\83O
160 FBoolData: Boolean; //
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
161 FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
162 FPON: string; //
\8f\91\82«
\8d\9e\82Ý
\97pPON
163 FKotehanName: string; //
\83R
\83e
\83n
\83\93\96¼
\91O
164 FKotehanMail: string; //
\83R
\83e
\83n
\83\93\83\81\81[
\83\8b
169 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\94Â
\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
170 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\88ê
\97\97\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
171 FIsLogFile : Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
173 function GetThreadItem(index: integer): TThreadItem;
174 procedure SetThreadItem(index: integer; value: TThreadItem);
175 procedure SetRound(b: Boolean);
176 procedure SetRoundName(s: string);
177 procedure SetLastModified(d: TDateTime);
178 procedure SetLastGetTime(d: TDateTime);
179 procedure SetUnRead(i: Integer);
180 procedure SetKotehanName(s: string);
181 procedure SetKotehanMail(s: string);
183 constructor Create; overload;
184 constructor Create( inPlugIn : TBoardPlugIn; inURL : string = '' ); overload;
185 destructor Destroy; override;
187 property Context: DWORD read FContext write FContext;
189 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
190 property No: Integer read FNo write FNo;
191 property Title: string read FTitle write FTitle;
192 property BBSID: string read FBBSID write FBBSID;
193 property URL: string read FURL write FURL;
194 property Round: Boolean read FRound write SetRound;
195 property RoundName: string read FRoundName write SetRoundName;
196 property RoundDate: TDateTime read FRoundDate write FRoundDate;
197 property LastModified: TDateTime read FLastModified write SetLastModified;
198 property LastGetTime: TDateTime read FLastGetTime write SetLastGetTime;
199 property UnRead: Integer read FUnRead write SetUnRead;
200 property Modified: Boolean read FModified write FModified;
201 property IsThreadDatRead: Boolean read FIsThreadDatRead write FIsThreadDatRead;
202 property ParentCategory: TCategory read FParentCategory write FParentCategory;
204 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
205 property FilePath : string read FFilePath write FFilePath;
206 property IsLogFile : Boolean read FIsLogFile write FIsLogFile;
207 function IsBoardPlugInAvailable : Boolean;
209 function Add(item: TThreadItem): integer;
210 procedure Insert(Index: Integer; Item: TThreadItem);
211 procedure Delete(index: integer);
212 procedure DeleteList(index: integer);
213 procedure Clear; override;
214 function Find(ItemFileName: string): TThreadItem;
215 function GetIndex(ItemFileName: string): Integer;
216 procedure LoadSettings;
217 procedure SaveSettings;
218 function GetReadCgiURL: string;
219 function GetSubjectFileName: string;
220 function GetFolderIndexFileName: string;
221 function GetSendURL: string;
223 function GetNewThreadCount: Integer;
224 function GetLogThreadCount: Integer;
225 function GetUserThreadCount: Integer;
226 function GetNewThread(Index: Integer): TThreadItem;
227 function GetLogThread(Index: Integer): TThreadItem;
228 function GetUserThread(Index: Integer): TThreadItem;
230 procedure BeginUpdate;
232 property NodeExpand: Boolean read FExpand write FExpand;
233 property BoolData: Boolean read FBoolData write FBoolData;
234 property SPID: string read FSPID write FSPID;
235 property PON: string read FPON write FPON;
236 property KotehanName: string read FKotehanName write SetKotehanName;
237 property KotehanMail: string read FKotehanMail write SetKotehanMail;
241 TThreadItem = class(TObject)
243 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é)
245 FNo: Integer; //
\94Ô
\8d\86
246 FFileName: string; //
\83X
\83\8c\83b
\83h
\83t
\83@
\83C
\83\8b\96¼
247 FTitle: string; //
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b
248 FShortTitle: string; //
\92Z
\82¢
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b\81i
\8c\9f\8dõ
\97p
\81j
249 FRoundDate: TDateTime; //
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e\81i
\8f\84\89ñ
\93ú
\8e\9e\81j
250 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
251 FCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83\8d\81[
\83J
\83\8b\81j
252 FAllResCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83T
\81[
\83o
\81j
253 FNewResCount: Integer; //
\83X
\83\8c\83b
\83h
\90V
\92\85\90\94
254 FSize: Integer; //
\83X
\83\8c\83b
\83h
\83T
\83C
\83Y
255 FRound: Boolean; //
\8f\84\89ñ
\83t
\83\89\83O
256 FRoundName: string; //
\8f\84\89ñ
\96¼
257 FIsLogFile: Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
258 FParentBoard: TBoard; //
\90e
\83{
\81[
\83h
259 FKokomade: Integer; //
\83R
\83R
\82Ü
\82Å
\93Ç
\82ñ
\82¾
\94Ô
\8d\86
260 FNewReceive: Integer; //
\83R
\83R
\82©
\82ç
\90V
\8bK
\8eó
\90M
261 FNewArrival: Boolean; //
\90V
\92\85
262 FUnRead: Boolean; //
\96¢
\93Ç
\83t
\83\89\83O
263 FScrollTop: Integer; //
\83X
\83N
\83\8d\81[
\83\8b\88Ê
\92u
264 FDownloadHost: string; //
\8d¡
\82Ì
\83z
\83X
\83g
\82Æ
\88á
\82¤
\8fê
\8d\87\82Ì
\83z
\83X
\83g
265 FAgeSage: TGikoAgeSage; //
\83A
\83C
\83e
\83\80\82Ì
\8fã
\82°
\89º
\82°
266 // FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
270 FURL : string; //
\82±
\82Ì
\83X
\83\8c\82ð
\83u
\83\89\83E
\83U
\82Å
\95\
\8e¦
\82·
\82é
\8dÛ
\82Ì URL
271 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\83X
\83\8c\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
272 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
273 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
275 procedure SetLastModified(d: TDateTime);
276 procedure SetRound(b: Boolean);
277 procedure SetRoundName(s: string);
278 procedure SetKokomade(i: Integer);
279 procedure SetUnRead(b: Boolean);
280 procedure SetScrollTop(i: Integer);
281 function GetURLWrapper: string;
283 constructor Create; overload;
284 constructor Create( inPlugIn : TBoardPlugIn; inURL : string = '' ); overload;
285 destructor Destroy; override;
287 function GetDatURL: string;
288 function GetDatgzURL: string;
289 // function GetOldDatgzURL: string;
290 function GetOfflawCgiURL(SessionID: string): string;
291 function GetSendURL: string;
292 procedure DeleteLogFile;
293 function GetThreadFileName: string;
294 procedure BeginUpdate;
297 property Context: DWORD read FContext write FContext;
299 property No: Integer read FNo write FNo;
300 property FileName: string read FFileName write FFileName;
301 property Title: string read FTitle write FTitle;
302 property ShortTitle: string read FShortTitle write FShortTitle;
303 property RoundDate: TDateTime read FRoundDate write FRoundDate;
304 property LastModified: TDateTime read FLastModified write SetLastModified;
305 property Count: Integer read FCount write FCount;
306 property AllResCount: Integer read FAllResCount write FAllResCount;
307 property NewResCount: Integer read FNewResCount write FNewResCount;
308 property Size: Integer read FSize write FSize;
309 property Round: Boolean read FRound write SetRound;
310 property RoundName: string read FRoundName write SetRoundName;
312 property IsLogFile: Boolean read FIsLogFile write FIsLogFile;
313 property ParentBoard: TBoard read FParentBoard write FParentBoard;
314 property Kokomade: Integer read FKokomade write SetKokomade;
315 property NewReceive: Integer read FNewReceive write FNewReceive;
316 property NewArrival: Boolean read FNewArrival write FNewArrival;
317 property UnRead: Boolean read FUnRead write SetUnRead;
318 property ScrollTop: Integer read FScrollTop write SetScrollTop;
319 property Expand: Boolean read FExpand write FExpand;
320 property DownloadHost: string read FDownloadHost write FDownloadHost;
321 property AgeSage: TGikoAgeSage read FAgeSage write FAgeSage;
322 // property SPID: string read FSPID write FSPID;
324 property URL : string read GetURLWrapper write FURL;
325 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
326 property FilePath : string read FFilePath write FFilePath;
327 property SizeByte : Integer read FSizeByte write FSizeByte;
328 function IsBoardPlugInAvailable : Boolean;
333 //
\8c\9f\8dõ
\8c\8b\89Ê
\83\8a\83X
\83g
334 { TSearchList = class(TList)
336 function GetThreadItem(index: integer): TThreadItem;
337 procedure SetThreadItem(index: integer; value: TThreadItem);
340 destructor Destroy; override;
342 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
344 function Add(item: TThreadItem): integer;
345 procedure Delete(index: integer);
346 procedure Clear; override;
355 GikoSystem, RoundData;
358 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
359 BBS2CH_LOG_FOLDER: string = '2ch';
361 FOLDER_INI_FILENAME: string = 'Folder.ini';
362 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
363 SUBJECT_FILENAME: string = 'subject.txt';
364 PATH_DELIM: string = '\';
365 //DEFAULT_LIST_COUNT: Integer = 100;
367 // COLUMN_CATEGORY: array[0..0] of string = ('
\83J
\83e
\83S
\83\8a\96¼');
368 // 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');
369 // 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');
371 (*************************************************************************
372 *
\8b@
\94\
\96¼
\81FTBBS
\83R
\83\93\83X
\83g
\83\89\83N
\83^
374 *************************************************************************)
375 constructor TBBS2ch.Create(LogFolder: string);
377 Title := BBS2CH_NAME;
378 FLogFolder := LogFolder;
381 (*************************************************************************
382 *
\8b@
\94\
\96¼
\81FTBBS
\83f
\83X
\83g
\83\89\83N
\83^
384 *************************************************************************)
385 destructor TBBS2ch.Destroy;
391 (*************************************************************************
394 *************************************************************************)
395 function TBBS2ch.GetCategory(index: integer): TCategory;
397 Result := TCategory(inherited Items[index]);
400 procedure TBBS2ch.SetCategory(index: integer; value: TCategory);
402 inherited Items[index] := value;
405 function TBBS2ch.Add(item: TCategory): integer;
407 Item.ParentBBS2ch := self;
408 Result := inherited Add(item);
411 procedure TBBS2ch.Delete(index: integer);
413 if Items[index] <> nil then
414 TCategory(Items[index]).Free;
416 inherited Delete(index);
419 procedure TBBS2ch.Clear;
423 for i := Count - 1 downto 0 do
427 function TBBS2ch.Find(key: string): TCategory;
432 function TBBS2ch.FindBBSID(BBSID: string): TBoard;
439 for i := 0 to Count - 1 do begin
440 Category := Items[i];
441 Board := Category.FindBBSID(BBSID);
442 if Board <> nil then begin
449 function TBBS2ch.FindBoardFromTitle(Title: string): TBoard;
456 for i := 0 to Count - 1 do begin
457 Category := Items[i];
458 Board := Category.FindBoardFromTitle(Title);
459 if Board <> nil then begin
466 function TBBS2ch.FindThreadItem(BBSID: string; FileName: string): TThreadItem;
471 Board := FindBBSID(BBSID);
474 Result := Board.Find(FileName);
477 (*************************************************************************
478 *
\8b@
\94\
\96¼
\81@
\81@
\81F
\83{
\81[
\83h
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
479 *
\89Â
\8e\8b\81@
\81@
\81@
\81FPublic
480 *
\97\9a\97ð
\82P
\81@
\81@
\81F
\90V
\8bK
\8dì
\90¬
481 *************************************************************************)
482 procedure TBBS2ch.ReadBoardFile;
488 CategoryList: TStringList;
489 BoardList: TStringList;
493 RoundItem: TRoundItem;
494 BBSList: TStringList;
495 CustomList: TStringList;
497 ini := TMemIniFile.Create('');
498 BBSList := TStringList.Create;
499 CustomList := TStringList.Create;
501 if FileExists(GikoSys.GetBoardFileName) then
502 BBSList.LoadFromFile(GikoSys.GetBoardFileName);
503 if FileExists(GikoSys.GetCustomBoardFileName) then
504 CustomList.LoadFromFile(GikoSys.GetCustomBoardFileName);
505 BBSList.AddStrings(CustomList);
506 ini.SetStrings(BBSList);
508 CategoryList := TStringList.Create;
509 BoardList := TStringList.Create;
511 ini.ReadSections(CategoryList);
512 for i := 0 to CategoryList.Count - 1 do begin
514 ini.ReadSection(CategoryList[i], BoardList);
515 Category := TCategory.Create;
516 Category.No := i + 1;
517 Category.Title := CategoryList[i];
519 for j := 0 to BoardList.Count - 1 do begin
521 inistr := ini.ReadString(CategoryList[i], BoardList[j], '');
523 //=====
\83v
\83\89\83O
\83C
\83\93
525 kbound := High( BoardPlugIns );
526 for k := Low( BoardPlugIns ) to kbound do begin
527 if Assigned( Pointer( BoardPlugIns[ k ].Module ) ) then begin
528 if BoardPlugIns[ k ].AcceptURL( inistr ) then begin
529 Board := TBoard.Create( BoardPlugIns[ k ], inistr );
536 // 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¢
539 if Board = nil then begin
540 Board := TBoard.Create;
545 Board.Title := BoardList[j];
546 Board.BBSID := GikoSys.UrlToID(inistr);
547 Board.RoundDate := ZERO_DATE;
549 idx := RoundList.Find(Board);
550 if idx <> -1 then begin
551 RoundItem := RoundList.Items[idx, grtBoard];
553 Board.RoundName := RoundItem.RoundName;
558 BBS2ch.Add(Category);
571 function TBBS2ch.GetBoardFromBBSID(BBSID: string): TBoard;
576 for i := 0 to BBS2ch.Count - 1 do begin
577 Result := BBS2ch.Items[i].FindBBSID(BBSID);
578 if Result <> nil then
583 (*************************************************************************
584 *
\83\8d\83O
\83t
\83H
\83\8b\83_
\8eæ
\93¾
586 *************************************************************************)
587 function TBBS2ch.GetLogFolder: string;
589 Result := IncludeTrailingPathDelimiter(FLogFolder)
590 + BBS2CH_LOG_FOLDER + PATH_DELIM;
593 procedure TBBS2ch.SetSelectText(s: string);
596 ShortSelectText := GikoSys.ZenToHan(s);
599 {class function TBBS2ch.GetColumnName(Index: Integer): string;
601 Result := COLUMN_CATEGORY[Index];
604 class function TBBS2ch.GetColumnCount: Integer;
606 Result := Length(COLUMN_CATEGORY);
609 //===================
611 //===================
612 constructor TCategory.Create;
616 destructor TCategory.Destroy;
622 function TCategory.GetBoard(index: integer): TBoard;
624 Result := TBoard(inherited Items[index]);
627 procedure TCategory.SetBoard(index: integer; value: TBoard);
629 inherited Items[index] := value;
632 function TCategory.Add(item: TBoard): integer;
634 Item.ParentCategory := self;
635 Result := inherited Add(item);
638 procedure TCategory.Delete(index: integer);
640 if Items[index] <> nil then
641 TBoard(Items[index]).Free;
643 inherited Delete(index);
646 procedure TCategory.Clear;
650 for i := Count - 1 downto 0 do
654 function TCategory.FindName(key: string): TBoard;
659 function TCategory.FindBBSID(BBSID: string): TBoard;
664 for i := 0 to Count - 1 do begin
665 if Items[i].FBBSID = BBSID then begin
672 function TCategory.FindBoardFromTitle(Title: string): TBoard;
677 for i := 0 to Count - 1 do begin
678 if Items[i].FTitle = Title then begin
685 function TCategory.IsMidoku: Boolean;
691 for i := 0 to Count - 1 do begin
692 if Items[i] <> nil then begin
693 for j := 0 to Items[i].Count - 1 do begin
694 if Items[i].Items[j] <> nil then begin
695 // if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].Count > Items[i].Items[j].Kokomade) then begin
696 if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].UnRead) then begin
706 {class function TCategory.GetColumnName(Index: Integer): string;
708 Result := COLUMN_BOARD[Index];
711 class function TCategory.GetColumnCount: Integer;
713 Result := Length(COLUMN_BOARD);
716 //===================
718 //===================
719 constructor TBoard.Create;
726 FRoundDate := ZERO_DATE;
727 FLastModified := ZERO_DATE;
728 FLastGetTime := ZERO_DATE;
729 FIsThreadDatRead := False;
731 // FListStyle := vsReport;
732 // FItemNoVisible := True;
739 // *************************************************************************
740 //
\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^
741 // *************************************************************************
742 constructor TBoard.Create(
743 inPlugIn : TBoardPlugIn;
750 FBoardPlugIn := inPlugIn;
753 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
754 inPlugIn.CreateBoardItem( DWORD( Self ) );
758 // *************************************************************************
759 //
\83f
\83X
\83g
\83\89\83N
\83^
760 // *************************************************************************
761 destructor TBoard.Destroy;
763 if FModified then begin
764 GikoSys.WriteThreadDat(Self);
768 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
769 if IsBoardPlugInAvailable then
770 BoardPlugIn.DisposeBoardItem( DWORD( Self ) );
776 // *************************************************************************
777 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
778 // *************************************************************************
779 function TBoard.IsBoardPlugInAvailable : Boolean;
783 if BoardPlugIn = nil then
786 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
797 function TBoard.GetThreadItem(index: integer): TThreadItem;
799 Result := TThreadItem(inherited Items[index]);
802 procedure TBoard.SetThreadItem(index: integer; value: TThreadItem);
804 inherited Items[index] := value;
807 function TBoard.Add(Item: TThreadItem): Integer;
809 Item.ParentBoard := Self;
810 Result := inherited Add(Item);
813 procedure TBoard.Insert(Index: Integer; Item: TThreadItem);
815 Item.ParentBoard := Self;
816 inherited Insert(Index, Item);
819 //Index
\82Å
\8ew
\92è
\82³
\82ê
\82½
\83X
\83\8c\83b
\83h
\83I
\83u
\83W
\83F
\83N
\83g
\82ð
\94j
\8aü
820 procedure TBoard.Delete(index: Integer);
822 if Items[index] <> nil then
823 TThreadItem(Items[index]).Free;
825 inherited Delete(index);
828 //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
829 procedure TBoard.DeleteList(index: integer);
831 inherited Delete(index);
834 procedure TBoard.Clear;
839 for i := Count - 1 downto 0 do
843 function TBoard.Find(ItemFileName: string): TThreadItem;
848 for i := 0 to Count - 1 do begin
849 if Items[i].FileName = ItemFileName then begin
856 function TBoard.GetIndex(ItemFileName: string): Integer;
861 for i := 0 to Count - 1 do begin
862 if Items[i].FileName = ItemFileName then begin
869 {function TBoard.GetMidokuCount: Integer;
874 for i := 0 to Count- 1 do begin
875 if Items[i] <> nil then begin
876 if (Items[i].IsLogFile) and (Items[i].Count > Items[i].Kokomade) then
883 procedure TBoard.LoadSettings;
888 FileName := ParentCategory.ParentBBS2ch.GetLogFolder
889 + BBSID + PATH_DELIM + FOLDER_INI_FILENAME;
891 if not FileExists(FileName) then
893 ini := TMemIniFile.Create(FileName);
895 // Round := ini.ReadBool('Status', 'Round', False);
896 FRoundDate := ini.ReadDateTime('Status', 'RoundDate', ZERO_DATE);
897 FLastModified := ini.ReadDateTime('Status', 'LastModified', ZERO_DATE);
898 FLastGetTime := ini.ReadDateTime('Status', 'LastGetTime', ZERO_DATE);
899 FUnRead := ini.ReadInteger('Status', 'UnRead', 0);
900 FSPID := ini.ReadString('Cookie', 'SPID', '');
901 FPON := ini.ReadString('Cookie', 'PON', '');
902 FKotehanName := ini.ReadString('Kotehan', 'Name', '');
903 FKotehanMail := ini.ReadString('Kotehan', 'Mail', '');
904 // ListStyle := TViewStyle(Ord(ini.ReadInteger('Status', 'ListStyle', 3)));
905 // ItemNoVisible := ini.ReadBool('Status', 'ItemNoVisible', True);
906 // ViewType := TGikoViewType(Ord(ini.ReadInteger('Status', 'ViewType', 0)));
914 procedure TBoard.SaveSettings;
919 FileName := ParentCategory.ParentBBS2ch.GetLogFolder
920 + BBSID + PATH_DELIM;
921 if not GikoSys.DirectoryExistsEx(FileName) then
922 GikoSys.ForceDirectoriesEx(FileName);
923 FileName := FileName + FOLDER_INI_FILENAME;
924 ini := TMemIniFile.Create(FileName);
928 // ini.WriteBool('Status', 'Round', Round);
929 ini.WriteDateTime('Status', 'RoundDate', FRoundDate);
930 ini.WriteDateTime('Status', 'LastModified', FLastModified);
931 ini.WriteDateTime('Status', 'LastGetTime', FLastGetTime);
932 ini.WriteInteger('Status', 'UnRead', FUnRead);
933 ini.WriteString('Cookie', 'SPID', FSPID);
934 ini.WriteString('Cookie', 'PON', FPON);
935 ini.WriteString('Kotehan', 'Name', FKotehanName);
936 ini.WriteString('Kotehan', 'Mail', FKotehanMail);
937 // ini.WriteInteger('Status', 'ListStyle', Ord(ListStyle));
938 // ini.WriteBool('Status', 'ItemNoVisible', ItemNoVisible);
939 // ini.WriteInteger('Status', 'ViewType', Ord(ViewType));
946 //
\83T
\83u
\83W
\83F
\83N
\83gURL
\8eæ
\93¾
947 function TBoard.GetReadCgiURL: string;
949 //Result := URL + SUBJECT_FILENAME;
950 //Result := GikoSys.UrlToServer(URL)
951 // + 'test/read.cgi/' + BBSID + '/?raw=0.0';
952 Result := URL + SUBJECT_FILENAME;
956 //
\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
957 function TBoard.GetSubjectFileName: string;
959 Result := ParentCategory.ParentBBS2ch.GetLogFolder
960 + BBSID + PATH_DELIM + SUBJECT_FILENAME;
963 //
\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
964 function TBoard.GetFolderIndexFileName: string;
966 Result := ParentCategory.ParentBBS2ch.GetLogFolder
967 + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME;
970 //
\83X
\83\8c\97§
\82Ä
\91\97\90MURL
971 function TBoard.GetSendURL: string;
973 Result := GikoSys.UrlToServer(URL) + 'test/subbbs.cgi';
976 procedure TBoard.SetRound(b: Boolean);
981 RoundList.Delete(Self);
982 if FRound = b then Exit;
988 procedure TBoard.SetRoundName(s: string);
990 if FRoundName = s then Exit;
996 procedure TBoard.SetLastModified(d: TDateTime);
998 if FLastModified = d then Exit;
1004 procedure TBoard.SetLastGetTime(d: TDateTime);
1006 if FLastGetTime = d then Exit;
1012 procedure TBoard.SetUnRead(i: Integer);
1014 if FUnRead = i then Exit;
1015 if i < 0 then i := 0;
1021 procedure TBoard.SetKotehanName(s: string);
1023 if FKotehanName = s then Exit;
1029 procedure TBoard.SetKotehanMail(s: string);
1031 if FKotehanMail = s then Exit;
1037 function TBoard.GetNewThreadCount: Integer;
1042 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1044 for i := 0 to Count - 1 do begin
1045 if Items[i].NewArrival then
1049 for i := 0 to Count - 1 do begin
1050 if Items[i].NewArrival then
1052 if Items[i].ShortTitle = '' then
1053 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1054 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
1061 function TBoard.GetLogThreadCount: Integer;
1066 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1068 for i := 0 to Count - 1 do begin
1069 if Items[i].IsLogFile then
1073 for i := 0 to Count - 1 do begin
1074 if Items[i].IsLogFile then
1076 if Items[i].ShortTitle = '' then
1077 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1078 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
1085 function TBoard.GetUserThreadCount: Integer;
1090 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1093 for i := 0 to Count - 1 do begin
1094 if Items[i].ShortTitle = '' then
1095 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1096 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then
1101 function TBoard.GetNewThread(Index: Integer): TThreadItem;
1108 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1110 for i := 0 to Count - 1 do begin
1111 if Items[i].NewArrival then
1113 if Index = Cnt then begin
1121 for i := 0 to Count - 1 do begin
1122 if Items[i].NewArrival then
1124 if Items[i].ShortTitle = '' then
1125 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1126 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1127 if Index = Cnt then begin
1138 function TBoard.GetLogThread(Index: Integer): TThreadItem;
1144 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1146 for i := 0 to Count - 1 do begin
1147 if Items[i].IsLogFile then
1149 if Index = Cnt then begin
1157 for i := 0 to Count - 1 do begin
1158 if Items[i].IsLogFile then
1160 if Items[i].ShortTitle = '' then
1161 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1162 if AnsiPos(ParentCategory.ParentBBS2ch.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1163 if Index = Cnt then begin
1175 function TBoard.GetUserThread(Index: Integer): TThreadItem;
1182 if Length( ParentCategory.ParentBBS2ch.ShortSelectText ) = 0 then
1184 for i := 0 to Count - 1 do begin
1187 Result := Items[ i ];
1193 for i := 0 to Count - 1 do begin
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 begin
1197 if Index = Cnt then begin
1207 procedure TBoard.BeginUpdate;
1212 procedure TBoard.EndUpdate;
1217 {class function TBoard.GetColumnName(Index: Integer): string;
1219 Result := COLUMN_THREADITEM[Index];
1222 class function TBoard.GetColumnCount: Integer;
1224 Result := Length(COLUMN_THREADITEM);
1227 //constructor TThreadItem.Create(AOwner: TComponent);
1228 constructor TThreadItem.Create;
1233 FRoundDate := ZERO_DATE;
1234 FLastModified := ZERO_DATE;
1240 FIsLogFile := False;
1241 FParentBoard := nil;
1244 FNewArrival := False;
1248 FBoardPlugIn := nil;
1251 // *************************************************************************
1252 //
\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^
1253 // *************************************************************************
1254 constructor TThreadItem.Create(
1255 inPlugIn : TBoardPlugIn;
1262 FBoardPlugIn := inPlugIn;
1265 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1266 inPlugIn.CreateThreadItem( DWORD( Self ) );
1270 // *************************************************************************
1271 //
\83f
\83X
\83g
\83\89\83N
\83^
1272 // *************************************************************************
1273 destructor TThreadItem.Destroy;
1276 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1277 if IsBoardPlugInAvailable then
1278 FBoardPlugIn.DisposeThreadItem( DWORD( Self ) );
1284 // *************************************************************************
1285 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
1286 // *************************************************************************
1287 function TThreadItem.IsBoardPlugInAvailable : Boolean;
1291 if BoardPlugIn = nil then
1294 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
1305 function TThreadItem.GetDatURL: string;
1307 Protocol, Host, Path, Document, Port, Bookmark: string;
1309 Result := ParentBoard.URL
1312 if FDownloadHost <> '' then begin
1313 GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1314 Result := Format('%s://%s%s%s', [Protocol,
1319 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1320 // + 'test/read.cgi/' + ParentBoard.BBSID + '/'
1321 // + ChangeFileExt(FileName, '') + '/?raw='
1322 // + IntToStr(ResNum) + '.' + IntToStr(ResSize);
1325 function TThreadItem.GetDatgzURL: string;
1326 function isOldKako(s: string): Boolean;
1329 if AnsiPos('piza.', s) <> 0 then
1331 else if AnsiPos('www.bbspink.', s) <> 0 then
1333 else if AnsiPos('tako.', s) <> 0 then
1337 Protocol, Host, Path, Document, Port, Bookmark: string;
1340 if FDownloadHost = '' then begin
1341 DatNo := ChangeFileExt(FileName, '');
1342 if isOldKako(ParentBoard.URL) then begin
1343 Result := Format('%s%s/%.3s/%s.dat', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1345 if Length(DatNo) > 9 then begin
1346 //http://xxx.2ch.net/xxx/kako/9999/99999/999999999.dat.gz
1347 Result := Format('%s%s/%.4s/%.5s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo, DatNo]);
1349 //http://xxx.2ch.net/xxx/kako/999/999999999.dat.gz
1350 Result := Format('%s%s/%.3s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1354 Gikosys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1355 DatNo := ChangeFileExt(Document, '');
1356 if isOldKako(DownloadHost) then begin
1357 Result := Format('%s://%s/%s/kako/%.3s/%s.dat', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1359 if Length(DatNo) > 9 then begin
1360 Result := Format('%s://%s/%s/kako/%.4s/%.5s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo, DatNo]);
1362 Result := Format('%s://%s/%s/kako/%.3s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1368 {function TThreadItem.GetOldDatgzURL: string;
1370 Protocol, Host, Path, Document, Port, Bookmark: string;
1372 Result := Format('%s%s/%.3s/%s.gz', [ParentBoard.URL,
1376 if FDownloadHost <> '' then begin
1377 ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1378 Result := Format('%s://%s%s%s', [Protocol,
1386 function TThreadItem.GetOfflawCgiURL(SessionID: string): string;
1388 // Protocol, Host, Path, Document, Port, Bookmark: string;
1390 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1391 // + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1392 // + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1393 if FDownloadHost = '' then begin
1394 Result := GikoSys.UrlToServer(ParentBoard.URL)
1395 + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1396 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1398 //http://news.2ch.net/test/offlaw.cgi/newsplus/1014038577/?raw=.196928&sid=
1399 //GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1400 Result := 'http://' + FDownloadHost
1401 + '/test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1402 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1403 // Result := Format('%s://%s%s%s', [Protocol,
1410 function TThreadItem.GetSendURL: string;
1412 Result := GikoSys.UrlToServer(ParentBoard.URL)
1416 procedure TThreadItem.DeleteLogFile;
1418 DeleteFile(GetThreadFileName);
1419 if FileExists(ChangeFileExt(GetThreadFileName,'.NG')) = true then
1420 DeleteFile(ChangeFileExt(GetThreadFileName,'.NG'));
1421 FRoundDate := ZERO_DATE;
1422 FLastModified := ZERO_DATE;
1424 FIsLogFile := False;
1427 FNewArrival := False;
1431 FDownloadHost := '';
1432 FAgeSage := gasNone;
1439 function TThreadItem.GetThreadFileName: string;
1441 if Length( FilePath ) > 0 then
1444 Result := ParentBoard.ParentCategory.ParentBBS2ch.GetLogFolder
1445 + ParentBoard.BBSID + PATH_DELIM + FileName;
1448 procedure TThreadItem.SetLastModified(d: TDateTime);
1450 if FLastModified = d then Exit;
1452 if FUpdate and (ParentBoard <> nil) then
1453 ParentBoard.FModified := True;
1456 {procedure TThreadItem.SetRoundNo(i: Integer);
1458 if FRoundNo = i then Exit;
1460 if FUpdate and (ParentBoard <> nil) then
1461 ParentBoard.FModified := True;
1464 procedure TThreadItem.SetRound(b: Boolean);
1469 RoundList.Delete(Self);
1470 if FRound = b then Exit;
1472 if FUpdate and (ParentBoard <> nil) then
1473 ParentBoard.FModified := True;
1476 procedure TThreadItem.SetRoundName(s: string);
1478 if FRoundName = s then Exit;
1480 if FUpdate and (ParentBoard <> nil) then
1481 ParentBoard.FModified := True;
1484 procedure TThreadItem.SetKokomade(i: Integer);
1486 if FKokomade = i then Exit;
1488 if FUpdate and (ParentBoard <> nil) then
1489 ParentBoard.FModified := True;
1492 procedure TThreadItem.SetUnRead(b: Boolean);
1494 if FUnRead = b then Exit;
1496 if FUpdate and (ParentBoard <> nil) then
1497 ParentBoard.FModified := True;
1500 procedure TThreadItem.SetScrollTop(i: Integer);
1502 if FScrollTop = i then Exit;
1504 if FUpdate and (ParentBoard <> nil) then
1505 ParentBoard.FModified := True;
1508 procedure TThreadItem.BeginUpdate;
1513 procedure TThreadItem.EndUpdate;
1518 function TThreadItem.GetURLWrapper: string;
1522 Result := GikoSys.GetURL( ParentBoard.BBSID, FileName )
1529 BBS2ch := TBBS2ch.Create;
1532 if BBS2ch <> nil then