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Ì
\8fã
\82°
\89º
\82°
13 TGikoAgeSage = (gasNone, gasAge, gasSage, gasNew, gasNull);
19 // BBS
\82Ì
\83\8b\81[
\83g
23 FFilePath : string; //
\94Â
\83\8a\83X
\83g
\82Ì
\83p
\83X
25 FKubetsuChk: Boolean; //
\8di
\8d\9e\82Ý
\8e\9e\91å
\95¶
\8e\9a\8f¬
\95¶
\8e\9a\8bæ
\95Ê
26 FSelectText: string; //
\8di
\8d\9e\82Ý
\95¶
\8e\9a\97ñ
27 FShortSelectText: string;
28 FIsBoardFileRead : Boolean; //
\94Â
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
30 function GetCategory(index: integer): TCategory;
31 procedure SetCategory(index: integer; value: TCategory);
32 procedure SetSelectText(s: string);
34 constructor Create( boardFilePath : string );
35 destructor Destroy; override;
37 function Add(item: TCategory): integer;
38 procedure Delete(index: integer);
39 procedure Clear; override;
40 function Find(key: string): TCategory;
41 function FindBBSID(const BBSID: string): TBoard;
42 function FindBoardFromTitle(const Title: string): TBoard;
43 function FindBoardFromURL(const inURL: string): TBoard;
44 function FindThreadFromURL(const inURL : string ) : TThreadItem;
45 function FindThreadItem(const BBSID, FileName: string): TThreadItem;
46 function FindCategoryFromTitle(const inTitle : string ) : TCategory;
47 property FilePath : string read FFilePath write FFilePath;
49 property Items[index: integer]: TCategory read GetCategory write SetCategory;
50 property Title: string read FTitle write FTitle;
51 property NodeExpand: Boolean read FExpand write FExpand;
53 property KubetsuChk: Boolean read FKubetsuChk write FKubetsuChk;
54 property SelectText: string read FSelectText write SetSelectText;
55 property ShortSelectText: string read FShortSelectText write FShortSelectText;
57 property IsBoardFileRead : Boolean read FIsBoardFileRead write FIsBoardFileRead;
60 //
\83J
\83e
\83S
\83\8a(
\94Â URL
\82Ì
\83\8a\83X
\83g)
61 // TCategory = class(THashedStringList)
62 TCategory = class(TStringList)
69 function GetBoard(index: integer): TBoard;
70 procedure SetBoard(index: integer; value: TBoard);
73 destructor Destroy; override;
75 property No: Integer read FNo write FNo;
76 property Title: string read FTitle write FTitle;
77 property Items[index: integer]: TBoard read GetBoard write SetBoard;
78 property ParenTBBS: TBBS read FParenTBBS write FParenTBBS;
80 function Add(item: TBoard): integer;
81 procedure Delete(index: integer);
82 procedure Clear; override;
83 function FindName(const key: string): TBoard;
84 function FindBBSID(const BBSID: string): TBoard;
85 function FindBoardFromTitle(const Title: string): TBoard;
86 function FindBoardFromURL(const inURL: string): TBoard;
87 function FindThreadFromURL(const inURL : string ) : TThreadItem;
88 function IsMidoku: Boolean;
90 property NodeExpand: Boolean read FExpand write FExpand;
93 //
\94Â(
\83X
\83\8c\83b
\83h URL
\82Ì
\83\8a\83X
\83g)
94 // TBoard = class(THashedStringList)
95 TBoard = class(TStringList)
97 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é)
99 FNo: Integer; //
\94Ô
\8d\86
100 FTitle: string; //
\83{
\81[
\83h
\83^
\83C
\83g
\83\8b
101 FBBSID: string; //BBSID
102 FURL: string; //
\83{
\81[
\83hURL
103 FRound: Boolean; //
\83X
\83\8c\83b
\83h
\88ê
\97\97\8f\84\89ñ
\97\
\96ñ
104 FRoundName: string; //
\8f\84\89ñ
\96¼
105 //FRoundName: PChar; //
\8f\84\89ñ
\96¼
106 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
107 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
108 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
109 FIsThreadDatRead: Boolean; //
\83X
\83\8c\83b
\83h
\83\8a\83X
\83g
\82Í
\93Ç
\82Ý
\8d\9e\82Ü
\82ê
\82Ä
\82¢
\82é
\82©
\81H
110 FUnRead: Integer; //
\83X
\83\8c\83b
\83h
\96¢
\93Ç
\90\94
111 FParentCategory: TCategory; //
\90e
\83J
\83e
\83S
\83\8a
112 FModified: Boolean; //
\8fC
\90³
\83t
\83\89\83O
113 FBoolData: Boolean; //
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
114 FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
115 FPON: string; //
\8f\91\82«
\8d\9e\82Ý
\97pPON
116 FCookie: string; //
\8f\91\82«
\8d\9e\82Ý
\97pCookie
\95¶
\8e\9a\97ñ
117 FExpires: TDateTime; //Cookie
\82Ì
\97L
\8cø
\8aú
\8cÀ
118 FKotehanName: string; //
\83R
\83e
\83n
\83\93\96¼
\91O
119 FKotehanMail: string; //
\83R
\83e
\83n
\83\93\83\81\81[
\83\8b
124 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\94Â
\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
125 FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\88ê
\97\97\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
126 FIsLogFile : Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
127 FIntData : Integer; //
\8dD
\82«
\82É
\82¢
\82¶
\82Á
\82Ä
\82æ
\82µ
\81B
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
128 FListData : TList; //
\8dD
\82«
\82É
\82¢
\82¶
\82Á
\82Ä
\82æ
\82µ
\81B
\82¢
\82ë
\82ñ
\82È
\97p
\93r
\82É
\8eg
\82¤yo
130 FSETTINGTXTTime : TDateTime; //SETTING.TXT
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e
131 FIsSETTINGTXT : boolean; //SETTING.TXT
\82ð
\8eæ
\93¾
\82µ
\82Ä
\82¢
\82é
\82©
132 FHEADTXTTime : TDateTime; //HEAD.TXT
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e
133 FIsHEADTXT : boolean; //HEAD.TXT
\82ð
\8eæ
\93¾
\82µ
\82Ä
\82¢
\82é
\82©
134 FTitlePictureURL: string; //top
\8aG
\82ÌURL
135 FMultiplicity : Integer; //
\8fd
\95¡
\82µ
\82Ä
\82¢
\82é
\82©
\82Ç
\82¤
\82©
\81H
136 FIs2ch : Boolean; //host
\82ª2ch
\82©
\82Ç
\82¤
\82©
137 FNewThreadCount: Integer; //
\90V
\92\85\83X
\83\8c\83b
\83h
\82Ì
\90\94
138 FLogThreadCount: Integer; //
\83\8d\83O
\97L
\82è
\83X
\83\8c\83b
\83h
\82Ì
\90\94
139 FUserThreadCount: Integer; //
\81H
141 function GetThreadItem(index: integer): TThreadItem;
142 procedure SetThreadItem(index: integer; value: TThreadItem);
143 procedure SetRound(b: Boolean);
144 procedure SetRoundName(s: string);
145 //procedure SetRoundName(s: PChar);
146 procedure SetLastModified(d: TDateTime);
147 procedure SetLastGetTime(d: TDateTime);
148 procedure SetUnRead(i: Integer);
149 procedure SetKotehanName(s: string);
150 procedure SetKotehanMail(s: string);
153 constructor Create( inPlugIn : TBoardPlugIn; inURL : string );
154 destructor Destroy; override;
156 property Context: DWORD read FContext write FContext;
158 property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem;
159 property No: Integer read FNo write FNo;
160 property Title: string read FTitle write FTitle;
161 property BBSID: string read FBBSID write FBBSID;
162 property URL: string read FURL write FURL;
163 property Round: Boolean read FRound write SetRound;
164 //property RoundName: PChar read FRoundName write SetRoundName;
165 property RoundName: string read FRoundName write SetRoundName;
166 property RoundDate: TDateTime read FRoundDate write FRoundDate;
167 property LastModified: TDateTime read FLastModified write SetLastModified;
168 property LastGetTime: TDateTime read FLastGetTime write SetLastGetTime;
169 property UnRead: Integer read FUnRead write SetUnRead;
170 property Modified: Boolean read FModified write FModified;
171 property IsThreadDatRead: Boolean read FIsThreadDatRead write FIsThreadDatRead;
172 property ParentCategory: TCategory read FParentCategory write FParentCategory;
174 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn;
175 property FilePath : string read FFilePath write FFilePath;
176 property IsLogFile : Boolean read FIsLogFile write FIsLogFile;
177 property IntData : Integer read FIntData write FIntData;
178 property ListData : TList read FListData write FListData;
179 function IsBoardPlugInAvailable : Boolean;
181 function Add(item: TThreadItem): integer;
182 procedure Insert(Index: Integer; Item: TThreadItem);
183 procedure Delete(index: integer);
184 procedure DeleteList(index: integer);
185 procedure Clear; override;
186 function FindThreadFromFileName(const ItemFileName: string): TThreadItem;
187 function FindThreadFromURL(const inURL : string ) : TThreadItem;
188 function GetIndexFromFileName(const ItemFileName: string): Integer;
189 function GetIndexFromURL(const URL: string; reverse : Boolean = False): Integer;
190 procedure LoadSettings;
191 procedure SaveSettings;
192 function GetReadCgiURL: string;
193 function GetSubjectFileName: string;
194 function GetFolderIndexFileName: string;
195 function GetSETTINGTXTFileName: string;
196 function GETHEADTXTFileName: string;
197 function GetTitlePictureFileName: string;
198 function GetSendURL: string;
200 function GetNewThreadCount: Integer;
201 function GetLogThreadCount: Integer;
202 function GetUserThreadCount: Integer;
203 function GetNewThread(Index: Integer): TThreadItem;
204 function GetLogThread(Index: Integer): TThreadItem; overload;
205 function GetLogThread(Index: Integer; Base: Integer): TThreadItem; overload;
206 function GetUserThread(Index: Integer): TThreadItem;
208 procedure BeginUpdate;
210 property NodeExpand: Boolean read FExpand write FExpand;
211 property BoolData: Boolean read FBoolData write FBoolData;
212 property SPID: string read FSPID write FSPID;
213 property PON: string read FPON write FPON;
214 property KotehanName: string read FKotehanName write SetKotehanName;
215 property KotehanMail: string read FKotehanMail write SetKotehanMail;
217 property SETTINGTXTTime: TDateTime read FSETTINGTXTTime write FSETTINGTXTTime;
218 property IsSETTINGTXT: boolean read FIsSETTINGTXT write FIsSETTINGTXT;
219 property HEADTXTTime: TDateTime read FHEADTXTTime write FHEADTXTTime;
220 property IsHEADTXT: boolean read FIsHEADTXT write FIsHEADTXT;
221 property TitlePictureURL: string read FTitlePictureURL write FTitlePictureURL;
222 property Multiplicity: Integer read FMultiplicity write FMultiplicity;
223 property Is2ch : boolean read FIs2ch write FIs2ch;
224 property NewThreadCount: Integer read FNewThreadCount write FNewThreadCount; //
\90V
\92\85\83X
\83\8c\83b
\83h
\82Ì
\90\94
225 property LogThreadCount: Integer read FLogThreadCount write FLogThreadCount; //
\83\8d\83O
\97L
\82è
\83X
\83\8c\83b
\83h
\82Ì
\90\94
226 property UserThreadCount: Integer read FUserThreadCount write FUserThreadCount; //
\81H
227 property Cookie: string read FCookie write FCookie;
228 property Expires: TDateTime read FExpires write FExpires;
232 TThreadItem = class(TObject)
234 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é)
236 FNo: Integer; //
\94Ô
\8d\86
237 FFileName: string; //
\83X
\83\8c\83b
\83h
\83t
\83@
\83C
\83\8b\96¼
238 FTitle: string; //
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b
239 FShortTitle: string; //
\92Z
\82¢
\83X
\83\8c\83b
\83h
\83^
\83C
\83g
\83\8b\81i
\8c\9f\8dõ
\97p
\81j
240 FRoundDate: TDateTime; //
\83X
\83\8c\83b
\83h
\82ð
\8eæ
\93¾
\82µ
\82½
\93ú
\8e\9e\81i
\8f\84\89ñ
\93ú
\8e\9e\81j
241 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
242 FCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83\8d\81[
\83J
\83\8b\81j
243 FAllResCount: Integer; //
\83X
\83\8c\83b
\83h
\83J
\83E
\83\93\83g
\81i
\83T
\81[
\83o
\81j
244 FNewResCount: Integer; //
\83X
\83\8c\83b
\83h
\90V
\92\85\90\94
245 FSize: Integer; //
\83X
\83\8c\83b
\83h
\83T
\83C
\83Y
246 FRound: Boolean; //
\8f\84\89ñ
\83t
\83\89\83O
247 FRoundName: string; //
\8f\84\89ñ
\96¼
248 //FRoundName: PChar; //
\8f\84\89ñ
\96¼
249 FIsLogFile: Boolean; //
\83\8d\83O
\91¶
\8dÝ
\83t
\83\89\83O
250 FParentBoard: TBoard; //
\90e
\83{
\81[
\83h
251 FKokomade: Integer; //
\83R
\83R
\82Ü
\82Å
\93Ç
\82ñ
\82¾
\94Ô
\8d\86
252 FNewReceive: Integer; //
\83R
\83R
\82©
\82ç
\90V
\8bK
\8eó
\90M
253 FNewArrival: Boolean; //
\90V
\92\85
254 FUnRead: Boolean; //
\96¢
\93Ç
\83t
\83\89\83O
255 FScrollTop: Integer; //
\83X
\83N
\83\8d\81[
\83\8b\88Ê
\92u
256 FDownloadHost: string; //
\8d¡
\82Ì
\83z
\83X
\83g
\82Æ
\88á
\82¤
\8fê
\8d\87\82Ì
\83z
\83X
\83g
257 FAgeSage: TGikoAgeSage; //
\83A
\83C
\83e
\83\80\82Ì
\8fã
\82°
\89º
\82°
258 // FSPID: string; //
\8f\91\82«
\8d\9e\82Ý
\97pSPID
262 FURL : string; //
\82±
\82Ì
\83X
\83\8c\82ð
\83u
\83\89\83E
\83U
\82Å
\95\
\8e¦
\82·
\82é
\8dÛ
\82Ì URL
263 //FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\83X
\83\8c\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
264 //FFilePath : string; //
\82±
\82Ì
\83X
\83\8c\82ª
\95Û
\91¶
\82³
\82ê
\82Ä
\82¢
\82é
\83p
\83X
266 procedure SetLastModified(d: TDateTime);
267 procedure SetRound(b: Boolean);
268 procedure SetRoundName(const s: string);
269 //procedure SetRoundName(const s: PChar);
270 procedure SetKokomade(i: Integer);
271 procedure SetUnRead(b: Boolean);
272 procedure SetScrollTop(i: Integer);
274 function GetCreateDate: TDateTime;
275 function GetFilePath: String;
277 constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard; inURL : string ); overload;
278 constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard;
279 inURL : string; inExist: Boolean; const inFilename: string ); overload;
281 destructor Destroy; override;
283 function GetDatURL: string;
284 function GetDatgzURL: string;
285 // function GetOldDatgzURL: string;
286 function GetOfflawCgiURL(const SessionID: string): string;
287 function GetSendURL: string;
288 procedure DeleteLogFile;
289 function GetThreadFileName: string;
290 procedure BeginUpdate;
293 property Context: DWORD read FContext write FContext;
295 property No: Integer read FNo write FNo;
296 property FileName: string read FFileName write FFileName;
297 property Title: string read FTitle write FTitle;
298 property ShortTitle: string read FShortTitle write FShortTitle;
299 property RoundDate: TDateTime read FRoundDate write FRoundDate;
300 property LastModified: TDateTime read FLastModified write SetLastModified;
301 property Count: Integer read FCount write FCount;
302 property AllResCount: Integer read FAllResCount write FAllResCount;
303 property NewResCount: Integer read FNewResCount write FNewResCount;
304 property Size: Integer read FSize write FSize;
305 property Round: Boolean read FRound write SetRound;
306 property RoundName: string read FRoundName write SetRoundName;
307 //property RoundName: PChar read FRoundName write SetRoundName;
309 property IsLogFile: Boolean read FIsLogFile write FIsLogFile;
310 property ParentBoard: TBoard read FParentBoard write FParentBoard;
311 property Kokomade: Integer read FKokomade write SetKokomade;
312 property NewReceive: Integer read FNewReceive write FNewReceive;
313 property NewArrival: Boolean read FNewArrival write FNewArrival;
314 property UnRead: Boolean read FUnRead write SetUnRead;
315 property ScrollTop: Integer read FScrollTop write SetScrollTop;
316 property Expand: Boolean read FExpand write FExpand;
317 property DownloadHost: string read FDownloadHost write FDownloadHost;
318 property AgeSage: TGikoAgeSage read FAgeSage write FAgeSage;
319 property CreateDate: TDateTime read GetCreateDate;
320 property URL : string read FURL write FURL;
321 property FilePath : string read GetFilePath;
324 TBoardGroup = class(TStringList)
326 FBoardPlugIn : TBoardPlugIn; //
\82±
\82Ì
\94Â
\82ð
\83T
\83|
\81[
\83g
\82·
\82é
\83v
\83\89\83O
\83C
\83\93
328 procedure Clear ; override;
329 property BoardPlugIn : TBoardPlugIn read FBoardPlugIn write FBoardPlugIn;
333 function BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard;
334 function BBSsFindBoardFromURL( inURL : string ) : TBoard;
335 function BBSsFindBoardFromTitle( inTitle : string ) : TBoard;
336 function BBSsFindThreadFromURL(const inURL : string ) : TThreadItem;
337 function ConvertDateTimeString( inDateTimeString : string) : TDateTime;
340 BBSs : array of TBBS;
341 BoardGroups : array of TBoardGroup;
346 GikoSystem, RoundData, MojuUtils;
349 BBS2CH_NAME: string = '
\82Q
\82¿
\82á
\82ñ
\82Ë
\82é';
350 BBS2CH_LOG_FOLDER: string = '2ch';
351 EXTERNAL_LOG_FOLDER: string = 'exboard';
353 FOLDER_INI_FILENAME: string = 'Folder.ini';
354 FOLDER_INDEX_FILENAME: string = 'Folder.idx';
355 SUBJECT_FILENAME: string = 'subject.txt';
356 PATH_DELIM: string = '\';
357 SETTINGTXT_FILENAME: string = 'SETTING.TXT';
358 HEADTXT_FILENAME: string = 'head.html';
359 //DEFAULT_LIST_COUNT: Integer = 100;
361 // COLUMN_CATEGORY: array[0..0] of string = ('
\83J
\83e
\83S
\83\8a\96¼');
362 // 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');
363 // 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');
365 // BBSID
\82ð
\97p
\82¢
\82é 2
\82¿
\82á
\82ñ
\82Ë
\82é
\82Ì
\82Ý
\92T
\82µ
\8fo
\82µ
\82Ü
\82·
366 // BBSID
\82Ì
\8eg
\97p
\82Í
\8bÉ
\97Í
\94ð
\82¯
\82Ä
\82
\82¾
\82³
\82¢
\81B
367 //
\89Â
\94\
\82È
\8fê
\8d\87\82Í URL
\82ð
\8eg
\97p
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B
368 function BBSsFindBoardFromBBSID(
376 // Result := BBSs[ 0 ].FindBBSID( inBBSID );
378 if Length(BoardGroups) > 0 then begin
379 for i := BoardGroups[0].Count - 1 downto 0 do begin
380 tmpBoard := TBoard(BoardGroups[0].Objects[i]);
381 if tmpBoard.Is2ch then begin
382 if AnsiCompareStr(tmpBoard.BBSID, inBBSID) = 0 then begin
391 {**********************************************
392 \82±
\82Ì
\8aÖ
\90\94\82Í
\95K
\82¸
\94Â
\82ÌURL
\82Ì
\8c`
\8e®
\82Å
\93n
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B
393 plugin
\82ð
\8eg
\97p
\82·
\82é
\82È
\82ç
\82Î
\81AExtractBoardURL( inURL )
394 2ch
\82È
\82ç
\82Î
\81AGikoSys.Get2chThreadURL2BoardURL( inURL );
395 \82Å
\95Ï
\8a·
\82µ
\82Ä
\82©
\82ç
\8cÄ
\82Ñ
\8fo
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81B
396 **********************************************}
397 function BBSsFindBoardFromURL(
402 accept : TAcceptType;
403 protocol, host, path, document, port, bookmark : string;
406 for i := Length(BoardGroups) - 1 downto 1 do begin
407 accept := BoardGroups[i].BoardPlugIn.AcceptURL(inURL);
408 if (accept = atBoard) or (accept = atThread) then begin
409 if BoardGroups[i].Find(inURL, p) then begin
410 Result := TBoard(BoardGroups[i].Objects[p]);
413 inURL := BoardGroups[i].BoardPlugIn.ExtractBoardURL(inURL);
414 if BoardGroups[i].Find(inURL, p) then begin
415 Result := TBoard(BoardGroups[i].Objects[p]);
421 //
\82±
\82±
\82É
\82«
\82½
\82ç
\81Aplugin
\82ð
\8eg
\82í
\82È
\82¢
\82â
\82Â
\82ç
\82ð
\92²
\82×
\82é
422 if BoardGroups[0].Find(inURL, p) then
423 Result := TBoard(BoardGroups[0].Objects[p]);
425 if (Result = nil) then begin
426 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
427 //
\83z
\83X
\83g
\82ª2ch
\82È
\82çBBSID
\82Å
\92²
\82×
\82é
428 if GikoSys.Is2chHost(host) then begin
429 Result := BBSsFindBoardFromBBSID(GikoSys.URLToID( inURL ));
435 function BBSsFindBoardFromTitle(
443 for i := Length( BBSs ) - 1 downto 0 do begin
444 for j := BoardGroups[i].Count - 1 downto 0 do begin
445 tmpBoard := TBoard(BoardGroups[i].Objects[j]);
446 if ( AnsiCompareStr(tmpBoard.Title, inTitle) = 0) then begin
455 function BBSsFindThreadFromURL(
461 protocol, host, path, document, port, bookmark : string;
462 BBSID, BBSKey : string;
466 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
467 board := BBSsFindBoardFromURL( boardURL );
471 Result := board.FindThreadFromURL( inURL );
472 //
\82à
\82µ
\82à2ch
\82Ì
\94Â
\82È
\82ç
473 if (Result = nil) and (board.Is2ch) then begin
474 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
475 GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
476 Result := board.FindThreadFromFileName(BBSKey + '.dat');
482 (*************************************************************************
483 *
\8b@
\94\
\96¼
\81FTBBS
\83R
\83\93\83X
\83g
\83\89\83N
\83^
485 *************************************************************************)
486 constructor TBBS.Create( boardFilePath : string );
489 Title := BBS2CH_NAME;
490 FFilePath := boardFilePath;
493 (*************************************************************************
494 *
\8b@
\94\
\96¼
\81FTBBS
\83f
\83X
\83g
\83\89\83N
\83^
496 *************************************************************************)
497 destructor TBBS.Destroy;
503 (*************************************************************************
506 *************************************************************************)
507 function TBBS.GetCategory(index: integer): TCategory;
509 Result := TCategory(inherited Items[index]);
512 procedure TBBS.SetCategory(index: integer; value: TCategory);
514 inherited Items[index] := value;
517 function TBBS.Add(item: TCategory): integer;
519 Item.ParenTBBS := self;
520 Result := inherited Add(item);
523 procedure TBBS.Delete(index: integer);
525 if Items[index] <> nil then
526 TCategory(Items[index]).Free;
528 inherited Delete(index);
531 procedure TBBS.Clear;
535 for i := Count - 1 downto 0 do
540 function TBBS.Find(key: string): TCategory;
545 function TBBS.FindBBSID(const BBSID: string): TBoard;
549 if not IsBoardFileRead then
550 GikoSys.ReadBoardFile( Self );
551 for i := Count - 1 downto 0 do begin
552 Result := Items[ i ].FindBBSID(BBSID);
553 if Result <> nil then
559 //*************************************************************************
560 //
\83^
\83C
\83g
\83\8b\82Ì
\88ê
\92v
\82·
\82é
\94Â
\82ð
\92T
\82·
561 //*************************************************************************)
562 function TBBS.FindBoardFromTitle(const Title: string): TBoard;
566 if not IsBoardFileRead then
567 GikoSys.ReadBoardFile( Self );
568 for i := Count - 1 downto 0 do begin
569 Result := Items[ i ].FindBoardFromTitle(Title);
570 if Result <> nil then
576 //*************************************************************************
577 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\94Â
\82ð
\92T
\82·
578 //*************************************************************************)
579 function TBBS.FindBoardFromURL(const inURL: string): TBoard;
583 if not IsBoardFileRead then
584 GikoSys.ReadBoardFile( Self );
585 for i := Count - 1 downto 0 do begin
586 Result := Items[ i ].FindBoardFromURL( inURL );
587 if Result <> nil then
593 //*************************************************************************
594 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\83X
\83\8c\83b
\83h
\82ð
\92T
\82·
595 //*************************************************************************)
596 function TBBS.FindThreadFromURL(const inURL: string): TThreadItem;
602 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
603 board := FindBoardFromURL( boardURL );
607 Result := board.FindThreadFromURL( inURL );
611 function TBBS.FindThreadItem(const BBSID, FileName: string): TThreadItem;
616 Board := FindBBSID(BBSID);
619 Result := Board.FindThreadFromFileName(FileName);
622 function TBBS.FindCategoryFromTitle(const inTitle : string ) : TCategory;
627 for i := Count - 1 downto 0 do begin
628 if AnsiCompareStr(Items[ i ].Title, inTitle) = 0 then begin
629 Result := Items[ i ];
638 procedure TBBS.SetSelectText(s: string);
641 ShortSelectText := CustomStringReplace(ZenToHan(s), ' ', '');
644 {class function TBBS.GetColumnName(Index: Integer): string;
646 Result := COLUMN_CATEGORY[Index];
649 class function TBBS.GetColumnCount: Integer;
651 Result := Length(COLUMN_CATEGORY);
654 //===================
656 //===================
657 constructor TCategory.Create;
661 Duplicates := dupIgnore;
662 CaseSensitive := False;
666 destructor TCategory.Destroy;
672 function TCategory.GetBoard(index: integer): TBoard;
674 Result := TBoard( Objects[index] );
677 procedure TCategory.SetBoard(index: integer; value: TBoard);
679 Objects[index] := value;
680 Strings[index] := value.URL
683 function TCategory.Add(item: TBoard): integer;
685 Item.ParentCategory := self;
686 Result := AddObject( item.URL, item );
689 procedure TCategory.Delete(index: integer);
691 {if (Items[index] <> nil) then begin
693 if TBoard(Items[index]).Multiplicity = 0 then
694 TBoard(Items[index]).Free
696 TBoard(Items[index]).Multiplicity := TBoard(Items[index]).Multiplicity - 1;
701 inherited Delete(index);
704 procedure TCategory.Clear;
708 for i := Count - 1 downto 0 do
713 function TCategory.FindName(const key: string): TBoard;
718 function TCategory.FindBBSID(const BBSID: string): TBoard;
722 for i := Count - 1 downto 0 do begin
723 if AnsiCompareStr(Items[i].FBBSID, BBSID) = 0 then begin
731 //*************************************************************************
732 //
\83^
\83C
\83g
\83\8b\82Ì
\88ê
\92v
\82·
\82é
\94Â
\82ð
\92T
\82·
733 //*************************************************************************)
734 function TCategory.FindBoardFromTitle(const Title: string): TBoard;
738 for i := Count - 1 downto 0 do begin
739 if AnsiCompareStr(Items[i].FTitle, Title) = 0 then begin
747 //*************************************************************************
748 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\94Â
\82ð
\92T
\82·
749 //*************************************************************************)
750 function TCategory.FindBoardFromURL(const inURL: string): TBoard;
754 i := IndexOf( inURL );
756 Result := TBoard( Objects[ i ] )
761 //*************************************************************************
762 // URL
\82ð
\8eó
\82¯
\95t
\82¯
\82é
\83X
\83\8c\83b
\83h
\82ð
\92T
\82·
763 //*************************************************************************)
764 function TCategory.FindThreadFromURL(const inURL: string): TThreadItem;
770 boardURL := GikoSys.GetThreadURL2BoardURL( inURL );
771 board := FindBoardFromURL( boardURL );
775 Result := board.FindThreadFromURL( inURL );
779 function TCategory.IsMidoku: Boolean;
785 for i := 0 to Count - 1 do begin
786 if Items[i] <> nil then begin
787 for j := 0 to Items[i].Count - 1 do begin
788 if Items[i].Items[j] <> nil then begin
789 // if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].Count > Items[i].Items[j].Kokomade) then begin
790 if (Items[i].Items[j].IsLogFile) and (Items[i].Items[j].UnRead) then begin
800 {class function TCategory.GetColumnName(Index: Integer): string;
802 Result := COLUMN_BOARD[Index];
805 class function TCategory.GetColumnCount: Integer;
807 Result := Length(COLUMN_BOARD);
810 //===================
812 //===================
813 procedure TBoard.Init;
815 Duplicates := dupIgnore;
816 CaseSensitive := False;
824 FRoundDate := ZERO_DATE;
825 FLastModified := ZERO_DATE;
826 FLastGetTime := ZERO_DATE;
827 FIsThreadDatRead := False;
829 // FListStyle := vsReport;
830 // FItemNoVisible := True;
835 // *************************************************************************
836 //
\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^
837 // *************************************************************************
838 constructor TBoard.Create(
839 inPlugIn : TBoardPlugIn;
843 protocol, host, path, document, port, bookmark : string;
849 FBoardPlugIn := inPlugIn;
851 BBSID := GikoSys.UrlToID( inURL );
853 if inPlugIn = nil then begin
854 // subject.txt
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
855 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
856 if GikoSys.Is2chHost( host ) then begin
859 GikoSys.Setting.LogFolderP +
860 BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
864 GikoSys.Setting.LogFolderP +
865 EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
868 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
869 inPlugIn.CreateBoardItem( DWORD( Self ) );
870 //Self.Is2ch := False; //plugin
\91¤
\82Å
\90Ý
\92è
\82·
\82é
875 // *************************************************************************
876 //
\83f
\83X
\83g
\83\89\83N
\83^
877 // *************************************************************************
878 destructor TBoard.Destroy;
880 if FModified then begin
881 GikoSys.WriteThreadDat(Self);
885 //
\83v
\83\89\83O
\83C
\83\93\82É TBoardItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
886 if IsBoardPlugInAvailable then
887 BoardPlugIn.DisposeBoardItem( DWORD( Self ) );
893 // *************************************************************************
894 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
895 // *************************************************************************
896 function TBoard.IsBoardPlugInAvailable : Boolean;
900 if BoardPlugIn = nil then
903 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
914 function TBoard.GetThreadItem(index: integer): TThreadItem;
916 Result := TThreadItem( Objects[index] );
919 procedure TBoard.SetThreadItem(index: integer; value: TThreadItem);
921 Objects[index] := value;
922 Strings[index] := value.URL;
925 function TBoard.Add(Item: TThreadItem): Integer;
927 Item.ParentBoard := Self;
928 Result := inherited AddObject(Item.URL, Item);
931 procedure TBoard.Insert(Index: Integer; Item: TThreadItem);
933 Item.ParentBoard := Self;
934 inherited InsertObject(Index, Item.URL, Item);
938 //Index
\82Å
\8ew
\92è
\82³
\82ê
\82½
\83X
\83\8c\83b
\83h
\83I
\83u
\83W
\83F
\83N
\83g
\82ð
\94j
\8aü
939 procedure TBoard.Delete(index: Integer);
941 if Items[index] <> nil then
942 TThreadItem(Items[index]).Free;
943 inherited Delete(index);
946 //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
947 procedure TBoard.DeleteList(index: integer);
949 inherited Delete(index);
952 procedure TBoard.Clear;
957 for i := Count - 1 downto 0 do
962 function TBoard.FindThreadFromFileName(const ItemFileName: string): TThreadItem;
967 for i := 0 to Count - 1 do begin
968 if AnsiCompareStr(Items[i].FileName, ItemFileName) = 0 then begin
975 function TBoard.GetIndexFromFileName(const ItemFileName: string): Integer;
980 for i := 0 to Count - 1 do begin
981 if Items[i].FileName = ItemFileName then begin
988 function TBoard.GetIndexFromURL(const URL: string; reverse : Boolean = False): Integer;
993 Result := IndexOf( URL )
996 for i := Self.Count - 1 downto 0 do begin
997 if Strings[i] = URL then begin
1005 function TBoard.FindThreadFromURL(const inURL : string ) : TThreadItem;
1010 if not IsThreadDatRead then
1011 GikoSys.ReadSubjectFile( Self );
1013 i := IndexOf( inURL );
1015 Result := TThreadItem( Objects[ i ] )
1021 {function TBoard.GetMidokuCount: Integer;
1026 for i := 0 to Count- 1 do begin
1027 if Items[i] <> nil then begin
1028 if (Items[i].IsLogFile) and (Items[i].Count > Items[i].Kokomade) then
1035 procedure TBoard.LoadSettings;
1041 if Length( FilePath ) > 0 then
1042 FileName := ExtractFilePath( FilePath ) + FOLDER_INI_FILENAME
1044 FileName := GikoSys.Setting.LogFolderP
1045 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + FOLDER_INI_FILENAME;
1047 if not FileExists(FileName) then
1049 ini := TMemIniFile.Create(FileName);
1051 // Round := ini.ReadBool('Status', 'Round', False);
1052 tmp := ini.ReadString('Status', 'RoundDate', DateTimeToStr(ZERO_DATE));
1053 FRoundDate := ConvertDateTimeString(tmp);
1054 tmp := ini.ReadString('Status', 'LastModified', DateTimeToStr(ZERO_DATE));
1055 FLastModified := ConvertDateTimeString(tmp);
1056 tmp := ini.ReadString('Status', 'LastGetTime', DateTimeToStr(ZERO_DATE));
1057 FLastGetTime := ConvertDateTimeString(tmp);
1059 tmp := ini.ReadString('BoardInformation', 'SETTINGTXTTime', DateTimeToStr(ZERO_DATE));
1060 FSETTINGTXTTime := ConvertDateTimeString(tmp);
1061 tmp := ini.ReadString('BoardInformation', 'HEADTXTTime', DateTimeToStr(ZERO_DATE));
1062 FHEADTXTTime := ConvertDateTimeString(tmp);
1064 FIsSETTINGTXT := ini.ReadBool('BoardInformation', 'IsSETTINGTXT', false);
1065 FIsHEADTXT := ini.ReadBool('BoardInformation', 'IsHEADTXT', false);
1066 FTitlePictureURL := ini.ReadString('BoardInformation', 'TitlePictureURL', '');
1068 FUnRead := ini.ReadInteger('Status', 'UnRead', 0);
1069 FSPID := ini.ReadString('Cookie', 'SPID', '');
1070 FPON := ini.ReadString('Cookie', 'PON', '');
1071 FCookie := ini.ReadString('Cookie', 'Cookie', '');
1072 tmp := ini.ReadString('Cookie', 'Expires', DateTimeToStr(ZERO_DATE));
1073 FExpires := ConvertDateTimeString(tmp);
1074 FKotehanName := ini.ReadString('Kotehan', 'Name', '');
1075 FKotehanMail := ini.ReadString('Kotehan', 'Mail', '');
1084 procedure TBoard.SaveSettings;
1089 if Length( FilePath ) > 0 then
1090 FileName := ExtractFilePath( FilePath )
1092 FileName := GikoSys.Setting.LogFolderP
1093 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM;
1094 if not GikoSys.DirectoryExistsEx(FileName) then
1095 GikoSys.ForceDirectoriesEx(FileName);
1096 FileName := FileName + FOLDER_INI_FILENAME;
1097 ini := TMemIniFile.Create(FileName);
1101 // ini.WriteBool('Status', 'Round', Round);
1102 ini.WriteDateTime('Status', 'RoundDate', FRoundDate);
1103 ini.WriteDateTime('Status', 'LastModified', FLastModified);
1104 ini.WriteDateTime('Status', 'LastGetTime', FLastGetTime);
1105 ini.WriteInteger('Status', 'UnRead', FUnRead);
1106 ini.WriteString('Cookie', 'SPID', FSPID);
1107 ini.WriteString('Cookie', 'PON', FPON);
1108 ini.WriteString('Cookie', 'Cookie', FCookie);
1109 ini.WriteDateTime('Cookie', 'Expires', FExpires);
1110 ini.WriteString('Kotehan', 'Name', FKotehanName);
1111 ini.WriteString('Kotehan', 'Mail', FKotehanMail);
1113 ini.WriteDateTime('BoardInformation', 'SETTINGTXTTime', FSETTINGTXTTime);
1114 ini.WriteDateTime('BoardInformation', 'HEADTXTTime', FHEADTXTTime);
1116 ini.WriteBool('BoardInformation', 'IsSETTINGTXT', FIsSETTINGTXT);
1117 ini.WriteBool('BoardInformation', 'IsHEADTXT', FIsHEADTXT);
1118 ini.WriteString('BoardInformation', 'TitlePictureURL', FTitlePictureURL);
1119 // ini.WriteInteger('Status', 'ListStyle', Ord(ListStyle));
1120 // ini.WriteBool('Status', 'ItemNoVisible', ItemNoVisible);
1121 // ini.WriteInteger('Status', 'ViewType', Ord(ViewType));
1127 //
\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ð
1128 // 2003/02/08 0:32:13
\82É
\95Ï
\8a·
\82·
\82é
1129 function ConvertDateTimeString( inDateTimeString : string) : TDateTime;
1131 ZERO_DATE_STRING : string = '1970/01/01 0:00:00';
1141 if inDateTimeString = '' then
1142 inDateTimeString := ZERO_DATE_STRING;
1144 if ( AnsiPos('/', inDateTimeString ) = 0 ) and
1145 ( AnsiCompareStr( DateTimeToStr(ZERO_DATE), inDateTimeString) <> 0 ) then begin
1146 for i := 0 to 1 do begin
1147 Insert('/',inDateTimeString, AnsiPos(' ', inDateTimeString) + 1 );
1148 Delete(inDateTimeString, AnsiPos(' ', inDateTimeString), 1);
1152 Result := StrToDateTime( inDateTimeString );
1154 if( inDateTimeString[5] = '/' ) and ( inDateTimeString[8] = '/' ) then begin
1155 y := StrToIntDef( Copy(inDateTimeString, 1, 4), 1970 );
1156 m := StrToIntDef( Copy(inDateTimeString, 6, 2), 1 );
1157 d := StrToIntDef( Copy(inDateTimeString, 9, 2), 1 );
1158 hour := 0; min := 0; sec := 0;
1160 if Length(inDateTimeString) > 11 then begin
1161 if( inDateTimeString[13] = ':' ) and ( inDateTimeString[16] = ':' ) then begin
1162 hour := StrToIntDef( Copy(inDateTimeString, 12, 1), 0 );
1163 min := StrToIntDef( Copy(inDateTimeString, 14, 2), 0 );
1164 sec := StrToIntDef( Copy(inDateTimeString, 17, 2), 0 );
1165 end else if( inDateTimeString[14] = ':' ) and ( inDateTimeString[17] = ':' ) then begin
1166 hour := StrToIntDef( Copy(inDateTimeString, 12, 2), 0 );
1167 min := StrToIntDef( Copy(inDateTimeString, 15, 2), 0 );
1168 sec := StrToIntDef( Copy(inDateTimeString, 18, 2), 0 );
1172 Result := EncodeDateTime(y ,m, d, hour, min, sec, 0);
1174 Result := ZERO_DATE;
1177 Result := ZERO_DATE;
1181 // Result := inDateTimeString;
1183 //
\83T
\83u
\83W
\83F
\83N
\83gURL
\8eæ
\93¾
1184 function TBoard.GetReadCgiURL: string;
1186 //Result := URL + SUBJECT_FILENAME;
1187 //Result := GikoSys.UrlToServer(URL)
1188 // + 'test/read.cgi/' + BBSID + '/?raw=0.0';
1189 Result := URL + SUBJECT_FILENAME;
1193 //
\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
1194 function TBoard.GetSubjectFileName: string;
1196 if Length( FilePath ) > 0 then
1199 Result := GikoSys.Setting.LogFolderP
1200 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME;
1203 //
\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
1204 function TBoard.GetFolderIndexFileName: string;
1206 if Length( FilePath ) > 0 then
1207 Result := ExtractFilePath( FilePath ) + FOLDER_INDEX_FILENAME
1209 Result := GikoSys.Setting.LogFolderP
1210 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME;
1212 //SETTING.TXT
\82Ì
\83t
\83@
\83C
\83\8b\96¼
\8eæ
\93¾
1213 function TBoard.GetSETTINGTXTFileName: string;
1215 if Length( FilePath ) > 0 then
1216 Result := ExtractFilePath( FilePath ) + SETTINGTXT_FILENAME
1218 Result := GikoSys.Setting.LogFolderP
1219 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SETTINGTXT_FILENAME;
1222 function TBoard.GETHEADTXTFileName: string;
1224 if Length( FilePath ) > 0 then
1225 Result := ExtractFilePath( FilePath ) + HEADTXT_FILENAME
1227 Result := GikoSys.Setting.LogFolderP
1228 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + HEADTXT_FILENAME;
1230 function TBoard.GetTitlePictureFileName: string;
1234 if FTitlePictureURL = '' then
1237 tmpName := Copy(FTitlePictureURL, LastDelimiter('/', FTitlePictureURL) + 1, Length(FTitlePictureURL));
1238 if Length( FilePath ) > 0 then
1239 Result := ExtractFilePath( FilePath ) + tmpName
1241 Result := GikoSys.Setting.LogFolderP
1242 + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + tmpName;
1246 //
\83X
\83\8c\97§
\82Ä
\91\97\90MURL
1247 function TBoard.GetSendURL: string;
1249 // Protocol, Host, Path, Document, Port, Bookmark : string;
1251 Result := GikoSys.UrlToServer(URL);
1252 //GikoSys.ParseURI( URL, Protocol,Host, Path, Document, Port, Bookmark );
1253 //if GikoSys.Is2chHost(Host) then
1255 Result := Result + 'test/bbs.cgi'
1257 Result := Result + 'test/subbbs.cgi';
1261 procedure TBoard.SetRound(b: Boolean);
1266 RoundList.Delete(Self);
1267 if FRound = b then Exit;
1273 procedure TBoard.SetRoundName(s: string);
1275 if FRoundName = s then Exit;
1281 procedure TBoard.SetRoundName(s: PChar);
1283 if FRoundName = s then Exit;
1289 procedure TBoard.SetLastModified(d: TDateTime);
1291 if FLastModified = d then Exit;
1297 procedure TBoard.SetLastGetTime(d: TDateTime);
1299 if FLastGetTime = d then Exit;
1305 procedure TBoard.SetUnRead(i: Integer);
1307 if FUnRead = i then Exit;
1308 if i < 0 then i := 0;
1314 procedure TBoard.SetKotehanName(s: string);
1316 if FKotehanName = s then Exit;
1322 procedure TBoard.SetKotehanMail(s: string);
1324 if FKotehanMail = s then Exit;
1330 function TBoard.GetNewThreadCount: Integer;
1335 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1337 for i := 0 to Count - 1 do begin
1338 if Items[i].NewArrival then
1342 for i := 0 to Count - 1 do begin
1343 if Items[i].NewArrival then
1345 if Items[i].ShortTitle = '' then
1346 Items[i].ShortTitle := CustomStringReplace(ZenToHan(Items[i].Title), ' ', '');
1347 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1354 function TBoard.GetLogThreadCount: Integer;
1359 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1361 for i := 0 to Count - 1 do begin
1362 if Items[i].IsLogFile then
1366 for i := 0 to Count - 1 do begin
1367 if Items[i].IsLogFile then
1369 if Items[i].ShortTitle = '' then
1370 Items[i].ShortTitle := CustomStringReplace(ZenToHan(Items[i].Title), ' ', '');
1371 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1378 function TBoard.GetUserThreadCount: Integer;
1383 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1386 for i := 0 to Count - 1 do begin
1387 if Items[i].ShortTitle = '' then
1388 Items[i].ShortTitle := CustomStringReplace(ZenToHan(Items[i].Title), ' ', '');
1389 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then
1394 function TBoard.GetNewThread(Index: Integer): TThreadItem;
1401 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1403 for i := 0 to Count - 1 do begin
1404 if Items[i].NewArrival then
1406 if Index = Cnt then begin
1414 for i := 0 to Count - 1 do begin
1415 if Items[i].NewArrival then
1417 if Items[i].ShortTitle = '' then
1418 Items[i].ShortTitle := CustomStringReplace(ZenToHan(Items[i].Title), ' ', '');
1419 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1420 if Index = Cnt then begin
1431 function TBoard.GetLogThread(Index: Integer): TThreadItem;
1437 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1439 for i := 0 to Count - 1 do begin
1440 if Items[i].IsLogFile then
1442 if Index = Cnt then begin
1450 for i := 0 to Count - 1 do begin
1451 if Items[i].IsLogFile then
1453 if Items[i].ShortTitle = '' then
1454 Items[i].ShortTitle := ZenToHan(Items[i].Title);
1455 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1456 if Index = Cnt then begin
1467 function TBoard.GetLogThread(Index: Integer; Base: Integer): TThreadItem;
1473 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1475 for i := Base to Count - 1 do begin
1476 if Items[i].IsLogFile then
1478 if Index = Cnt then begin
1486 for i := Base to Count - 1 do begin
1487 if Items[i].IsLogFile then
1489 if Items[i].ShortTitle = '' then
1490 Items[i].ShortTitle := ZenToHan(Items[i].Title);
1491 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1492 if Index = Cnt then begin
1503 function TBoard.GetUserThread(Index: Integer): TThreadItem;
1510 if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then
1512 for i := 0 to Count - 1 do begin
1515 Result := Items[ i ];
1521 for i := 0 to Count - 1 do begin
1522 if Items[i].ShortTitle = '' then
1523 Items[i].ShortTitle := CustomStringReplace(ZenToHan(Items[i].Title), ' ', '');
1524 if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin
1525 if Index = Cnt then begin
1535 procedure TBoard.BeginUpdate;
1540 procedure TBoard.EndUpdate;
1545 {class function TBoard.GetColumnName(Index: Integer): string;
1547 Result := COLUMN_THREADITEM[Index];
1550 class function TBoard.GetColumnCount: Integer;
1552 Result := Length(COLUMN_THREADITEM);
1555 //constructor TThreadItem.Create(AOwner: TComponent);
1556 procedure TThreadItem.Init;
1561 FRoundDate := ZERO_DATE;
1562 FLastModified := ZERO_DATE;
1568 FIsLogFile := False;
1569 FParentBoard := nil;
1572 FNewArrival := False;
1576 //FBoardPlugIn := nil;
1579 // *************************************************************************
1580 //
\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^
1581 // *************************************************************************
1582 constructor TThreadItem.Create(
1583 const inPlugIn : TBoardPlugIn;
1584 const inBoard : TBoard;
1589 protocol, host, path, document, port, bookmark : string;
1590 BBSID, BBSKey : string;
1592 READ_PATH = '/test/read.cgi';
1597 FParentBoard := inBoard;
1598 //FBoardPlugIn := inPlugIn;
1601 if inPlugIn = nil then begin
1602 foundPos := Pos( READ_PATH, inURL );
1603 if foundPos > 0 then begin
1604 // dat
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
1605 GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
1606 GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
1607 FileName := BBSKey + '.dat';
1608 IsLogFile := FileExists( FilePath );
1609 URL := GikoSys.Get2chBrowsableThreadURL( inURL );
1612 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1613 inPlugIn.CreateThreadItem( DWORD( Self ) );
1617 // *************************************************************************
1618 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ð
\8ew
\92è
\82µ
\82½
\83R
\83\93\83X
\83g
\83\89\83N
\83^ Log
\97L
\82è
\82©
\82Ç
\82¤
\82©
\94»
\92f
\8dÏ
\82Ý
1619 // FileName
\82à
\8eæ
\93¾
\8dÏ
\82Ý
\81@
\81¨
\81@ReadSubject
\97p
1620 // *************************************************************************
1621 constructor TThreadItem.Create(
1622 const inPlugIn : TBoardPlugIn;
1623 const inBoard : TBoard;
1626 const inFilename: string
1632 FParentBoard := inBoard;
1635 if inPlugIn = nil then begin
1636 // dat
\82Ì
\95Û
\91¶
\83p
\83X
\82ð
\90Ý
\92è
1637 FileName := inFilename;
1638 IsLogFile := inExist;
1639 URL := GikoSys.Get2chBrowsableThreadURL( inURL );
1641 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\8dì
\90¬
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1642 inPlugIn.CreateThreadItem( DWORD( Self ) );
1646 // *************************************************************************
1647 //
\83f
\83X
\83g
\83\89\83N
\83^
1648 // *************************************************************************
1649 destructor TThreadItem.Destroy;
1652 //
\83v
\83\89\83O
\83C
\83\93\82É TThreadItem
\82ª
\94j
\8aü
\82³
\82ê
\82½
\82±
\82Æ
\82ð
\93`
\82¦
\82é
1653 if Self.ParentBoard.IsBoardPlugInAvailable then
1654 Self.ParentBoard.BoardPlugIn.DisposeThreadItem( DWORD( Self ) );
1660 // *************************************************************************
1661 //
\8aO
\95\94\94Â
\83v
\83\89\83O
\83C
\83\93\82ª
\8eg
\97p
\89Â
\94\
\82©
1662 // *************************************************************************
1664 function TThreadItem.IsBoardPlugInAvailable : Boolean;
1668 if BoardPlugIn = nil then
1671 if not Assigned( Pointer( BoardPlugIn.Module ) ) then
1682 function TThreadItem.GetDatURL: string;
1684 Protocol, Host, Path, Document, Port, Bookmark: string;
1686 Result := ParentBoard.URL
1689 if FDownloadHost <> '' then begin
1690 GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1691 Result := Format('%s://%s%s%s', [Protocol,
1696 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1697 // + 'test/read.cgi/' + ParentBoard.BBSID + '/'
1698 // + ChangeFileExt(FileName, '') + '/?raw='
1699 // + IntToStr(ResNum) + '.' + IntToStr(ResSize);
1702 function TThreadItem.GetDatgzURL: string;
1703 function isOldKako(s: string): Boolean;
1706 if AnsiPos('piza.', s) <> 0 then
1708 else if AnsiPos('www.bbspink.', s) <> 0 then
1710 else if AnsiPos('tako.', s) <> 0 then
1714 Protocol, Host, Path, Document, Port, Bookmark: string;
1717 if FDownloadHost = '' then begin
1718 DatNo := ChangeFileExt(FileName, '');
1719 if isOldKako(ParentBoard.URL) then begin
1720 Result := Format('%s%s/%.3s/%s.dat', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1722 if Length(DatNo) > 9 then begin
1723 //http://xxx.2ch.net/xxx/kako/9999/99999/999999999.dat.gz
1724 Result := Format('%s%s/%.4s/%.5s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo, DatNo]);
1726 //http://xxx.2ch.net/xxx/kako/999/999999999.dat.gz
1727 Result := Format('%s%s/%.3s/%s.dat.gz', [ParentBoard.URL, 'kako', DatNo, DatNo]);
1731 Gikosys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1732 DatNo := ChangeFileExt(Document, '');
1733 if isOldKako(DownloadHost) then begin
1734 Result := Format('%s://%s/%s/kako/%.3s/%s.dat', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1736 if Length(DatNo) > 9 then begin
1737 Result := Format('%s://%s/%s/kako/%.4s/%.5s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo, DatNo]);
1739 Result := Format('%s://%s/%s/kako/%.3s/%s.dat.gz', [Protocol, DownloadHost, ParentBoard.FBBSID, DatNo, DatNo]);
1745 {function TThreadItem.GetOldDatgzURL: string;
1747 Protocol, Host, Path, Document, Port, Bookmark: string;
1749 Result := Format('%s%s/%.3s/%s.gz', [ParentBoard.URL,
1753 if FDownloadHost <> '' then begin
1754 ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1755 Result := Format('%s://%s%s%s', [Protocol,
1763 function TThreadItem.GetOfflawCgiURL(const SessionID: string): string;
1765 // Protocol, Host, Path, Document, Port, Bookmark: string;
1767 // Result := GikoSys.UrlToServer(ParentBoard.URL)
1768 // + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1769 // + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1770 if FDownloadHost = '' then begin
1771 Result := GikoSys.UrlToServer(ParentBoard.URL)
1772 + 'test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1773 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1775 //http://news.2ch.net/test/offlaw.cgi/newsplus/1014038577/?raw=.196928&sid=
1776 //GikoSys.ParseURI(Result, Protocol, Host, Path, Document, Port, Bookmark);
1777 Result := 'http://' + FDownloadHost
1778 + '/test/offlaw.cgi/' + ParentBoard.BBSID + '/'
1779 + ChangeFileExt(FileName, '') + '/?raw=.0&sid=' + HttpEncode(SessionID);
1780 // Result := Format('%s://%s%s%s', [Protocol,
1787 function TThreadItem.GetSendURL: string;
1789 Result := GikoSys.UrlToServer(ParentBoard.URL)
1793 procedure TThreadItem.DeleteLogFile;
1795 ParentBoard.BeginUpdate;
1798 ParentBoard.UnRead := ParentBoard.UnRead - 1;
1799 DeleteFile(GetThreadFileName);
1800 if FileExists(ChangeFileExt(GetThreadFileName,'.NG')) = true then
1801 DeleteFile(ChangeFileExt(GetThreadFileName,'.NG'));
1802 FRoundDate := ZERO_DATE;
1803 FLastModified := ZERO_DATE;
1805 FIsLogFile := False;
1808 FNewArrival := False;
1812 FDownloadHost := '';
1813 FAgeSage := gasNone;
1819 ParentBoard.EndUpdate;
1820 ParentBoard.Modified := True;
1823 function TThreadItem.GetThreadFileName: string;
1825 if Length( FilePath ) > 0 then
1828 Result := GikoSys.Setting.LogFolderP
1829 + BBS2CH_LOG_FOLDER + PATH_DELIM + ParentBoard.BBSID + PATH_DELIM + FileName;
1832 procedure TThreadItem.SetLastModified(d: TDateTime);
1834 if FLastModified = d then Exit;
1836 if FUpdate and (ParentBoard <> nil) then
1837 ParentBoard.FModified := True;
1840 {procedure TThreadItem.SetRoundNo(i: Integer);
1842 if FRoundNo = i then Exit;
1844 if FUpdate and (ParentBoard <> nil) then
1845 ParentBoard.FModified := True;
1848 procedure TThreadItem.SetRound(b: Boolean);
1853 RoundList.Delete(Self);
1854 if FRound = b then Exit;
1856 if FUpdate and (ParentBoard <> nil) then
1857 ParentBoard.FModified := True;
1860 procedure TThreadItem.SetRoundName(const s: string);
1862 if FRoundName = s then Exit;
1864 if FUpdate and (ParentBoard <> nil) then
1865 ParentBoard.FModified := True;
1868 procedure TThreadItem.SetRoundName(const s: PChar);
1870 if FRoundName = s then Exit;
1872 if FUpdate and (ParentBoard <> nil) then
1873 ParentBoard.FModified := True;
1876 procedure TThreadItem.SetKokomade(i: Integer);
1878 if FKokomade = i then Exit;
1880 if FUpdate and (ParentBoard <> nil) then
1881 ParentBoard.FModified := True;
1884 procedure TThreadItem.SetUnRead(b: Boolean);
1886 if FUnRead = b then Exit;
1888 if FUpdate and (ParentBoard <> nil) then
1889 ParentBoard.FModified := True;
1892 procedure TThreadItem.SetScrollTop(i: Integer);
1894 if FScrollTop = i then Exit;
1896 if FUpdate and (ParentBoard <> nil) then
1897 ParentBoard.FModified := True;
1900 procedure TThreadItem.BeginUpdate;
1905 procedure TThreadItem.EndUpdate;
1911 BBS2ch := TBBS.Create;
1914 if BBS2ch <> nil then
1916 function TThreadItem.GetCreateDate: TDateTime;
1921 //
\83t
\83@
\83C
\83\8b\96¼
\82©
\82ç
\83X
\83\8c\8dì
\90¬
\93ú
\8e\9e\82ð
\8b\81\82ß
\82é
1923 if ( GikoSys.Setting.CreationTimeLogs ) and not IsLogFile then
1926 //
\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
1927 tmp := ChangeFileExt(FFileName, '');
1928 if AnsiPos('_', tmp) <> 0 then
1929 if AnsiPos('_', tmp) > 9 then
1930 tmp := Copy(tmp, 1, AnsiPos('_', tmp)-1)
1932 Delete(tmp, AnsiPos('_', tmp), 1);
1934 if ( Length(tmp) = 9) and ( tmp[1] = '0' ) then
1935 Insert('1', tmp, 1);
1937 unixtime := StrToInt64Def(tmp, ZERO_DATE);
1938 Result := UnixToDateTime(unixtime) + OffsetFromUTC;
1939 if GikoSys.Setting.FutureThread then begin
1940 if CompareDateTime(Result, Now) = 1 then
1941 Result := ZERO_DATE;
1947 Result := ZERO_DATE;
1950 function TThreadItem.GetFilePath: String;
1954 path := ExtractFilePath(Self.ParentBoard.FilePath) + Self.FileName;
1958 procedure TBoardGroup.Clear;
1962 for i := Self.Count - 1 downto 0 do begin
1963 TBoard(Self.Objects[i]).Free;