6 Windows, SysUtils, Classes, ComCtrls, {HTTPApp,} YofUtils, IdGlobal,
7 ExternalBoardManager, ExternalBoardPlugInMain, StrUtils;
10 //
\83\8a\83X
\83g
\82Ì
\95\
\8e¦
\83A
\83C
\83e
\83\80\91I
\91ð
11 TGikoViewType = (gvtAll, gvtLog, gvtNew, gvtLive, gvtArch, gvtUser);
12 //
\83\8a\83X
\83g
\82Ì
\8fã
\82°
\89º
\82°
13 TGikoAgeSage = (gasNone, gasAge, gasSage, gasNew, gasArch, gasNull);
20 // BBS
\82Ì
\83\8b\81[
\83g
24 FFilePath : string; //
\94Â
\83\8a\83X
\83g
\82Ì
\83p
\83X
26 FKubetsuChk: Boolean; //
\8di
\8d\9e\82Ý
\8e\9e\91å
\95¶
\8e\9a\8f¬
\95¶
\8e\9a\8bæ
\95Ê
27 FSelectText: string; //
\8di
\8d\9e\82Ý
\95¶
\8e\9a\97ñ
28 FShortSelectText: string;
29 FIsBoardFileRead : Boolean; //
\94Â
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
31 function GetCategory(index: integer): TCategory;
32 procedure SetCategory(index: integer; value: TCategory);
33 procedure SetSelectText(s: string);
35 constructor Create( boardFilePath : string );
36 destructor Destroy; override;
38 function Add(item: TCategory): integer;
39 procedure Delete(index: integer);
40 procedure Clear; override;
41 function Find(key: string): TCategory;
42 function FindBBSID(const BBSID: string): TBoard;
43 function FindBoardFromTitle(const Title: string): TBoard;
44 function FindBoardFromURL(const inURL: string): TBoard;
45 function FindThreadFromURL(const inURL : string ) : TThreadItem;
46 function FindThreadItem(const BBSID, FileName: string): TThreadItem;
47 function FindCategoryFromTitle(const inTitle : string ) : TCategory;
48 property FilePath : string read FFilePath write FFilePath;
50 property Items[index: integer]: TCategory read GetCategory write SetCategory;
51 property Title: string read FTitle write FTitle;
52 property NodeExpand: Boolean read FExpand write FExpand;
54 property KubetsuChk: Boolean read FKubetsuChk write FKubetsuChk;
55 property SelectText: string read FSelectText write SetSelectText;
56 property ShortSelectText: string read FShortSelectText write FShortSelectText;
58 property IsBoardFileRead : Boolean read FIsBoardFileRead write FIsBoardFileRead;
61 //
\83J
\83e
\83S
\83\8a(
\94Â URL
\82Ì
\83\8a\83X
\83g)
62 TCategory = class(TStringList)
69 function GetBoard(index: integer): TBoard;
70 procedure SetBoard(index: integer; value: TBoard);
73 destructor Destroy; override;
75 property No: Integer read FNo write FNo;
76 property Title: string read FTitle write FTitle;
77 property Items[index: integer]: TBoard read GetBoard write SetBoard;
78 property ParenTBBS: TBBS read FParenTBBS write FParenTBBS;
80 function Add(item: TBoard): integer;
81 procedure Delete(index: integer);
82 procedure Clear; override;
83 function FindName(const key: string): TBoard;
84 function FindBBSID(const BBSID: string): TBoard;
85 function FindBoardFromTitle(const Title: string): TBoard;
86 function FindBoardFromURL(const inURL: string): TBoard;
87 function FindThreadFromURL(const inURL : string ) : TThreadItem;
88 function IsMidoku: Boolean;
90 property NodeExpand: Boolean read FExpand write FExpand;
93 //!
\83X
\83\8c\83b
\83h
\90\94\83J
\83E
\83\93\83g
\8fð
\8c\8f\95¶
94 TThreadCount = function(Item : TThreadItem): Boolean;
96 //
\94Â(
\83X
\83\8c\83b
\83h URL
\82Ì
\83\8a\83X
\83g)
97 TBoard = class(TStringList)
99 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é)
101 FNo: Integer; //
\94Ô
\8d\86
102 FTitle: string; //
\83{
\81[
\83h
\83^
\83C
\83g
\83\8b
103 FBBSID: string; //BBSID
104 FURL: string; //
\83{
\81[
\83hURL
105 FRound: Boolean; //
\83X
\83\8c\83b
\83h
\88ê
\97\97\8f\84\89ñ
\97\
\96ñ
106 FRoundName: string; //
\8f\84\89ñ
\96¼
107 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
108 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
109 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
110 FIsThreadDatRead: Boolean; //
\83X
\83\8c\83b
\83h
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
111 FUnRead: Integer; //
\83X
\83\8c\83b
\83h
\96¢
\93Ç
\90\94
112 FParentCategory: TCategory; //
\90e
\83J
\83e
\83S
\83\8a
113 FModified: Boolean; //
\8fC
\90³
\83t
\83\89\83O
114 FBoolData: Boolean; //
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
115 FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
116 FPON: string; //
\8f\91\82«
\8d\9e\82Ý
\97pPON
117 FCookie: string; //
\8f\91\82«
\8d\9e\82Ý
\97pCookie
\95¶
\8e\9a\97ñ
118 FExpires: TDateTime; //Cookie
\82Ì
\97L
\8cø
\8aú
\8cÀ
119 FKotehanName: string; //
\83R
\83e
\83n
\83\93\96¼
\91O
120 FKotehanMail: string; //
\83R
\83e
\83n
\83\93\83\81\81[
\83\8b
125 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\94Â
\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
126 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\88ê
\97\97\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
127 FIsLogFile : Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
128 FIntData : Integer; //
\8dD
\82«
\82É
\82¢
\82¶
\82Á
\82Ä
\82æ
\82µ
\81B
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
129 FListData : TList; //
\8dD
\82«
\82É
\82¢
\82¶
\82Á
\82Ä
\82æ
\82µ
\81B
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
131 FSETTINGTXTTime : TDateTime; //SETTING.TXT
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e
132 FIsSETTINGTXT : boolean; //SETTING.TXT
\82ð
\8eæ
\93¾
\82µ
\82Ä
\82¢
\82é
\82©
133 FHEADTXTTime : TDateTime; //HEAD.TXT
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e
134 FIsHEADTXT : boolean; //HEAD.TXT
\82ð
\8eæ
\93¾
\82µ
\82Ä
\82¢
\82é
\82©
135 FTitlePictureURL: string; //top
\8aG
\82ÌURL
136 FMultiplicity : Integer; //
\8fd
\95¡
\82µ
\82Ä
\82¢
\82é
\82©
\82Ç
\82¤
\82©
\81H
137 FIs2ch : Boolean; //host
\82ª2ch
\82©
\82Ç
\82¤
\82©
138 FNewThreadCount: Integer; //
\90V
\92\85\83X
\83\8c\83b
\83h
\82Ì
\90\94
139 FLogThreadCount: Integer; //
\83\8d\83O
\97L
\82è
\83X
\83\8c\83b
\83h
\82Ì
\90\94
140 FUserThreadCount: Integer; //
\81H
141 FLiveThreadCount: Integer; //
\90¶
\91¶
\83X
\83\8c\83b
\83h
\90\94
142 FArchiveThreadCount: Integer; //DAT
\97\8e\82¿
\83X
\83\8c\83b
\83h
\90\94
143 function GetThreadItem(index: integer): TThreadItem;
144 procedure SetThreadItem(index: integer; value: TThreadItem);
145 procedure SetRound(b: Boolean);
146 procedure SetRoundName(s: string);
147 //procedure SetRoundName(s: PChar);
148 procedure SetLastModified(d: TDateTime);
149 procedure SetLastGetTime(d: TDateTime);
150 procedure SetUnRead(i: Integer);
151 procedure SetKotehanName(s: string);
152 procedure SetKotehanMail(s: string);
155 constructor Create( inPlugIn : TBoardPlugIn; inURL : string );
156 destructor Destroy; override;
158 property Context: DWORD read FContext write FContext;
160 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
161 property No: Integer read FNo write FNo;
162 property Title: string read FTitle write FTitle;
163 property BBSID: string read FBBSID write FBBSID;
164 property URL: string read FURL write FURL;
165 property Round: Boolean read FRound write SetRound;
166 //property RoundName: PChar read FRoundName write SetRoundName;
167 property RoundName: string read FRoundName write SetRoundName;
168 property RoundDate: TDateTime read FRoundDate write FRoundDate;
169 property LastModified: TDateTime read FLastModified write SetLastModified;
170 property LastGetTime: TDateTime read FLastGetTime write SetLastGetTime;
171 property UnRead: Integer read FUnRead write SetUnRead;
172 property Modified: Boolean read FModified write FModified;
173 property IsThreadDatRead: Boolean read FIsThreadDatRead write FIsThreadDatRead;
174 property ParentCategory: TCategory read FParentCategory write FParentCategory;
176 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
177 property FilePath : string read FFilePath write FFilePath;
178 property IsLogFile : Boolean read FIsLogFile write FIsLogFile;
179 property IntData : Integer read FIntData write FIntData;
180 property ListData : TList read FListData write FListData;
181 function IsBoardPlugInAvailable : Boolean;
183 function Add(item: TThreadItem): integer;
184 procedure Insert(Index: Integer; Item: TThreadItem);
185 procedure Delete(index: integer);
186 procedure DeleteList(index: integer);
187 procedure Clear; override;
188 function FindThreadFromFileName(const ItemFileName: string): TThreadItem;
189 function FindThreadFromURL(const inURL : string ) : TThreadItem;
190 function GetIndexFromFileName(const ItemFileName: string): Integer;
191 function GetIndexFromURL(const URL: string; reverse : Boolean = False): Integer;
192 procedure LoadSettings;
193 procedure SaveSettings;
194 function GetReadCgiURL: string;
195 function GetSubjectFileName: string;
196 function GetFolderIndexFileName: string;
197 function GetSETTINGTXTFileName: string;
198 function GETHEADTXTFileName: string;
199 function GetTitlePictureFileName: string;
200 function GetSendURL: string;
202 function GetNewThreadCount: Integer;
203 function GetLogThreadCount: Integer;
204 function GetArchiveThreadCount: Integer;
205 function GetLiveThreadCount: Integer;
206 function GetUserThreadCount: Integer;
207 function GetNewThread(Index: Integer): TThreadItem;
208 function GetLogThread(Index: Integer): TThreadItem; overload;
209 function GetArchiveThread(Index: Integer): TThreadItem;
210 function GetLiveThread(Index: Integer): TThreadItem;
211 function GetUserThread(Index: Integer): TThreadItem;
212 function GetThreadCount(func :TThreadCount ): Integer;
213 function GetThread(func :TThreadCount;const Index :Integer ): TThreadItem;
214 procedure BeginUpdate;
216 property NodeExpand: Boolean read FExpand write FExpand;
217 property BoolData: Boolean read FBoolData write FBoolData;
218 property SPID: string read FSPID write FSPID;
219 property PON: string read FPON write FPON;
220 property KotehanName: string read FKotehanName write SetKotehanName;
221 property KotehanMail: string read FKotehanMail write SetKotehanMail;
223 property SETTINGTXTTime: TDateTime read FSETTINGTXTTime write FSETTINGTXTTime;
224 property IsSETTINGTXT: boolean read FIsSETTINGTXT write FIsSETTINGTXT;
225 property HEADTXTTime: TDateTime read FHEADTXTTime write FHEADTXTTime;
226 property IsHEADTXT: boolean read FIsHEADTXT write FIsHEADTXT;
227 property TitlePictureURL: string read FTitlePictureURL write FTitlePictureURL;
228 property Multiplicity: Integer read FMultiplicity write FMultiplicity;
229 property Is2ch : boolean read FIs2ch write FIs2ch;
230 property NewThreadCount: Integer read FNewThreadCount write FNewThreadCount; //
\90V
\92\85\83X
\83\8c\83b
\83h
\82Ì
\90\94
231 property LogThreadCount: Integer read FLogThreadCount write FLogThreadCount; //
\83\8d\83O
\97L
\82è
\83X
\83\8c\83b
\83h
\82Ì
\90\94
232 property UserThreadCount: Integer read FUserThreadCount write FUserThreadCount; //
\81H
233 property LiveThreadCount: Integer read FLiveThreadCount write FLiveThreadCount;
234 property ArchiveThreadCount: Integer read FArchiveThreadCount write FArchiveThreadCount;
236 property Cookie: string read FCookie write FCookie;
237 property Expires: TDateTime read FExpires write FExpires;
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é)
244 FNo: Integer; //
\94Ô
\8d\86
245 FFileName: string; //
\83X
\83\8c\83b
\83h
\83t
\83@
\83C
\83\8b\96¼
246 FTitle: string; //
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b
247 FShortTitle: string; //
\92Z
\82¢
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b\81i
\8c\9f\8dõ
\97p
\81j
248 FRoundDate: TDateTime; //
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e\81i
\8f\84\89ñ
\93ú
\8e\9e\81j
249 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
250 FCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83\8d\81[
\83J
\83\8b\81j
251 FAllResCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83T
\81[
\83o
\81j
252 FNewResCount: Integer; //
\83X
\83\8c\83b
\83h
\90V
\92\85\90\94
253 FSize: Integer; //
\83X
\83\8c\83b
\83h
\83T
\83C
\83Y
254 FRound: Boolean; //
\8f\84\89ñ
\83t
\83\89\83O
255 FRoundName: string; //
\8f\84\89ñ
\96¼
256 FIsLogFile: Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
257 FParentBoard: TBoard; //
\90e
\83{
\81[
\83h
258 FKokomade: Integer; //
\83R
\83R
\82Ü
\82Å
\93Ç
\82ñ
\82¾
\94Ô
\8d\86
259 FNewReceive: Integer; //
\83R
\83R
\82©
\82ç
\90V
\8bK
\8eó
\90M
260 FNewArrival: Boolean; //
\90V
\92\85
261 FUnRead: Boolean; //
\96¢
\93Ç
\83t
\83\89\83O
262 FScrollTop: Integer; //
\83X
\83N
\83\8d\81[
\83\8b\88Ê
\92u
263 FDownloadHost: string; //
\8d¡
\82Ì
\83z
\83X
\83g
\82Æ
\88á
\82¤
\8fê
\8d\87\82Ì
\83z
\83X
\83g
264 FAgeSage: TGikoAgeSage; //
\83A
\83C
\83e
\83\80\82Ì
\8fã
\82°
\89º
\82°
267 FURL : string; //
\82±
\82Ì
\83X
\83\8c\82ð
\83u
\83\89\83E
\83U
\82Å
\95\
\8e¦
\82·
\82é
\8dÛ
\82Ì URL
268 FJumpAddress : Integer; //
\83\8c\83X
\94Ô
\8d\86\8ew
\92èURL
\82ð
\93¥
\82ñ
\82¾
\82Æ
\82«
\82É
\8ew
\92è
\82³
\82ê
\82é
\83\8c\83X
\82Ì
\94Ô
\8d\86\82ª
\93ü
\82é
269 procedure SetLastModified(d: TDateTime);
270 procedure SetRound(b: Boolean);
271 procedure SetRoundName(const s: string);
272 //procedure SetRoundName(const s: PChar);
273 procedure SetKokomade(i: Integer);
274 procedure SetUnRead(b: Boolean);
275 procedure SetScrollTop(i: Integer);
277 function GetCreateDate: TDateTime;
278 function GetFilePath: String;
280 constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard; inURL : string ); overload;
281 constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard;
282 const inURL : string; inExist: Boolean; const inFilename: string ); overload;
284 destructor Destroy; override;
286 function GetDatURL: string;
287 function GetDatgzURL: string;
288 // function GetOldDatgzURL: string;
289 function GetOfflawCgiURL(const SessionID: string): string;
290 function GetSendURL: string;
291 procedure DeleteLogFile;
292 function GetThreadFileName: string;
293 procedure BeginUpdate;
296 property Context: DWORD read FContext write FContext;
298 property No: Integer read FNo write FNo;
299 property FileName: string read FFileName write FFileName;
300 property Title: string read FTitle write FTitle;
301 property ShortTitle: string read FShortTitle write FShortTitle;
302 property RoundDate: TDateTime read FRoundDate write FRoundDate;
303 property LastModified: TDateTime read FLastModified write SetLastModified;
304 property Count: Integer read FCount write FCount;
305 property AllResCount: Integer read FAllResCount write FAllResCount;
306 property NewResCount: Integer read FNewResCount write FNewResCount;
307 property Size: Integer read FSize write FSize;
308 property Round: Boolean read FRound write SetRound;
309 property RoundName: string read FRoundName write SetRoundName;
310 //property RoundName: PChar 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 CreateDate: TDateTime read GetCreateDate;
323 property URL : string read FURL write FURL;
324 property FilePath : string read GetFilePath;
325 property JumpAddress : Integer read FJumpAddress write FJumpAddress;
328 TBoardGroup = class(TStringList)
330 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\94Â
\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
332 destructor Destroy; override;
333 procedure Clear ; override;
334 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn write FBoardPlugIn;
337 //
\93Á
\8eê
\97p
\93r
\97pTBoard
338 TSpecialBoard = class(TBoard)
340 function Add(item: TThreadItem): integer; overload;
341 procedure Clear; overload;
344 function BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard;
345 function BBSsFindBoardFromURL( inURL : string ) : TBoard;
346 function BBSsFindBoardFromTitle( inTitle : string ) : TBoard;
347 function BBSsFindThreadFromURL(const inURL : string ) : TThreadItem;
348 function ConvertDateTimeString( inDateTimeString : string) : TDateTime;
350 procedure DestorySpecialBBS( inBBS : TBBS );
353 BBSs : array of TBBS;
354 BoardGroups : array of TBoardGroup;
356 SpecialBoard: TSpecialBoard;
361 GikoSystem, RoundData, MojuUtils, DateUtils, IniFiles;
364 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
365 BBS2CH_LOG_FOLDER: string = '2ch';
366 EXTERNAL_LOG_FOLDER: string = 'exboard';
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 SETTINGTXT_FILENAME: string = 'SETTING.TXT';
373 HEADTXT_FILENAME: string = 'head.html';
374 //DEFAULT_LIST_COUNT: Integer = 100;
376 //!
\83\8d\83O
\82ð
\8e\9d\82Á
\82Ä
\82¢
\82é
\82È
\82ç
\90^
\82ð
\95Ô
\82·
377 function CountLog(Item: TThreadItem): Boolean;
379 Result := Item.IsLogFile;
381 //!
\90V
\92\85\82È
\82ç
\90^
\82ð
\95Ô
\82·
382 function CountNew(Item: TThreadItem): Boolean;
384 Result := Item.NewArrival;
386 //! DAT
\97\8e\82¿
\82È
\82ç
\90^
\82ð
\95Ô
\82·
387 function CountDat(Item: TThreadItem): Boolean;
389 Result := (Item.AgeSage = gasArch);
391 //!
\90¶
\91¶
\83X
\83\8c\82È
\82ç
\90^
\82ð
\95Ô
\82·
392 function CountLive(Item: TThreadItem): Boolean;
394 Result := (Item.AgeSage <> gasArch);
398 function CountAll(Item: TThreadItem): Boolean;
405 // BBSID
\82ð
\97p
\82¢
\82é 2
\82¿
\82á
\82ñ
\82Ë
\82é
\82Ì
\82Ý
\92T
\82µ
\8fo
\82µ
\82Ü
\82·
406 // BBSID
\82Ì
\8eg
\97p
\82Í
\8bÉ
\97Í
\94ð
\82¯
\82Ä
\82
\82¾
\82³
\82¢
\81B
407 //
\89Â
\94\
\82È
\8fê
\8d\87\82Í URL
\82ð
\8eg
\97p
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B
408 function BBSsFindBoardFromBBSID(
416 // Result := BBSs[ 0 ].FindBBSID( inBBSID );
418 if Length(BoardGroups) > 0 then begin
419 for i := BoardGroups[0].Count - 1 downto 0 do begin
420 tmpBoard := TBoard(BoardGroups[0].Objects[i]);
421 if tmpBoard.Is2ch then begin
422 if AnsiCompareStr(tmpBoard.BBSID, inBBSID) = 0 then begin
431 {**********************************************
432 \82±
\82Ì
\8aÖ
\90\94\82Í
\95K
\82¸
\94Â
\82ÌURL
\82Ì
\8c`
\8e®
\82Å
\93n
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B
433 plugin
\82ð
\8eg
\97p
\82·
\82é
\82È
\82ç
\82Î
\81AExtractBoardURL( inURL )
434 2ch
\82È
\82ç
\82Î
\81AGikoSys.Get2chThreadURL2BoardURL( inURL );
435 \82Å
\95Ï
\8a·
\82µ
\82Ä
\82©
\82ç
\8cÄ
\82Ñ
\8fo
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B
436 **********************************************}
437 function BBSsFindBoardFromURL(
442 accept : TAcceptType;
443 protocol, host, path, document, port, bookmark : string;
446 for i := Length(BoardGroups) - 1 downto 1 do begin
447 accept := BoardGroups[i].BoardPlugIn.AcceptURL(inURL);
448 if (accept = atBoard) or (accept = atThread) then begin
449 if BoardGroups[i].Find(inURL, p) then begin
450 Result := TBoard(BoardGroups[i].Objects[p]);
453 inURL := BoardGroups[i].BoardPlugIn.ExtractBoardURL(inURL);
454 if BoardGroups[i].Find(inURL, p) then begin
455 Result := TBoard(BoardGroups[i].Objects[p]);
461 //
\82±
\82±
\82É
\82«
\82½
\82ç
\81Aplugin
\82ð
\8eg
\82í
\82È
\82¢
\82â
\82Â
\82ç
\82ð
\92²
\82×
\82é
462 if BoardGroups[0].Find(inURL, p) then
463 Result := TBoard(BoardGroups[0].Objects[p]);
465 if (Result = nil) then begin
466 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
467 //
\83z
\83X
\83g
\82ª2ch
\82È
\82çBBSID
\82Å
\92²
\82×
\82é
468 if GikoSys.Is2chHost(host) then begin
469 Result := BBSsFindBoardFromBBSID(GikoSys.URLToID( inURL ));
475 function BBSsFindBoardFromTitle(
483 for i := Length( BBSs ) - 1 downto 0 do begin
484 for j := BoardGroups[i].Count - 1 downto 0 do begin
485 tmpBoard := TBoard(BoardGroups[i].Objects[j]);
486 if ( AnsiCompareStr(tmpBoard.Title, inTitle) = 0) then begin
495 function BBSsFindThreadFromURL(
500 tmpThread : TThreadItem;
502 protocol, host, path, document, port, bookmark : string;
503 BBSID, BBSKey : string;
507 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
508 board := BBSsFindBoardFromURL( boardURL );
512 Result := board.FindThreadFromURL( inURL );
513 //
\82à
\82µ
\82à2ch
\82Ì
\94Â
\82È
\82ç
514 if (Result = nil) and (board.Is2ch) then begin
515 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
516 GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
517 Result := board.FindThreadFromFileName(BBSKey + '.dat');
518 end else if (Result = nil) and not (board.Is2ch) then begin
519 //
\83v
\83\89\83O
\83C
\83\93\8cn
\82Ì
\92T
\8dõ
\81i
\8eå
\82ÉURL
\82ª
\93r
\92\86\82Å
\95Ï
\8dX
\82É
\82È
\82Á
\82½
\97Þ)
521 bi := Length(BoardGroups) - 1;
522 for i := 1 to bi do begin
523 if (BoardGroups[i].BoardPlugIn <> nil) and (Assigned(Pointer(BoardGroups[i].BoardPlugIn.Module))) then begin
524 if BoardGroups[i].BoardPlugIn.AcceptURL( inURL ) = atThread then begin
525 tmpThread := TThreadItem.Create( BoardGroups[i].BoardPlugIn, Board, inURL );
526 if not board.IsThreadDatRead then begin
527 GikoSys.ReadSubjectFile( board );
529 Result := Board.FindThreadFromFileName( tmpThread.FileName );
543 \brief
\93Á
\8eê
\97p
\93rBBS
\8dí
\8f\9c
544 \param bbs
\8dí
\8f\9c\82·
\82é
\93Á
\8eê
\97p
\93rBBS
546 procedure DestorySpecialBBS( inBBS : TBBS );
548 sCategory : TCategory;
549 sBoard : TSpecialBoard;
551 if inBBS <> nil then begin
552 sCategory := inBBS.Items[0];
553 if sCategory <> nil then begin
554 sBoard := TSpecialBoard(sCategory.Items[0]);
555 if sBoard <> nil then begin
556 sBoard.Modified := False;
565 (*************************************************************************
566 *
\8b@
\94\
\96¼
\81FTBBS
\83R
\83\93\83X
\83g
\83\89\83N
\83^
568 *************************************************************************)
569 constructor TBBS.Create( boardFilePath : string );
572 Title := BBS2CH_NAME;
573 FFilePath := boardFilePath;
576 (*************************************************************************
577 *
\8b@
\94\
\96¼
\81FTBBS
\83f
\83X
\83g
\83\89\83N
\83^
579 *************************************************************************)
580 destructor TBBS.Destroy;
586 (*************************************************************************
589 *************************************************************************)
590 function TBBS.GetCategory(index: integer): TCategory;
592 Result := TCategory(inherited Items[index]);
595 procedure TBBS.SetCategory(index: integer; value: TCategory);
597 inherited Items[index] := value;
600 function TBBS.Add(item: TCategory): integer;
602 Item.ParenTBBS := self;
603 Result := inherited Add(item);
606 procedure TBBS.Delete(index: integer);
608 if Items[index] <> nil then
609 TCategory(Items[index]).Free;
611 inherited Delete(index);
614 procedure TBBS.Clear;
618 for i := Count - 1 downto 0 do
623 function TBBS.Find(key: string): TCategory;
628 function TBBS.FindBBSID(const BBSID: string): TBoard;
632 if not IsBoardFileRead then
633 GikoSys.ReadBoardFile( Self );
634 for i := Count - 1 downto 0 do begin
635 Result := Items[ i ].FindBBSID(BBSID);
636 if Result <> nil then
642 //*************************************************************************
643 //
\83^
\83C
\83g
\83\8b\82Ì
\88ê
\92v
\82·
\82é
\94Â
\82ð
\92T
\82·
644 //*************************************************************************)
645 function TBBS.FindBoardFromTitle(const Title: string): TBoard;
649 if not IsBoardFileRead then
650 GikoSys.ReadBoardFile( Self );
651 for i := Count - 1 downto 0 do begin
652 Result := Items[ i ].FindBoardFromTitle(Title);
653 if Result <> nil then
659 //*************************************************************************
660 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\94Â
\82ð
\92T
\82·
661 //*************************************************************************)
662 function TBBS.FindBoardFromURL(const inURL: string): TBoard;
666 if not IsBoardFileRead then
667 GikoSys.ReadBoardFile( Self );
668 for i := Count - 1 downto 0 do begin
669 Result := Items[ i ].FindBoardFromURL( inURL );
670 if Result <> nil then
676 //*************************************************************************
677 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\83X
\83\8c\83b
\83h
\82ð
\92T
\82·
678 //*************************************************************************)
679 function TBBS.FindThreadFromURL(const inURL: string): TThreadItem;
685 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
686 board := FindBoardFromURL( boardURL );
690 Result := board.FindThreadFromURL( inURL );
694 function TBBS.FindThreadItem(const BBSID, FileName: string): TThreadItem;
699 Board := FindBBSID(BBSID);
702 Result := Board.FindThreadFromFileName(FileName);
705 function TBBS.FindCategoryFromTitle(const inTitle : string ) : TCategory;
710 for i := Count - 1 downto 0 do begin
711 if AnsiCompareStr(Items[ i ].Title, inTitle) = 0 then begin
712 Result := Items[ i ];
721 procedure TBBS.SetSelectText(s: string);
724 ShortSelectText := CustomStringReplace(ZenToHan(s), ' ', '');
727 {class function TBBS.GetColumnName(Index: Integer): string;
729 Result := COLUMN_CATEGORY[Index];
732 class function TBBS.GetColumnCount: Integer;
734 Result := Length(COLUMN_CATEGORY);
737 //===================
739 //===================
740 constructor TCategory.Create;
744 Duplicates := dupIgnore;
745 CaseSensitive := False;
749 destructor TCategory.Destroy;
755 function TCategory.GetBoard(index: integer): TBoard;
757 Result := TBoard( Objects[index] );
760 procedure TCategory.SetBoard(index: integer; value: TBoard);
762 Objects[index] := value;
763 Strings[index] := value.URL
766 function TCategory.Add(item: TBoard): integer;
768 Item.ParentCategory := self;
769 Result := AddObject( item.URL, item );
772 procedure TCategory.Delete(index: integer);
774 inherited Delete(index);
777 procedure TCategory.Clear;
781 for i := Count - 1 downto 0 do
786 function TCategory.FindName(const key: string): TBoard;
791 function TCategory.FindBBSID(const BBSID: string): TBoard;
795 for i := Count - 1 downto 0 do begin
796 if AnsiCompareStr(Items[i].FBBSID, BBSID) = 0 then begin
804 //*************************************************************************
805 //
\83^
\83C
\83g
\83\8b\82Ì
\88ê
\92v
\82·
\82é
\94Â
\82ð
\92T
\82·
806 //*************************************************************************)
807 function TCategory.FindBoardFromTitle(const Title: string): TBoard;
811 for i := Count - 1 downto 0 do begin
812 if AnsiCompareStr(Items[i].FTitle, Title) = 0 then begin
820 //*************************************************************************
821 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\94Â
\82ð
\92T
\82·
822 //*************************************************************************)
823 function TCategory.FindBoardFromURL(const inURL: string): TBoard;
827 i := IndexOf( inURL );
829 Result := TBoard( Objects[ i ] )
834 //*************************************************************************
835 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\83X
\83\8c\83b
\83h
\82ð
\92T
\82·
836 //*************************************************************************)
837 function TCategory.FindThreadFromURL(const inURL: string): TThreadItem;
843 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
844 board := FindBoardFromURL( boardURL );
848 Result := board.FindThreadFromURL( inURL );
852 function TCategory.IsMidoku: Boolean;
858 for i := 0 to Count - 1 do begin
859 if Items[i] <> nil then begin
860 for j := 0 to Items[i].Count - 1 do begin
861 if Items[i].Items[j] <> nil then begin
862 // if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].Count > Items[i].Items[j].Kokomade) then begin
863 if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].UnRead) then begin
873 {class function TCategory.GetColumnName(Index: Integer): string;
875 Result := COLUMN_BOARD[Index];
878 class function TCategory.GetColumnCount: Integer;
880 Result := Length(COLUMN_BOARD);
883 //===================
885 //===================
886 procedure TBoard.Init;
888 Duplicates := dupIgnore;
889 CaseSensitive := False;
897 FRoundDate := ZERO_DATE;
898 FLastModified := ZERO_DATE;
899 FLastGetTime := ZERO_DATE;
900 FIsThreadDatRead := False;
903 // FListStyle := vsReport;
904 // FItemNoVisible := True;
909 // *************************************************************************
910 //
\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^
911 // *************************************************************************
912 constructor TBoard.Create(
913 inPlugIn : TBoardPlugIn;
917 protocol, host, path, document, port, bookmark : string;
923 FBoardPlugIn := inPlugIn;
925 BBSID := GikoSys.UrlToID( inURL );
927 if inPlugIn = nil then begin
928 // subject.txt
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
929 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
930 if GikoSys.Is2chHost( host ) then begin
933 GikoSys.Setting.LogFolderP +
934 BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
938 GikoSys.Setting.LogFolderP +
939 EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
942 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
943 inPlugIn.CreateBoardItem( DWORD( Self ) );
944 //Self.Is2ch := False; //plugin
\91¤
\82Å
\90Ý
\92è
\82·
\82é
949 // *************************************************************************
950 //
\83f
\83X
\83g
\83\89\83N
\83^
951 // *************************************************************************
952 destructor TBoard.Destroy;
954 if FModified then begin
955 GikoSys.WriteThreadDat(Self);
959 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
960 if IsBoardPlugInAvailable then
961 BoardPlugIn.DisposeBoardItem( DWORD( Self ) );
967 // *************************************************************************
968 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
969 // *************************************************************************
970 function TBoard.IsBoardPlugInAvailable : Boolean;
974 if BoardPlugIn = nil then
977 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
988 function TBoard.GetThreadItem(index: integer): TThreadItem;
990 Result := TThreadItem( Objects[index] );
993 procedure TBoard.SetThreadItem(index: integer; value: TThreadItem);
995 Objects[index] := value;
996 Strings[index] := value.URL;
999 function TBoard.Add(Item: TThreadItem): Integer;
1001 Item.ParentBoard := Self;
1002 Result := inherited AddObject(Item.URL, Item);
1005 procedure TBoard.Insert(Index: Integer; Item: TThreadItem);
1007 Item.ParentBoard := Self;
1008 inherited InsertObject(Index, Item.URL, Item);
1012 //Index
\82Å
\8ew
\92è
\82³
\82ê
\82½
\83X
\83\8c\83b
\83h
\83I
\83u
\83W
\83F
\83N
\83g
\82ð
\94j
\8aü
1013 procedure TBoard.Delete(index: Integer);
1015 if Items[index] <> nil then
1016 TThreadItem(Items[index]).Free;
1017 inherited Delete(index);
1020 //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
1021 procedure TBoard.DeleteList(index: integer);
1023 inherited Delete(index);
1026 procedure TBoard.Clear;
1031 for i := Count - 1 downto 0 do
1036 function TBoard.FindThreadFromFileName(const ItemFileName: string): TThreadItem;
1041 for i := 0 to Count - 1 do begin
1042 if AnsiCompareStr(Items[i].FileName, ItemFileName) = 0 then begin
1049 function TBoard.GetIndexFromFileName(const ItemFileName: string): Integer;
1054 for i := 0 to Count - 1 do begin
1055 if Items[i].FileName = ItemFileName then begin
1062 function TBoard.GetIndexFromURL(const URL: string; reverse : Boolean = False): Integer;
1067 Result := IndexOf( URL )
1070 for i := Self.Count - 1 downto 0 do begin
1071 if Strings[i] = URL then begin
1079 function TBoard.FindThreadFromURL(const inURL : string ) : TThreadItem;
1084 if not IsThreadDatRead then
1085 GikoSys.ReadSubjectFile( Self );
1087 i := IndexOf( inURL );
1089 Result := TThreadItem( Objects[ i ] )
1095 {function TBoard.GetMidokuCount: Integer;
1100 for i := 0 to Count- 1 do begin
1101 if Items[i] <> nil then begin
1102 if (Items[i].IsLogFile) and (Items[i].Count > Items[i].Kokomade) then
1109 procedure TBoard.LoadSettings;
1115 if Length( FilePath ) > 0 then
1116 FileName := ExtractFilePath( FilePath ) + FOLDER_INI_FILENAME
1118 FileName := GikoSys.Setting.LogFolderP
1119 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + FOLDER_INI_FILENAME;
1121 if not FileExists(FileName) then
1123 ini := TMemIniFile.Create(FileName);
1125 // Round := ini.ReadBool('Status', 'Round', False);
1126 tmp := ini.ReadString('Status', 'RoundDate', DateTimeToStr(ZERO_DATE));
1127 FRoundDate := ConvertDateTimeString(tmp);
1128 tmp := ini.ReadString('Status', 'LastModified', DateTimeToStr(ZERO_DATE));
1129 FLastModified := ConvertDateTimeString(tmp);
1130 tmp := ini.ReadString('Status', 'LastGetTime', DateTimeToStr(ZERO_DATE));
1131 FLastGetTime := ConvertDateTimeString(tmp);
1133 tmp := ini.ReadString('BoardInformation', 'SETTINGTXTTime', DateTimeToStr(ZERO_DATE));
1134 FSETTINGTXTTime := ConvertDateTimeString(tmp);
1135 tmp := ini.ReadString('BoardInformation', 'HEADTXTTime', DateTimeToStr(ZERO_DATE));
1136 FHEADTXTTime := ConvertDateTimeString(tmp);
1138 FIsSETTINGTXT := ini.ReadBool('BoardInformation', 'IsSETTINGTXT', false);
1139 FIsHEADTXT := ini.ReadBool('BoardInformation', 'IsHEADTXT', false);
1140 FTitlePictureURL := ini.ReadString('BoardInformation', 'TitlePictureURL', '');
1142 FUnRead := ini.ReadInteger('Status', 'UnRead', 0);
1143 FSPID := ini.ReadString('Cookie', 'SPID', '');
1144 FPON := ini.ReadString('Cookie', 'PON', '');
1145 FCookie := ini.ReadString('Cookie', 'Cookie', '');
1146 tmp := ini.ReadString('Cookie', 'Expires', DateTimeToStr(ZERO_DATE));
1147 FExpires := ConvertDateTimeString(tmp);
1148 FKotehanName := ini.ReadString('Kotehan', 'Name', '');
1149 FKotehanMail := ini.ReadString('Kotehan', 'Mail', '');
1158 procedure TBoard.SaveSettings;
1163 if Length( FilePath ) > 0 then
1164 FileName := ExtractFilePath( FilePath )
1166 FileName := GikoSys.Setting.LogFolderP
1167 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM;
1168 if not GikoSys.DirectoryExistsEx(FileName) then
1169 GikoSys.ForceDirectoriesEx(FileName);
1170 FileName := FileName + FOLDER_INI_FILENAME;
1171 ini := TMemIniFile.Create(FileName);
1175 // ini.WriteBool('Status', 'Round', Round);
1176 ini.WriteDateTime('Status', 'RoundDate', FRoundDate);
1177 ini.WriteDateTime('Status', 'LastModified', FLastModified);
1178 ini.WriteDateTime('Status', 'LastGetTime', FLastGetTime);
1179 ini.WriteInteger('Status', 'UnRead', FUnRead);
1180 ini.WriteString('Cookie', 'SPID', FSPID);
1181 ini.WriteString('Cookie', 'PON', FPON);
1182 ini.WriteString('Cookie', 'Cookie', FCookie);
1183 ini.WriteDateTime('Cookie', 'Expires', FExpires);
1184 ini.WriteString('Kotehan', 'Name', FKotehanName);
1185 ini.WriteString('Kotehan', 'Mail', FKotehanMail);
1187 ini.WriteDateTime('BoardInformation', 'SETTINGTXTTime', FSETTINGTXTTime);
1188 ini.WriteDateTime('BoardInformation', 'HEADTXTTime', FHEADTXTTime);
1190 ini.WriteBool('BoardInformation', 'IsSETTINGTXT', FIsSETTINGTXT);
1191 ini.WriteBool('BoardInformation', 'IsHEADTXT', FIsHEADTXT);
1192 ini.WriteString('BoardInformation', 'TitlePictureURL', FTitlePictureURL);
1193 // ini.WriteInteger('Status', 'ListStyle', Ord(ListStyle));
1194 // ini.WriteBool('Status', 'ItemNoVisible', ItemNoVisible);
1195 // ini.WriteInteger('Status', 'ViewType', Ord(ViewType));
1201 //
\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ð
1202 // 2003/02/08 0:32:13
\82É
\95Ï
\8a·
\82·
\82é
1203 function ConvertDateTimeString( inDateTimeString : string) : TDateTime;
1205 ZERO_DATE_STRING : string = '1970/01/01 0:00:00';
1215 if inDateTimeString = '' then
1216 inDateTimeString := ZERO_DATE_STRING;
1218 if ( AnsiPos('/', inDateTimeString ) = 0 ) and
1219 ( AnsiCompareStr( DateTimeToStr(ZERO_DATE), inDateTimeString) <> 0 ) then begin
1220 for i := 0 to 1 do begin
1221 Insert('/',inDateTimeString, AnsiPos(' ', inDateTimeString) + 1 );
1222 Delete(inDateTimeString, AnsiPos(' ', inDateTimeString), 1);
1226 Result := StrToDateTime( inDateTimeString );
1228 if( inDateTimeString[5] = '/' ) and ( inDateTimeString[8] = '/' ) then begin
1229 y := StrToIntDef( Copy(inDateTimeString, 1, 4), 1970 );
1230 m := StrToIntDef( Copy(inDateTimeString, 6, 2), 1 );
1231 d := StrToIntDef( Copy(inDateTimeString, 9, 2), 1 );
1232 hour := 0; min := 0; sec := 0;
1234 if Length(inDateTimeString) > 11 then begin
1235 if( inDateTimeString[13] = ':' ) and ( inDateTimeString[16] = ':' ) then begin
1236 hour := StrToIntDef( Copy(inDateTimeString, 12, 1), 0 );
1237 min := StrToIntDef( Copy(inDateTimeString, 14, 2), 0 );
1238 sec := StrToIntDef( Copy(inDateTimeString, 17, 2), 0 );
1239 end else if( inDateTimeString[14] = ':' ) and ( inDateTimeString[17] = ':' ) then begin
1240 hour := StrToIntDef( Copy(inDateTimeString, 12, 2), 0 );
1241 min := StrToIntDef( Copy(inDateTimeString, 15, 2), 0 );
1242 sec := StrToIntDef( Copy(inDateTimeString, 18, 2), 0 );
1246 Result := EncodeDateTime(y ,m, d, hour, min, sec, 0);
1248 Result := ZERO_DATE;
1251 Result := ZERO_DATE;
1255 // Result := inDateTimeString;
1257 //!
\83T
\83u
\83W
\83F
\83N
\83gURL
\8eæ
\93¾
1258 function TBoard.GetReadCgiURL: string;
1260 Result := URL + SUBJECT_FILENAME;
1264 //!
\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
1265 function TBoard.GetSubjectFileName: string;
1267 if Length( FilePath ) > 0 then
1270 Result := GikoSys.Setting.LogFolderP
1271 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME;
1274 //!
\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
1275 function TBoard.GetFolderIndexFileName: string;
1277 if Length( FilePath ) > 0 then
1278 Result := ExtractFilePath( FilePath ) + FOLDER_INDEX_FILENAME
1280 Result := GikoSys.Setting.LogFolderP
1281 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME;
1283 //! SETTING.TXT
\82Ì
\83t
\83@
\83C
\83\8b\96¼
\8eæ
\93¾
1284 function TBoard.GetSETTINGTXTFileName: string;
1286 if Length( FilePath ) > 0 then
1287 Result := ExtractFilePath( FilePath ) + SETTINGTXT_FILENAME
1289 Result := GikoSys.Setting.LogFolderP
1290 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SETTINGTXT_FILENAME;
1293 function TBoard.GETHEADTXTFileName: string;
1295 if Length( FilePath ) > 0 then
1296 Result := ExtractFilePath( FilePath ) + HEADTXT_FILENAME
1298 Result := GikoSys.Setting.LogFolderP
1299 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + HEADTXT_FILENAME;
1301 function TBoard.GetTitlePictureFileName: string;
1305 if FTitlePictureURL = '' then
1308 tmpName := Copy(FTitlePictureURL, LastDelimiter('/', FTitlePictureURL) + 1, Length(FTitlePictureURL));
1309 if Length( FilePath ) > 0 then
1310 Result := ExtractFilePath( FilePath ) + tmpName
1312 Result := GikoSys.Setting.LogFolderP
1313 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + tmpName;
1317 //
\83X
\83\8c\97§
\82Ä
\91\97\90MURL
1318 function TBoard.GetSendURL: string;
1320 Result := GikoSys.UrlToServer(URL);
1322 Result := Result + 'test/bbs.cgi'
1324 Result := Result + 'test/subbbs.cgi';
1328 procedure TBoard.SetRound(b: Boolean);
1333 RoundList.Delete(Self);
1334 if FRound = b then Exit;
1340 procedure TBoard.SetRoundName(s: string);
1342 if FRoundName = s then Exit;
1348 procedure TBoard.SetLastModified(d: TDateTime);
1350 if FLastModified = d then Exit;
1356 procedure TBoard.SetLastGetTime(d: TDateTime);
1358 if FLastGetTime = d then Exit;
1364 procedure TBoard.SetUnRead(i: Integer);
1366 if FUnRead = i then Exit;
1367 if i < 0 then i := 0;
1373 procedure TBoard.SetKotehanName(s: string);
1375 if FKotehanName = s then Exit;
1381 procedure TBoard.SetKotehanMail(s: string);
1383 if FKotehanMail = s then Exit;
1388 //! func
\82Ì
\8fð
\8c\8f\82É
\88ê
\92v
\82·
\82é
\83X
\83\8c\83b
\83h
\82Ì
\90\94\82ð
\95Ô
\82·
1389 function TBoard.GetThreadCount(func :TThreadCount ): Integer;
1394 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1396 for i := 0 to Count - 1 do begin
1397 if func(Items[i]) then
1401 for i := 0 to Count - 1 do begin
1402 if func(Items[i]) then
1404 if Items[i].ShortTitle = '' then
1405 Items[i].ShortTitle := CustomStringReplace(ZenToHan(Items[i].Title), ' ', '');
1406 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1412 //!
\90V
\92\85\83X
\83\8c\83b
\83h
\82Ì
\90\94\82ð
\8eæ
\93¾
\82·
\82é
1413 function TBoard.GetNewThreadCount: Integer;
1415 Result := GetThreadCount(CountNew);
1417 //!
\83\8d\83O
\97L
\82è
\83X
\83\8c\83b
\83h
\82Ì
\90\94\82ð
\8eæ
\93¾
\82·
\82é
1418 function TBoard.GetLogThreadCount: Integer;
1420 Result := GetThreadCount(CountLog);
1422 //!
\8di
\8d\9e\82Ý
\8fð
\8c\8f\82É
\88ê
\92v
\82·
\82é
\83X
\83\8c\83b
\83h
\82Ì
\90\94\82ð
\8eæ
\93¾
\82·
\82é
1423 function TBoard.GetUserThreadCount: Integer;
1425 Result := GetThreadCount(CountAll);
1427 //! DAT
\97\8e\82¿
\83X
\83\8c\83b
\83h
\82Ì
\90\94\82ð
\8eæ
\93¾
\82·
\82é
1428 function TBoard.GetArchiveThreadCount: Integer;
1430 Result := GetThreadCount(CountDat);
1432 //!
\90¶
\91¶
\83X
\83\8c\83b
\83h
\82Ì
\90\94\82ð
\8eæ
\93¾
\82·
\82é
1433 function TBoard.GetLiveThreadCount: Integer;
1435 Result := GetThreadCount(CountLive);
1437 //! func
\82Ì
\8fð
\8c\8f\82É
\93K
\8d\87\82·
\82éIndex
\94Ô
\96Ú
\82Ì
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82·
\82é
1438 function TBoard.GetThread(func :TThreadCount;const Index :Integer ): TThreadItem;
1445 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1447 for i := 0 to Count - 1 do begin
1448 if func(Items[i]) then begin
1449 if Index = Cnt then begin
1457 for i := 0 to Count - 1 do begin
1458 if func(Items[i]) then begin
1459 if Length(Items[i].ShortTitle) = 0 then
1460 Items[i].ShortTitle := CustomStringReplace(ZenToHan(Items[i].Title), ' ', '');
1461 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1462 if Index = Cnt then begin
1472 //! DAT
\97\8e\82¿
\83X
\83\8c\83b
\83h
\82ÅIndex
\94Ô
\96Ú
\82Ì
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82·
\82é
1473 function TBoard.GetArchiveThread(Index: Integer): TThreadItem;
1475 Result := GetThread(CountDat, Index);
1477 //!
\90¶
\91¶
\83X
\83\8c\83b
\83h
\82ÅIndex
\94Ô
\96Ú
\82Ì
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82·
\82é
1478 function TBoard.GetLiveThread(Index: Integer): TThreadItem;
1480 Result := GetThread(CountLive, Index);
1482 //!
\90V
\92\85\83X
\83\8c\83b
\83h
\82ÅIndex
\94Ô
\96Ú
\82Ì
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82·
\82é
1483 function TBoard.GetNewThread(Index: Integer): TThreadItem;
1485 Result := GetThread(CountNew, Index);
1487 //! Log
\82 \82è
\83X
\83\8c\83b
\83h
\82ÌIndex
\94Ô
\96Ú
\82Ì
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82·
\82é
1488 function TBoard.GetLogThread(Index: Integer): TThreadItem;
1490 Result := GetThread(CountLog, Index);
1492 //!
\8di
\8d\9e\82Ý
\82ÅIndex
\94Ô
\96Ú
\82Ì
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82·
\82é
1493 function TBoard.GetUserThread(Index: Integer): TThreadItem;
1495 Result := GetThread(CountAll, Index);
1498 procedure TBoard.BeginUpdate;
1503 procedure TBoard.EndUpdate;
1508 //constructor TThreadItem.Create(AOwner: TComponent);
1509 procedure TThreadItem.Init;
1514 FRoundDate := ZERO_DATE;
1515 FLastModified := ZERO_DATE;
1521 FIsLogFile := False;
1522 FParentBoard := nil;
1525 FNewArrival := False;
1532 // *************************************************************************
1533 //
\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^
1534 // *************************************************************************
1535 constructor TThreadItem.Create(
1536 const inPlugIn : TBoardPlugIn;
1537 const inBoard : TBoard;
1542 protocol, host, path, document, port, bookmark : string;
1543 BBSID, BBSKey : string;
1545 READ_PATH = '/test/read.cgi';
1550 FParentBoard := inBoard;
1551 //FBoardPlugIn := inPlugIn;
1554 if inPlugIn = nil then begin
1555 foundPos := Pos( READ_PATH, inURL );
1556 if foundPos > 0 then begin
1557 // dat
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
1558 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
1559 GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
1560 FileName := BBSKey + '.dat';
1561 IsLogFile := FileExists( FilePath );
1562 URL := GikoSys.Get2chBrowsableThreadURL( inURL );
1565 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1566 inPlugIn.CreateThreadItem( DWORD( Self ) );
1570 // *************************************************************************
1571 //
\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^ Log
\97L
\82è
\82©
\82Ç
\82¤
\82©
\94»
\92f
\8dÏ
\82Ý
1572 // FileName
\82à
\8eæ
\93¾
\8dÏ
\82Ý
\81@
\81¨
\81@ReadSubject
\97p
1573 // *************************************************************************
1574 constructor TThreadItem.Create(
1575 const inPlugIn : TBoardPlugIn;
1576 const inBoard : TBoard;
1577 const inURL : string;
1579 const inFilename: string
1585 FParentBoard := inBoard;
1588 if inPlugIn = nil then begin
1589 // dat
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
1590 FileName := inFilename;
1591 IsLogFile := inExist;
1594 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1595 inPlugIn.CreateThreadItem( DWORD( Self ) );
1599 // *************************************************************************
1600 //
\83f
\83X
\83g
\83\89\83N
\83^
1601 // *************************************************************************
1602 destructor TThreadItem.Destroy;
1605 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1606 if Self.ParentBoard.IsBoardPlugInAvailable then
1607 Self.ParentBoard.BoardPlugIn.DisposeThreadItem( DWORD( Self ) );
1613 function TThreadItem.GetDatURL: string;
1615 Protocol, Host, Path, Document, Port, Bookmark: string;
1617 Result := ParentBoard.URL
1620 if FDownloadHost <> '' then begin
1621 GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1622 Result := Format('%s://%s%s%s', [Protocol,
1627 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1628 // + 'test/read.cgi/' + ParentBoard.BBSID + '/'
1629 // + ChangeFileExt(FileName, '') + '/?raw='
1630 // + IntToStr(ResNum) + '.' + IntToStr(ResSize);
1633 function TThreadItem.GetDatgzURL: string;
1634 function isOldKako(s: string): Boolean;
1637 if AnsiPos('piza.', s) <> 0 then
1639 else if AnsiPos('www.bbspink.', s) <> 0 then
1641 else if AnsiPos('tako.', s) <> 0 then
1645 Protocol, Host, Path, Document, Port, Bookmark: string;
1648 if FDownloadHost = '' then begin
1649 DatNo := ChangeFileExt(FileName, '');
1650 if isOldKako(ParentBoard.URL) then begin
1651 Result := Format('%s%s/%.3s/%s.dat', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1653 if Length(DatNo) > 9 then begin
1654 //http://xxx.2ch.net/xxx/kako/9999/99999/999999999.dat.gz
1655 Result := Format('%s%s/%.4s/%.5s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo, DatNo]);
1657 //http://xxx.2ch.net/xxx/kako/999/999999999.dat.gz
1658 Result := Format('%s%s/%.3s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1662 Gikosys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1663 DatNo := ChangeFileExt(Document, '');
1664 if isOldKako(DownloadHost) then begin
1665 Result := Format('%s://%s/%s/kako/%.3s/%s.dat', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1667 if Length(DatNo) > 9 then begin
1668 Result := Format('%s://%s/%s/kako/%.4s/%.5s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo, DatNo]);
1670 Result := Format('%s://%s/%s/kako/%.3s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1676 function TThreadItem.GetOfflawCgiURL(const SessionID: string): string;
1678 if FDownloadHost = '' then begin
1679 Result := GikoSys.UrlToServer(ParentBoard.URL)
1680 + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1681 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1683 //http://news.2ch.net/test/offlaw.cgi/newsplus/1014038577/?raw=.196928&sid=
1684 //GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1685 Result := 'http://' + FDownloadHost
1686 + '/test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1687 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1691 function TThreadItem.GetSendURL: string;
1693 Result := GikoSys.UrlToServer(ParentBoard.URL)
1697 procedure TThreadItem.DeleteLogFile;
1699 tmpFileName: String;
1701 ParentBoard.BeginUpdate;
1704 ParentBoard.UnRead := ParentBoard.UnRead - 1;
1705 DeleteFile(GetThreadFileName);
1706 //
\8e\8e\8c±
\93I
\82Étmp
\82à
\8dí
\8f\9c\82µ
\82Ä
\82Ý
\82é
1707 tmpFileName := StringReplace(GetThreadFileName, 'dat', 'tmp', [rfReplaceAll]);
1708 DeleteFile(tmpFileName);
1710 if FileExists(ChangeFileExt(GetThreadFileName,'.NG')) = true then
1711 DeleteFile(ChangeFileExt(GetThreadFileName,'.NG'));
1712 FRoundDate := ZERO_DATE;
1713 FLastModified := ZERO_DATE;
1715 FIsLogFile := False;
1718 FNewArrival := False;
1722 FDownloadHost := '';
1723 FAgeSage := gasNone;
1729 ParentBoard.EndUpdate;
1730 ParentBoard.Modified := True;
1733 function TThreadItem.GetThreadFileName: string;
1735 if Length( FilePath ) > 0 then
1738 Result := GikoSys.Setting.LogFolderP
1739 + BBS2CH_LOG_FOLDER + PATH_DELIM + ParentBoard.BBSID + PATH_DELIM + FileName;
1742 procedure TThreadItem.SetLastModified(d: TDateTime);
1744 if FLastModified = d then Exit;
1746 if FUpdate and (ParentBoard <> nil) then
1747 ParentBoard.FModified := True;
1750 procedure TThreadItem.SetRound(b: Boolean);
1755 RoundList.Delete(Self);
1756 if FRound = b then Exit;
1758 if FUpdate and (ParentBoard <> nil) then
1759 ParentBoard.FModified := True;
1762 procedure TThreadItem.SetRoundName(const s: string);
1764 if FRoundName = s then Exit;
1766 if FUpdate and (ParentBoard <> nil) then
1767 ParentBoard.FModified := True;
1771 procedure TThreadItem.SetKokomade(i: Integer);
1773 if FKokomade = i then Exit;
1775 if FUpdate and (ParentBoard <> nil) then
1776 ParentBoard.FModified := True;
1779 procedure TThreadItem.SetUnRead(b: Boolean);
1781 if FUnRead = b then Exit;
1783 if FUpdate and (ParentBoard <> nil) then begin
1784 ParentBoard.FModified := True;
1785 if FUnRead then begin
1786 ParentBoard.UnRead := ParentBoard.UnRead + 1;
1788 ParentBoard.UnRead := ParentBoard.UnRead - 1;
1793 procedure TThreadItem.SetScrollTop(i: Integer);
1795 if FScrollTop = i then Exit;
1797 if FUpdate and (ParentBoard <> nil) then
1798 ParentBoard.FModified := True;
1801 procedure TThreadItem.BeginUpdate;
1806 procedure TThreadItem.EndUpdate;
1811 function TThreadItem.GetCreateDate: TDateTime;
1813 //
\83t
\83@
\83C
\83\8b\96¼
\82©
\82ç
\83X
\83\8c\8dì
\90¬
\93ú
\8e\9e\82ð
\8b\81\82ß
\82é
1815 if ( GikoSys.Setting.CreationTimeLogs ) and not IsLogFile then
1818 //
\83\8d\83O
\83t
\83@
\83C
\83\8b\82Ì
\8ag
\92£
\8eq
\82ð
\82Í
\82¸
\82µ
\82½
\82à
\82Ì
\82ª
\83X
\83\8c\8dì
\90¬
\93ú
\8e\9e
1819 Result := GikoSys.GetCreateDateFromName(FFileName);
1820 if GikoSys.Setting.FutureThread then begin
1821 if CompareDateTime(Result, Now) = 1 then
1822 Result := ZERO_DATE;
1828 Result := ZERO_DATE;
1831 function TThreadItem.GetFilePath: String;
1835 path := ExtractFilePath(Self.ParentBoard.FilePath) + Self.FileName;
1839 destructor TBoardGroup.Destroy;
1844 procedure TBoardGroup.Clear;
1848 for i := Self.Count - 1 downto 0 do begin
1850 TBoard(Self.Objects[i]).Free;
1857 if FBoardPlugIn <> nil then
1859 FBoardPlugIn := nil;
1865 function TSpecialBoard.Add(item: TThreadItem): integer;
1867 Result := inherited AddObject(Item.URL, Item);
1870 procedure TSpecialBoard.Clear;
1874 for i := Count - 1 downto 0 do