| 4 |
|
|
| 5 |
uses |
uses |
| 6 |
Windows, Messages, SysUtils, Classes, {Graphics,} Controls, {Forms,} |
Windows, Messages, SysUtils, Classes, {Graphics,} Controls, {Forms,} |
| 7 |
ComCtrls, IniFiles, ShellAPI, Math, GikoSystem, |
ComCtrls, IniFiles, ShellAPI, Math, GikoSystem, ActiveX, |
| 8 |
{$IF Defined(DELPRO) } |
{$IF Defined(DELPRO) } |
| 9 |
SHDocVw, |
SHDocVw, |
| 10 |
MSHTML, |
MSHTML, |
| 31 |
constructor Create; |
constructor Create; |
| 32 |
|
|
| 33 |
function AddBeProfileLink(AID : string; ANum: Integer):string ; |
function AddBeProfileLink(AID : string; ANum: Integer):string ; |
| 34 |
procedure CreateUsePluginHTML(doc: Variant; ThreadItem: TThreadItem; var sTitle: string); |
procedure CreateUsePluginHTML(html: TStringList; ThreadItem: TThreadItem; var sTitle: string); |
| 35 |
procedure CreateUseSKINHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList); |
procedure CreateUseSKINHTML(html: TStringList; ThreadItem: TThreadItem; ReadList: TStringList); |
| 36 |
procedure CreateUseCSSHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
procedure CreateUseCSSHTML(html: TStringList; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
| 37 |
procedure CreateDefaultHTML (doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
procedure CreateDefaultHTML (html: TStringList; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
| 38 |
function ConvertResAnchor(res: string): string; |
function ConvertResAnchor(res: string): string; |
| 39 |
public |
public |
| 40 |
{ Public 宣言 } |
{ Public 宣言 } |
| 43 |
function SkinedRes(skin: string; Res: TResRec; No: string): string; |
function SkinedRes(skin: string; Res: TResRec; No: string): string; |
| 44 |
function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue : string; DatToHTML: boolean = false): string; overload; |
function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue : string; DatToHTML: boolean = false): string; overload; |
| 45 |
function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue, FullURL : string): string; overload; |
function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue, FullURL : string): string; overload; |
| 46 |
procedure CreateHTML2(doc: Variant; ThreadItem: TThreadItem; var sTitle: string); |
procedure CreateHTML2(doc: IDispatch; ThreadItem: TThreadItem; var sTitle: string); |
| 47 |
procedure CreateHTML3(var html: TStringList; ThreadItem: TThreadItem; var sTitle: string); |
procedure CreateHTML3(var html: TStringList; ThreadItem: TThreadItem; var sTitle: string); |
| 48 |
end; |
end; |
| 49 |
|
|
| 118 |
CustomStringReplace( Skin, '<SIZEKB/>', IntToStr( Floor( SizeByte / 1024 ) )); |
CustomStringReplace( Skin, '<SIZEKB/>', IntToStr( Floor( SizeByte / 1024 ) )); |
| 119 |
CustomStringReplace( Skin, '<SIZE/>', IntToStr( SizeByte )); |
CustomStringReplace( Skin, '<SIZE/>', IntToStr( SizeByte )); |
| 120 |
|
|
| 121 |
|
|
| 122 |
//----- とりあえずかちゅ〜しゃ互換用。コメントアウトしてもよし |
//----- とりあえずかちゅ〜しゃ互換用。コメントアウトしてもよし |
| 123 |
// やりかたが苦しいけど、オプションダイアログのプレビュー用 try |
if GikoSys.Setting.UseKatjushaType then begin |
| 124 |
try |
// やりかたが苦しいけど、オプションダイアログのプレビュー用 try |
| 125 |
if ThreadItem.ParentBoard <> nil then |
try |
| 126 |
if ThreadItem.ParentBoard.ParentCategory <> nil then |
if ThreadItem.ParentBoard <> nil then |
| 127 |
CustomStringReplace( Skin, '&BBSNAME', ThreadItem.ParentBoard.ParentCategory.ParenTBBS.Title); |
if ThreadItem.ParentBoard.ParentCategory <> nil then |
| 128 |
CustomStringReplace( Skin, '&THREADURL', ThreadItem.URL); |
CustomStringReplace( Skin, '&BBSNAME', ThreadItem.ParentBoard.ParentCategory.ParenTBBS.Title); |
| 129 |
except end; |
CustomStringReplace( Skin, '&THREADURL', ThreadItem.URL); |
| 130 |
CustomStringReplace( Skin, '&BOARDNAME', ThreadItem.ParentBoard.Title); |
except end; |
| 131 |
CustomStringReplace( Skin, '&BOARDURL', ThreadItem.ParentBoard.URL); |
CustomStringReplace( Skin, '&BOARDNAME', ThreadItem.ParentBoard.Title); |
| 132 |
CustomStringReplace( Skin, '&THREADNAME', ThreadItem.Title); |
CustomStringReplace( Skin, '&BOARDURL', ThreadItem.ParentBoard.URL); |
| 133 |
CustomStringReplace( Skin, '&SKINPATH', GikoSys.Setting.CSSFileName); |
CustomStringReplace( Skin, '&THREADNAME', ThreadItem.Title); |
| 134 |
CustomStringReplace( Skin, '&GETRESCOUNT', IntToStr( ThreadItem.NewReceive - 1 )); |
CustomStringReplace( Skin, '&SKINPATH', GikoSys.Setting.CSSFileName); |
| 135 |
CustomStringReplace( Skin, '&NEWRESCOUNT', IntToStr( ThreadItem.NewResCount )); |
CustomStringReplace( Skin, '&GETRESCOUNT', IntToStr( ThreadItem.NewReceive - 1 )); |
| 136 |
CustomStringReplace( Skin, '&ALLRESCOUNT', IntToStr( ThreadItem.AllResCount )); |
CustomStringReplace( Skin, '&NEWRESCOUNT', IntToStr( ThreadItem.NewResCount )); |
| 137 |
|
CustomStringReplace( Skin, '&ALLRESCOUNT', IntToStr( ThreadItem.AllResCount )); |
| 138 |
CustomStringReplace( Skin, '&NEWDATE', FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate)); |
|
| 139 |
CustomStringReplace( Skin, '&SIZEKB', IntToStr( Floor( SizeByte / 1024 ) )); |
CustomStringReplace( Skin, '&NEWDATE', FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate)); |
| 140 |
CustomStringReplace( Skin, '&SIZE', IntToStr( SizeByte )); |
CustomStringReplace( Skin, '&SIZEKB', IntToStr( Floor( SizeByte / 1024 ) )); |
| 141 |
//----- ここまで |
CustomStringReplace( Skin, '&SIZE', IntToStr( SizeByte )); |
| 142 |
|
//----- ここまで |
| 143 |
|
end; |
| 144 |
end; |
end; |
| 145 |
Result := Skin.Text; |
Result := Skin.Text; |
| 146 |
finally |
finally |
| 177 |
Skin := CustomStringReplace( Skin, '<NONSPAMMINESS/>', FloatToStr( 100 - spamminess ) ); |
Skin := CustomStringReplace( Skin, '<NONSPAMMINESS/>', FloatToStr( 100 - spamminess ) ); |
| 178 |
|
|
| 179 |
//----- かちゅ〜しゃ互換用。コメントアウトしてもよし |
//----- かちゅ〜しゃ互換用。コメントアウトしてもよし |
| 180 |
Skin := CustomStringReplace( Skin, '&NUMBER', |
if GikoSys.Setting.UseKatjushaType then begin |
| 181 |
'<a href="menu:' + No + '" name="' + No + '">' + No + '</a>'); |
Skin := CustomStringReplace( Skin, '&NUMBER', |
| 182 |
Skin := CustomStringReplace( Skin, '&PLAINNUMBER', No); |
'<a href="menu:' + No + '" name="' + No + '">' + No + '</a>'); |
| 183 |
Skin := CustomStringReplace( Skin, '&NAME', '<b>' + Res.FName + '</b>'); |
Skin := CustomStringReplace( Skin, '&PLAINNUMBER', No); |
| 184 |
Skin := CustomStringReplace( Skin, '&MAILNAME', |
Skin := CustomStringReplace( Skin, '&NAME', '<b>' + Res.FName + '</b>'); |
| 185 |
'<a href="mailto:' + Res.FMailTo + '"><b>' + Res.FName + '</b></a>'); |
Skin := CustomStringReplace( Skin, '&MAILNAME', |
| 186 |
Skin := CustomStringReplace( Skin, '&MAIL', Res.FMailTo); |
'<a href="mailto:' + Res.FMailTo + '"><b>' + Res.FName + '</b></a>'); |
| 187 |
Skin := CustomStringReplace( Skin, '&DATE', Res.FDateTime); |
Skin := CustomStringReplace( Skin, '&MAIL', Res.FMailTo); |
| 188 |
Skin := CustomStringReplace( Skin, '&MESSAGE', Res.FBody); |
Skin := CustomStringReplace( Skin, '&DATE', Res.FDateTime); |
| 189 |
Skin := CustomStringReplace( Skin, '&SPAMMINESS', FloatToStr( spamminess ) ); |
Skin := CustomStringReplace( Skin, '&MESSAGE', Res.FBody); |
| 190 |
Skin := CustomStringReplace( Skin, '&NONSPAMMINESS', FloatToStr( 100 - spamminess ) ); |
Skin := CustomStringReplace( Skin, '&SPAMMINESS', FloatToStr( spamminess ) ); |
| 191 |
|
Skin := CustomStringReplace( Skin, '&NONSPAMMINESS', FloatToStr( 100 - spamminess ) ); |
| 192 |
|
end; |
| 193 |
//----- ここまで |
//----- ここまで |
| 194 |
|
|
| 195 |
Result := Skin; |
Result := Skin; |
| 319 |
GT = '>'; |
GT = '>'; |
| 320 |
SN = '0123456789-'; |
SN = '0123456789-'; |
| 321 |
ZN = '0123456789−'; |
ZN = '0123456789−'; |
| 322 |
|
FORMAT_LINK = '<a href="../test/read.cgi?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s" target="_blank">'; |
| 323 |
var |
var |
| 324 |
i : integer; |
i : integer; |
| 325 |
s,r : string; |
s,r : string; |
| 343 |
FIndex.FNo := No; |
FIndex.FNo := No; |
| 344 |
List.Add(FIndex); |
List.Add(FIndex); |
| 345 |
end; |
end; |
| 346 |
function ChooseString(const Text, Separator: string; Index: integer): string; |
procedure separateNumber(var st: String; var et: String; const Text, Separator: String); |
| 347 |
var |
var |
| 348 |
S : string; |
p : Integer; |
|
i, p : integer; |
|
| 349 |
begin |
begin |
| 350 |
S := Text; |
p := Pos(Separator, Text); |
| 351 |
for i := 0 to Index - 1 do begin |
if (p > 0 ) then begin |
| 352 |
if (AnsiPos(Separator, S) = 0) then S := '' |
st := Copy(Text, 1, p - 1); |
| 353 |
else S := Copy(S, AnsiPos(Separator, S) + Length(Separator), Length(S)); |
et := Copy(Text, p + Length(Separator), Length(Text)); |
| 354 |
|
end else begin |
| 355 |
|
st := Text; |
| 356 |
|
et := Text; |
| 357 |
end; |
end; |
|
p := AnsiPos(Separator, S); |
|
|
if (p > 0) then Result := Copy(S, 1, p - 1) else Result := S; |
|
| 358 |
end; |
end; |
| 359 |
begin |
begin |
| 360 |
{ v1.0 b2 - 03 } |
{ v1.0 b2 - 03 } |
| 373 |
case b of |
case b of |
| 374 |
mbSingleByte : begin |
mbSingleByte : begin |
| 375 |
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
| 376 |
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin |
if (Pos('<A HREF', oc) = 0) then begin |
| 377 |
sw := True; |
sw := True; |
| 378 |
sp := i; |
sp := i; |
| 379 |
i := i + 7; |
i := i + 7; |
| 382 |
end; |
end; |
| 383 |
end else |
end else |
| 384 |
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
| 385 |
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 1) then begin |
if (Pos('<A HREF', oc) = 1) then begin |
| 386 |
i := i + 7; |
i := i + 7; |
| 387 |
oc:=''; |
oc:=''; |
| 388 |
chk := True; |
chk := True; |
| 389 |
end; |
end; |
| 390 |
end else |
end else |
| 391 |
if (not sw) and (Copy(s,i,4) = GT) then begin |
if (not sw) and (Copy(s,i,4) = GT) then begin |
| 392 |
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin |
if (Pos('<A HREF', oc) = 0) then begin |
| 393 |
sw := True; |
sw := True; |
| 394 |
sp := i; |
sp := i; |
| 395 |
i := i + 3; |
i := i + 3; |
| 399 |
end else |
end else |
| 400 |
if ((not sw) and (Copy(s,i,1) = ',')) or |
if ((not sw) and (Copy(s,i,1) = ',')) or |
| 401 |
((not sw) and (Copy(s,i,1) = '=')) then begin |
((not sw) and (Copy(s,i,1) = '=')) then begin |
| 402 |
if ((not Chk) and (AnsiLowerCase(oc) = '</a>')) or |
if ((not Chk) and (oc = '</A>')) or |
| 403 |
((Chk) and (oc = '')) or |
((Chk) and (oc = '')) or |
| 404 |
((not Chk) and (al)) then |
((not Chk) and (al)) then |
| 405 |
begin |
begin |
| 427 |
//chk := False; |
//chk := False; |
| 428 |
end; |
end; |
| 429 |
end else begin |
end else begin |
| 430 |
if Copy(s,i,1) = '<' then oc := ''; |
if Copy(s,i,1) = '<' then begin |
| 431 |
oc := oc + Copy(s,i,1); |
oc := '<'; |
| 432 |
|
end else begin |
| 433 |
|
oc := oc + AnsiUpperCase(Copy(s,i,1)); |
| 434 |
|
end; |
| 435 |
chk := False; |
chk := False; |
| 436 |
al := False; |
al := False; |
| 437 |
end; |
end; |
| 477 |
end; |
end; |
| 478 |
end; |
end; |
| 479 |
for i := List.Count - 1 downto 0 do begin |
for i := List.Count - 1 downto 0 do begin |
| 480 |
if (AnsiPos('-', PIndex(List[i]).FNo) > 0) then begin |
separateNumber(st, et, PIndex(List[i]).FNo, '-'); |
|
st := ChooseString(PIndex(List[i]).FNo, '-', 0); |
|
|
et := ChooseString(PIndex(List[i]).FNo, '-', 1); |
|
|
end else begin |
|
|
st := PIndex(List[i]).FNo; |
|
|
et := PIndex(List[i]).FNo; |
|
|
end; |
|
| 481 |
if not DatToHTML then |
if not DatToHTML then |
| 482 |
r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) + |
r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) + |
| 483 |
Format('<a href="../test/read.cgi?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s" target="_blank">', |
Format(FORMAT_LINK, [ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) + |
|
[ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) + |
|
| 484 |
Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' + |
Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' + |
| 485 |
Copy(r,PIndex(List[i]).FIndexTo,Length(r)) |
Copy(r,PIndex(List[i]).FIndexTo,Length(r)) |
| 486 |
else |
else |
| 513 |
ZN = '0123456789−'; |
ZN = '0123456789−'; |
| 514 |
var |
var |
| 515 |
i : integer; |
i : integer; |
| 516 |
s,r : string; |
s : string; |
| 517 |
b : TMbcsByteType; |
b : TMbcsByteType; |
| 518 |
sw: boolean; |
sw: boolean; |
| 519 |
sp: integer; |
sp: integer; |
| 550 |
begin |
begin |
| 551 |
{ v1.0 b2 - 03 } |
{ v1.0 b2 - 03 } |
| 552 |
s := Body; |
s := Body; |
| 553 |
r := Body; |
Result := Body; |
| 554 |
i := 1; |
i := 1; |
| 555 |
sw := False; |
sw := False; |
| 556 |
No := ''; |
No := ''; |
| 561 |
al := False; |
al := False; |
| 562 |
while true do begin |
while true do begin |
| 563 |
b := ByteType(s, i); |
b := ByteType(s, i); |
| 564 |
case b of |
case b of |
| 565 |
mbSingleByte : begin |
mbSingleByte : begin |
| 566 |
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
| 567 |
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin |
if (Pos('<A HREF', AnsiUpperCase(oc)) = 0) then begin |
| 568 |
sw := True; |
sw := True; |
| 569 |
sp := i; |
sp := i; |
| 570 |
i := i + 7; |
i := i + 7; |
| 573 |
end; |
end; |
| 574 |
end else |
end else |
| 575 |
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
| 576 |
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 1) then begin |
if (Pos('<A HREF', AnsiUpperCase(oc)) = 1) then begin |
| 577 |
i := i + 7; |
i := i + 7; |
| 578 |
oc:=''; |
oc:=''; |
| 579 |
chk := True; |
chk := True; |
| 580 |
end; |
end; |
| 581 |
end else |
end else |
| 582 |
if (not sw) and (Copy(s,i,4) = GT) then begin |
if (not sw) and (Copy(s,i,4) = GT) then begin |
| 583 |
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin |
if (Pos('<A HREF', AnsiUpperCase(oc)) = 0) then begin |
| 584 |
sw := True; |
sw := True; |
| 585 |
sp := i; |
sp := i; |
| 586 |
i := i + 3; |
i := i + 3; |
| 602 |
end else |
end else |
| 603 |
if (sw) then begin |
if (sw) then begin |
| 604 |
sx := Copy(s,i,1); |
sx := Copy(s,i,1); |
| 605 |
if (AnsiPos(sx, SN) > 0) then begin |
if (Pos(sx, SN) > 0) then begin |
| 606 |
No := No + sx; |
No := No + sx; |
| 607 |
end else begin |
end else begin |
| 608 |
if (No <> '') and (No <> '-') then begin |
if (No <> '') and (No <> '-') then begin |
| 665 |
end; |
end; |
| 666 |
end; |
end; |
| 667 |
for i := List.Count - 1 downto 0 do begin |
for i := List.Count - 1 downto 0 do begin |
|
//plName := Copy(PluginName, LastDelimiter('\',PluginName) + 1, Length(PluginName) - LastDelimiter('/',PluginName) -1 ); |
|
| 668 |
if (AnsiPos('-', PIndex(List[i]).FNo) > 0) then begin |
if (AnsiPos('-', PIndex(List[i]).FNo) > 0) then begin |
| 669 |
st := ChooseString(PIndex(List[i]).FNo, '-', 0); |
st := ChooseString(PIndex(List[i]).FNo, '-', 0); |
| 670 |
et := ChooseString(PIndex(List[i]).FNo, '-', 1); |
et := ChooseString(PIndex(List[i]).FNo, '-', 1); |
| 672 |
st := PIndex(List[i]).FNo; |
st := PIndex(List[i]).FNo; |
| 673 |
et := PIndex(List[i]).FNo; |
et := PIndex(List[i]).FNo; |
| 674 |
end; |
end; |
| 675 |
r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) + |
Result := Copy(Result,0, PIndex(List[i]).FIndexFrom - 1) + |
| 676 |
Format('<a href="%s&%s=%s&%s=%s&%s=%s" target="_blank">', |
Format('<a href="%s&%s=%s&%s=%s&%s=%s" target="_blank">', |
| 677 |
[FullURL, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) + |
[FullURL, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) + |
| 678 |
Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' + |
Copy(Result,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' + |
| 679 |
Copy(r,PIndex(List[i]).FIndexTo,Length(r)); |
Copy(Result,PIndex(List[i]).FIndexTo,Length(Result)); |
| 680 |
Dispose(PIndex(List[i])); |
Dispose(PIndex(List[i])); |
| 681 |
end; |
end; |
| 682 |
List.Free; |
List.Free; |
|
Result := r; |
|
| 683 |
end; |
end; |
| 684 |
|
|
| 685 |
function THTMLCreate.ConvertResAnchor(res: string): string; |
function THTMLCreate.ConvertResAnchor(res: string): string; |
| 731 |
end; |
end; |
| 732 |
|
|
| 733 |
//Pluginを利用するBoardのスレッドのHTMLを作成してdocに書き込む |
//Pluginを利用するBoardのスレッドのHTMLを作成してdocに書き込む |
| 734 |
procedure THTMLCreate.CreateUsePluginHTML(doc: Variant; ThreadItem: TThreadItem; var sTitle: string); |
procedure THTMLCreate.CreateUsePluginHTML(html: TStringList; ThreadItem: TThreadItem; var sTitle: string); |
| 735 |
var |
var |
| 736 |
i: integer; |
i: integer; |
| 737 |
NewReceiveNo: Integer; |
NewReceiveNo: Integer; |
| 745 |
NewReceiveNo := ThreadItem.NewReceive; |
NewReceiveNo := ThreadItem.NewReceive; |
| 746 |
// フォントやサイズの設定 |
// フォントやサイズの設定 |
| 747 |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
| 748 |
|
html.BeginUpdate; |
| 749 |
try |
try |
| 750 |
doc.open; |
//doc.open; |
| 751 |
// ヘッダ |
// ヘッダ |
| 752 |
doc.Write( boardPlugIn.GetHeader( DWORD( threadItem ), |
//doc.Write( boardPlugIn.GetHeader( DWORD( threadItem ), |
| 753 |
'<style type="text/css">body {' + UserOptionalStyle + '}</style>' ) + #13#10 ); |
html.Append( boardPlugIn.GetHeader( DWORD( threadItem ), |
| 754 |
doc.Write('<p id="idSearch"></p>' + #13#10 ); |
'<style type="text/css">body {' + UserOptionalStyle + '}</style>' )); |
| 755 |
|
// '<style type="text/css">body {' + UserOptionalStyle + '}</style>' ) + #13#10 ); |
| 756 |
|
//doc.Write('<p id="idSearch"></p>' + #13#10 ); |
| 757 |
|
html.Add('<p id="idSearch"></p>'); |
| 758 |
for i := 0 to threadItem.Count - 1 do begin |
for i := 0 to threadItem.Count - 1 do begin |
| 759 |
// 1 は必ず表示 |
// 1 は必ず表示 |
| 760 |
if i <> 0 then begin |
if i <> 0 then begin |
| 777 |
try |
try |
| 778 |
if GikoSys.Setting.UseSkin then begin |
if GikoSys.Setting.UseSkin then begin |
| 779 |
if FileExists( GikoSys.GetSkinNewmarkFileName ) then |
if FileExists( GikoSys.GetSkinNewmarkFileName ) then |
| 780 |
doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) |
//doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) |
| 781 |
|
html.Append( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size )) |
| 782 |
else |
else |
| 783 |
doc.Write( '<a name="new"></a>' + #13#10 ); |
//doc.Write( '<a name="new"></a>' + #13#10 ); |
| 784 |
|
html.Append( '<a name="new"></a>' ); |
| 785 |
end else if GikoSys.Setting.UseCSS then begin |
end else if GikoSys.Setting.UseCSS then begin |
| 786 |
doc.Write('<a name="new"></a><div class="new">新着レス <span class="newdate">' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</span></div>' + #13#10); |
//doc.Write('<a name="new"></a><div class="new">新着レス <span class="newdate">' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</span></div>' + #13#10); |
| 787 |
|
html.Append('<a name="new"></a><div class="new">新着レス <span class="newdate">' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</span></div>'); |
| 788 |
end else begin |
end else begin |
| 789 |
doc.Write('</dl>'); |
//doc.Write('</dl>'); |
| 790 |
doc.Write('<a name="new"></a>'); |
html.Append('</dl>'); |
| 791 |
doc.Write('<table width="100%" bgcolor="#3333CC" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#6666FF" valign="middle"><font size="-1" color="#ffffff"><b>新着レス ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>'); |
//doc.Write('<a name="new"></a>'); |
| 792 |
doc.Write('<dl> + #13#10'); |
html.Append('<a name="new"></a>'); |
| 793 |
|
//doc.Write('<table width="100%" bgcolor="#3333CC" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#6666FF" valign="middle"><font size="-1" color="#ffffff"><b>新着レス ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>'); |
| 794 |
|
html.Append('<table width="100%" bgcolor="#3333CC" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#6666FF" valign="middle"><font size="-1" color="#ffffff"><b>新着レス ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>'); |
| 795 |
|
//doc.Write('<dl> + #13#10'); |
| 796 |
|
html.Append('<dl>'); |
| 797 |
end; |
end; |
| 798 |
except |
except |
| 799 |
doc.Write( '<a name="new"></a>' + #13#10); |
//doc.Write( '<a name="new"></a>' + #13#10); |
| 800 |
|
html.Append( '<a name="new"></a>'); |
| 801 |
end; |
end; |
| 802 |
end; |
end; |
| 803 |
|
|
| 804 |
// レス |
// レス |
| 805 |
doc.Write( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ) + #13#10 ); |
//doc.Write( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ) + #13#10 ); |
| 806 |
|
html.Append( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ) ); |
| 807 |
|
|
| 808 |
if ThreadItem.Kokomade = (i + 1) then begin |
if ThreadItem.Kokomade = (i + 1) then begin |
| 809 |
// ここまで読んだ |
// ここまで読んだ |
| 810 |
try |
try |
| 811 |
if GikoSys.Setting.UseSkin then begin |
if GikoSys.Setting.UseSkin then begin |
| 812 |
if FileExists( GikoSys.GetSkinBookmarkFileName ) then |
if FileExists( GikoSys.GetSkinBookmarkFileName ) then |
| 813 |
doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) |
//doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) |
| 814 |
|
html.Append( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) ) |
| 815 |
else |
else |
| 816 |
doc.Write( '<a name="koko"></a>' + #13#10 ); |
//doc.Write( '<a name="koko"></a>' + #13#10 ); |
| 817 |
|
html.Append( '<a name="koko"></a>' ); |
| 818 |
end else if GikoSys.Setting.UseCSS then begin |
end else if GikoSys.Setting.UseCSS then begin |
| 819 |
doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>' + #13#10 ); |
//doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>' + #13#10 ); |
| 820 |
|
html.Append('<a name="koko"></a><div class="koko">ココまで読んだ</div>' ); |
| 821 |
end else begin |
end else begin |
| 822 |
doc.Write('</dl>'); |
//doc.Write('</dl>'); |
| 823 |
doc.Write('<a name="koko"></a><table width="100%" bgcolor="#55AA55" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#77CC77" valign="middle"><font size="-1" color="#ffffff"><b>ココまで読んだ</b></font></td></tr></table>'); |
html.Append('</dl>'); |
| 824 |
doc.Write('<dl>' + #13#10 ); |
//doc.Write('<a name="koko"></a><table width="100%" bgcolor="#55AA55" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#77CC77" valign="middle"><font size="-1" color="#ffffff"><b>ココまで読んだ</b></font></td></tr></table>'); |
| 825 |
|
html.Append('<a name="koko"></a><table width="100%" bgcolor="#55AA55" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#77CC77" valign="middle"><font size="-1" color="#ffffff"><b>ココまで読んだ</b></font></td></tr></table>'); |
| 826 |
|
//doc.Write('<dl>' + #13#10 ); |
| 827 |
|
html.Append('<dl>' ); |
| 828 |
end; |
end; |
| 829 |
except |
except |
| 830 |
doc.Write( '<a name="koko"></a>' + #13#10 ); |
//doc.Write( '<a name="koko"></a>' + #13#10 ); |
| 831 |
|
html.Append( '<a name="koko"></a>' ); |
| 832 |
end; |
end; |
| 833 |
end; |
end; |
| 834 |
end; |
end; |
| 835 |
|
|
| 836 |
|
|
| 837 |
// スキン(フッタ) |
// スキン(フッタ) |
| 838 |
doc.Write( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ) + #13#10 ); |
//doc.Write( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ) + #13#10 ); |
| 839 |
|
html.Append( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ) ); |
| 840 |
finally |
finally |
| 841 |
doc.Close; |
//doc.Close; |
| 842 |
|
html.EndUpdate; |
| 843 |
end; |
end; |
| 844 |
|
|
| 845 |
end; |
end; |
| 847 |
end; |
end; |
| 848 |
|
|
| 849 |
|
|
| 850 |
procedure THTMLCreate.CreateUseSKINHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList); |
procedure THTMLCreate.CreateUseSKINHTML(html : TStringList; ThreadItem: TThreadItem; ReadList: TStringList); |
| 851 |
var |
var |
| 852 |
i: integer; |
i: integer; |
| 853 |
No: string; |
No: string; |
| 871 |
// フォントやサイズの設定 |
// フォントやサイズの設定 |
| 872 |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
| 873 |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
| 874 |
doc.open; |
//doc.open; |
| 875 |
|
html.BeginUpdate; |
| 876 |
try |
try |
| 877 |
doc.charset := 'Shift_JIS'; |
//doc.charset := 'Shift_JIS'; |
| 878 |
|
|
| 879 |
// スキンの設定 |
// スキンの設定 |
| 880 |
try |
try |
| 882 |
if Length( UserOptionalStyle ) > 0 then |
if Length( UserOptionalStyle ) > 0 then |
| 883 |
SkinHeader := CustomStringReplace( SkinHeader, '</head>', |
SkinHeader := CustomStringReplace( SkinHeader, '</head>', |
| 884 |
'<style type="text/css">body {' + UserOptionalStyle + '}</style></head>'); |
'<style type="text/css">body {' + UserOptionalStyle + '}</style></head>'); |
| 885 |
doc.Write( SkinHeader + #13#10); |
//doc.Write( SkinHeader + #13#10); |
| 886 |
|
html.Append( SkinHeader); |
| 887 |
except |
except |
| 888 |
end; |
end; |
| 889 |
|
|
| 897 |
except |
except |
| 898 |
end; |
end; |
| 899 |
|
|
| 900 |
doc.Write('<p id="idSearch"></p>' + #13#10); |
//doc.Write('<p id="idSearch"></p>' + #13#10); |
| 901 |
doc.Write('<a name="top"></a>' + #13#10); |
html.Append('<p id="idSearch"></p>'); |
| 902 |
|
//doc.Write('<a name="top"></a>' + #13#10); |
| 903 |
|
html.Append('<a name="top"></a>'); |
| 904 |
|
|
| 905 |
for i := 0 to ReadList.Count - 1 do begin |
for i := 0 to ReadList.Count - 1 do begin |
| 906 |
// 1 は必ず表示 |
// 1 は必ず表示 |
| 923 |
if (NewReceiveNo = i + 1) or ((NewReceiveNo = 0) and (i = 0)) then begin |
if (NewReceiveNo = i + 1) or ((NewReceiveNo = 0) and (i = 0)) then begin |
| 924 |
try |
try |
| 925 |
if FileExists( GikoSys.GetSkinNewmarkFileName ) then |
if FileExists( GikoSys.GetSkinNewmarkFileName ) then |
| 926 |
doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10) |
//doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10) |
| 927 |
|
html.Append( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) ) |
| 928 |
else |
else |
| 929 |
doc.Write( '<a name="new"></a>' + #13#10 ); |
//doc.Write( '<a name="new"></a>' + #13#10 ); |
| 930 |
|
html.Append( '<a name="new"></a>' ); |
| 931 |
except |
except |
| 932 |
doc.Write( '<a name="new"></a>' + #13#10 ); |
//doc.Write( '<a name="new"></a>' + #13#10 ); |
| 933 |
|
html.Append( '<a name="new"></a>' ); |
| 934 |
end; |
end; |
| 935 |
end; |
end; |
| 936 |
|
|
| 949 |
// 通常のレス |
// 通常のレス |
| 950 |
strTmp := ReplaceRes( SkinRes ); |
strTmp := ReplaceRes( SkinRes ); |
| 951 |
|
|
| 952 |
doc.Write( strTmp + #13#10 ); |
//doc.Write( strTmp + #13#10 ); |
| 953 |
|
html.Append( strTmp ); |
| 954 |
except |
except |
| 955 |
end; |
end; |
| 956 |
end; |
end; |
| 959 |
// ここまで読んだ |
// ここまで読んだ |
| 960 |
try |
try |
| 961 |
if FileExists( GikoSys.GetSkinBookmarkFileName ) then |
if FileExists( GikoSys.GetSkinBookmarkFileName ) then |
| 962 |
doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) |
//doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) |
| 963 |
|
html.Append( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) ) |
| 964 |
else |
else |
| 965 |
doc.Write( '<a name="koko"></a>' + #13#10 ); |
//doc.Write( '<a name="koko"></a>' + #13#10 ); |
| 966 |
|
html.Append( '<a name="koko"></a>' ); |
| 967 |
except |
except |
| 968 |
doc.Write( '<a name="koko"></a>' + #13#10 ); |
//doc.Write( '<a name="koko"></a>' + #13#10 ); |
| 969 |
|
html.Append( '<a name="koko"></a>' ); |
| 970 |
end; |
end; |
| 971 |
end; |
end; |
| 972 |
end; |
end; |
| 973 |
|
|
| 974 |
doc.Write('<a name="bottom"></a>' + #13#10); |
//doc.Write('<a name="bottom"></a>' + #13#10); |
| 975 |
|
html.Append('<a name="bottom"></a>' ); |
| 976 |
// スキン(フッタ) |
// スキン(フッタ) |
| 977 |
try |
try |
| 978 |
doc.Write( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) + #13#10 ); |
//doc.Write( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) + #13#10 ); |
| 979 |
|
html.Append( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) ); |
| 980 |
except |
except |
| 981 |
end; |
end; |
| 982 |
finally |
finally |
| 983 |
doc.close; |
//doc.close; |
| 984 |
|
html.EndUpdate; |
| 985 |
end; |
end; |
| 986 |
end; |
end; |
| 987 |
end; |
end; |
| 988 |
end; |
end; |
| 989 |
|
|
| 990 |
procedure THTMLCreate.CreateUseCSSHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
procedure THTMLCreate.CreateUseCSSHTML(html: TStringList; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
| 991 |
var |
var |
| 992 |
i: integer; |
i: integer; |
| 993 |
No: string; |
No: string; |
| 997 |
UserOptionalStyle: string; |
UserOptionalStyle: string; |
| 998 |
begin |
begin |
| 999 |
if ThreadItem <> nil then begin |
if ThreadItem <> nil then begin |
| 1000 |
doc.open; |
//doc.open; |
| 1001 |
|
html.BeginUpdate; |
| 1002 |
try |
try |
| 1003 |
doc.charset := 'Shift_JIS'; |
//doc.charset := 'Shift_JIS'; |
| 1004 |
NewReceiveNo := ThreadItem.NewReceive; |
NewReceiveNo := ThreadItem.NewReceive; |
| 1005 |
// フォントやサイズの設定 |
// フォントやサイズの設定 |
| 1006 |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
| 1007 |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
| 1008 |
if GikoSys.Setting.UseCSS and FileExists(CSSFileName) then begin |
if GikoSys.Setting.UseCSS and FileExists(CSSFileName) then begin |
| 1009 |
//CSS使用 |
//CSS使用 |
| 1010 |
doc.Write('<html><head>' + #13#10); |
html.Append('<html><head>'); |
| 1011 |
doc.Write('<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">' + #13#10); |
html.Append('<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">'); |
| 1012 |
doc.Write('<title>' + sTitle + '</title>' + #13#10); |
html.Append('<title>' + sTitle + '</title>'); |
| 1013 |
doc.Write('<link rel="stylesheet" href="'+CSSFileName+'" type="text/css">' + #13#10); |
html.Append('<link rel="stylesheet" href="'+CSSFileName+'" type="text/css">'); |
| 1014 |
if Length( UserOptionalStyle ) > 0 then |
if Length( UserOptionalStyle ) > 0 then |
| 1015 |
doc.Write('<style type="text/css">body {' + UserOptionalStyle + '}</style>' + #13#10); |
html.Append('<style type="text/css">body {' + UserOptionalStyle + '}</style>'); |
| 1016 |
doc.Write('</head>' + #13#10); |
html.Append('</head>'); |
| 1017 |
doc.Write('<body>' + #13#10); |
html.Append('<body>'); |
| 1018 |
doc.Write('<a name="top"></a>' + #13#10); |
html.Append('<a name="top"></a>'); |
| 1019 |
doc.Write('<p id="idSearch"></p>' + #13#10); |
html.Append('<p id="idSearch"></p>'); |
| 1020 |
doc.Write('<div class="title">' + sTitle + '</div>' + #13#10); |
html.Append('<div class="title">' + sTitle + '</div>'); |
| 1021 |
for i := 0 to ReadList.Count - 1 do begin |
for i := 0 to ReadList.Count - 1 do begin |
| 1022 |
// 1 は必ず表示 |
// 1 は必ず表示 |
| 1023 |
if i <> 0 then begin |
if i <> 0 then begin |
| 1036 |
end; |
end; |
| 1037 |
|
|
| 1038 |
if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin |
if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin |
| 1039 |
doc.Write('<a name="new"></a><div class="new">新着レス <span class="newdate">' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</span></div>' + #13#10); |
html.Append('<a name="new"></a><div class="new">新着レス <span class="newdate">' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</span></div>'); |
| 1040 |
end; |
end; |
| 1041 |
|
|
| 1042 |
if (Trim(ReadList[i]) <> '') then begin |
if (Trim(ReadList[i]) <> '') then begin |
| 1045 |
Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true'); |
Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true'); |
| 1046 |
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
| 1047 |
if Res.FMailTo = '' then |
if Res.FMailTo = '' then |
| 1048 |
doc.Write('<a name="' + No + '"></a>' |
html.Append('<a name="' + No + '"></a>' |
| 1049 |
+ '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span> ' |
+ '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span> ' |
| 1050 |
+ '<span class="name_label">名前:</span> ' |
+ '<span class="name_label">名前:</span> ' |
| 1051 |
+ '<span class="name"><b>' + Res.FName + '</b></span> ' |
+ '<span class="name"><b>' + Res.FName + '</b></span> ' |
| 1052 |
+ '<span class="date_label">投稿日:</span> ' |
+ '<span class="date_label">投稿日:</span> ' |
| 1053 |
+ '<span class="date">' + Res.FDateTime+ '</span></div>' |
+ '<span class="date">' + Res.FDateTime+ '</span></div>' |
| 1054 |
+ '<div class="mes">' + Res.FBody + ' </div>' + #13#10) |
+ '<div class="mes">' + Res.FBody + ' </div>') |
| 1055 |
else if GikoSys.Setting.ShowMail then |
else if GikoSys.Setting.ShowMail then |
| 1056 |
doc.Write('<a name="' + No + '"></a>' |
html.Append('<a name="' + No + '"></a>' |
| 1057 |
+ '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span>' |
+ '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span>' |
| 1058 |
+ '<span class="name_label"> 名前: </span>' |
+ '<span class="name_label"> 名前: </span>' |
| 1059 |
+ '<a class="name_mail" href="mailto:' + Res.FMailTo + '">' |
+ '<a class="name_mail" href="mailto:' + Res.FMailTo + '">' |
| 1060 |
+ '<b>' + Res.FName + '</b></a><span class="mail"> [' + Res.FMailTo + ']</span>' |
+ '<b>' + Res.FName + '</b></a><span class="mail"> [' + Res.FMailTo + ']</span>' |
| 1061 |
+ '<span class="date_label"> 投稿日:</span>' |
+ '<span class="date_label"> 投稿日:</span>' |
| 1062 |
+ '<span class="date"> ' + Res.FDateTime+ '</span></div>' |
+ '<span class="date"> ' + Res.FDateTime+ '</span></div>' |
| 1063 |
+ '<div class="mes">' + Res.FBody + ' </div>' + #13#10) |
+ '<div class="mes">' + Res.FBody + ' </div>') |
| 1064 |
else |
else |
| 1065 |
doc.Write('<a name="' + No + '"></a>' |
html.Append('<a name="' + No + '"></a>' |
| 1066 |
+ '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span>' |
+ '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span>' |
| 1067 |
+ '<span class="name_label"> 名前: </span>' |
+ '<span class="name_label"> 名前: </span>' |
| 1068 |
+ '<a class="name_mail" href="mailto:' + Res.FMailTo + '">' |
+ '<a class="name_mail" href="mailto:' + Res.FMailTo + '">' |
| 1069 |
+ '<b>' + Res.FName + '</b></a>' |
+ '<b>' + Res.FName + '</b></a>' |
| 1070 |
+ '<span class="date_label"> 投稿日:</span>' |
+ '<span class="date_label"> 投稿日:</span>' |
| 1071 |
+ '<span class="date"> ' + Res.FDateTime+ '</span></div>' |
+ '<span class="date"> ' + Res.FDateTime+ '</span></div>' |
| 1072 |
+ '<div class="mes">' + Res.FBody + ' </div>' + #13#10); |
+ '<div class="mes">' + Res.FBody + ' </div>'); |
| 1073 |
end; |
end; |
| 1074 |
|
|
| 1075 |
if ThreadItem.Kokomade = (i + 1) then begin |
if ThreadItem.Kokomade = (i + 1) then begin |
| 1076 |
doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>' + #13#10); |
html.Append('<a name="koko"></a><div class="koko">ココまで読んだ</div>'); |
| 1077 |
end; |
end; |
| 1078 |
|
|
| 1079 |
end; |
end; |
| 1080 |
|
|
| 1081 |
doc.Write('<a name="bottom"></a>' + #13#10); |
html.Append('<a name="bottom"></a>'); |
| 1082 |
doc.Write('<a name="last"></a>' + #13#10); |
html.Append('<a name="last"></a>'); |
| 1083 |
doc.Write('</body></html>' + #13#10); |
html.Append('</body></html>'); |
| 1084 |
end; |
end; |
| 1085 |
finally |
finally |
| 1086 |
doc.Close; |
html.EndUpdate; |
| 1087 |
|
//doc.Close; |
| 1088 |
end; |
end; |
| 1089 |
end; |
end; |
| 1090 |
end; |
end; |
| 1091 |
|
|
| 1092 |
procedure THTMLCreate.CreateDefaultHTML (doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
procedure THTMLCreate.CreateDefaultHTML (html: TStringList; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
| 1093 |
var |
var |
| 1094 |
i: integer; |
i: integer; |
| 1095 |
No: string; |
No: string; |
| 1097 |
Res: TResRec; |
Res: TResRec; |
| 1098 |
begin |
begin |
| 1099 |
if ThreadItem <> nil then begin |
if ThreadItem <> nil then begin |
| 1100 |
doc.open; |
//doc.open; |
| 1101 |
|
html.BeginUpdate; |
| 1102 |
try |
try |
| 1103 |
doc.charset := 'Shift_JIS'; |
//doc.charset := 'Shift_JIS'; |
| 1104 |
NewReceiveNo := ThreadItem.NewReceive; |
NewReceiveNo := ThreadItem.NewReceive; |
| 1105 |
doc.Write('<html><head>' + #13#10); |
html.Append('<html><head>'); |
| 1106 |
doc.Write('<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">' + #13#10); |
html.Append('<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">'); |
| 1107 |
doc.Write('<title>' + sTitle + '</title></head>' + #13#10); |
html.Append('<title>' + sTitle + '</title></head>'); |
| 1108 |
doc.Write('<body TEXT="#000000" BGCOLOR="#EFEFEF" link="#0000FF" alink="#FF0000" vlink="#660099">' + #13#10); |
html.Append('<body TEXT="#000000" BGCOLOR="#EFEFEF" link="#0000FF" alink="#FF0000" vlink="#660099">'); |
| 1109 |
doc.Write('<a name="top"></a>' + #13#10); |
html.Append('<a name="top"></a>'); |
| 1110 |
doc.Write('<font size=+1 color="#FF0000">' + sTitle + '</font>' + #13#10); |
html.Append('<font size=+1 color="#FF0000">' + sTitle + '</font>'); |
| 1111 |
doc.Write('<dl>' + #13#10); |
html.Append('<dl>'); |
| 1112 |
doc.Write('<p id="idSearch"></p>' + #13#10); |
html.Append('<p id="idSearch"></p>'); |
| 1113 |
for i := 0 to ReadList.Count - 1 do begin |
for i := 0 to ReadList.Count - 1 do begin |
| 1114 |
// 1 は必ず表示 |
// 1 は必ず表示 |
| 1115 |
if i <> 0 then begin |
if i <> 0 then begin |
| 1128 |
end; |
end; |
| 1129 |
|
|
| 1130 |
if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin |
if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin |
| 1131 |
doc.Write('</dl>' + #13#10); |
html.Append('</dl>'); |
| 1132 |
doc.Write('<a name="new"></a>' + #13#10); |
html.Append('<a name="new"></a>'); |
| 1133 |
doc.Write('<table width="100%" bgcolor="#3333CC" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#6666FF" valign="middle"><font size="-1" color="#ffffff"><b>新着レス ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>' + #13#10); |
html.Append('<table width="100%" bgcolor="#3333CC" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#6666FF" valign="middle"><font size="-1" color="#ffffff"><b>新着レス ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>'); |
| 1134 |
doc.Write('<dl>' + #13#10); |
html.Append('<dl>'); |
| 1135 |
end; |
end; |
| 1136 |
|
|
| 1137 |
if (Trim(ReadList[i]) <> '') then begin |
if (Trim(ReadList[i]) <> '') then begin |
| 1140 |
Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true'); |
Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true'); |
| 1141 |
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
| 1142 |
if Res.FMailTo = '' then |
if Res.FMailTo = '' then |
| 1143 |
doc.Write('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> 名前:<font color="forestgreen"><b> ' + Res.FName + ' </b></font> 投稿日: <span class="date">' + Res.FDateTime+ '</span><br><dd>' + Res.Fbody + ' <br><br><br>' + #13#10) |
html.Append('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> 名前:<font color="forestgreen"><b> ' + Res.FName + ' </b></font> 投稿日: <span class="date">' + Res.FDateTime+ '</span><br><dd>' + Res.Fbody + ' <br><br><br>') |
| 1144 |
else if GikoSys.Setting.ShowMail then |
else if GikoSys.Setting.ShowMail then |
| 1145 |
doc.Write('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> 名前:<a href="mailto:' + Res.FMailTo + '"><b> ' + Res.FName + ' </B></a> [' + Res.FMailTo + '] 投稿日: <span class="date">' + Res.FDateTime+ '</span><br><dd>' + Res.Fbody + ' <br><br><br>' + #13#10) |
html.Append('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> 名前:<a href="mailto:' + Res.FMailTo + '"><b> ' + Res.FName + ' </B></a> [' + Res.FMailTo + '] 投稿日: <span class="date">' + Res.FDateTime+ '</span><br><dd>' + Res.Fbody + ' <br><br><br>') |
| 1146 |
else |
else |
| 1147 |
doc.Write('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> 名前:<a href="mailto:' + Res.FMailTo + '"><b> ' + Res.FName + ' </B></a> 投稿日: <span class="date">' + Res.FDateTime+ '</span><br><dd>' + Res.Fbody + ' <br><br><br>' + #13#10); |
html.Append('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> 名前:<a href="mailto:' + Res.FMailTo + '"><b> ' + Res.FName + ' </B></a> 投稿日: <span class="date">' + Res.FDateTime+ '</span><br><dd>' + Res.Fbody + ' <br><br><br>'); |
| 1148 |
end; |
end; |
| 1149 |
if ThreadItem.Kokomade = (i + 1) then begin |
if ThreadItem.Kokomade = (i + 1) then begin |
| 1150 |
doc.Write('</dl>' + #13#10); |
html.Append('</dl>'); |
| 1151 |
doc.Write('<a name="koko"></a><table width="100%" bgcolor="#55AA55" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#77CC77" valign="middle"><font size="-1" color="#ffffff"><b>ココまで読んだ</b></font></td></tr></table>' + #13#10); |
html.Append('<a name="koko"></a><table width="100%" bgcolor="#55AA55" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#77CC77" valign="middle"><font size="-1" color="#ffffff"><b>ココまで読んだ</b></font></td></tr></table>'); |
| 1152 |
doc.Write('<dl>' + #13#10); |
html.Append('<dl>'); |
| 1153 |
end; |
end; |
| 1154 |
end; |
end; |
| 1155 |
doc.Write('</dl>' + #13#10); |
html.Append('</dl>'); |
| 1156 |
doc.Write('<a name="bottom"></a>' + #13#10); |
html.Append('<a name="bottom"></a>'); |
| 1157 |
doc.Write('</body></html>' + #13#10); |
html.Append('</body></html>'); |
| 1158 |
finally |
finally |
| 1159 |
doc.Close; |
//doc.Close; |
| 1160 |
|
html.EndUpdate; |
| 1161 |
end; |
end; |
| 1162 |
end; |
end; |
| 1163 |
end; |
end; |
| 1164 |
|
|
| 1165 |
procedure THTMLCreate.CreateHTML2(doc: Variant; ThreadItem: TThreadItem; var sTitle: string); |
procedure THTMLCreate.CreateHTML2(doc: IDispatch; ThreadItem: TThreadItem; var sTitle: string); |
| 1166 |
var |
var |
| 1167 |
ReadList: TStringList; |
ReadList: TStringList; |
| 1168 |
CSSFileName: string; |
CSSFileName: string; |
| 1169 |
FileName: string; |
FileName: string; |
| 1170 |
Res: TResRec; |
Res: TResRec; |
| 1171 |
|
html: TStringList; |
| 1172 |
|
mStream : TMemoryStream; |
| 1173 |
{$IFDEF DEBUG} |
{$IFDEF DEBUG} |
| 1174 |
st, rt: Cardinal; |
st, rt: Cardinal; |
| 1175 |
{$ENDIF} |
{$ENDIF} |
| 1179 |
st := GetTickCount; |
st := GetTickCount; |
| 1180 |
{$ENDIF} |
{$ENDIF} |
| 1181 |
if ThreadItem <> nil then begin |
if ThreadItem <> nil then begin |
| 1182 |
if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin |
html := TStringList.Create; |
| 1183 |
CreateUsePluginHTML(doc, ThreadItem, sTitle); |
try |
| 1184 |
end else begin |
if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin |
| 1185 |
ShortDayNames[1] := '日'; ShortDayNames[2] := '月'; |
CreateUsePluginHTML(html, ThreadItem, sTitle); |
| 1186 |
ShortDayNames[3] := '火'; ShortDayNames[4] := '水'; |
end else begin |
| 1187 |
ShortDayNames[5] := '木'; ShortDayNames[6] := '金'; |
ShortDayNames[1] := '日'; ShortDayNames[2] := '月'; |
| 1188 |
ShortDayNames[7] := '土'; |
ShortDayNames[3] := '火'; ShortDayNames[4] := '水'; |
| 1189 |
|
ShortDayNames[5] := '木'; ShortDayNames[6] := '金'; |
| 1190 |
|
ShortDayNames[7] := '土'; |
| 1191 |
|
|
| 1192 |
ReadList := TStringList.Create; |
ReadList := TStringList.Create; |
| 1193 |
try |
try |
| 1194 |
if ThreadItem.IsLogFile then begin |
if ThreadItem.IsLogFile then begin |
| 1195 |
FileName := ThreadItem.GetThreadFileName; |
FileName := ThreadItem.GetThreadFileName; |
| 1196 |
ReadList.LoadFromFile(FileName); |
ReadList.LoadFromFile(FileName); |
| 1197 |
GikoSys.FAbon.IndividualAbon(ReadList, ChangeFileExt(FileName,'.NG')); |
GikoSys.FAbon.IndividualAbon(ReadList, ChangeFileExt(FileName,'.NG')); |
| 1198 |
GikoSys.FAbon.Execute(ReadList); // あぼ〜んして |
GikoSys.FAbon.Execute(ReadList); // あぼ〜んして |
| 1199 |
GikoSys.FSelectResFilter.Execute(ReadList); //レスのフィルタリングをする |
GikoSys.FSelectResFilter.Execute(ReadList); //レスのフィルタリングをする |
| 1200 |
if ThreadItem.Title = '' then begin |
if ThreadItem.Title = '' then begin |
| 1201 |
Res := DivideStrLine(ReadList[0]); |
Res := DivideStrLine(ReadList[0]); |
| 1202 |
sTitle := Res.FTitle; |
sTitle := Res.FTitle; |
| 1203 |
end else |
end else |
| 1204 |
sTitle := ThreadItem.Title |
sTitle := ThreadItem.Title |
| 1205 |
end else begin |
end else begin |
| 1206 |
sTitle := CustomStringReplace(ThreadItem.Title, '@`', ','); |
sTitle := CustomStringReplace(ThreadItem.Title, '@`', ','); |
| 1207 |
end; |
end; |
| 1208 |
|
|
| 1209 |
// フォントやサイズの設定 |
// フォントやサイズの設定 |
| 1210 |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
| 1211 |
if GikoSys.Setting.UseSkin then begin |
if GikoSys.Setting.UseSkin then begin |
| 1212 |
CreateUseSKINHTML(doc, ThreadItem, ReadList); |
CreateUseSKINHTML(html, ThreadItem, ReadList); |
| 1213 |
end else if GikoSys.Setting.UseCSS and FileExists(CSSFileName) then begin |
end else if GikoSys.Setting.UseCSS and FileExists(CSSFileName) then begin |
| 1214 |
CreateUseCSSHTML(doc, ThreadItem, ReadList, sTitle); |
CreateUseCSSHTML(html, ThreadItem, ReadList, sTitle); |
| 1215 |
end else begin |
end else begin |
| 1216 |
CreateDefaultHTML(doc, ThreadItem, ReadList, sTitle); |
CreateDefaultHTML(html, ThreadItem, ReadList, sTitle); |
| 1217 |
|
end; |
| 1218 |
|
finally |
| 1219 |
|
ReadList.Free; |
| 1220 |
end; |
end; |
| 1221 |
|
end; |
| 1222 |
|
//WebBrowserに書き込み |
| 1223 |
|
mStream := TMemoryStream.Create; |
| 1224 |
|
try |
| 1225 |
|
html.SaveToStream(mStream); |
| 1226 |
|
mStream.Seek(soFromBeginning, 0); |
| 1227 |
|
(doc as IPersistStreamInit).Load(TStreamAdapter.Create(mStream)); |
| 1228 |
finally |
finally |
| 1229 |
ReadList.Free; |
mStream.Free; |
| 1230 |
end; |
end; |
| 1231 |
|
finally |
| 1232 |
|
html.Free; |
| 1233 |
end; |
end; |
| 1234 |
end; |
end; |
| 1235 |
{$IFDEF DEBUG} |
{$IFDEF DEBUG} |