6 Windows, SysUtils, Classes, ComCtrls, IniFiles, {HTTPApp,} YofUtils, IdGlobal,
7 ExternalBoardManager, ExternalBoardPlugInMain, StrUtils, DateUtils;
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, gasNull);
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 // BBS
\82Ì
\83\8b\81[
\83g
77 FFilePath : string; //
\94Â
\83\8a\83X
\83g
\82Ì
\83p
\83X
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;
82 FIsBoardFileRead : Boolean; //
\94Â
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
84 function GetCategory(index: integer): TCategory;
85 procedure SetCategory(index: integer; value: TCategory);
86 procedure SetSelectText(s: string);
88 constructor Create( boardFilePath : string );
89 destructor Destroy; override;
91 function Add(item: TCategory): integer;
92 procedure Delete(index: integer);
93 procedure Clear; override;
94 function Find(key: string): TCategory;
95 function FindBBSID(const BBSID: string): TBoard;
96 function FindBoardFromTitle(const Title: string): TBoard;
97 function FindBoardFromURL(const inURL: string): TBoard;
98 function FindThreadFromURL(const inURL : string ) : TThreadItem;
99 function FindThreadItem(const BBSID, FileName: string): TThreadItem;
100 function FindCategoryFromTitle(const inTitle : string ) : TCategory;
101 property FilePath : string read FFilePath write FFilePath;
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;
111 property IsBoardFileRead : Boolean read FIsBoardFileRead write FIsBoardFileRead;
114 //
\83J
\83e
\83S
\83\8a(
\94Â URL
\82Ì
\83\8a\83X
\83g)
115 TCategory = class(THashedStringList)
122 function GetBoard(index: integer): TBoard;
123 procedure SetBoard(index: integer; value: TBoard);
126 destructor Destroy; override;
128 property No: Integer read FNo write FNo;
129 property Title: string read FTitle write FTitle;
130 property Items[index: integer]: TBoard read GetBoard write SetBoard;
131 property ParenTBBS: TBBS read FParenTBBS write FParenTBBS;
133 function Add(item: TBoard): integer;
134 procedure Delete(index: integer);
135 procedure Clear; override;
136 function FindName(const key: string): TBoard;
137 function FindBBSID(const BBSID: string): TBoard;
138 function FindBoardFromTitle(const Title: string): TBoard;
139 function FindBoardFromURL(const inURL: string): TBoard;
140 function FindThreadFromURL(const inURL : string ) : TThreadItem;
141 function IsMidoku: Boolean;
143 property NodeExpand: Boolean read FExpand write FExpand;
146 //
\94Â(
\83X
\83\8c\83b
\83h URL
\82Ì
\83\8a\83X
\83g)
147 TBoard = class(THashedStringList)
149 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é)
151 FNo: Integer; //
\94Ô
\8d\86
152 FTitle: string; //
\83{
\81[
\83h
\83^
\83C
\83g
\83\8b
153 FBBSID: string; //BBSID
154 FURL: string; //
\83{
\81[
\83hURL
155 FRound: Boolean; //
\83X
\83\8c\83b
\83h
\88ê
\97\97\8f\84\89ñ
\97\
\96ñ
156 FRoundName: string; //
\8f\84\89ñ
\96¼
157 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
158 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
159 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
160 FIsThreadDatRead: Boolean; //
\83X
\83\8c\83b
\83h
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
161 FUnRead: Integer; //
\83X
\83\8c\83b
\83h
\96¢
\93Ç
\90\94
162 FParentCategory: TCategory; //
\90e
\83J
\83e
\83S
\83\8a
163 FModified: Boolean; //
\8fC
\90³
\83t
\83\89\83O
164 FBoolData: Boolean; //
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
165 FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
166 FPON: string; //
\8f\91\82«
\8d\9e\82Ý
\97pPON
167 FKotehanName: string; //
\83R
\83e
\83n
\83\93\96¼
\91O
168 FKotehanMail: string; //
\83R
\83e
\83n
\83\93\83\81\81[
\83\8b
173 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\94Â
\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
174 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\88ê
\97\97\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
175 FIsLogFile : Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
176 FIntData : Integer; //
\8dD
\82«
\82É
\82¢
\82¶
\82Á
\82Ä
\82æ
\82µ
\81B
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
177 FListData : TList; //
\8dD
\82«
\82É
\82¢
\82¶
\82Á
\82Ä
\82æ
\82µ
\81B
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
179 FSETTINGTXTTime: TDateTime; //SETTING.TXT
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e
180 FIsSETTINGTXT: boolean; //SETTING.TXT
\82ð
\8eæ
\93¾
\82µ
\82Ä
\82¢
\82é
\82©
181 FHEADTXTTime: TDateTime; //HEAD.TXT
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e
182 FIsHEADTXT: boolean; //HEAD.TXT
\82ð
\8eæ
\93¾
\82µ
\82Ä
\82¢
\82é
\82©
183 FTitlePictureURL: string; //top
\8aG
\82ÌURL
185 function GetThreadItem(index: integer): TThreadItem;
186 procedure SetThreadItem(index: integer; value: TThreadItem);
187 procedure SetRound(b: Boolean);
188 procedure SetRoundName(s: string);
189 procedure SetLastModified(d: TDateTime);
190 procedure SetLastGetTime(d: TDateTime);
191 procedure SetUnRead(i: Integer);
192 procedure SetKotehanName(s: string);
193 procedure SetKotehanMail(s: string);
196 constructor Create( inPlugIn : TBoardPlugIn; inURL : string );
197 destructor Destroy; override;
199 property Context: DWORD read FContext write FContext;
201 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
202 property No: Integer read FNo write FNo;
203 property Title: string read FTitle write FTitle;
204 property BBSID: string read FBBSID write FBBSID;
205 property URL: string read FURL write FURL;
206 property Round: Boolean read FRound write SetRound;
207 property RoundName: string read FRoundName write SetRoundName;
208 property RoundDate: TDateTime read FRoundDate write FRoundDate;
209 property LastModified: TDateTime read FLastModified write SetLastModified;
210 property LastGetTime: TDateTime read FLastGetTime write SetLastGetTime;
211 property UnRead: Integer read FUnRead write SetUnRead;
212 property Modified: Boolean read FModified write FModified;
213 property IsThreadDatRead: Boolean read FIsThreadDatRead write FIsThreadDatRead;
214 property ParentCategory: TCategory read FParentCategory write FParentCategory;
216 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
217 property FilePath : string read FFilePath write FFilePath;
218 property IsLogFile : Boolean read FIsLogFile write FIsLogFile;
219 property IntData : Integer read FIntData write FIntData;
220 property ListData : TList read FListData write FListData;
221 function IsBoardPlugInAvailable : Boolean;
223 function Add(item: TThreadItem): integer;
224 procedure Insert(Index: Integer; Item: TThreadItem);
225 procedure Delete(index: integer);
226 procedure DeleteList(index: integer);
227 procedure Clear; override;
228 function FindThreadFromFileName(const ItemFileName: string): TThreadItem;
229 function FindThreadFromURL(const inURL : string ) : TThreadItem;
230 function GetIndexFromFileName(const ItemFileName: string): Integer;
231 function GetIndexFromURL(const URL: string): Integer;
232 procedure LoadSettings;
233 procedure SaveSettings;
234 function GetReadCgiURL: string;
235 function GetSubjectFileName: string;
236 function GetFolderIndexFileName: string;
237 function GetSETTINGTXTFileName: string;
238 function GETHEADTXTFileName: string;
239 function GetTitlePictureFileName: string;
240 function GetSendURL: string;
242 function GetNewThreadCount: Integer;
243 function GetLogThreadCount: Integer;
244 function GetUserThreadCount: Integer;
245 function GetNewThread(Index: Integer): TThreadItem;
246 function GetLogThread(Index: Integer): TThreadItem;
247 function GetUserThread(Index: Integer): TThreadItem;
249 procedure BeginUpdate;
251 property NodeExpand: Boolean read FExpand write FExpand;
252 property BoolData: Boolean read FBoolData write FBoolData;
253 property SPID: string read FSPID write FSPID;
254 property PON: string read FPON write FPON;
255 property KotehanName: string read FKotehanName write SetKotehanName;
256 property KotehanMail: string read FKotehanMail write SetKotehanMail;
258 property SETTINGTXTTime: TDateTime read FSETTINGTXTTime write FSETTINGTXTTime;
259 property IsSETTINGTXT: boolean read FIsSETTINGTXT write FIsSETTINGTXT;
260 property HEADTXTTime: TDateTime read FHEADTXTTime write FHEADTXTTime;
261 property IsHEADTXT: boolean read FIsHEADTXT write FIsHEADTXT;
262 property TitlePictureURL: string read FTitlePictureURL write FTitlePictureURL;
267 TThreadItem = class(TObject)
269 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é)
271 FNo: Integer; //
\94Ô
\8d\86
272 FFileName: string; //
\83X
\83\8c\83b
\83h
\83t
\83@
\83C
\83\8b\96¼
273 FTitle: string; //
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b
274 FShortTitle: string; //
\92Z
\82¢
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b\81i
\8c\9f\8dõ
\97p
\81j
275 FRoundDate: TDateTime; //
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e\81i
\8f\84\89ñ
\93ú
\8e\9e\81j
276 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
277 FCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83\8d\81[
\83J
\83\8b\81j
278 FAllResCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83T
\81[
\83o
\81j
279 FNewResCount: Integer; //
\83X
\83\8c\83b
\83h
\90V
\92\85\90\94
280 FSize: Integer; //
\83X
\83\8c\83b
\83h
\83T
\83C
\83Y
281 FRound: Boolean; //
\8f\84\89ñ
\83t
\83\89\83O
282 FRoundName: string; //
\8f\84\89ñ
\96¼
283 FIsLogFile: Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
284 FParentBoard: TBoard; //
\90e
\83{
\81[
\83h
285 FKokomade: Integer; //
\83R
\83R
\82Ü
\82Å
\93Ç
\82ñ
\82¾
\94Ô
\8d\86
286 FNewReceive: Integer; //
\83R
\83R
\82©
\82ç
\90V
\8bK
\8eó
\90M
287 FNewArrival: Boolean; //
\90V
\92\85
288 FUnRead: Boolean; //
\96¢
\93Ç
\83t
\83\89\83O
289 FScrollTop: Integer; //
\83X
\83N
\83\8d\81[
\83\8b\88Ê
\92u
290 FDownloadHost: string; //
\8d¡
\82Ì
\83z
\83X
\83g
\82Æ
\88á
\82¤
\8fê
\8d\87\82Ì
\83z
\83X
\83g
291 FAgeSage: TGikoAgeSage; //
\83A
\83C
\83e
\83\80\82Ì
\8fã
\82°
\89º
\82°
292 // FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
296 FURL : string; //
\82±
\82Ì
\83X
\83\8c\82ð
\83u
\83\89\83E
\83U
\82Å
\95\
\8e¦
\82·
\82é
\8dÛ
\82Ì URL
297 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\83X
\83\8c\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
298 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
300 procedure SetLastModified(d: TDateTime);
301 procedure SetRound(b: Boolean);
302 procedure SetRoundName(const s: string);
303 procedure SetKokomade(i: Integer);
304 procedure SetUnRead(b: Boolean);
305 procedure SetScrollTop(i: Integer);
307 function GetCreateDate: TDateTime;
309 constructor Create( inPlugIn : TBoardPlugIn; inURL : string );
310 destructor Destroy; override;
312 function GetDatURL: string;
313 function GetDatgzURL: string;
314 // function GetOldDatgzURL: string;
315 function GetOfflawCgiURL(const SessionID: string): string;
316 function GetSendURL: string;
317 procedure DeleteLogFile;
318 function GetThreadFileName: string;
319 procedure BeginUpdate;
322 property Context: DWORD read FContext write FContext;
324 property No: Integer read FNo write FNo;
325 property FileName: string read FFileName write FFileName;
326 property Title: string read FTitle write FTitle;
327 property ShortTitle: string read FShortTitle write FShortTitle;
328 property RoundDate: TDateTime read FRoundDate write FRoundDate;
329 property LastModified: TDateTime read FLastModified write SetLastModified;
330 property Count: Integer read FCount write FCount;
331 property AllResCount: Integer read FAllResCount write FAllResCount;
332 property NewResCount: Integer read FNewResCount write FNewResCount;
333 property Size: Integer read FSize write FSize;
334 property Round: Boolean read FRound write SetRound;
335 property RoundName: string read FRoundName write SetRoundName;
337 property IsLogFile: Boolean read FIsLogFile write FIsLogFile;
338 property ParentBoard: TBoard read FParentBoard write FParentBoard;
339 property Kokomade: Integer read FKokomade write SetKokomade;
340 property NewReceive: Integer read FNewReceive write FNewReceive;
341 property NewArrival: Boolean read FNewArrival write FNewArrival;
342 property UnRead: Boolean read FUnRead write SetUnRead;
343 property ScrollTop: Integer read FScrollTop write SetScrollTop;
344 property Expand: Boolean read FExpand write FExpand;
345 property DownloadHost: string read FDownloadHost write FDownloadHost;
346 property AgeSage: TGikoAgeSage read FAgeSage write FAgeSage;
347 // property SPID: string read FSPID write FSPID;
348 property CreateDate: TDateTime read GetCreateDate;
349 property URL : string read FURL write FURL;
350 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
351 property FilePath : string read FFilePath write FFilePath;
352 function IsBoardPlugInAvailable : Boolean;
357 //
\8c\9f\8dõ
\8c\8b\89Ê
\83\8a\83X
\83g
358 { TSearchList = class(TList)
360 function GetThreadItem(index: integer): TThreadItem;
361 procedure SetThreadItem(index: integer; value: TThreadItem);
364 destructor Destroy; override;
366 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
368 function Add(item: TThreadItem): integer;
369 procedure Delete(index: integer);
370 procedure Clear; override;
373 function BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard;
374 function BBSsFindBoardFromURL( inURL : string ) : TBoard;
375 function BBSsFindBoardFromTitle( inTitle : string ) : TBoard;
376 function BBSsFindThreadFromURL(const inURL : string ) : TThreadItem;
377 function ConvertDateTimeString( inDateTimeString : string) : TDateTime;
380 BBSs : array of TBBS;
385 GikoSystem, RoundData, MojuUtils;
388 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
389 BBS2CH_LOG_FOLDER: string = '2ch';
390 EXTERNAL_LOG_FOLDER: string = 'exboard';
392 FOLDER_INI_FILENAME: string = 'Folder.ini';
393 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
394 SUBJECT_FILENAME: string = 'subject.txt';
395 PATH_DELIM: string = '\';
396 SETTINGTXT_FILENAME: string = 'SETTING.TXT';
397 HEADTXT_FILENAME: string = 'head.txt';
398 //DEFAULT_LIST_COUNT: Integer = 100;
400 // COLUMN_CATEGORY: array[0..0] of string = ('
\83J
\83e
\83S
\83\8a\96¼');
401 // 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');
402 // 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');
404 // BBSID
\82ð
\97p
\82¢
\82é 2
\82¿
\82á
\82ñ
\82Ë
\82é
\82Ì
\82Ý
\92T
\82µ
\8fo
\82µ
\82Ü
\82·
405 // BBSID
\82Ì
\8eg
\97p
\82Í
\8bÉ
\97Í
\94ð
\82¯
\82Ä
\82
\82¾
\82³
\82¢
\81B
406 //
\89Â
\94\
\82È
\8fê
\8d\87\82Í URL
\82ð
\8eg
\97p
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B
407 function BBSsFindBoardFromBBSID(
412 Result := BBSs[ 0 ].FindBBSID( inBBSID );
416 function BBSsFindBoardFromURL(
423 for i := Length( BBSs ) - 1 downto 0 do begin
424 Result := BBSs[ i ].FindBoardFromURL( inURL );
425 if Result <> nil then
433 function BBSsFindBoardFromTitle(
440 for i := Length( BBSs ) - 1 downto 0 do begin
441 Result := BBSs[ i ].FindBoardFromTitle( inTitle );
442 if Result <> nil then
450 function BBSsFindThreadFromURL(
458 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
459 board := BBSsFindBoardFromURL( boardURL );
463 Result := board.FindThreadFromURL( inURL );
467 (*************************************************************************
468 *
\8b@
\94\
\96¼
\81FTBBS
\83R
\83\93\83X
\83g
\83\89\83N
\83^
470 *************************************************************************)
471 constructor TBBS.Create( boardFilePath : string );
474 Title := BBS2CH_NAME;
475 FFilePath := boardFilePath;
478 (*************************************************************************
479 *
\8b@
\94\
\96¼
\81FTBBS
\83f
\83X
\83g
\83\89\83N
\83^
481 *************************************************************************)
482 destructor TBBS.Destroy;
488 (*************************************************************************
491 *************************************************************************)
492 function TBBS.GetCategory(index: integer): TCategory;
494 Result := TCategory(inherited Items[index]);
497 procedure TBBS.SetCategory(index: integer; value: TCategory);
499 inherited Items[index] := value;
502 function TBBS.Add(item: TCategory): integer;
504 Item.ParenTBBS := self;
505 Result := inherited Add(item);
508 procedure TBBS.Delete(index: integer);
510 if Items[index] <> nil then
511 TCategory(Items[index]).Free;
513 inherited Delete(index);
516 procedure TBBS.Clear;
520 for i := Count - 1 downto 0 do
525 function TBBS.Find(key: string): TCategory;
530 function TBBS.FindBBSID(const BBSID: string): TBoard;
534 if not IsBoardFileRead then
535 GikoSys.ReadBoardFile( Self );
536 for i := Count - 1 downto 0 do begin
537 Result := Items[ i ].FindBBSID(BBSID);
538 if Result <> nil then
544 //*************************************************************************
545 //
\83^
\83C
\83g
\83\8b\82Ì
\88ê
\92v
\82·
\82é
\94Â
\82ð
\92T
\82·
546 //*************************************************************************)
547 function TBBS.FindBoardFromTitle(const Title: string): TBoard;
551 if not IsBoardFileRead then
552 GikoSys.ReadBoardFile( Self );
553 for i := Count - 1 downto 0 do begin
554 Result := Items[ i ].FindBoardFromTitle(Title);
555 if Result <> nil then
561 //*************************************************************************
562 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\94Â
\82ð
\92T
\82·
563 //*************************************************************************)
564 function TBBS.FindBoardFromURL(const inURL: string): TBoard;
568 if not IsBoardFileRead then
569 GikoSys.ReadBoardFile( Self );
570 for i := Count - 1 downto 0 do begin
571 Result := Items[ i ].FindBoardFromURL( inURL );
572 if Result <> nil then
578 //*************************************************************************
579 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\83X
\83\8c\83b
\83h
\82ð
\92T
\82·
580 //*************************************************************************)
581 function TBBS.FindThreadFromURL(const inURL: string): TThreadItem;
587 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
588 board := FindBoardFromURL( boardURL );
592 Result := board.FindThreadFromURL( inURL );
596 function TBBS.FindThreadItem(const BBSID, FileName: string): TThreadItem;
601 Board := FindBBSID(BBSID);
604 Result := Board.FindThreadFromFileName(FileName);
607 function TBBS.FindCategoryFromTitle(const inTitle : string ) : TCategory;
612 for i := Count - 1 downto 0 do begin
613 if AnsiCompareStr(Items[ i ].Title, inTitle) = 0 then begin
614 Result := Items[ i ];
623 procedure TBBS.SetSelectText(s: string);
626 ShortSelectText := ZenToHan(s);
629 {class function TBBS.GetColumnName(Index: Integer): string;
631 Result := COLUMN_CATEGORY[Index];
634 class function TBBS.GetColumnCount: Integer;
636 Result := Length(COLUMN_CATEGORY);
639 //===================
641 //===================
642 constructor TCategory.Create;
647 destructor TCategory.Destroy;
653 function TCategory.GetBoard(index: integer): TBoard;
655 Result := TBoard( Objects[index] );
658 procedure TCategory.SetBoard(index: integer; value: TBoard);
660 Objects[index] := value;
661 Strings[index] := value.URL
664 function TCategory.Add(item: TBoard): integer;
666 Item.ParentCategory := self;
667 Result := AddObject( item.URL, item );
670 procedure TCategory.Delete(index: integer);
672 if Items[index] <> nil then
673 TBoard(Items[index]).Free;
674 inherited Delete(index);
677 procedure TCategory.Clear;
681 for i := Count - 1 downto 0 do
686 function TCategory.FindName(const key: string): TBoard;
691 function TCategory.FindBBSID(const BBSID: string): TBoard;
695 for i := Count - 1 downto 0 do begin
696 if AnsiCompareStr(Items[i].FBBSID, BBSID) = 0 then begin
704 //*************************************************************************
705 //
\83^
\83C
\83g
\83\8b\82Ì
\88ê
\92v
\82·
\82é
\94Â
\82ð
\92T
\82·
706 //*************************************************************************)
707 function TCategory.FindBoardFromTitle(const Title: string): TBoard;
711 for i := Count - 1 downto 0 do begin
712 if AnsiCompareStr(Items[i].FTitle, Title) = 0 then begin
720 //*************************************************************************
721 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\94Â
\82ð
\92T
\82·
722 //*************************************************************************)
723 function TCategory.FindBoardFromURL(const inURL: string): TBoard;
727 i := IndexOf( inURL );
729 Result := TBoard( Objects[ i ] )
734 //*************************************************************************
735 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\83X
\83\8c\83b
\83h
\82ð
\92T
\82·
736 //*************************************************************************)
737 function TCategory.FindThreadFromURL(const inURL: string): TThreadItem;
743 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
744 board := FindBoardFromURL( boardURL );
748 Result := board.FindThreadFromURL( inURL );
752 function TCategory.IsMidoku: Boolean;
758 for i := 0 to Count - 1 do begin
759 if Items[i] <> nil then begin
760 for j := 0 to Items[i].Count - 1 do begin
761 if Items[i].Items[j] <> nil then begin
762 // if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].Count > Items[i].Items[j].Kokomade) then begin
763 if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].UnRead) then begin
773 {class function TCategory.GetColumnName(Index: Integer): string;
775 Result := COLUMN_BOARD[Index];
778 class function TCategory.GetColumnCount: Integer;
780 Result := Length(COLUMN_BOARD);
783 //===================
785 //===================
786 procedure TBoard.Init;
793 FRoundDate := ZERO_DATE;
794 FLastModified := ZERO_DATE;
795 FLastGetTime := ZERO_DATE;
796 FIsThreadDatRead := False;
798 // FListStyle := vsReport;
799 // FItemNoVisible := True;
804 // *************************************************************************
805 //
\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^
806 // *************************************************************************
807 constructor TBoard.Create(
808 inPlugIn : TBoardPlugIn;
812 protocol, host, path, document, port, bookmark : string;
818 FBoardPlugIn := inPlugIn;
820 BBSID := GikoSys.UrlToID( inURL );
822 if inPlugIn = nil then begin
823 // subject.txt
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
824 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
825 if GikoSys.Is2chHost( host ) then
827 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
828 BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
831 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
832 EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
834 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
835 inPlugIn.CreateBoardItem( DWORD( Self ) );
840 // *************************************************************************
841 //
\83f
\83X
\83g
\83\89\83N
\83^
842 // *************************************************************************
843 destructor TBoard.Destroy;
845 if FModified then begin
846 GikoSys.WriteThreadDat(Self);
850 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
851 if IsBoardPlugInAvailable then
852 BoardPlugIn.DisposeBoardItem( DWORD( Self ) );
858 // *************************************************************************
859 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
860 // *************************************************************************
861 function TBoard.IsBoardPlugInAvailable : Boolean;
865 if BoardPlugIn = nil then
868 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
879 function TBoard.GetThreadItem(index: integer): TThreadItem;
881 Result := TThreadItem( Objects[index] );
884 procedure TBoard.SetThreadItem(index: integer; value: TThreadItem);
886 Objects[index] := value;
887 Strings[index] := value.URL;
890 function TBoard.Add(Item: TThreadItem): Integer;
892 Item.ParentBoard := Self;
893 Result := inherited AddObject(Item.URL, Item);
896 procedure TBoard.Insert(Index: Integer; Item: TThreadItem);
898 Item.ParentBoard := Self;
899 inherited InsertObject(Index, Item.URL, Item);
903 //Index
\82Å
\8ew
\92è
\82³
\82ê
\82½
\83X
\83\8c\83b
\83h
\83I
\83u
\83W
\83F
\83N
\83g
\82ð
\94j
\8aü
904 procedure TBoard.Delete(index: Integer);
906 if Items[index] <> nil then
907 TThreadItem(Items[index]).Free;
908 inherited Delete(index);
911 //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
912 procedure TBoard.DeleteList(index: integer);
914 inherited Delete(index);
917 procedure TBoard.Clear;
922 for i := Count - 1 downto 0 do
927 function TBoard.FindThreadFromFileName(const ItemFileName: string): TThreadItem;
932 for i := 0 to Count - 1 do begin
933 if AnsiCompareStr(Items[i].FileName, ItemFileName) = 0 then begin
940 function TBoard.GetIndexFromFileName(const ItemFileName: string): Integer;
945 for i := 0 to Count - 1 do begin
946 if Items[i].FileName = ItemFileName then begin
953 function TBoard.GetIndexFromURL(const URL: string): Integer;
955 Result := IndexOf( URL );
958 function TBoard.FindThreadFromURL(const inURL : string ) : TThreadItem;
963 if not IsThreadDatRead then
964 GikoSys.ReadSubjectFile( Self );
966 i := IndexOf( inURL );
968 Result := TThreadItem( Objects[ i ] )
974 {function TBoard.GetMidokuCount: Integer;
979 for i := 0 to Count- 1 do begin
980 if Items[i] <> nil then begin
981 if (Items[i].IsLogFile) and (Items[i].Count > Items[i].Kokomade) then
988 procedure TBoard.LoadSettings;
994 if Length( FilePath ) > 0 then
995 FileName := ExtractFilePath( FilePath ) + FOLDER_INI_FILENAME
997 FileName := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
998 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + FOLDER_INI_FILENAME;
1000 if not FileExists(FileName) then
1002 ini := TMemIniFile.Create(FileName);
1004 // Round := ini.ReadBool('Status', 'Round', False);
1005 tmp := ini.ReadString('Status', 'RoundDate', DateTimeToStr(ZERO_DATE));
1006 FRoundDate := ConvertDateTimeString(tmp);
1007 tmp := ini.ReadString('Status', 'LastModified', DateTimeToStr(ZERO_DATE));
1008 FLastModified := ConvertDateTimeString(tmp);
1009 tmp := ini.ReadString('Status', 'LastGetTime', DateTimeToStr(ZERO_DATE));
1010 FLastGetTime := ConvertDateTimeString(tmp);
1012 tmp := ini.ReadString('BoardInformation', 'SETTINGTXTTime', DateTimeToStr(ZERO_DATE));
1013 FSETTINGTXTTime := ConvertDateTimeString(tmp);
1014 tmp := ini.ReadString('BoardInformation', 'HEADTXTTime', DateTimeToStr(ZERO_DATE));
1015 FHEADTXTTime := ConvertDateTimeString(tmp);
1017 FIsSETTINGTXT := ini.ReadBool('BoardInformation', 'IsSETTINGTXT', false);
1018 FIsHEADTXT := ini.ReadBool('BoardInformation', 'IsHEADTXT', false);
1019 FTitlePictureURL := ini.ReadString('BoardInformation', 'TitlePictureURL', '');
1021 FUnRead := ini.ReadInteger('Status', 'UnRead', 0);
1022 FSPID := ini.ReadString('Cookie', 'SPID', '');
1023 FPON := ini.ReadString('Cookie', 'PON', '');
1024 FKotehanName := ini.ReadString('Kotehan', 'Name', '');
1025 FKotehanMail := ini.ReadString('Kotehan', 'Mail', '');
1034 procedure TBoard.SaveSettings;
1039 if Length( FilePath ) > 0 then
1040 FileName := ExtractFilePath( FilePath )
1042 FileName := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1043 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM;
1044 if not GikoSys.DirectoryExistsEx(FileName) then
1045 GikoSys.ForceDirectoriesEx(FileName);
1046 FileName := FileName + FOLDER_INI_FILENAME;
1047 ini := TMemIniFile.Create(FileName);
1051 // ini.WriteBool('Status', 'Round', Round);
1052 ini.WriteDateTime('Status', 'RoundDate', FRoundDate);
1053 ini.WriteDateTime('Status', 'LastModified', FLastModified);
1054 ini.WriteDateTime('Status', 'LastGetTime', FLastGetTime);
1055 ini.WriteInteger('Status', 'UnRead', FUnRead);
1056 ini.WriteString('Cookie', 'SPID', FSPID);
1057 ini.WriteString('Cookie', 'PON', FPON);
1058 ini.WriteString('Kotehan', 'Name', FKotehanName);
1059 ini.WriteString('Kotehan', 'Mail', FKotehanMail);
1061 ini.WriteDateTime('BoardInformation', 'SETTINGTXTTime', FSETTINGTXTTime);
1062 ini.WriteDateTime('BoardInformation', 'HEADTXTTime', FHEADTXTTime);
1064 ini.WriteBool('BoardInformation', 'IsSETTINGTXT', FIsSETTINGTXT);
1065 ini.WriteBool('BoardInformation', 'IsHEADTXT', FIsHEADTXT);
1066 ini.WriteString('BoardInformation', 'TitlePictureURL', FTitlePictureURL);
1067 // ini.WriteInteger('Status', 'ListStyle', Ord(ListStyle));
1068 // ini.WriteBool('Status', 'ItemNoVisible', ItemNoVisible);
1069 // ini.WriteInteger('Status', 'ViewType', Ord(ViewType));
1075 //
\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ð
1076 // 2003/02/08 0:32:13
\82É
\95Ï
\8a·
\82·
\82é
1077 function ConvertDateTimeString( inDateTimeString : string) : TDateTime;
1079 ZERO_DATE_STRING : string = '1970/01/01 0:00:00';
1089 if inDateTimeString = '' then
1090 inDateTimeString := ZERO_DATE_STRING;
1092 if ( AnsiPos('/', inDateTimeString ) = 0 ) and
1093 ( AnsiCompareStr( DateTimeToStr(ZERO_DATE), inDateTimeString) <> 0 ) then begin
1094 for i := 0 to 1 do begin
1095 Insert('/',inDateTimeString, AnsiPos(' ', inDateTimeString) + 1 );
1096 Delete(inDateTimeString, AnsiPos(' ', inDateTimeString), 1);
1100 Result := StrToDateTime( inDateTimeString );
1102 if( inDateTimeString[5] = '/' ) and ( inDateTimeString[8] = '/' ) then begin
1103 y := StrToIntDef( Copy(inDateTimeString, 1, 4), 1970 );
1104 m := StrToIntDef( Copy(inDateTimeString, 6, 2), 1 );
1105 d := StrToIntDef( Copy(inDateTimeString, 9, 2), 1 );
1106 hour := 0; min := 0; sec := 0;
1108 if Length(inDateTimeString) > 11 then begin
1109 if( inDateTimeString[13] = ':' ) and ( inDateTimeString[16] = ':' ) then begin
1110 hour := StrToIntDef( Copy(inDateTimeString, 12, 1), 0 );
1111 min := StrToIntDef( Copy(inDateTimeString, 14, 2), 0 );
1112 sec := StrToIntDef( Copy(inDateTimeString, 17, 2), 0 );
1113 end else if( inDateTimeString[14] = ':' ) and ( inDateTimeString[17] = ':' ) then begin
1114 hour := StrToIntDef( Copy(inDateTimeString, 12, 2), 0 );
1115 min := StrToIntDef( Copy(inDateTimeString, 15, 2), 0 );
1116 sec := StrToIntDef( Copy(inDateTimeString, 18, 2), 0 );
1120 Result := EncodeDateTime(y ,m, d, hour, min, sec, 0);
1122 Result := ZERO_DATE;
1125 Result := ZERO_DATE;
1129 // Result := inDateTimeString;
1131 //
\83T
\83u
\83W
\83F
\83N
\83gURL
\8eæ
\93¾
1132 function TBoard.GetReadCgiURL: string;
1134 //Result := URL + SUBJECT_FILENAME;
1135 //Result := GikoSys.UrlToServer(URL)
1136 // + 'test/read.cgi/' + BBSID + '/?raw=0.0';
1137 Result := URL + SUBJECT_FILENAME;
1141 //
\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
1142 function TBoard.GetSubjectFileName: string;
1144 if Length( FilePath ) > 0 then
1147 Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1148 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME;
1151 //
\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
1152 function TBoard.GetFolderIndexFileName: string;
1154 if Length( FilePath ) > 0 then
1155 Result := ExtractFilePath( FilePath ) + FOLDER_INDEX_FILENAME
1157 Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1158 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME;
1160 //SETTING.TXT
\82Ì
\83t
\83@
\83C
\83\8b\96¼
\8eæ
\93¾
1161 function TBoard.GetSETTINGTXTFileName: string;
1163 if Length( FilePath ) > 0 then
1164 Result := ExtractFilePath( FilePath ) + SETTINGTXT_FILENAME
1166 Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1167 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SETTINGTXT_FILENAME;
1170 function TBoard.GETHEADTXTFileName: string;
1172 if Length( FilePath ) > 0 then
1173 Result := ExtractFilePath( FilePath ) + HEADTXT_FILENAME
1175 Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1176 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + HEADTXT_FILENAME;
1178 function TBoard.GetTitlePictureFileName: string;
1182 if FTitlePictureURL = '' then
1185 tmpName := Copy(FTitlePictureURL, LastDelimiter('/', FTitlePictureURL) + 1, Length(FTitlePictureURL));
1186 if Length( FilePath ) > 0 then
1187 Result := ExtractFilePath( FilePath ) + tmpName
1189 Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1190 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + tmpName;
1194 //
\83X
\83\8c\97§
\82Ä
\91\97\90MURL
1195 function TBoard.GetSendURL: string;
1197 Result := GikoSys.UrlToServer(URL) + 'test/subbbs.cgi';
1200 procedure TBoard.SetRound(b: Boolean);
1205 RoundList.Delete(Self);
1206 if FRound = b then Exit;
1212 procedure TBoard.SetRoundName(s: string);
1214 if FRoundName = s then Exit;
1220 procedure TBoard.SetLastModified(d: TDateTime);
1222 if FLastModified = d then Exit;
1228 procedure TBoard.SetLastGetTime(d: TDateTime);
1230 if FLastGetTime = d then Exit;
1236 procedure TBoard.SetUnRead(i: Integer);
1238 if FUnRead = i then Exit;
1239 if i < 0 then i := 0;
1245 procedure TBoard.SetKotehanName(s: string);
1247 if FKotehanName = s then Exit;
1253 procedure TBoard.SetKotehanMail(s: string);
1255 if FKotehanMail = s then Exit;
1261 function TBoard.GetNewThreadCount: Integer;
1266 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1268 for i := 0 to Count - 1 do begin
1269 if Items[i].NewArrival then
1273 for i := 0 to Count - 1 do begin
1274 if Items[i].NewArrival then
1276 if Items[i].ShortTitle = '' then
1277 Items[i].ShortTitle := ZenToHan(Items[i].Title);
1278 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1285 function TBoard.GetLogThreadCount: Integer;
1290 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1292 for i := 0 to Count - 1 do begin
1293 if Items[i].IsLogFile then
1297 for i := 0 to Count - 1 do begin
1298 if Items[i].IsLogFile then
1300 if Items[i].ShortTitle = '' then
1301 Items[i].ShortTitle := ZenToHan(Items[i].Title);
1302 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1309 function TBoard.GetUserThreadCount: Integer;
1314 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1317 for i := 0 to Count - 1 do begin
1318 if Items[i].ShortTitle = '' then
1319 Items[i].ShortTitle := ZenToHan(Items[i].Title);
1320 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1325 function TBoard.GetNewThread(Index: Integer): TThreadItem;
1332 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1334 for i := 0 to Count - 1 do begin
1335 if Items[i].NewArrival then
1337 if Index = Cnt then begin
1345 for i := 0 to Count - 1 do begin
1346 if Items[i].NewArrival then
1348 if Items[i].ShortTitle = '' then
1349 Items[i].ShortTitle := ZenToHan(Items[i].Title);
1350 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1351 if Index = Cnt then begin
1362 function TBoard.GetLogThread(Index: Integer): TThreadItem;
1368 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1370 for i := 0 to Count - 1 do begin
1371 if Items[i].IsLogFile then
1373 if Index = Cnt then begin
1381 for i := 0 to Count - 1 do begin
1382 if Items[i].IsLogFile then
1384 if Items[i].ShortTitle = '' then
1385 Items[i].ShortTitle := ZenToHan(Items[i].Title);
1386 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1387 if Index = Cnt then begin
1399 function TBoard.GetUserThread(Index: Integer): TThreadItem;
1406 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1408 for i := 0 to Count - 1 do begin
1411 Result := Items[ i ];
1417 for i := 0 to Count - 1 do begin
1418 if Items[i].ShortTitle = '' then
1419 Items[i].ShortTitle := ZenToHan(Items[i].Title);
1420 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1421 if Index = Cnt then begin
1431 procedure TBoard.BeginUpdate;
1436 procedure TBoard.EndUpdate;
1441 {class function TBoard.GetColumnName(Index: Integer): string;
1443 Result := COLUMN_THREADITEM[Index];
1446 class function TBoard.GetColumnCount: Integer;
1448 Result := Length(COLUMN_THREADITEM);
1451 //constructor TThreadItem.Create(AOwner: TComponent);
1452 procedure TThreadItem.Init;
1457 FRoundDate := ZERO_DATE;
1458 FLastModified := ZERO_DATE;
1464 FIsLogFile := False;
1465 FParentBoard := nil;
1468 FNewArrival := False;
1472 FBoardPlugIn := nil;
1475 // *************************************************************************
1476 //
\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^
1477 // *************************************************************************
1478 constructor TThreadItem.Create(
1479 inPlugIn : TBoardPlugIn;
1484 protocol, host, path, document, port, bookmark : string;
1485 BBSID, BBSKey : string;
1487 READ_PATH = '/test/read.cgi';
1493 FBoardPlugIn := inPlugIn;
1496 if inPlugIn = nil then begin
1497 foundPos := Pos( READ_PATH, inURL );
1498 if foundPos > 0 then begin
1499 // dat
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
1500 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
1501 GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
1502 if GikoSys.Is2chHost( host ) then
1504 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
1505 BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat'
1508 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
1509 EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat';
1510 FileName := BBSKey + '.dat';
1511 IsLogFile := FileExists( FilePath );
1512 URL := GikoSys.Get2chBrowsableThreadURL( inURL );
1515 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1516 inPlugIn.CreateThreadItem( DWORD( Self ) );
1521 // *************************************************************************
1522 //
\83f
\83X
\83g
\83\89\83N
\83^
1523 // *************************************************************************
1524 destructor TThreadItem.Destroy;
1527 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1528 if IsBoardPlugInAvailable then
1529 FBoardPlugIn.DisposeThreadItem( DWORD( Self ) );
1535 // *************************************************************************
1536 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
1537 // *************************************************************************
1538 function TThreadItem.IsBoardPlugInAvailable : Boolean;
1542 if BoardPlugIn = nil then
1545 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
1556 function TThreadItem.GetDatURL: string;
1558 Protocol, Host, Path, Document, Port, Bookmark: string;
1560 Result := ParentBoard.URL
1563 if FDownloadHost <> '' then begin
1564 GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1565 Result := Format('%s://%s%s%s', [Protocol,
1570 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1571 // + 'test/read.cgi/' + ParentBoard.BBSID + '/'
1572 // + ChangeFileExt(FileName, '') + '/?raw='
1573 // + IntToStr(ResNum) + '.' + IntToStr(ResSize);
1576 function TThreadItem.GetDatgzURL: string;
1577 function isOldKako(s: string): Boolean;
1580 if AnsiPos('piza.', s) <> 0 then
1582 else if AnsiPos('www.bbspink.', s) <> 0 then
1584 else if AnsiPos('tako.', s) <> 0 then
1588 Protocol, Host, Path, Document, Port, Bookmark: string;
1591 if FDownloadHost = '' then begin
1592 DatNo := ChangeFileExt(FileName, '');
1593 if isOldKako(ParentBoard.URL) then begin
1594 Result := Format('%s%s/%.3s/%s.dat', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1596 if Length(DatNo) > 9 then begin
1597 //http://xxx.2ch.net/xxx/kako/9999/99999/999999999.dat.gz
1598 Result := Format('%s%s/%.4s/%.5s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo, DatNo]);
1600 //http://xxx.2ch.net/xxx/kako/999/999999999.dat.gz
1601 Result := Format('%s%s/%.3s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1605 Gikosys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1606 DatNo := ChangeFileExt(Document, '');
1607 if isOldKako(DownloadHost) then begin
1608 Result := Format('%s://%s/%s/kako/%.3s/%s.dat', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1610 if Length(DatNo) > 9 then begin
1611 Result := Format('%s://%s/%s/kako/%.4s/%.5s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo, DatNo]);
1613 Result := Format('%s://%s/%s/kako/%.3s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1619 {function TThreadItem.GetOldDatgzURL: string;
1621 Protocol, Host, Path, Document, Port, Bookmark: string;
1623 Result := Format('%s%s/%.3s/%s.gz', [ParentBoard.URL,
1627 if FDownloadHost <> '' then begin
1628 ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1629 Result := Format('%s://%s%s%s', [Protocol,
1637 function TThreadItem.GetOfflawCgiURL(const SessionID: string): string;
1639 // Protocol, Host, Path, Document, Port, Bookmark: string;
1641 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1642 // + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1643 // + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1644 if FDownloadHost = '' then begin
1645 Result := GikoSys.UrlToServer(ParentBoard.URL)
1646 + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1647 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1649 //http://news.2ch.net/test/offlaw.cgi/newsplus/1014038577/?raw=.196928&sid=
1650 //GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1651 Result := 'http://' + FDownloadHost
1652 + '/test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1653 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1654 // Result := Format('%s://%s%s%s', [Protocol,
1661 function TThreadItem.GetSendURL: string;
1663 Result := GikoSys.UrlToServer(ParentBoard.URL)
1667 procedure TThreadItem.DeleteLogFile;
1669 ParentBoard.BeginUpdate;
1671 DeleteFile(GetThreadFileName);
1672 if FileExists(ChangeFileExt(GetThreadFileName,'.NG')) = true then
1673 DeleteFile(ChangeFileExt(GetThreadFileName,'.NG'));
1674 FRoundDate := ZERO_DATE;
1675 FLastModified := ZERO_DATE;
1677 FIsLogFile := False;
1680 FNewArrival := False;
1684 FDownloadHost := '';
1685 FAgeSage := gasNone;
1691 ParentBoard.EndUpdate;
1692 ParentBoard.Modified := True;
1695 function TThreadItem.GetThreadFileName: string;
1697 if Length( FilePath ) > 0 then
1700 Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1701 + BBS2CH_LOG_FOLDER + PATH_DELIM + ParentBoard.BBSID + PATH_DELIM + FileName;
1704 procedure TThreadItem.SetLastModified(d: TDateTime);
1706 if FLastModified = d then Exit;
1708 if FUpdate and (ParentBoard <> nil) then
1709 ParentBoard.FModified := True;
1712 {procedure TThreadItem.SetRoundNo(i: Integer);
1714 if FRoundNo = i then Exit;
1716 if FUpdate and (ParentBoard <> nil) then
1717 ParentBoard.FModified := True;
1720 procedure TThreadItem.SetRound(b: Boolean);
1725 RoundList.Delete(Self);
1726 if FRound = b then Exit;
1728 if FUpdate and (ParentBoard <> nil) then
1729 ParentBoard.FModified := True;
1732 procedure TThreadItem.SetRoundName(const s: string);
1734 if FRoundName = s then Exit;
1736 if FUpdate and (ParentBoard <> nil) then
1737 ParentBoard.FModified := True;
1740 procedure TThreadItem.SetKokomade(i: Integer);
1742 if FKokomade = i then Exit;
1744 if FUpdate and (ParentBoard <> nil) then
1745 ParentBoard.FModified := True;
1748 procedure TThreadItem.SetUnRead(b: Boolean);
1750 if FUnRead = b then Exit;
1752 if FUpdate and (ParentBoard <> nil) then
1753 ParentBoard.FModified := True;
1756 procedure TThreadItem.SetScrollTop(i: Integer);
1758 if FScrollTop = i then Exit;
1760 if FUpdate and (ParentBoard <> nil) then
1761 ParentBoard.FModified := True;
1764 procedure TThreadItem.BeginUpdate;
1769 procedure TThreadItem.EndUpdate;
1775 BBS2ch := TBBS.Create;
1778 if BBS2ch <> nil then
1780 function TThreadItem.GetCreateDate: TDateTime;
1785 //
\83t
\83@
\83C
\83\8b\96¼
\82©
\82ç
\83X
\83\8c\8dì
\90¬
\93ú
\8e\9e\82ð
\8b\81\82ß
\82é
1787 if ( GikoSys.Setting.CreationTimeLogs ) and not IsLogFile then
1790 //
\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
1791 tmp := ChangeFileExt(FFileName, '');
1792 if AnsiPos('_', tmp) <> 0 then
1793 if AnsiPos('_', tmp) > 9 then
1794 tmp := Copy(tmp, 1, AnsiPos('_', tmp)-1)
1796 Delete(tmp, AnsiPos('_', tmp), 1);
1798 if ( Length(tmp) = 9) and ( tmp[1] = '0' ) then
1799 Insert('1', tmp, 1);
1801 unixtime := StrToInt64Def(tmp, ZERO_DATE);
1802 Result := UnixToDateTime(unixtime) + OffsetFromUTC;
1803 if GikoSys.Setting.FutureThread then begin
1804 if CompareDateTime(Result, Now) = 1 then
1805 Result := ZERO_DATE;
1811 Result := ZERO_DATE;