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);
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 function GetThreadItem(index: integer): TThreadItem;
180 procedure SetThreadItem(index: integer; value: TThreadItem);
181 procedure SetRound(b: Boolean);
182 procedure SetRoundName(s: string);
183 procedure SetLastModified(d: TDateTime);
184 procedure SetLastGetTime(d: TDateTime);
185 procedure SetUnRead(i: Integer);
186 procedure SetKotehanName(s: string);
187 procedure SetKotehanMail(s: string);
190 constructor Create( inPlugIn : TBoardPlugIn; inURL : string );
191 destructor Destroy; override;
193 property Context: DWORD read FContext write FContext;
195 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
196 property No: Integer read FNo write FNo;
197 property Title: string read FTitle write FTitle;
198 property BBSID: string read FBBSID write FBBSID;
199 property URL: string read FURL write FURL;
200 property Round: Boolean read FRound write SetRound;
201 property RoundName: string read FRoundName write SetRoundName;
202 property RoundDate: TDateTime read FRoundDate write FRoundDate;
203 property LastModified: TDateTime read FLastModified write SetLastModified;
204 property LastGetTime: TDateTime read FLastGetTime write SetLastGetTime;
205 property UnRead: Integer read FUnRead write SetUnRead;
206 property Modified: Boolean read FModified write FModified;
207 property IsThreadDatRead: Boolean read FIsThreadDatRead write FIsThreadDatRead;
208 property ParentCategory: TCategory read FParentCategory write FParentCategory;
210 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
211 property FilePath : string read FFilePath write FFilePath;
212 property IsLogFile : Boolean read FIsLogFile write FIsLogFile;
213 property IntData : Integer read FIntData write FIntData;
214 property ListData : TList read FListData write FListData;
215 function IsBoardPlugInAvailable : Boolean;
217 function Add(item: TThreadItem): integer;
218 procedure Insert(Index: Integer; Item: TThreadItem);
219 procedure Delete(index: integer);
220 procedure DeleteList(index: integer);
221 procedure Clear; override;
222 function FindThreadFromFileName(const ItemFileName: string): TThreadItem;
223 function FindThreadFromURL(const inURL : string ) : TThreadItem;
224 function GetIndexFromFileName(const ItemFileName: string): Integer;
225 function GetIndexFromURL(const URL: string): Integer;
226 procedure LoadSettings;
227 procedure SaveSettings;
228 function GetReadCgiURL: string;
229 function GetSubjectFileName: string;
230 function GetFolderIndexFileName: string;
231 function GetSendURL: string;
233 function GetNewThreadCount: Integer;
234 function GetLogThreadCount: Integer;
235 function GetUserThreadCount: Integer;
236 function GetNewThread(Index: Integer): TThreadItem;
237 function GetLogThread(Index: Integer): TThreadItem;
238 function GetUserThread(Index: Integer): TThreadItem;
240 procedure BeginUpdate;
242 property NodeExpand: Boolean read FExpand write FExpand;
243 property BoolData: Boolean read FBoolData write FBoolData;
244 property SPID: string read FSPID write FSPID;
245 property PON: string read FPON write FPON;
246 property KotehanName: string read FKotehanName write SetKotehanName;
247 property KotehanMail: string read FKotehanMail write SetKotehanMail;
251 TThreadItem = class(TObject)
253 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é)
255 FNo: Integer; //
\94Ô
\8d\86
256 FFileName: string; //
\83X
\83\8c\83b
\83h
\83t
\83@
\83C
\83\8b\96¼
257 FTitle: string; //
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b
258 FShortTitle: string; //
\92Z
\82¢
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b\81i
\8c\9f\8dõ
\97p
\81j
259 FRoundDate: TDateTime; //
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e\81i
\8f\84\89ñ
\93ú
\8e\9e\81j
260 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
261 FCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83\8d\81[
\83J
\83\8b\81j
262 FAllResCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83T
\81[
\83o
\81j
263 FNewResCount: Integer; //
\83X
\83\8c\83b
\83h
\90V
\92\85\90\94
264 FSize: Integer; //
\83X
\83\8c\83b
\83h
\83T
\83C
\83Y
265 FRound: Boolean; //
\8f\84\89ñ
\83t
\83\89\83O
266 FRoundName: string; //
\8f\84\89ñ
\96¼
267 FIsLogFile: Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
268 FParentBoard: TBoard; //
\90e
\83{
\81[
\83h
269 FKokomade: Integer; //
\83R
\83R
\82Ü
\82Å
\93Ç
\82ñ
\82¾
\94Ô
\8d\86
270 FNewReceive: Integer; //
\83R
\83R
\82©
\82ç
\90V
\8bK
\8eó
\90M
271 FNewArrival: Boolean; //
\90V
\92\85
272 FUnRead: Boolean; //
\96¢
\93Ç
\83t
\83\89\83O
273 FScrollTop: Integer; //
\83X
\83N
\83\8d\81[
\83\8b\88Ê
\92u
274 FDownloadHost: string; //
\8d¡
\82Ì
\83z
\83X
\83g
\82Æ
\88á
\82¤
\8fê
\8d\87\82Ì
\83z
\83X
\83g
275 FAgeSage: TGikoAgeSage; //
\83A
\83C
\83e
\83\80\82Ì
\8fã
\82°
\89º
\82°
276 // FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
280 FURL : string; //
\82±
\82Ì
\83X
\83\8c\82ð
\83u
\83\89\83E
\83U
\82Å
\95\
\8e¦
\82·
\82é
\8dÛ
\82Ì URL
281 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\83X
\83\8c\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
282 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
283 FSizeByte : Integer; // CreateHTML2
\82ð
\8eÀ
\8ds
\82µ
\82Ä
\82¢
\82é
\8dÅ
\92\86\82É
\88ê
\8e\9e\93I
\82É
\95Û
\91¶
\82³
\82ê
\82é
\92l
285 procedure SetLastModified(d: TDateTime);
286 procedure SetRound(b: Boolean);
287 procedure SetRoundName(const s: string);
288 procedure SetKokomade(i: Integer);
289 procedure SetUnRead(b: Boolean);
290 procedure SetScrollTop(i: Integer);
292 function GetCreateDate: TDateTime;
294 constructor Create( inPlugIn : TBoardPlugIn; inURL : string );
295 destructor Destroy; override;
297 function GetDatURL: string;
298 function GetDatgzURL: string;
299 // function GetOldDatgzURL: string;
300 function GetOfflawCgiURL(const SessionID: string): string;
301 function GetSendURL: string;
302 procedure DeleteLogFile;
303 function GetThreadFileName: string;
304 procedure BeginUpdate;
307 property Context: DWORD read FContext write FContext;
309 property No: Integer read FNo write FNo;
310 property FileName: string read FFileName write FFileName;
311 property Title: string read FTitle write FTitle;
312 property ShortTitle: string read FShortTitle write FShortTitle;
313 property RoundDate: TDateTime read FRoundDate write FRoundDate;
314 property LastModified: TDateTime read FLastModified write SetLastModified;
315 property Count: Integer read FCount write FCount;
316 property AllResCount: Integer read FAllResCount write FAllResCount;
317 property NewResCount: Integer read FNewResCount write FNewResCount;
318 property Size: Integer read FSize write FSize;
319 property Round: Boolean read FRound write SetRound;
320 property RoundName: string read FRoundName write SetRoundName;
322 property IsLogFile: Boolean read FIsLogFile write FIsLogFile;
323 property ParentBoard: TBoard read FParentBoard write FParentBoard;
324 property Kokomade: Integer read FKokomade write SetKokomade;
325 property NewReceive: Integer read FNewReceive write FNewReceive;
326 property NewArrival: Boolean read FNewArrival write FNewArrival;
327 property UnRead: Boolean read FUnRead write SetUnRead;
328 property ScrollTop: Integer read FScrollTop write SetScrollTop;
329 property Expand: Boolean read FExpand write FExpand;
330 property DownloadHost: string read FDownloadHost write FDownloadHost;
331 property AgeSage: TGikoAgeSage read FAgeSage write FAgeSage;
332 // property SPID: string read FSPID write FSPID;
333 property CreateDate: TDateTime read GetCreateDate;
334 property URL : string read FURL write FURL;
335 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
336 property FilePath : string read FFilePath write FFilePath;
337 property SizeByte : Integer read FSizeByte write FSizeByte;
338 function IsBoardPlugInAvailable : Boolean;
343 //
\8c\9f\8dõ
\8c\8b\89Ê
\83\8a\83X
\83g
344 { TSearchList = class(TList)
346 function GetThreadItem(index: integer): TThreadItem;
347 procedure SetThreadItem(index: integer; value: TThreadItem);
350 destructor Destroy; override;
352 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
354 function Add(item: TThreadItem): integer;
355 procedure Delete(index: integer);
356 procedure Clear; override;
359 function BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard;
360 function BBSsFindBoardFromURL( inURL : string ) : TBoard;
361 function BBSsFindBoardFromTitle( inTitle : string ) : TBoard;
362 function BBSsFindThreadFromURL(const inURL : string ) : TThreadItem;
363 function ConvertDateTimeString( inDateTimeString : string) : TDateTime;
366 BBSs : array of TBBS;
371 GikoSystem, RoundData;
374 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
375 BBS2CH_LOG_FOLDER: string = '2ch';
376 EXTERNAL_LOG_FOLDER: string = 'exboard';
378 FOLDER_INI_FILENAME: string = 'Folder.ini';
379 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
380 SUBJECT_FILENAME: string = 'subject.txt';
381 PATH_DELIM: string = '\';
382 //DEFAULT_LIST_COUNT: Integer = 100;
384 // COLUMN_CATEGORY: array[0..0] of string = ('
\83J
\83e
\83S
\83\8a\96¼');
385 // 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');
386 // 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');
388 // BBSID
\82ð
\97p
\82¢
\82é 2
\82¿
\82á
\82ñ
\82Ë
\82é
\82Ì
\82Ý
\92T
\82µ
\8fo
\82µ
\82Ü
\82·
389 // BBSID
\82Ì
\8eg
\97p
\82Í
\8bÉ
\97Í
\94ð
\82¯
\82Ä
\82
\82¾
\82³
\82¢
\81B
390 //
\89Â
\94\
\82È
\8fê
\8d\87\82Í URL
\82ð
\8eg
\97p
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B
391 function BBSsFindBoardFromBBSID(
396 Result := BBSs[ 0 ].FindBBSID( inBBSID );
400 function BBSsFindBoardFromURL(
407 for i := Length( BBSs ) - 1 downto 0 do begin
408 Result := BBSs[ i ].FindBoardFromURL( inURL );
409 if Result <> nil then
417 function BBSsFindBoardFromTitle(
424 for i := Length( BBSs ) - 1 downto 0 do begin
425 Result := BBSs[ i ].FindBoardFromTitle( inTitle );
426 if Result <> nil then
434 function BBSsFindThreadFromURL(
442 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
443 board := BBSsFindBoardFromURL( boardURL );
447 Result := board.FindThreadFromURL( inURL );
451 (*************************************************************************
452 *
\8b@
\94\
\96¼
\81FTBBS
\83R
\83\93\83X
\83g
\83\89\83N
\83^
454 *************************************************************************)
455 constructor TBBS.Create( boardFilePath : string );
458 Title := BBS2CH_NAME;
459 FFilePath := boardFilePath;
462 (*************************************************************************
463 *
\8b@
\94\
\96¼
\81FTBBS
\83f
\83X
\83g
\83\89\83N
\83^
465 *************************************************************************)
466 destructor TBBS.Destroy;
472 (*************************************************************************
475 *************************************************************************)
476 function TBBS.GetCategory(index: integer): TCategory;
478 Result := TCategory(inherited Items[index]);
481 procedure TBBS.SetCategory(index: integer; value: TCategory);
483 inherited Items[index] := value;
486 function TBBS.Add(item: TCategory): integer;
488 Item.ParenTBBS := self;
489 Result := inherited Add(item);
492 procedure TBBS.Delete(index: integer);
494 if Items[index] <> nil then
495 TCategory(Items[index]).Free;
497 inherited Delete(index);
500 procedure TBBS.Clear;
504 for i := Count - 1 downto 0 do
509 function TBBS.Find(key: string): TCategory;
514 function TBBS.FindBBSID(const BBSID: string): TBoard;
518 if not IsBoardFileRead then
519 GikoSys.ReadBoardFile( Self );
520 for i := Count - 1 downto 0 do begin
521 Result := Items[ i ].FindBBSID(BBSID);
522 if Result <> nil then
528 //*************************************************************************
529 //
\83^
\83C
\83g
\83\8b\82Ì
\88ê
\92v
\82·
\82é
\94Â
\82ð
\92T
\82·
530 //*************************************************************************)
531 function TBBS.FindBoardFromTitle(const Title: string): TBoard;
535 if not IsBoardFileRead then
536 GikoSys.ReadBoardFile( Self );
537 for i := Count - 1 downto 0 do begin
538 Result := Items[ i ].FindBoardFromTitle(Title);
539 if Result <> nil then
545 //*************************************************************************
546 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\94Â
\82ð
\92T
\82·
547 //*************************************************************************)
548 function TBBS.FindBoardFromURL(const inURL: string): TBoard;
552 if not IsBoardFileRead then
553 GikoSys.ReadBoardFile( Self );
554 for i := Count - 1 downto 0 do begin
555 Result := Items[ i ].FindBoardFromURL( inURL );
556 if Result <> nil then
562 //*************************************************************************
563 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\83X
\83\8c\83b
\83h
\82ð
\92T
\82·
564 //*************************************************************************)
565 function TBBS.FindThreadFromURL(const inURL: string): TThreadItem;
571 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
572 board := FindBoardFromURL( boardURL );
576 Result := board.FindThreadFromURL( inURL );
580 function TBBS.FindThreadItem(const BBSID, FileName: string): TThreadItem;
585 Board := FindBBSID(BBSID);
588 Result := Board.FindThreadFromFileName(FileName);
591 function TBBS.FindCategoryFromTitle(const inTitle : string ) : TCategory;
596 for i := Count - 1 downto 0 do begin
597 if AnsiCompareStr(Items[ i ].Title, inTitle) = 0 then begin
598 Result := Items[ i ];
607 procedure TBBS.SetSelectText(s: string);
610 ShortSelectText := GikoSys.ZenToHan(s);
613 {class function TBBS.GetColumnName(Index: Integer): string;
615 Result := COLUMN_CATEGORY[Index];
618 class function TBBS.GetColumnCount: Integer;
620 Result := Length(COLUMN_CATEGORY);
623 //===================
625 //===================
626 constructor TCategory.Create;
631 destructor TCategory.Destroy;
637 function TCategory.GetBoard(index: integer): TBoard;
639 Result := TBoard( Objects[index] );
642 procedure TCategory.SetBoard(index: integer; value: TBoard);
644 Objects[index] := value;
645 Strings[index] := value.URL
648 function TCategory.Add(item: TBoard): integer;
650 Item.ParentCategory := self;
651 Result := AddObject( item.URL, item );
654 procedure TCategory.Delete(index: integer);
656 if Items[index] <> nil then
657 TBoard(Items[index]).Free;
658 inherited Delete(index);
661 procedure TCategory.Clear;
665 for i := Count - 1 downto 0 do
670 function TCategory.FindName(const key: string): TBoard;
675 function TCategory.FindBBSID(const BBSID: string): TBoard;
679 for i := Count - 1 downto 0 do begin
680 if AnsiCompareStr(Items[i].FBBSID, BBSID) = 0 then begin
688 //*************************************************************************
689 //
\83^
\83C
\83g
\83\8b\82Ì
\88ê
\92v
\82·
\82é
\94Â
\82ð
\92T
\82·
690 //*************************************************************************)
691 function TCategory.FindBoardFromTitle(const Title: string): TBoard;
695 for i := Count - 1 downto 0 do begin
696 if AnsiCompareStr(Items[i].FTitle, Title) = 0 then begin
704 //*************************************************************************
705 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\94Â
\82ð
\92T
\82·
706 //*************************************************************************)
707 function TCategory.FindBoardFromURL(const inURL: string): TBoard;
711 i := IndexOf( inURL );
713 Result := TBoard( Objects[ i ] )
718 //*************************************************************************
719 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\83X
\83\8c\83b
\83h
\82ð
\92T
\82·
720 //*************************************************************************)
721 function TCategory.FindThreadFromURL(const inURL: string): TThreadItem;
727 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
728 board := FindBoardFromURL( boardURL );
732 Result := board.FindThreadFromURL( inURL );
736 function TCategory.IsMidoku: Boolean;
742 for i := 0 to Count - 1 do begin
743 if Items[i] <> nil then begin
744 for j := 0 to Items[i].Count - 1 do begin
745 if Items[i].Items[j] <> nil then begin
746 // if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].Count > Items[i].Items[j].Kokomade) then begin
747 if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].UnRead) then begin
757 {class function TCategory.GetColumnName(Index: Integer): string;
759 Result := COLUMN_BOARD[Index];
762 class function TCategory.GetColumnCount: Integer;
764 Result := Length(COLUMN_BOARD);
767 //===================
769 //===================
770 procedure TBoard.Init;
777 FRoundDate := ZERO_DATE;
778 FLastModified := ZERO_DATE;
779 FLastGetTime := ZERO_DATE;
780 FIsThreadDatRead := False;
782 // FListStyle := vsReport;
783 // FItemNoVisible := True;
788 // *************************************************************************
789 //
\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^
790 // *************************************************************************
791 constructor TBoard.Create(
792 inPlugIn : TBoardPlugIn;
796 protocol, host, path, document, port, bookmark : string;
802 FBoardPlugIn := inPlugIn;
804 BBSID := GikoSys.UrlToID( inURL );
806 if inPlugIn = nil then begin
807 // subject.txt
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
808 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
809 if GikoSys.Is2chHost( host ) then
811 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
812 BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
815 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
816 EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
818 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
819 inPlugIn.CreateBoardItem( DWORD( Self ) );
824 // *************************************************************************
825 //
\83f
\83X
\83g
\83\89\83N
\83^
826 // *************************************************************************
827 destructor TBoard.Destroy;
829 if FModified then begin
830 GikoSys.WriteThreadDat(Self);
834 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
835 if IsBoardPlugInAvailable then
836 BoardPlugIn.DisposeBoardItem( DWORD( Self ) );
842 // *************************************************************************
843 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
844 // *************************************************************************
845 function TBoard.IsBoardPlugInAvailable : Boolean;
849 if BoardPlugIn = nil then
852 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
863 function TBoard.GetThreadItem(index: integer): TThreadItem;
865 Result := TThreadItem( Objects[index] );
868 procedure TBoard.SetThreadItem(index: integer; value: TThreadItem);
870 Objects[index] := value;
871 Strings[index] := value.URL;
874 function TBoard.Add(Item: TThreadItem): Integer;
876 Item.ParentBoard := Self;
877 Result := inherited AddObject(Item.URL, Item);
880 procedure TBoard.Insert(Index: Integer; Item: TThreadItem);
882 Item.ParentBoard := Self;
883 inherited InsertObject(Index, Item.URL, Item);
887 //Index
\82Å
\8ew
\92è
\82³
\82ê
\82½
\83X
\83\8c\83b
\83h
\83I
\83u
\83W
\83F
\83N
\83g
\82ð
\94j
\8aü
888 procedure TBoard.Delete(index: Integer);
890 if Items[index] <> nil then
891 TThreadItem(Items[index]).Free;
892 inherited Delete(index);
895 //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
896 procedure TBoard.DeleteList(index: integer);
898 inherited Delete(index);
901 procedure TBoard.Clear;
906 for i := Count - 1 downto 0 do
911 function TBoard.FindThreadFromFileName(const ItemFileName: string): TThreadItem;
916 for i := 0 to Count - 1 do begin
917 if AnsiCompareStr(Items[i].FileName, ItemFileName) = 0 then begin
924 function TBoard.GetIndexFromFileName(const ItemFileName: string): Integer;
929 for i := 0 to Count - 1 do begin
930 if Items[i].FileName = ItemFileName then begin
937 function TBoard.GetIndexFromURL(const URL: string): Integer;
939 Result := IndexOf( URL );
942 function TBoard.FindThreadFromURL(const inURL : string ) : TThreadItem;
947 if not IsThreadDatRead then
948 GikoSys.ReadSubjectFile( Self );
950 i := IndexOf( inURL );
952 Result := TThreadItem( Objects[ i ] )
958 {function TBoard.GetMidokuCount: Integer;
963 for i := 0 to Count- 1 do begin
964 if Items[i] <> nil then begin
965 if (Items[i].IsLogFile) and (Items[i].Count > Items[i].Kokomade) then
972 procedure TBoard.LoadSettings;
978 if Length( FilePath ) > 0 then
979 FileName := ExtractFilePath( FilePath ) + FOLDER_INI_FILENAME
981 FileName := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
982 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + FOLDER_INI_FILENAME;
984 if not FileExists(FileName) then
986 ini := TMemIniFile.Create(FileName);
988 // Round := ini.ReadBool('Status', 'Round', False);
989 tmp := ini.ReadString('Status', 'RoundDate', DateTimeToStr(ZERO_DATE));
990 FRoundDate := ConvertDateTimeString(tmp);
991 tmp := ini.ReadString('Status', 'LastModified', DateTimeToStr(ZERO_DATE));
992 FLastModified := ConvertDateTimeString(tmp);
993 tmp := ini.ReadString('Status', 'LastGetTime', DateTimeToStr(ZERO_DATE));
994 FLastGetTime := ConvertDateTimeString(tmp);
998 FRoundDate := ini.ReadDateTime('Status', 'RoundDate', ZERO_DATE);
1000 tmp := ini.ReadString('Status', 'RoundDate', DateTimeToStr(ZERO_DATE));
1001 FRoundDate := StrToDateTime(ConvertDateTimeString(tmp));
1004 FLastModified := ini.ReadDateTime('Status', 'LastModified', ZERO_DATE);
1006 tmp := ini.ReadString('Status', 'LastModified', DateTimeToStr(ZERO_DATE));
1007 FLastModified := StrToDateTime(ConvertDateTimeString(tmp));
1010 FLastGetTime := ini.ReadDateTime('Status', 'LastGetTime', ZERO_DATE);
1012 tmp := ini.ReadString('Status', 'LastGetTime', DateTimeToStr(ZERO_DATE));
1013 FLastGetTime := StrToDateTime(ConvertDateTimeString(tmp));
1016 FUnRead := ini.ReadInteger('Status', 'UnRead', 0);
1017 FSPID := ini.ReadString('Cookie', 'SPID', '');
1018 FPON := ini.ReadString('Cookie', 'PON', '');
1019 FKotehanName := ini.ReadString('Kotehan', 'Name', '');
1020 FKotehanMail := ini.ReadString('Kotehan', 'Mail', '');
1021 // ListStyle := TViewStyle(Ord(ini.ReadInteger('Status', 'ListStyle', 3)));
1022 // ItemNoVisible := ini.ReadBool('Status', 'ItemNoVisible', True);
1023 // ViewType := TGikoViewType(Ord(ini.ReadInteger('Status', 'ViewType', 0)));
1031 procedure TBoard.SaveSettings;
1036 if Length( FilePath ) > 0 then
1037 FileName := ExtractFilePath( FilePath )
1039 FileName := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1040 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM;
1041 if not GikoSys.DirectoryExistsEx(FileName) then
1042 GikoSys.ForceDirectoriesEx(FileName);
1043 FileName := FileName + FOLDER_INI_FILENAME;
1044 ini := TMemIniFile.Create(FileName);
1048 // ini.WriteBool('Status', 'Round', Round);
1049 ini.WriteDateTime('Status', 'RoundDate', FRoundDate);
1050 ini.WriteDateTime('Status', 'LastModified', FLastModified);
1051 ini.WriteDateTime('Status', 'LastGetTime', FLastGetTime);
1052 ini.WriteInteger('Status', 'UnRead', FUnRead);
1053 ini.WriteString('Cookie', 'SPID', FSPID);
1054 ini.WriteString('Cookie', 'PON', FPON);
1055 ini.WriteString('Kotehan', 'Name', FKotehanName);
1056 ini.WriteString('Kotehan', 'Mail', FKotehanMail);
1057 // ini.WriteInteger('Status', 'ListStyle', Ord(ListStyle));
1058 // ini.WriteBool('Status', 'ItemNoVisible', ItemNoVisible);
1059 // ini.WriteInteger('Status', 'ViewType', Ord(ViewType));
1065 //
\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ð
1066 // 2003/02/08 0:32:13
\82É
\95Ï
\8a·
\82·
\82é
1067 function ConvertDateTimeString( inDateTimeString : string) : TDateTime;
1069 ZERO_DATE_STRING : string = '1970/01/01 0:00:00';
1079 if inDateTimeString = '' then
1080 inDateTimeString := ZERO_DATE_STRING;
1082 if ( AnsiPos('/', inDateTimeString ) = 0 ) and
1083 ( AnsiCompareStr( DateTimeToStr(ZERO_DATE), inDateTimeString) <> 0 ) then begin
1084 for i := 0 to 1 do begin
1085 Insert('/',inDateTimeString, AnsiPos(' ', inDateTimeString) + 1 );
1086 Delete(inDateTimeString, AnsiPos(' ', inDateTimeString), 1);
1090 Result := StrToDateTime( inDateTimeString );
1092 if( inDateTimeString[5] = '/' ) and ( inDateTimeString[8] = '/' ) then begin
1093 y := StrToIntDef( Copy(inDateTimeString, 1, 4), 1970 );
1094 m := StrToIntDef( Copy(inDateTimeString, 6, 2), 1 );
1095 d := StrToIntDef( Copy(inDateTimeString, 9, 2), 1 );
1096 hour := 0; min := 0; sec := 0;
1098 if Length(inDateTimeString) > 11 then begin
1099 if( inDateTimeString[13] = ':' ) and ( inDateTimeString[16] = ':' ) then begin
1100 hour := StrToIntDef( Copy(inDateTimeString, 12, 1), 0 );
1101 min := StrToIntDef( Copy(inDateTimeString, 14, 2), 0 );
1102 sec := StrToIntDef( Copy(inDateTimeString, 17, 2), 0 );
1103 end else if( inDateTimeString[14] = ':' ) and ( inDateTimeString[17] = ':' ) then begin
1104 hour := StrToIntDef( Copy(inDateTimeString, 12, 2), 0 );
1105 min := StrToIntDef( Copy(inDateTimeString, 15, 2), 0 );
1106 sec := StrToIntDef( Copy(inDateTimeString, 18, 2), 0 );
1110 Result := EncodeDateTime(y ,m, d, hour, min, sec, 0);
1112 Result := ZERO_DATE;
1115 Result := ZERO_DATE;
1119 // Result := inDateTimeString;
1121 //
\83T
\83u
\83W
\83F
\83N
\83gURL
\8eæ
\93¾
1122 function TBoard.GetReadCgiURL: string;
1124 //Result := URL + SUBJECT_FILENAME;
1125 //Result := GikoSys.UrlToServer(URL)
1126 // + 'test/read.cgi/' + BBSID + '/?raw=0.0';
1127 Result := URL + SUBJECT_FILENAME;
1131 //
\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
1132 function TBoard.GetSubjectFileName: string;
1134 if Length( FilePath ) > 0 then
1137 Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1138 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME;
1141 //
\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
1142 function TBoard.GetFolderIndexFileName: string;
1144 if Length( FilePath ) > 0 then
1145 Result := ExtractFilePath( FilePath ) + FOLDER_INDEX_FILENAME
1147 Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1148 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME;
1151 //
\83X
\83\8c\97§
\82Ä
\91\97\90MURL
1152 function TBoard.GetSendURL: string;
1154 Result := GikoSys.UrlToServer(URL) + 'test/subbbs.cgi';
1157 procedure TBoard.SetRound(b: Boolean);
1162 RoundList.Delete(Self);
1163 if FRound = b then Exit;
1169 procedure TBoard.SetRoundName(s: string);
1171 if FRoundName = s then Exit;
1177 procedure TBoard.SetLastModified(d: TDateTime);
1179 if FLastModified = d then Exit;
1185 procedure TBoard.SetLastGetTime(d: TDateTime);
1187 if FLastGetTime = d then Exit;
1193 procedure TBoard.SetUnRead(i: Integer);
1195 if FUnRead = i then Exit;
1196 if i < 0 then i := 0;
1202 procedure TBoard.SetKotehanName(s: string);
1204 if FKotehanName = s then Exit;
1210 procedure TBoard.SetKotehanMail(s: string);
1212 if FKotehanMail = s then Exit;
1218 function TBoard.GetNewThreadCount: Integer;
1223 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1225 for i := 0 to Count - 1 do begin
1226 if Items[i].NewArrival then
1230 for i := 0 to Count - 1 do begin
1231 if Items[i].NewArrival then
1233 if Items[i].ShortTitle = '' then
1234 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1235 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1242 function TBoard.GetLogThreadCount: Integer;
1247 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1249 for i := 0 to Count - 1 do begin
1250 if Items[i].IsLogFile then
1254 for i := 0 to Count - 1 do begin
1255 if Items[i].IsLogFile then
1257 if Items[i].ShortTitle = '' then
1258 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1259 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1266 function TBoard.GetUserThreadCount: Integer;
1271 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1274 for i := 0 to Count - 1 do begin
1275 if Items[i].ShortTitle = '' then
1276 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1277 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1282 function TBoard.GetNewThread(Index: Integer): TThreadItem;
1289 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1291 for i := 0 to Count - 1 do begin
1292 if Items[i].NewArrival then
1294 if Index = Cnt then begin
1302 for i := 0 to Count - 1 do begin
1303 if Items[i].NewArrival then
1305 if Items[i].ShortTitle = '' then
1306 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1307 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1308 if Index = Cnt then begin
1319 function TBoard.GetLogThread(Index: Integer): TThreadItem;
1325 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1327 for i := 0 to Count - 1 do begin
1328 if Items[i].IsLogFile then
1330 if Index = Cnt then begin
1338 for i := 0 to Count - 1 do begin
1339 if Items[i].IsLogFile then
1341 if Items[i].ShortTitle = '' then
1342 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1343 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1344 if Index = Cnt then begin
1356 function TBoard.GetUserThread(Index: Integer): TThreadItem;
1363 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1365 for i := 0 to Count - 1 do begin
1368 Result := Items[ i ];
1374 for i := 0 to Count - 1 do begin
1375 if Items[i].ShortTitle = '' then
1376 Items[i].ShortTitle := GikoSys.ZenToHan(Items[i].Title);
1377 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1378 if Index = Cnt then begin
1388 procedure TBoard.BeginUpdate;
1393 procedure TBoard.EndUpdate;
1398 {class function TBoard.GetColumnName(Index: Integer): string;
1400 Result := COLUMN_THREADITEM[Index];
1403 class function TBoard.GetColumnCount: Integer;
1405 Result := Length(COLUMN_THREADITEM);
1408 //constructor TThreadItem.Create(AOwner: TComponent);
1409 procedure TThreadItem.Init;
1414 FRoundDate := ZERO_DATE;
1415 FLastModified := ZERO_DATE;
1421 FIsLogFile := False;
1422 FParentBoard := nil;
1425 FNewArrival := False;
1429 FBoardPlugIn := nil;
1432 // *************************************************************************
1433 //
\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^
1434 // *************************************************************************
1435 constructor TThreadItem.Create(
1436 inPlugIn : TBoardPlugIn;
1441 protocol, host, path, document, port, bookmark : string;
1442 BBSID, BBSKey : string;
1444 READ_PATH = '/test/read.cgi';
1450 FBoardPlugIn := inPlugIn;
1453 if inPlugIn = nil then begin
1454 foundPos := Pos( READ_PATH, inURL );
1455 if foundPos > 0 then begin
1456 // dat
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
1457 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
1458 GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
1459 if GikoSys.Is2chHost( host ) then
1461 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
1462 BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat'
1465 IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
1466 EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat';
1467 FileName := BBSKey + '.dat';
1468 IsLogFile := FileExists( FilePath );
1469 URL := GikoSys.Get2chBrowsableThreadURL( inURL );
1472 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1473 inPlugIn.CreateThreadItem( DWORD( Self ) );
1478 // *************************************************************************
1479 //
\83f
\83X
\83g
\83\89\83N
\83^
1480 // *************************************************************************
1481 destructor TThreadItem.Destroy;
1484 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1485 if IsBoardPlugInAvailable then
1486 FBoardPlugIn.DisposeThreadItem( DWORD( Self ) );
1492 // *************************************************************************
1493 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
1494 // *************************************************************************
1495 function TThreadItem.IsBoardPlugInAvailable : Boolean;
1499 if BoardPlugIn = nil then
1502 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
1513 function TThreadItem.GetDatURL: string;
1515 Protocol, Host, Path, Document, Port, Bookmark: string;
1517 Result := ParentBoard.URL
1520 if FDownloadHost <> '' then begin
1521 GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1522 Result := Format('%s://%s%s%s', [Protocol,
1527 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1528 // + 'test/read.cgi/' + ParentBoard.BBSID + '/'
1529 // + ChangeFileExt(FileName, '') + '/?raw='
1530 // + IntToStr(ResNum) + '.' + IntToStr(ResSize);
1533 function TThreadItem.GetDatgzURL: string;
1534 function isOldKako(s: string): Boolean;
1537 if AnsiPos('piza.', s) <> 0 then
1539 else if AnsiPos('www.bbspink.', s) <> 0 then
1541 else if AnsiPos('tako.', s) <> 0 then
1545 Protocol, Host, Path, Document, Port, Bookmark: string;
1548 if FDownloadHost = '' then begin
1549 DatNo := ChangeFileExt(FileName, '');
1550 if isOldKako(ParentBoard.URL) then begin
1551 Result := Format('%s%s/%.3s/%s.dat', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1553 if Length(DatNo) > 9 then begin
1554 //http://xxx.2ch.net/xxx/kako/9999/99999/999999999.dat.gz
1555 Result := Format('%s%s/%.4s/%.5s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo, DatNo]);
1557 //http://xxx.2ch.net/xxx/kako/999/999999999.dat.gz
1558 Result := Format('%s%s/%.3s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1562 Gikosys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1563 DatNo := ChangeFileExt(Document, '');
1564 if isOldKako(DownloadHost) then begin
1565 Result := Format('%s://%s/%s/kako/%.3s/%s.dat', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1567 if Length(DatNo) > 9 then begin
1568 Result := Format('%s://%s/%s/kako/%.4s/%.5s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo, DatNo]);
1570 Result := Format('%s://%s/%s/kako/%.3s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1576 {function TThreadItem.GetOldDatgzURL: string;
1578 Protocol, Host, Path, Document, Port, Bookmark: string;
1580 Result := Format('%s%s/%.3s/%s.gz', [ParentBoard.URL,
1584 if FDownloadHost <> '' then begin
1585 ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1586 Result := Format('%s://%s%s%s', [Protocol,
1594 function TThreadItem.GetOfflawCgiURL(const SessionID: string): string;
1596 // Protocol, Host, Path, Document, Port, Bookmark: string;
1598 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1599 // + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1600 // + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1601 if FDownloadHost = '' then begin
1602 Result := GikoSys.UrlToServer(ParentBoard.URL)
1603 + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1604 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1606 //http://news.2ch.net/test/offlaw.cgi/newsplus/1014038577/?raw=.196928&sid=
1607 //GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1608 Result := 'http://' + FDownloadHost
1609 + '/test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1610 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1611 // Result := Format('%s://%s%s%s', [Protocol,
1618 function TThreadItem.GetSendURL: string;
1620 Result := GikoSys.UrlToServer(ParentBoard.URL)
1624 procedure TThreadItem.DeleteLogFile;
1626 ParentBoard.BeginUpdate;
1628 DeleteFile(GetThreadFileName);
1629 if FileExists(ChangeFileExt(GetThreadFileName,'.NG')) = true then
1630 DeleteFile(ChangeFileExt(GetThreadFileName,'.NG'));
1631 FRoundDate := ZERO_DATE;
1632 FLastModified := ZERO_DATE;
1634 FIsLogFile := False;
1637 FNewArrival := False;
1641 FDownloadHost := '';
1642 FAgeSage := gasNone;
1648 ParentBoard.EndUpdate;
1649 ParentBoard.Modified := True;
1652 function TThreadItem.GetThreadFileName: string;
1654 if Length( FilePath ) > 0 then
1657 Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
1658 + BBS2CH_LOG_FOLDER + PATH_DELIM + ParentBoard.BBSID + PATH_DELIM + FileName;
1661 procedure TThreadItem.SetLastModified(d: TDateTime);
1663 if FLastModified = d then Exit;
1665 if FUpdate and (ParentBoard <> nil) then
1666 ParentBoard.FModified := True;
1669 {procedure TThreadItem.SetRoundNo(i: Integer);
1671 if FRoundNo = i then Exit;
1673 if FUpdate and (ParentBoard <> nil) then
1674 ParentBoard.FModified := True;
1677 procedure TThreadItem.SetRound(b: Boolean);
1682 RoundList.Delete(Self);
1683 if FRound = b then Exit;
1685 if FUpdate and (ParentBoard <> nil) then
1686 ParentBoard.FModified := True;
1689 procedure TThreadItem.SetRoundName(const s: string);
1691 if FRoundName = s then Exit;
1693 if FUpdate and (ParentBoard <> nil) then
1694 ParentBoard.FModified := True;
1697 procedure TThreadItem.SetKokomade(i: Integer);
1699 if FKokomade = i then Exit;
1701 if FUpdate and (ParentBoard <> nil) then
1702 ParentBoard.FModified := True;
1705 procedure TThreadItem.SetUnRead(b: Boolean);
1707 if FUnRead = b then Exit;
1709 if FUpdate and (ParentBoard <> nil) then
1710 ParentBoard.FModified := True;
1713 procedure TThreadItem.SetScrollTop(i: Integer);
1715 if FScrollTop = i then Exit;
1717 if FUpdate and (ParentBoard <> nil) then
1718 ParentBoard.FModified := True;
1721 procedure TThreadItem.BeginUpdate;
1726 procedure TThreadItem.EndUpdate;
1732 BBS2ch := TBBS.Create;
1735 if BBS2ch <> nil then
1737 function TThreadItem.GetCreateDate: TDateTime;
1742 //
\83t
\83@
\83C
\83\8b\96¼
\82©
\82ç
\83X
\83\8c\8dì
\90¬
\93ú
\8e\9e\82ð
\8b\81\82ß
\82é
1744 if ( GikoSys.Setting.CreationTimeLogs ) and not IsLogFile then
1747 //
\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
1748 tmp := ChangeFileExt(FFileName, '');
1749 if AnsiPos('_', tmp) <> 0 then
1750 if AnsiPos('_', tmp) > 9 then
1751 tmp := Copy(tmp, 1, AnsiPos('_', tmp)-1)
1753 Delete(tmp, AnsiPos('_', tmp), 1);
1755 if ( Length(tmp) = 9) and ( tmp[1] = '0' ) then
1756 Insert('1', tmp, 1);
1759 unixtime := StrToInt64(tmp);
1760 Result := UnixToDateTime(unixtime) + OffsetFromUTC;
1761 if GikoSys.Setting.FutureThread then begin
1762 if CompareDateTime(Result, Now) = 1 then
1763 Result := ZERO_DATE;
1769 Result := ZERO_DATE;