| 9 |
type |
type |
| 10 |
//リストの表示アイテム選択 |
//リストの表示アイテム選択 |
| 11 |
TGikoViewType = (gvtAll, gvtLog, gvtNew, gvtUser); |
TGikoViewType = (gvtAll, gvtLog, gvtNew, gvtUser); |
|
//リストの取得件数 |
|
|
//TGikoListCount = (glc50, glc100, glc200, glc500, glc1000, glcAll); |
|
|
//巡回番号 |
|
|
//TGikoRoundNo = (grnNone, grn1, grn2, grn3, grn4, grn5, grnOnce); |
|
| 12 |
//リストの上げ下げ |
//リストの上げ下げ |
| 13 |
TGikoAgeSage = (gasNone, gasAge, gasSage, gasNew, gasNull); |
TGikoAgeSage = (gasNone, gasAge, gasSage, gasNew, gasNull); |
| 14 |
|
|
|
{ TFolder = class |
|
|
private |
|
|
FItemList: TList; //子アイテムリスト |
|
|
FLeaf: Boolean; //下にフォルダを持つことが出来るか |
|
|
public |
|
|
function Add(Item: TFolder): Integer; |
|
|
procedure Clear; |
|
|
procedure Delete(Index: Integer); |
|
|
procedure Exchange(Index1, Index2: Integer); |
|
|
procedure Insert(Index: Integer; Item: TFolder); |
|
|
procedure Move(CurIndex, NewIndex: Integer); |
|
|
function Remove(Item: TFolder): Integer; |
|
|
procedure Sort(Compare: TListSortCompare); |
|
|
property Capacity: Integer read FCapacity write SetCapacity; |
|
|
property Count: Integer read FCount write SetCount; |
|
|
property Items[Index: Integer]: TFolder read Get write Put; default; |
|
|
|
|
|
property Leaf: Boolean read FLeaf; |
|
|
end; |
|
|
|
|
|
TBBS = class(TFolder) |
|
|
end; |
|
|
TCategory class(TFolder) |
|
|
end; |
|
|
TBoard = class(TFolder) |
|
|
end; |
|
|
TThreadItem = class(TFolder) |
|
|
end; |
|
|
} |
|
|
|
|
|
{ |
|
|
TBBS = class(TBBS) |
|
|
end; |
|
|
TBoard2ch = class(TBoard) |
|
|
end; |
|
|
TThreadItem2ch = class(TThreadItem) |
|
|
end; |
|
|
} |
|
|
|
|
|
// ITest = interface |
|
|
// end; |
|
|
// IBBS = interface |
|
|
// end; |
|
|
// ICategory = interface |
|
|
// end; |
|
|
// IBoard = interface |
|
|
// end; |
|
|
// IThreadItem = interface |
|
|
// end; |
|
|
|
|
| 15 |
TCategory = class; |
TCategory = class; |
| 16 |
TBoard = class; |
TBoard = class; |
| 17 |
TThreadItem = class; |
TThreadItem = class; |
| 124 |
FIntData : Integer; // 好きにいじってよし。いろんな用途に使うyo |
FIntData : Integer; // 好きにいじってよし。いろんな用途に使うyo |
| 125 |
FListData : TList; // 好きにいじってよし。いろんな用途に使うyo |
FListData : TList; // 好きにいじってよし。いろんな用途に使うyo |
| 126 |
|
|
| 127 |
FSETTINGTXTTime: TDateTime; //SETTING.TXTを取得した日時 |
FSETTINGTXTTime : TDateTime; //SETTING.TXTを取得した日時 |
| 128 |
FIsSETTINGTXT: boolean; //SETTING.TXTを取得しているか |
FIsSETTINGTXT : boolean; //SETTING.TXTを取得しているか |
| 129 |
FHEADTXTTime: TDateTime; //HEAD.TXTを取得した日時 |
FHEADTXTTime : TDateTime; //HEAD.TXTを取得した日時 |
| 130 |
FIsHEADTXT: boolean; //HEAD.TXTを取得しているか |
FIsHEADTXT : boolean; //HEAD.TXTを取得しているか |
| 131 |
FTitlePictureURL: string; //top絵のURL |
FTitlePictureURL: string; //top絵のURL |
| 132 |
FMultiplicity : Integer; //重複しているかどうか? |
FMultiplicity : Integer; //重複しているかどうか? |
| 133 |
|
FIs2ch : Boolean; //hostが2chかどうか |
| 134 |
|
FNewThreadCount: Integer; //新着スレッドの数 |
| 135 |
|
FLogThreadCount: Integer; //ログ有りスレッドの数 |
| 136 |
|
FUserThreadCount: Integer; //? |
| 137 |
|
|
| 138 |
function GetThreadItem(index: integer): TThreadItem; |
function GetThreadItem(index: integer): TThreadItem; |
| 139 |
procedure SetThreadItem(index: integer; value: TThreadItem); |
procedure SetThreadItem(index: integer; value: TThreadItem); |
| 140 |
procedure SetRound(b: Boolean); |
procedure SetRound(b: Boolean); |
| 196 |
function GetLogThreadCount: Integer; |
function GetLogThreadCount: Integer; |
| 197 |
function GetUserThreadCount: Integer; |
function GetUserThreadCount: Integer; |
| 198 |
function GetNewThread(Index: Integer): TThreadItem; |
function GetNewThread(Index: Integer): TThreadItem; |
| 199 |
function GetLogThread(Index: Integer): TThreadItem; |
function GetLogThread(Index: Integer): TThreadItem; overload; |
| 200 |
|
function GetLogThread(Index: Integer; Base: Integer): TThreadItem; overload; |
| 201 |
function GetUserThread(Index: Integer): TThreadItem; |
function GetUserThread(Index: Integer): TThreadItem; |
| 202 |
|
|
| 203 |
procedure BeginUpdate; |
procedure BeginUpdate; |
| 213 |
property IsSETTINGTXT: boolean read FIsSETTINGTXT write FIsSETTINGTXT; |
property IsSETTINGTXT: boolean read FIsSETTINGTXT write FIsSETTINGTXT; |
| 214 |
property HEADTXTTime: TDateTime read FHEADTXTTime write FHEADTXTTime; |
property HEADTXTTime: TDateTime read FHEADTXTTime write FHEADTXTTime; |
| 215 |
property IsHEADTXT: boolean read FIsHEADTXT write FIsHEADTXT; |
property IsHEADTXT: boolean read FIsHEADTXT write FIsHEADTXT; |
| 216 |
property TitlePictureURL: string read FTitlePictureURL write FTitlePictureURL; |
property TitlePictureURL: string read FTitlePictureURL write FTitlePictureURL; |
| 217 |
property Multiplicity: Integer read FMultiplicity write FMultiplicity; |
property Multiplicity: Integer read FMultiplicity write FMultiplicity; |
| 218 |
|
property Is2ch : boolean read FIs2ch write FIs2ch; |
| 219 |
|
property NewThreadCount: Integer read FNewThreadCount write FNewThreadCount; //新着スレッドの数 |
| 220 |
|
property LogThreadCount: Integer read FLogThreadCount write FLogThreadCount; //ログ有りスレッドの数 |
| 221 |
|
property UserThreadCount: Integer read FUserThreadCount write FUserThreadCount; //? |
| 222 |
end; |
end; |
| 223 |
|
|
| 224 |
//スレ |
//スレ |
| 252 |
FUpdate: Boolean; |
FUpdate: Boolean; |
| 253 |
FExpand: Boolean; |
FExpand: Boolean; |
| 254 |
FURL : string; // このスレをブラウザで表示する際の URL |
FURL : string; // このスレをブラウザで表示する際の URL |
| 255 |
FBoardPlugIn : TBoardPlugIn; // このスレをサポートするプラグイン |
//FBoardPlugIn : TBoardPlugIn; // このスレをサポートするプラグイン |
| 256 |
FFilePath : string; // このスレが保存されているパス |
//FFilePath : string; // このスレが保存されているパス |
| 257 |
|
|
| 258 |
procedure SetLastModified(d: TDateTime); |
procedure SetLastModified(d: TDateTime); |
| 259 |
procedure SetRound(b: Boolean); |
procedure SetRound(b: Boolean); |
| 263 |
procedure SetScrollTop(i: Integer); |
procedure SetScrollTop(i: Integer); |
| 264 |
procedure Init; |
procedure Init; |
| 265 |
function GetCreateDate: TDateTime; |
function GetCreateDate: TDateTime; |
| 266 |
|
function GetFilePath: String; |
| 267 |
public |
public |
| 268 |
constructor Create( inPlugIn : TBoardPlugIn; inURL : string ); overload; |
constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard; inURL : string ); overload; |
| 269 |
constructor Create( is2ch : Boolean; const inURL, inHost, inBBSID, inBBSKey : string ); overload; |
constructor Create(const inPlugIn : TBoardPlugIn; const inBoard : TBoard; |
| 270 |
|
inURL : string; inExist: Boolean; const inFilename: string ); overload; |
| 271 |
|
|
| 272 |
destructor Destroy; override; |
destructor Destroy; override; |
| 273 |
|
|
| 309 |
// property SPID: string read FSPID write FSPID; |
// property SPID: string read FSPID write FSPID; |
| 310 |
property CreateDate: TDateTime read GetCreateDate; |
property CreateDate: TDateTime read GetCreateDate; |
| 311 |
property URL : string read FURL write FURL; |
property URL : string read FURL write FURL; |
| 312 |
property BoardPlugIn : TBoardPlugIn read FBoardPlugIn; |
//property BoardPlugIn : TBoardPlugIn read FBoardPlugIn; |
| 313 |
property FilePath : string read FFilePath write FFilePath; |
property FilePath : string read GetFilePath; |
| 314 |
function IsBoardPlugInAvailable : Boolean; |
//function IsBoardPlugInAvailable : Boolean; |
| 315 |
end; |
end; |
| 316 |
|
|
| 317 |
|
TBoardGroup = class(TStringList) |
| 318 |
|
private |
| 319 |
|
FBoardPlugIn : TBoardPlugIn; // この板をサポートするプラグイン |
| 320 |
|
public |
| 321 |
|
procedure Clear ; override; |
| 322 |
|
property BoardPlugIn : TBoardPlugIn read FBoardPlugIn write FBoardPlugIn; |
| 323 |
|
end; |
| 324 |
|
|
| 325 |
|
|
|
//検索結果リスト |
|
|
{ TSearchList = class(TList) |
|
|
private |
|
|
function GetThreadItem(index: integer): TThreadItem; |
|
|
procedure SetThreadItem(index: integer; value: TThreadItem); |
|
|
public |
|
|
constructor Create; |
|
|
destructor Destroy; override; |
|
|
|
|
|
property Items[index: integer]: TThreadItem read GetThreadItem write SetThreadItem; |
|
|
|
|
|
function Add(item: TThreadItem): integer; |
|
|
procedure Delete(index: integer); |
|
|
procedure Clear; override; |
|
|
end;} |
|
|
|
|
| 326 |
function BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard; |
function BBSsFindBoardFromBBSID( inBBSID : string ) : TBoard; |
| 327 |
function BBSsFindBoardFromURL( inURL : string ) : TBoard; |
function BBSsFindBoardFromURL( inURL : string ) : TBoard; |
| 328 |
function BBSsFindBoardFromTitle( inTitle : string ) : TBoard; |
function BBSsFindBoardFromTitle( inTitle : string ) : TBoard; |
| 331 |
|
|
| 332 |
var |
var |
| 333 |
BBSs : array of TBBS; |
BBSs : array of TBBS; |
| 334 |
|
BoardGroups : array of TBoardGroup; |
| 335 |
|
|
| 336 |
implementation |
implementation |
| 337 |
|
|
| 361 |
function BBSsFindBoardFromBBSID( |
function BBSsFindBoardFromBBSID( |
| 362 |
inBBSID : string |
inBBSID : string |
| 363 |
) : TBoard; |
) : TBoard; |
| 364 |
|
var |
| 365 |
|
i : Integer; |
| 366 |
|
tmpBoard : TBoard; |
| 367 |
begin |
begin |
| 368 |
|
|
| 369 |
Result := BBSs[ 0 ].FindBBSID( inBBSID ); |
// Result := BBSs[ 0 ].FindBBSID( inBBSID ); |
| 370 |
|
if Length(BoardGroups) > 0 then begin |
| 371 |
|
for i := BoardGroups[0].Count - 1 downto 0 do begin |
| 372 |
|
tmpBoard := TBoard(BoardGroups[0].Objects[i]); |
| 373 |
|
if tmpBoard.Is2ch then begin |
| 374 |
|
if AnsiCompareStr(tmpBoard.BBSID, inBBSID) = 0 then begin |
| 375 |
|
Result := tmpBoard; |
| 376 |
|
EXIT; |
| 377 |
|
end; |
| 378 |
|
end; |
| 379 |
|
end; |
| 380 |
|
end; |
| 381 |
|
|
| 382 |
end; |
end; |
| 383 |
|
|
| 385 |
inURL : string |
inURL : string |
| 386 |
) : TBoard; |
) : TBoard; |
| 387 |
var |
var |
| 388 |
i : Integer; |
i,p : Integer; |
| 389 |
|
accept : TAcceptType; |
| 390 |
begin |
begin |
| 391 |
|
Result := nil; |
| 392 |
for i := Length( BBSs ) - 1 downto 0 do begin |
for i := Length(BoardGroups) - 1 downto 1 do begin |
| 393 |
Result := BBSs[ i ].FindBoardFromURL( inURL ); |
accept := BoardGroups[i].BoardPlugIn.AcceptURL(inURL); |
| 394 |
if Result <> nil then |
if (accept = atBoard) or (accept = atThread) then begin |
| 395 |
Exit; |
if BoardGroups[i].Find(inURL, p) then begin |
| 396 |
end; |
Result := TBoard(BoardGroups[i].Objects[p]); |
| 397 |
|
Exit; |
| 398 |
Result := nil; |
end else begin |
| 399 |
|
inURL := BoardGroups[i].BoardPlugIn.ExtractBoardURL(inURL); |
| 400 |
|
if BoardGroups[i].Find(inURL, p) then begin |
| 401 |
|
Result := TBoard(BoardGroups[i].Objects[p]); |
| 402 |
|
Exit; |
| 403 |
|
end; |
| 404 |
|
end; |
| 405 |
|
end; |
| 406 |
|
end; |
| 407 |
|
//ここにきたら、pluginを使わないやつらを調べる |
| 408 |
|
if BoardGroups[0].Find(inURL, p) then |
| 409 |
|
Result := TBoard(BoardGroups[0].Objects[p]); |
| 410 |
|
|
| 411 |
end; |
end; |
| 412 |
|
|
| 414 |
inTitle : string |
inTitle : string |
| 415 |
) : TBoard; |
) : TBoard; |
| 416 |
var |
var |
| 417 |
i : Integer; |
i,j : Integer; |
| 418 |
|
tmpBoard : TBoard; |
| 419 |
begin |
begin |
| 420 |
|
Result := nil; |
| 421 |
for i := Length( BBSs ) - 1 downto 0 do begin |
for i := Length( BBSs ) - 1 downto 0 do begin |
| 422 |
Result := BBSs[ i ].FindBoardFromTitle( inTitle ); |
for j := BoardGroups[i].Count - 1 downto 0 do begin |
| 423 |
if Result <> nil then |
tmpBoard := TBoard(BoardGroups[i].Objects[j]); |
| 424 |
Exit; |
if ( AnsiCompareStr(tmpBoard.Title, inTitle) = 0) then begin |
| 425 |
|
Result := tmpBoard; |
| 426 |
|
Exit; |
| 427 |
|
end; |
| 428 |
|
end; |
| 429 |
end; |
end; |
| 430 |
|
|
|
Result := nil; |
|
|
|
|
| 431 |
end; |
end; |
| 432 |
|
|
| 433 |
function BBSsFindThreadFromURL( |
function BBSsFindThreadFromURL( |
| 532 |
i: Integer; |
i: Integer; |
| 533 |
begin |
begin |
| 534 |
if not IsBoardFileRead then |
if not IsBoardFileRead then |
| 535 |
GikoSys.ReadBoardFile( Self ); |
GikoSys.ReadBoardFile( Self ); |
| 536 |
for i := Count - 1 downto 0 do begin |
for i := Count - 1 downto 0 do begin |
| 537 |
Result := Items[ i ].FindBoardFromTitle(Title); |
Result := Items[ i ].FindBoardFromTitle(Title); |
| 538 |
if Result <> nil then |
if Result <> nil then |
| 549 |
i : Integer; |
i : Integer; |
| 550 |
begin |
begin |
| 551 |
if not IsBoardFileRead then |
if not IsBoardFileRead then |
| 552 |
GikoSys.ReadBoardFile( Self ); |
GikoSys.ReadBoardFile( Self ); |
| 553 |
for i := Count - 1 downto 0 do begin |
for i := Count - 1 downto 0 do begin |
| 554 |
Result := Items[ i ].FindBoardFromURL( inURL ); |
Result := Items[ i ].FindBoardFromURL( inURL ); |
| 555 |
if Result <> nil then |
if Result <> nil then |
| 656 |
|
|
| 657 |
procedure TCategory.Delete(index: integer); |
procedure TCategory.Delete(index: integer); |
| 658 |
begin |
begin |
| 659 |
if (Items[index] <> nil) then begin |
{if (Items[index] <> nil) then begin |
| 660 |
try |
try |
| 661 |
if TBoard(Items[index]).Multiplicity = 0 then |
if TBoard(Items[index]).Multiplicity = 0 then |
| 662 |
TBoard(Items[index]).Free |
TBoard(Items[index]).Free |
| 665 |
except |
except |
| 666 |
end; |
end; |
| 667 |
end; |
end; |
| 668 |
inherited Delete(index); |
} |
| 669 |
|
inherited Delete(index); |
| 670 |
end; |
end; |
| 671 |
|
|
| 672 |
procedure TCategory.Clear; |
procedure TCategory.Clear; |
| 821 |
if inPlugIn = nil then begin |
if inPlugIn = nil then begin |
| 822 |
// subject.txt の保存パスを設定 |
// subject.txt の保存パスを設定 |
| 823 |
GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark ); |
GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark ); |
| 824 |
if GikoSys.Is2chHost( host ) then |
if GikoSys.Is2chHost( host ) then begin |
| 825 |
|
Self.Is2ch := True; |
| 826 |
FilePath := |
FilePath := |
| 827 |
GikoSys.Setting.LogFolderP + |
GikoSys.Setting.LogFolderP + |
| 828 |
BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME |
BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME |
| 829 |
else |
end else begin |
| 830 |
|
Self.Is2ch := False; |
| 831 |
FilePath := |
FilePath := |
| 832 |
GikoSys.Setting.LogFolderP + |
GikoSys.Setting.LogFolderP + |
| 833 |
EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME |
EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME |
| 834 |
|
end; |
| 835 |
end else begin |
end else begin |
| 836 |
// プラグインに TBoardItem が作成されたことを伝える |
// プラグインに TBoardItem が作成されたことを伝える |
| 837 |
inPlugIn.CreateBoardItem( DWORD( Self ) ); |
inPlugIn.CreateBoardItem( DWORD( Self ) ); |
| 838 |
|
Self.Is2ch := False; |
| 839 |
end; |
end; |
| 840 |
|
|
| 841 |
end; |
end; |
| 1200 |
Protocol, Host, Path, Document, Port, Bookmark : string; |
Protocol, Host, Path, Document, Port, Bookmark : string; |
| 1201 |
begin |
begin |
| 1202 |
Result := GikoSys.UrlToServer(URL); |
Result := GikoSys.UrlToServer(URL); |
| 1203 |
GikoSys.ParseURI( URL, Protocol,Host, Path, Document, Port, Bookmark ); |
//GikoSys.ParseURI( URL, Protocol,Host, Path, Document, Port, Bookmark ); |
| 1204 |
if GikoSys.Is2chHost(Host) then |
//if GikoSys.Is2chHost(Host) then |
| 1205 |
|
if Self.Is2ch then |
| 1206 |
Result := Result + 'test/bbs.cgi' |
Result := Result + 'test/bbs.cgi' |
| 1207 |
else |
else |
| 1208 |
Result := Result + 'test/subbbs.cgi'; |
Result := Result + 'test/subbbs.cgi'; |
| 1407 |
end; |
end; |
| 1408 |
Result := nil; |
Result := nil; |
| 1409 |
end; |
end; |
| 1410 |
|
function TBoard.GetLogThread(Index: Integer; Base: Integer): TThreadItem; |
| 1411 |
|
var |
| 1412 |
|
i: Integer; |
| 1413 |
|
Cnt: Integer; |
| 1414 |
|
begin |
| 1415 |
|
Cnt := 0; |
| 1416 |
|
if Length( ParentCategory.ParenTBBS.ShortSelectText ) = 0 then |
| 1417 |
|
begin |
| 1418 |
|
for i := Base to Count - 1 do begin |
| 1419 |
|
if Items[i].IsLogFile then |
| 1420 |
|
begin |
| 1421 |
|
if Index = Cnt then begin |
| 1422 |
|
Result := Items[i]; |
| 1423 |
|
Exit; |
| 1424 |
|
end; |
| 1425 |
|
inc(Cnt); |
| 1426 |
|
end; |
| 1427 |
|
end; |
| 1428 |
|
end else begin |
| 1429 |
|
for i := Base to Count - 1 do begin |
| 1430 |
|
if Items[i].IsLogFile then |
| 1431 |
|
begin |
| 1432 |
|
if Items[i].ShortTitle = '' then |
| 1433 |
|
Items[i].ShortTitle := ZenToHan(Items[i].Title); |
| 1434 |
|
if AnsiPos(ParentCategory.ParenTBBS.ShortSelectText, Items[i].ShortTitle) <> 0 then begin |
| 1435 |
|
if Index = Cnt then begin |
| 1436 |
|
Result := Items[i]; |
| 1437 |
|
Exit; |
| 1438 |
|
end; |
| 1439 |
|
inc(Cnt); |
| 1440 |
|
end; |
| 1441 |
|
end; |
| 1442 |
|
end; |
| 1443 |
|
end; |
| 1444 |
|
Result := nil; |
| 1445 |
|
end; |
| 1446 |
function TBoard.GetUserThread(Index: Integer): TThreadItem; |
function TBoard.GetUserThread(Index: Integer): TThreadItem; |
| 1447 |
var |
var |
| 1448 |
i: Integer; |
i: Integer; |
| 1516 |
|
|
| 1517 |
FUpdate := True; |
FUpdate := True; |
| 1518 |
FURL := ''; |
FURL := ''; |
| 1519 |
FBoardPlugIn := nil; |
//FBoardPlugIn := nil; |
| 1520 |
end; |
end; |
| 1521 |
|
|
| 1522 |
// ************************************************************************* |
// ************************************************************************* |
| 1523 |
// 外部板プラグインを指定したコンストラクタ |
// 外部板プラグインを指定したコンストラクタ |
| 1524 |
// ************************************************************************* |
// ************************************************************************* |
| 1525 |
constructor TThreadItem.Create( |
constructor TThreadItem.Create( |
| 1526 |
inPlugIn : TBoardPlugIn; |
const inPlugIn : TBoardPlugIn; |
| 1527 |
inURL : string |
const inBoard : TBoard; |
| 1528 |
|
inURL : string |
| 1529 |
); |
); |
| 1530 |
var |
var |
| 1531 |
foundPos : Integer; |
foundPos : Integer; |
| 1537 |
|
|
| 1538 |
inherited Create; |
inherited Create; |
| 1539 |
Init; |
Init; |
| 1540 |
|
FParentBoard := inBoard; |
| 1541 |
FBoardPlugIn := inPlugIn; |
//FBoardPlugIn := inPlugIn; |
| 1542 |
URL := inURL; |
URL := inURL; |
| 1543 |
|
|
| 1544 |
if inPlugIn = nil then begin |
if inPlugIn = nil then begin |
| 1545 |
foundPos := Pos( READ_PATH, inURL ); |
foundPos := Pos( READ_PATH, inURL ); |
| 1547 |
// dat の保存パスを設定 |
// dat の保存パスを設定 |
| 1548 |
GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark ); |
GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark ); |
| 1549 |
GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey ); |
GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey ); |
|
if GikoSys.Is2chHost( host ) then |
|
|
FilePath := |
|
|
GikoSys.Setting.LogFolderP + |
|
|
BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat' |
|
|
else |
|
|
FilePath := |
|
|
GikoSys.Setting.LogFolderP + |
|
|
EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat'; |
|
| 1550 |
FileName := BBSKey + '.dat'; |
FileName := BBSKey + '.dat'; |
| 1551 |
IsLogFile := FileExists( FilePath ); |
IsLogFile := FileExists( FilePath ); |
| 1552 |
URL := GikoSys.Get2chBrowsableThreadURL( inURL ); |
URL := GikoSys.Get2chBrowsableThreadURL( inURL ); |
| 1557 |
end; |
end; |
| 1558 |
|
|
| 1559 |
end; |
end; |
|
|
|
| 1560 |
// ************************************************************************* |
// ************************************************************************* |
| 1561 |
// プラグインを利用しないコンストラクタ |
// 外部板プラグインを指定したコンストラクタ Log有りかどうか判断済み |
| 1562 |
|
// FileNameも取得済み → ReadSubject用 |
| 1563 |
// ************************************************************************* |
// ************************************************************************* |
| 1564 |
constructor TThreadItem.Create( |
constructor TThreadItem.Create( |
| 1565 |
is2ch : Boolean; |
const inPlugIn : TBoardPlugIn; |
| 1566 |
const inURL, inHost, inBBSID, inBBSKey : string |
const inBoard : TBoard; |
| 1567 |
|
inURL : string; |
| 1568 |
|
inExist: Boolean; |
| 1569 |
|
const inFilename: string |
| 1570 |
); |
); |
|
var |
|
|
foundPos : Integer; |
|
|
const |
|
|
READ_PATH = '/test/read.cgi'; |
|
| 1571 |
begin |
begin |
| 1572 |
|
|
| 1573 |
inherited Create; |
inherited Create; |
| 1574 |
Init; |
Init; |
| 1575 |
|
FParentBoard := inBoard; |
| 1576 |
|
URL := inURL; |
| 1577 |
|
|
| 1578 |
FBoardPlugIn := nil; |
if inPlugIn = nil then begin |
| 1579 |
|
// dat の保存パスを設定 |
| 1580 |
foundPos := Pos( READ_PATH, inURL ); |
FileName := inFilename; |
| 1581 |
if foundPos > 0 then begin |
IsLogFile := inExist; |
| 1582 |
// dat の保存パスを設定 |
URL := GikoSys.Get2chBrowsableThreadURL( inURL ); |
| 1583 |
if is2ch then |
end else begin |
| 1584 |
FilePath := |
// プラグインに TThreadItem が作成されたことを伝える |
| 1585 |
|
inPlugIn.CreateThreadItem( DWORD( Self ) ); |
| 1586 |
GikoSys.Setting.LogFolderP + |
end; |
|
BBS2CH_LOG_FOLDER + PATH_DELIM + inBBSID + PATH_DELIM + inBBSKey + '.dat' |
|
|
else |
|
|
FilePath := |
|
|
GikoSys.Setting.LogFolderP + |
|
|
EXTERNAL_LOG_FOLDER + PATH_DELIM + inHost + PATH_DELIM + inBBSID + PATH_DELIM + inBBSKey + '.dat'; |
|
|
FileName := inBBSKey + '.dat'; |
|
|
IsLogFile := FileExists( FilePath ); |
|
|
URL := GikoSys.Get2chBrowsableThreadURL( inURL ); |
|
|
end else |
|
|
URL := inURL; |
|
| 1587 |
|
|
| 1588 |
end; |
end; |
| 1589 |
// ************************************************************************* |
// ************************************************************************* |
| 1593 |
begin |
begin |
| 1594 |
|
|
| 1595 |
// プラグインに TThreadItem が破棄されたことを伝える |
// プラグインに TThreadItem が破棄されたことを伝える |
| 1596 |
if IsBoardPlugInAvailable then |
if Self.ParentBoard.IsBoardPlugInAvailable then |
| 1597 |
FBoardPlugIn.DisposeThreadItem( DWORD( Self ) ); |
Self.ParentBoard.BoardPlugIn.DisposeThreadItem( DWORD( Self ) ); |
| 1598 |
|
|
| 1599 |
inherited; |
inherited; |
| 1600 |
|
|
| 1603 |
// ************************************************************************* |
// ************************************************************************* |
| 1604 |
// 外部板プラグインが使用可能か |
// 外部板プラグインが使用可能か |
| 1605 |
// ************************************************************************* |
// ************************************************************************* |
| 1606 |
|
{ |
| 1607 |
function TThreadItem.IsBoardPlugInAvailable : Boolean; |
function TThreadItem.IsBoardPlugInAvailable : Boolean; |
| 1608 |
begin |
begin |
| 1609 |
|
|
| 1621 |
Result := False; |
Result := False; |
| 1622 |
|
|
| 1623 |
end; |
end; |
| 1624 |
|
} |
| 1625 |
function TThreadItem.GetDatURL: string; |
function TThreadItem.GetDatURL: string; |
| 1626 |
var |
var |
| 1627 |
Protocol, Host, Path, Document, Port, Bookmark: string; |
Protocol, Host, Path, Document, Port, Bookmark: string; |
| 1882 |
Result := ZERO_DATE; |
Result := ZERO_DATE; |
| 1883 |
end; |
end; |
| 1884 |
end; |
end; |
| 1885 |
|
function TThreadItem.GetFilePath: String; |
| 1886 |
|
var |
| 1887 |
|
path : String; |
| 1888 |
|
begin |
| 1889 |
|
path := ExtractFilePath(Self.ParentBoard.FilePath) + Self.FileName; |
| 1890 |
|
Result := path; |
| 1891 |
|
end; |
| 1892 |
|
|
| 1893 |
|
procedure TBoardGroup.Clear; |
| 1894 |
|
var |
| 1895 |
|
i : Integer; |
| 1896 |
|
begin |
| 1897 |
|
for i := Self.Count - 1 downto 0 do begin |
| 1898 |
|
TBoard(Self.Objects[i]).Free; |
| 1899 |
|
end; |
| 1900 |
|
inherited Clear; |
| 1901 |
|
Self.Capacity := 0; |
| 1902 |
|
end; |
| 1903 |
|
|
| 1904 |
|
|
| 1905 |
end. |
end. |
| 1906 |
|
|