| 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 |
|
procedure separateNumber(var st: String; var et: String; const Text, Separator: String); |
| 40 |
public |
public |
| 41 |
{ Public 宣言 } |
{ Public 宣言 } |
| 42 |
function AddAnchorTag(s: string): string; |
function AddAnchorTag(s: string): string; |
| 43 |
function LoadFromSkin(fileName: string; ThreadItem: TThreadItem; SizeByte: Integer): string; |
function LoadFromSkin(fileName: string; ThreadItem: TThreadItem; SizeByte: Integer): string; |
| 44 |
function SkinedRes(skin: string; Res: TResRec; No: string): string; |
function SkinedRes(skin: string; Res: TResRec; No: string): string; |
| 45 |
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; |
| 46 |
function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue, FullURL : string): string; overload; |
procedure CreateHTML2(doc: IDispatch; ThreadItem: TThreadItem; var sTitle: string); |
|
procedure CreateHTML2(doc: Variant; 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; |
| 301 |
end else |
end else |
| 302 |
Result := AID; |
Result := AID; |
| 303 |
end; |
end; |
| 304 |
|
procedure THTMLCreate.separateNumber(var st: String; var et: String; const Text, Separator: String); |
| 305 |
|
var |
| 306 |
|
p : Integer; |
| 307 |
|
begin |
| 308 |
|
p := Pos(Separator,Text); |
| 309 |
|
if (p > 0 ) then begin |
| 310 |
|
st := Copy(Text, 1, p - 1); |
| 311 |
|
et := Copy(Text, p + Length(Separator), Length(Text)); |
| 312 |
|
end else begin |
| 313 |
|
st := Text; |
| 314 |
|
et := Text; |
| 315 |
|
end; |
| 316 |
|
end; |
| 317 |
|
|
| 318 |
(************************************************************************* |
(************************************************************************* |
| 319 |
* |
* |
| 320 |
* from HotZonu |
* from HotZonu |
| 322 |
function THTMLCreate.ConvRes(const Body, Bbs, Key, |
function THTMLCreate.ConvRes(const Body, Bbs, Key, |
| 323 |
ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue : string; |
ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue : string; |
| 324 |
DatToHTML: boolean = false): string; |
DatToHTML: boolean = false): string; |
|
type |
|
|
PIndex = ^TIndex; |
|
|
TIndex = record |
|
|
FIndexFrom : integer; |
|
|
FIndexTo : integer; |
|
|
FNo : string; |
|
|
end; |
|
| 325 |
const |
const |
| 326 |
GT = '>'; |
GT = '>'; |
| 327 |
SN = '0123456789-'; |
SN = '0123456789'; |
| 328 |
ZN = '0123456789−'; |
FORMAT_LINK = '<a href="../test/read.cgi?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s" target="_blank">'; |
| 329 |
var |
var |
| 330 |
i : integer; |
i : integer; |
| 331 |
s,r : string; |
s : string; |
|
b : TMbcsByteType; |
|
| 332 |
sw: boolean; |
sw: boolean; |
| 333 |
sp: integer; |
cm: boolean; |
| 334 |
No: string; |
No: string; |
|
sx: string; |
|
|
List: TList; |
|
| 335 |
oc : string; |
oc : string; |
| 336 |
st, et: string; |
st, et: string; |
| 337 |
chk : boolean; |
pos, pmin : integer; |
| 338 |
al : boolean; |
j : integer; |
| 339 |
procedure Add(IndexFrom, IndexTo: integer; const No: string); |
token : array[0..5] of string; |
| 340 |
var |
ch : string; |
| 341 |
FIndex : PIndex; |
db : boolean; |
| 342 |
begin |
len : integer; |
| 343 |
New(FIndex); |
rink : string; |
|
FIndex.FIndexFrom := IndexFrom; |
|
|
FIndex.FIndexTo := IndexTo; |
|
|
FIndex.FNo := No; |
|
|
List.Add(FIndex); |
|
|
end; |
|
|
function ChooseString(const Text, Separator: string; Index: integer): string; |
|
|
var |
|
|
S : string; |
|
|
i, p : integer; |
|
|
begin |
|
|
S := Text; |
|
|
for i := 0 to Index - 1 do begin |
|
|
if (AnsiPos(Separator, S) = 0) then S := '' |
|
|
else S := Copy(S, AnsiPos(Separator, S) + Length(Separator), Length(S)); |
|
|
end; |
|
|
p := AnsiPos(Separator, S); |
|
|
if (p > 0) then Result := Copy(S, 1, p - 1) else Result := S; |
|
|
end; |
|
| 344 |
begin |
begin |
| 345 |
{ v1.0 b2 - 03 } |
//s に本文を全部入れる |
| 346 |
s := Body; |
s := Body; |
| 347 |
r := Body; |
//結果をクリア |
| 348 |
i := 1; |
Result := ''; |
| 349 |
sw := False; |
//検索対象の文字列郡 |
| 350 |
No := ''; |
token[0] := GT + GT; |
| 351 |
List:= TList.Create; |
token[1] := GT; |
| 352 |
oc := ''; |
token[2] := '>>'; |
| 353 |
sp := 0; |
token[3] := '>'; |
| 354 |
chk := False; |
token[4] := '<a '; |
| 355 |
al := False; |
token[5] := '<A '; |
| 356 |
while true do begin |
|
| 357 |
b := ByteType(s, i); |
// |
| 358 |
case b of |
while Length(s) > 2 do begin |
| 359 |
mbSingleByte : begin |
pmin := Length(s) + 1; |
| 360 |
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
i := Length(token); |
| 361 |
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin |
for j := 0 to 5 do begin |
| 362 |
sw := True; |
pos := AnsiPos(token[j], s); |
| 363 |
sp := i; |
if pos <> 0 then begin |
| 364 |
i := i + 7; |
if pos < pmin then begin |
| 365 |
oc:=''; |
//どれでヒットしたか保存 |
| 366 |
chk := True; |
i := j; |
| 367 |
end; |
//最小値を更新 |
| 368 |
end else |
pmin := pos; |
| 369 |
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
end; |
| 370 |
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 1) then begin |
end; |
| 371 |
i := i + 7; |
end; |
| 372 |
oc:=''; |
|
| 373 |
chk := True; |
//ヒットした文字列の一つ手前まで結果にコピー |
| 374 |
end; |
Result := Result + Copy(s, 1, pmin - 1); |
| 375 |
end else |
Delete(s, 1, pmin - 1); |
| 376 |
if (not sw) and (Copy(s,i,4) = GT) then begin |
|
| 377 |
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin |
if i = 6 then begin |
| 378 |
sw := True; |
//ヒットなし |
| 379 |
sp := i; |
end else if (i = 4) or (i = 5) then begin |
| 380 |
i := i + 3; |
//'<a ' or '<A' でヒット '</a>' or '</A>' までコピー |
| 381 |
oc:=''; |
pmin := AnsiPos('</a>' , s); |
| 382 |
chk := True; |
pos := AnsiPos('</A>' , s); |
| 383 |
end; |
if (pmin <> 0) and (pos <> 0) then begin |
| 384 |
end else |
if (pmin > pos) then begin |
| 385 |
if ((not sw) and (Copy(s,i,1) = ',')) or |
pmin := pos; |
| 386 |
((not sw) and (Copy(s,i,1) = '=')) then begin |
end; |
| 387 |
if ((not Chk) and (AnsiLowerCase(oc) = '</a>')) or |
end else if (pos <> 0) then begin |
| 388 |
((Chk) and (oc = '')) or |
pmin := pos; |
| 389 |
((not Chk) and (al)) then |
end; |
| 390 |
begin |
rink := Copy(s, 1, pmin + 3); |
| 391 |
sw := True; |
Result := Result + rink; |
| 392 |
sp := i; |
Delete(s, 1, pmin + 3); |
| 393 |
//i := i + 1; |
|
| 394 |
oc:=''; |
pmin := Length(rink); |
| 395 |
end; |
i := Length(token); |
| 396 |
end else |
for j := 0 to 3 do begin |
| 397 |
if (sw) then begin |
pos := AnsiPos(token[j], rink); |
| 398 |
sx := Copy(s,i,1); |
if pos <> 0 then begin |
| 399 |
if (AnsiPos(sx, SN) > 0) then begin |
if pos < pmin then begin |
| 400 |
No := No + sx; |
//どれでヒットしたか保存 |
| 401 |
end else begin |
i := j; |
| 402 |
if (No <> '') and (No <> '-') then begin |
//最小値を更新 |
| 403 |
Add(sp, i, No); |
pmin := pos; |
|
al := True; |
|
|
end; |
|
|
sw := False; |
|
|
// |
|
|
i := i - 1; |
|
|
// |
|
|
No := ''; |
|
|
oc:=''; |
|
|
//chk := False; |
|
| 404 |
end; |
end; |
|
end else begin |
|
|
if Copy(s,i,1) = '<' then oc := ''; |
|
|
oc := oc + Copy(s,i,1); |
|
|
chk := False; |
|
|
al := False; |
|
| 405 |
end; |
end; |
| 406 |
end; |
end; |
| 407 |
mbLeadByte : begin |
// レスアンカーが含まれていたら,が続く限りアンカーとして扱う |
| 408 |
if (not sw) and (Copy(s,i,4) = '>>') then begin |
if i <= 3 then begin |
| 409 |
sw := True; |
cm := false; |
| 410 |
sp := i; |
j := 1 ; |
| 411 |
i := i + 3; |
if (s[j] = ',') or (ZenToHan(Copy(s, j ,2)) = ',') then begin |
| 412 |
chk := True; |
cm := true; |
| 413 |
end else |
db := false; |
| 414 |
if (not sw) and (Copy(s,i,2) = '>') then begin |
sw := false; |
| 415 |
sw := True; |
if (ByteType(s, j) = mbSingleByte) then |
| 416 |
sp := i; |
Inc(j) |
| 417 |
i := i + 1; |
else |
| 418 |
chk := True; |
Inc(j, 2); |
| 419 |
end else |
No := ''; |
| 420 |
if (sw) then begin |
len := Length(s); |
| 421 |
sx := Copy(s,i,2); |
while cm do begin |
| 422 |
if (AnsiPos(sx, ZN) > 0) then begin |
while (j <= len) do begin |
| 423 |
No := No + ZenToHan(sx); |
if (ByteType(s, j) = mbSingleByte) then begin |
| 424 |
end else begin |
//1byte文字 |
| 425 |
if (No <> '') and (No <> '-') and (No <> '−') then begin |
ch := s[j]; |
| 426 |
Add(sp, i, No); |
Inc(j); |
| 427 |
|
db := false; |
| 428 |
|
end else begin |
| 429 |
|
//2byte文字 |
| 430 |
|
ch := ZenToHan(Copy(s, j, 2)); |
| 431 |
|
Inc(j, 2); |
| 432 |
|
db := true; |
| 433 |
|
end; |
| 434 |
|
if System.Pos(ch, SN) > 0 then begin |
| 435 |
|
No := No + ch; |
| 436 |
|
end else if (ch = '-') then begin |
| 437 |
|
if sw then break; |
| 438 |
|
if No = '' then cm := false; |
| 439 |
|
No := No + ch; |
| 440 |
|
sw := true; |
| 441 |
|
end else begin |
| 442 |
|
break; |
| 443 |
|
end; |
| 444 |
|
end; |
| 445 |
|
//終端まで行っての終了かチェック |
| 446 |
|
if j <= len then begin |
| 447 |
|
if db then j := j - 2 |
| 448 |
|
else j := j - 1; |
| 449 |
|
end; |
| 450 |
|
//何も数字が見つからないとき |
| 451 |
|
if No = '' then begin |
| 452 |
|
Result := Result + Copy(s, 1, j - 1); |
| 453 |
|
end else begin |
| 454 |
|
separateNumber(st, et, No, '-'); |
| 455 |
|
|
| 456 |
|
if not DatToHTML then begin |
| 457 |
|
Result := Result + Format(FORMAT_LINK, |
| 458 |
|
[ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]); |
| 459 |
|
end else begin |
| 460 |
|
Result := Result + Format('<a href="#%s">', [st]); |
| 461 |
|
end; |
| 462 |
|
Result := Result + Copy(s, 1, j - 1) + '</a>'; |
| 463 |
|
end; |
| 464 |
|
Delete(s, 1, j - 1); |
| 465 |
|
j := 1; |
| 466 |
|
if (s[j] = ',') or (ZenToHan(Copy(s, j ,2)) = ',') then begin |
| 467 |
|
cm := true; |
| 468 |
|
if (ByteType(s, j) = mbSingleByte) then |
| 469 |
|
Inc(j) |
| 470 |
|
else |
| 471 |
|
Inc(j, 2); |
| 472 |
|
No := ''; |
| 473 |
|
len := Length(s); |
| 474 |
|
end else begin |
| 475 |
|
cm := false; |
| 476 |
end; |
end; |
|
sw := False; |
|
|
i := i - 1; |
|
|
No := ''; |
|
| 477 |
end; |
end; |
|
end else begin |
|
|
oc := ''; |
|
|
chk := False; |
|
| 478 |
end; |
end; |
|
al := False; |
|
| 479 |
end; |
end; |
|
end; |
|
|
inc(i); |
|
|
if (i > Length(Body)) then begin |
|
|
if (sw) then begin |
|
|
if (No <> '') then Add(sp, i, No); |
|
|
end; |
|
|
Break; |
|
|
end; |
|
|
end; |
|
|
for i := List.Count - 1 downto 0 do begin |
|
|
if (AnsiPos('-', PIndex(List[i]).FNo) > 0) then begin |
|
|
st := ChooseString(PIndex(List[i]).FNo, '-', 0); |
|
|
et := ChooseString(PIndex(List[i]).FNo, '-', 1); |
|
| 480 |
end else begin |
end else begin |
| 481 |
st := PIndex(List[i]).FNo; |
//何かしら見つかったパターン |
| 482 |
et := PIndex(List[i]).FNo; |
j := Length(token[i]) + 1; |
| 483 |
end; |
oc := ''; |
| 484 |
if not DatToHTML then |
No := ''; |
| 485 |
r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) + |
sw := false; |
| 486 |
Format('<a href="../test/read.cgi?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s" target="_blank">', |
db := false; |
| 487 |
[ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) + |
len := Length(s); |
| 488 |
Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' + |
while j <= len do begin |
| 489 |
Copy(r,PIndex(List[i]).FIndexTo,Length(r)) |
if (ByteType(s, j) = mbSingleByte) then begin |
| 490 |
else |
//1byte文字 |
| 491 |
r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) + |
ch := s[j]; |
| 492 |
Format('<a href="#%s">', [st]) + |
Inc(j); |
| 493 |
Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' + |
db := false; |
| 494 |
Copy(r,PIndex(List[i]).FIndexTo,Length(r)); |
end else begin |
| 495 |
|
//2byte文字 |
| 496 |
Dispose(PIndex(List[i])); |
ch := ZenToHan(Copy(s, j, 2)); |
| 497 |
end; |
Inc(j, 2); |
| 498 |
List.Free; |
db := true; |
| 499 |
Result := r; |
end; |
|
end; |
|
| 500 |
|
|
| 501 |
function THTMLCreate.ConvRes( |
if System.Pos(ch, SN) > 0 then begin |
| 502 |
const Body, Bbs, Key, ParamBBS, ParamKey, |
No := No + ch; |
| 503 |
ParamStart, ParamTo, ParamNoFirst, |
end else if (ch = '-') then begin |
| 504 |
ParamTrue, FullURL : string |
if sw then break; |
| 505 |
): string; |
if No = '' then break; |
| 506 |
type |
No := No + ch; |
| 507 |
PIndex = ^TIndex; |
sw := true; |
|
TIndex = record |
|
|
FIndexFrom : integer; |
|
|
FIndexTo : integer; |
|
|
FNo : string; |
|
|
end; |
|
|
const |
|
|
GT = '>'; |
|
|
SN = '0123456789-'; |
|
|
ZN = '0123456789−'; |
|
|
var |
|
|
i : integer; |
|
|
s,r : string; |
|
|
b : TMbcsByteType; |
|
|
sw: boolean; |
|
|
sp: integer; |
|
|
No: string; |
|
|
sx: string; |
|
|
List: TList; |
|
|
oc : string; |
|
|
st, et: string; |
|
|
chk : boolean; |
|
|
al : boolean; |
|
|
procedure Add(IndexFrom, IndexTo: integer; const No: string); |
|
|
var |
|
|
FIndex : PIndex; |
|
|
begin |
|
|
New(FIndex); |
|
|
FIndex.FIndexFrom := IndexFrom; |
|
|
FIndex.FIndexTo := IndexTo; |
|
|
FIndex.FNo := No; |
|
|
List.Add(FIndex); |
|
|
end; |
|
|
function ChooseString(const Text, Separator: string; Index: integer): string; |
|
|
var |
|
|
S : string; |
|
|
i, p : integer; |
|
|
begin |
|
|
S := Text; |
|
|
for i := 0 to Index - 1 do begin |
|
|
if (AnsiPos(Separator, S) = 0) then S := '' |
|
|
else S := Copy(S, AnsiPos(Separator, S) + Length(Separator), Length(S)); |
|
|
end; |
|
|
p := AnsiPos(Separator, S); |
|
|
if (p > 0) then Result := Copy(S, 1, p - 1) else Result := S; |
|
|
end; |
|
|
begin |
|
|
{ v1.0 b2 - 03 } |
|
|
s := Body; |
|
|
r := Body; |
|
|
i := 1; |
|
|
sw := False; |
|
|
No := ''; |
|
|
List:= TList.Create; |
|
|
oc := ''; |
|
|
sp := 0; |
|
|
chk := False; |
|
|
al := False; |
|
|
while true do begin |
|
|
b := ByteType(s, i); |
|
|
case b of |
|
|
mbSingleByte : begin |
|
|
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
|
|
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin |
|
|
sw := True; |
|
|
sp := i; |
|
|
i := i + 7; |
|
|
oc:=''; |
|
|
chk := True; |
|
|
end; |
|
|
end else |
|
|
if (not sw) and (Copy(s,i,8) = GT + GT) then begin |
|
|
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 1) then begin |
|
|
i := i + 7; |
|
|
oc:=''; |
|
|
chk := True; |
|
|
end; |
|
|
end else |
|
|
if (not sw) and (Copy(s,i,4) = GT) then begin |
|
|
if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin |
|
|
sw := True; |
|
|
sp := i; |
|
|
i := i + 3; |
|
|
oc:=''; |
|
|
chk := True; |
|
|
end; |
|
|
end else |
|
|
if ((not sw) and (Copy(s,i,1) = ',')) or |
|
|
((not sw) and (Copy(s,i,1) = '=')) then begin |
|
|
if ((not Chk) and (AnsiLowerCase(oc) = '</a>')) or |
|
|
((Chk) and (oc = '')) or |
|
|
((not Chk) and (al)) then |
|
|
begin |
|
|
sw := True; |
|
|
sp := i; |
|
|
//i := i + 1; |
|
|
oc:=''; |
|
|
end; |
|
|
end else |
|
|
if (sw) then begin |
|
|
sx := Copy(s,i,1); |
|
|
if (AnsiPos(sx, SN) > 0) then begin |
|
|
No := No + sx; |
|
|
end else begin |
|
|
if (No <> '') and (No <> '-') then begin |
|
|
Add(sp, i, No); |
|
|
al := True; |
|
|
end; |
|
|
sw := False; |
|
|
// |
|
|
i := i - 1; |
|
|
// |
|
|
No := ''; |
|
|
oc:=''; |
|
|
//chk := False; |
|
|
end; |
|
| 508 |
end else begin |
end else begin |
| 509 |
if Copy(s,i,1) = '<' then oc := ''; |
break; |
|
oc := oc + Copy(s,i,1); |
|
|
chk := False; |
|
|
al := False; |
|
| 510 |
end; |
end; |
| 511 |
end; |
end; |
| 512 |
mbLeadByte : begin |
//終端まで行っての終了かチェック |
| 513 |
if (not sw) and (Copy(s,i,4) = '>>') then begin |
if j <= len then begin |
| 514 |
sw := True; |
if db then j := j - 2 |
| 515 |
sp := i; |
else j := j - 1; |
| 516 |
i := i + 3; |
end; |
| 517 |
chk := True; |
//何も数字が見つからないとき |
| 518 |
end else |
if No = '' then begin |
| 519 |
if (not sw) and (Copy(s,i,2) = '>') then begin |
Result := Result + Copy(s, 1, j - 1); |
| 520 |
sw := True; |
end else begin |
| 521 |
sp := i; |
separateNumber(st, et, No, '-'); |
| 522 |
i := i + 1; |
|
| 523 |
chk := True; |
if not DatToHTML then begin |
| 524 |
end else |
Result := Result + Format(FORMAT_LINK, |
| 525 |
if (sw) then begin |
[ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]); |
|
sx := Copy(s,i,2); |
|
|
if (AnsiPos(sx, ZN) > 0) then begin |
|
|
No := No + ZenToHan(sx); |
|
|
end else begin |
|
|
if (No <> '') and (No <> '-') and (No <> '−') then begin |
|
|
Add(sp, i, No); |
|
|
end; |
|
|
sw := False; |
|
|
i := i - 1; |
|
|
No := ''; |
|
|
end; |
|
| 526 |
end else begin |
end else begin |
| 527 |
oc := ''; |
Result := Result + Format('<a href="#%s">', [st]); |
|
chk := False; |
|
| 528 |
end; |
end; |
| 529 |
al := False; |
Result := Result + Copy(s, 1, j - 1) + '</a>'; |
|
end; |
|
|
end; |
|
|
inc(i); |
|
|
if (i > Length(Body)) then begin |
|
|
if (sw) then begin |
|
|
if (No <> '') then Add(sp, i, No); |
|
| 530 |
end; |
end; |
| 531 |
Break; |
Delete(s, 1, j - 1); |
|
end; |
|
|
end; |
|
|
for i := List.Count - 1 downto 0 do begin |
|
|
//plName := Copy(PluginName, LastDelimiter('\',PluginName) + 1, Length(PluginName) - LastDelimiter('/',PluginName) -1 ); |
|
|
if (AnsiPos('-', PIndex(List[i]).FNo) > 0) then begin |
|
|
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; |
|
| 532 |
end; |
end; |
|
r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) + |
|
|
Format('<a href="%s&%s=%s&%s=%s&%s=%s" target="_blank">', |
|
|
[FullURL, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) + |
|
|
Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' + |
|
|
Copy(r,PIndex(List[i]).FIndexTo,Length(r)); |
|
|
Dispose(PIndex(List[i])); |
|
| 533 |
end; |
end; |
| 534 |
List.Free; |
Result := Result + s; |
|
Result := r; |
|
| 535 |
end; |
end; |
| 536 |
|
|
| 537 |
function THTMLCreate.ConvertResAnchor(res: string): string; |
function THTMLCreate.ConvertResAnchor(res: string): string; |
| 583 |
end; |
end; |
| 584 |
|
|
| 585 |
//Pluginを利用するBoardのスレッドのHTMLを作成してdocに書き込む |
//Pluginを利用するBoardのスレッドのHTMLを作成してdocに書き込む |
| 586 |
procedure THTMLCreate.CreateUsePluginHTML(doc: Variant; ThreadItem: TThreadItem; var sTitle: string); |
procedure THTMLCreate.CreateUsePluginHTML(html: TStringList; ThreadItem: TThreadItem; var sTitle: string); |
| 587 |
var |
var |
| 588 |
i: integer; |
i: integer; |
| 589 |
NewReceiveNo: Integer; |
NewReceiveNo: Integer; |
| 597 |
NewReceiveNo := ThreadItem.NewReceive; |
NewReceiveNo := ThreadItem.NewReceive; |
| 598 |
// フォントやサイズの設定 |
// フォントやサイズの設定 |
| 599 |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
| 600 |
|
html.BeginUpdate; |
| 601 |
try |
try |
|
doc.open; |
|
| 602 |
// ヘッダ |
// ヘッダ |
| 603 |
doc.Write( boardPlugIn.GetHeader( DWORD( threadItem ), |
html.Append( boardPlugIn.GetHeader( DWORD( threadItem ), |
| 604 |
'<style type="text/css">body {' + UserOptionalStyle + '}</style>' ) + #13#10 ); |
'<style type="text/css">body {' + UserOptionalStyle + '}</style>' )); |
| 605 |
doc.Write('<p id="idSearch"></p>' + #13#10 ); |
html.Add('<p id="idSearch"></p>'); |
|
|
|
| 606 |
for i := 0 to threadItem.Count - 1 do begin |
for i := 0 to threadItem.Count - 1 do begin |
| 607 |
// 1 は必ず表示 |
// 1 は必ず表示 |
| 608 |
if i <> 0 then begin |
if i <> 0 then begin |
| 625 |
try |
try |
| 626 |
if GikoSys.Setting.UseSkin then begin |
if GikoSys.Setting.UseSkin then begin |
| 627 |
if FileExists( GikoSys.GetSkinNewmarkFileName ) then |
if FileExists( GikoSys.GetSkinNewmarkFileName ) then |
| 628 |
doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) |
html.Append( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size )) |
| 629 |
else |
else |
| 630 |
doc.Write( '<a name="new"></a>' + #13#10 ); |
//doc.Write( '<a name="new"></a>' + #13#10 ); |
| 631 |
|
html.Append( '<a name="new"></a>' ); |
| 632 |
end else if GikoSys.Setting.UseCSS then begin |
end else if GikoSys.Setting.UseCSS then begin |
| 633 |
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>'); |
| 634 |
end else begin |
end else begin |
| 635 |
doc.Write('</dl>'); |
html.Append('</dl>'); |
| 636 |
doc.Write('<a name="new"></a>'); |
html.Append('<a name="new"></a>'); |
| 637 |
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>'); |
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>'); |
| 638 |
doc.Write('<dl> + #13#10'); |
html.Append('<dl>'); |
| 639 |
end; |
end; |
| 640 |
except |
except |
| 641 |
doc.Write( '<a name="new"></a>' + #13#10); |
html.Append( '<a name="new"></a>'); |
| 642 |
end; |
end; |
| 643 |
end; |
end; |
| 644 |
|
|
| 645 |
// レス |
// レス |
| 646 |
doc.Write( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ) + #13#10 ); |
html.Append( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ) ); |
| 647 |
|
|
| 648 |
if ThreadItem.Kokomade = (i + 1) then begin |
if ThreadItem.Kokomade = (i + 1) then begin |
| 649 |
// ここまで読んだ |
// ここまで読んだ |
| 650 |
try |
try |
| 651 |
if GikoSys.Setting.UseSkin then begin |
if GikoSys.Setting.UseSkin then begin |
| 652 |
if FileExists( GikoSys.GetSkinBookmarkFileName ) then |
if FileExists( GikoSys.GetSkinBookmarkFileName ) then |
| 653 |
doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) |
html.Append( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) ) |
| 654 |
else |
else |
| 655 |
doc.Write( '<a name="koko"></a>' + #13#10 ); |
html.Append( '<a name="koko"></a>' ); |
| 656 |
end else if GikoSys.Setting.UseCSS then begin |
end else if GikoSys.Setting.UseCSS then begin |
| 657 |
doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>' + #13#10 ); |
html.Append('<a name="koko"></a><div class="koko">ココまで読んだ</div>' ); |
| 658 |
end else begin |
end else begin |
| 659 |
doc.Write('</dl>'); |
html.Append('</dl>'); |
| 660 |
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('<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>'); |
| 661 |
doc.Write('<dl>' + #13#10 ); |
html.Append('<dl>' ); |
| 662 |
end; |
end; |
| 663 |
except |
except |
| 664 |
doc.Write( '<a name="koko"></a>' + #13#10 ); |
html.Append( '<a name="koko"></a>' ); |
| 665 |
end; |
end; |
| 666 |
end; |
end; |
| 667 |
end; |
end; |
| 668 |
|
|
| 669 |
|
|
| 670 |
// スキン(フッタ) |
// スキン(フッタ) |
| 671 |
doc.Write( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ) + #13#10 ); |
html.Append( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ) ); |
| 672 |
finally |
finally |
| 673 |
doc.Close; |
html.EndUpdate; |
| 674 |
end; |
end; |
| 675 |
|
|
| 676 |
end; |
end; |
| 678 |
end; |
end; |
| 679 |
|
|
| 680 |
|
|
| 681 |
procedure THTMLCreate.CreateUseSKINHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList); |
procedure THTMLCreate.CreateUseSKINHTML(html : TStringList; ThreadItem: TThreadItem; ReadList: TStringList); |
| 682 |
var |
var |
| 683 |
i: integer; |
i: integer; |
| 684 |
No: string; |
No: string; |
| 690 |
SkinNewRes: string; |
SkinNewRes: string; |
| 691 |
SkinRes: string; |
SkinRes: string; |
| 692 |
strTmp : string; |
strTmp : string; |
| 693 |
function ReplaceRes( skin: string ): string; |
threadKey : string; |
|
begin |
|
|
Result := SkinedRes( skin, Res, No ); |
|
|
end; |
|
| 694 |
begin |
begin |
| 695 |
if ThreadItem <> nil then begin |
if ThreadItem <> nil then begin |
| 696 |
// スキン使用 |
// スキン使用 |
| 699 |
// フォントやサイズの設定 |
// フォントやサイズの設定 |
| 700 |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
| 701 |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
| 702 |
doc.open; |
|
| 703 |
|
threadKey := ChangeFileExt(ThreadItem.FileName, ''); |
| 704 |
|
html.BeginUpdate; |
| 705 |
try |
try |
| 706 |
doc.charset := 'Shift_JIS'; |
//doc.charset := 'Shift_JIS'; |
| 707 |
|
|
| 708 |
// スキンの設定 |
// スキンの設定 |
| 709 |
try |
try |
| 711 |
if Length( UserOptionalStyle ) > 0 then |
if Length( UserOptionalStyle ) > 0 then |
| 712 |
SkinHeader := CustomStringReplace( SkinHeader, '</head>', |
SkinHeader := CustomStringReplace( SkinHeader, '</head>', |
| 713 |
'<style type="text/css">body {' + UserOptionalStyle + '}</style></head>'); |
'<style type="text/css">body {' + UserOptionalStyle + '}</style></head>'); |
| 714 |
doc.Write( SkinHeader + #13#10); |
html.Append( SkinHeader); |
| 715 |
except |
except |
| 716 |
end; |
end; |
| 717 |
|
|
| 725 |
except |
except |
| 726 |
end; |
end; |
| 727 |
|
|
| 728 |
doc.Write('<p id="idSearch"></p>' + #13#10); |
html.Append('<p id="idSearch"></p>'); |
| 729 |
doc.Write('<a name="top"></a>' + #13#10); |
html.Append('<a name="top"></a>'); |
| 730 |
|
|
| 731 |
for i := 0 to ReadList.Count - 1 do begin |
for i := 0 to ReadList.Count - 1 do begin |
| 732 |
// 1 は必ず表示 |
// 1 は必ず表示 |
| 744 |
Continue; |
Continue; |
| 745 |
end; |
end; |
| 746 |
end; |
end; |
|
|
|
| 747 |
// 新着マーク |
// 新着マーク |
| 748 |
if (NewReceiveNo = i + 1) or ((NewReceiveNo = 0) and (i = 0)) then begin |
if (NewReceiveNo = i + 1) or ((NewReceiveNo = 0) and (i = 0)) then begin |
| 749 |
try |
try |
| 750 |
if FileExists( GikoSys.GetSkinNewmarkFileName ) then |
if FileExists( GikoSys.GetSkinNewmarkFileName ) then |
| 751 |
doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10) |
html.Append( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) ) |
| 752 |
else |
else |
| 753 |
doc.Write( '<a name="new"></a>' + #13#10 ); |
html.Append( '<a name="new"></a>' ); |
| 754 |
except |
except |
| 755 |
doc.Write( '<a name="new"></a>' + #13#10 ); |
html.Append( '<a name="new"></a>' ); |
| 756 |
end; |
end; |
| 757 |
end; |
end; |
| 758 |
|
|
| 760 |
No := IntToStr(i + 1); |
No := IntToStr(i + 1); |
| 761 |
|
|
| 762 |
Res := DivideStrLine(ReadList[i]); |
Res := DivideStrLine(ReadList[i]); |
| 763 |
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, threadKey, 'bbs', 'key', 'st', 'to', 'nofirst', 'true'); |
| 764 |
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
| 765 |
|
|
| 766 |
try |
try |
| 767 |
if NewReceiveNo <= (i + 1) then |
if NewReceiveNo <= (i + 1) then |
| 768 |
// 新着レス |
// 新着レス |
| 769 |
strTmp := ReplaceRes( SkinNewRes ) |
strTmp := SkinedRes( SkinNewRes, Res, No ) |
| 770 |
else |
else |
| 771 |
// 通常のレス |
// 通常のレス |
| 772 |
strTmp := ReplaceRes( SkinRes ); |
strTmp := SkinedRes( SkinRes, Res, No ); |
| 773 |
|
|
| 774 |
doc.Write( strTmp + #13#10 ); |
html.Append( strTmp ); |
| 775 |
except |
except |
| 776 |
end; |
end; |
| 777 |
end; |
end; |
| 780 |
// ここまで読んだ |
// ここまで読んだ |
| 781 |
try |
try |
| 782 |
if FileExists( GikoSys.GetSkinBookmarkFileName ) then |
if FileExists( GikoSys.GetSkinBookmarkFileName ) then |
| 783 |
doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) |
html.Append( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) ) |
| 784 |
else |
else |
| 785 |
doc.Write( '<a name="koko"></a>' + #13#10 ); |
html.Append( '<a name="koko"></a>' ); |
| 786 |
except |
except |
| 787 |
doc.Write( '<a name="koko"></a>' + #13#10 ); |
html.Append( '<a name="koko"></a>' ); |
| 788 |
end; |
end; |
| 789 |
end; |
end; |
| 790 |
end; |
end; |
| 791 |
|
|
| 792 |
doc.Write('<a name="bottom"></a>' + #13#10); |
html.Append('<a name="bottom"></a>' ); |
| 793 |
// スキン(フッタ) |
// スキン(フッタ) |
| 794 |
try |
try |
| 795 |
doc.Write( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) + #13#10 ); |
html.Append( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) ); |
| 796 |
except |
except |
| 797 |
end; |
end; |
| 798 |
finally |
finally |
| 799 |
doc.close; |
html.EndUpdate; |
| 800 |
end; |
end; |
| 801 |
end; |
end; |
| 802 |
end; |
end; |
| 803 |
end; |
end; |
| 804 |
|
|
| 805 |
procedure THTMLCreate.CreateUseCSSHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
procedure THTMLCreate.CreateUseCSSHTML(html: TStringList; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
| 806 |
var |
var |
| 807 |
i: integer; |
i: integer; |
| 808 |
No: string; |
No: string; |
| 812 |
UserOptionalStyle: string; |
UserOptionalStyle: string; |
| 813 |
begin |
begin |
| 814 |
if ThreadItem <> nil then begin |
if ThreadItem <> nil then begin |
| 815 |
doc.open; |
//doc.open; |
| 816 |
|
html.BeginUpdate; |
| 817 |
try |
try |
| 818 |
doc.charset := 'Shift_JIS'; |
//doc.charset := 'Shift_JIS'; |
| 819 |
NewReceiveNo := ThreadItem.NewReceive; |
NewReceiveNo := ThreadItem.NewReceive; |
| 820 |
// フォントやサイズの設定 |
// フォントやサイズの設定 |
| 821 |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
| 822 |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
| 823 |
if GikoSys.Setting.UseCSS and FileExists(CSSFileName) then begin |
if GikoSys.Setting.UseCSS and FileExists(CSSFileName) then begin |
| 824 |
//CSS使用 |
//CSS使用 |
| 825 |
doc.Write('<html><head>' + #13#10); |
html.Append('<html><head>'); |
| 826 |
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">'); |
| 827 |
doc.Write('<title>' + sTitle + '</title>' + #13#10); |
html.Append('<title>' + sTitle + '</title>'); |
| 828 |
doc.Write('<link rel="stylesheet" href="'+CSSFileName+'" type="text/css">' + #13#10); |
html.Append('<link rel="stylesheet" href="'+CSSFileName+'" type="text/css">'); |
| 829 |
if Length( UserOptionalStyle ) > 0 then |
if Length( UserOptionalStyle ) > 0 then |
| 830 |
doc.Write('<style type="text/css">body {' + UserOptionalStyle + '}</style>' + #13#10); |
html.Append('<style type="text/css">body {' + UserOptionalStyle + '}</style>'); |
| 831 |
doc.Write('</head>' + #13#10); |
html.Append('</head>'); |
| 832 |
doc.Write('<body>' + #13#10); |
html.Append('<body>'); |
| 833 |
doc.Write('<a name="top"></a>' + #13#10); |
html.Append('<a name="top"></a>'); |
| 834 |
doc.Write('<p id="idSearch"></p>' + #13#10); |
html.Append('<p id="idSearch"></p>'); |
| 835 |
doc.Write('<div class="title">' + sTitle + '</div>' + #13#10); |
html.Append('<div class="title">' + sTitle + '</div>'); |
| 836 |
for i := 0 to ReadList.Count - 1 do begin |
for i := 0 to ReadList.Count - 1 do begin |
| 837 |
// 1 は必ず表示 |
// 1 は必ず表示 |
| 838 |
if i <> 0 then begin |
if i <> 0 then begin |
| 851 |
end; |
end; |
| 852 |
|
|
| 853 |
if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin |
if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin |
| 854 |
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>'); |
| 855 |
end; |
end; |
| 856 |
|
|
| 857 |
if (Trim(ReadList[i]) <> '') then begin |
if (Trim(ReadList[i]) <> '') then begin |
| 860 |
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'); |
| 861 |
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
| 862 |
if Res.FMailTo = '' then |
if Res.FMailTo = '' then |
| 863 |
doc.Write('<a name="' + No + '"></a>' |
html.Append('<a name="' + No + '"></a>' |
| 864 |
+ '<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> ' |
| 865 |
+ '<span class="name_label">名前:</span> ' |
+ '<span class="name_label">名前:</span> ' |
| 866 |
+ '<span class="name"><b>' + Res.FName + '</b></span> ' |
+ '<span class="name"><b>' + Res.FName + '</b></span> ' |
| 867 |
+ '<span class="date_label">投稿日:</span> ' |
+ '<span class="date_label">投稿日:</span> ' |
| 868 |
+ '<span class="date">' + Res.FDateTime+ '</span></div>' |
+ '<span class="date">' + Res.FDateTime+ '</span></div>' |
| 869 |
+ '<div class="mes">' + Res.FBody + ' </div>' + #13#10) |
+ '<div class="mes">' + Res.FBody + ' </div>') |
| 870 |
else if GikoSys.Setting.ShowMail then |
else if GikoSys.Setting.ShowMail then |
| 871 |
doc.Write('<a name="' + No + '"></a>' |
html.Append('<a name="' + No + '"></a>' |
| 872 |
+ '<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>' |
| 873 |
+ '<span class="name_label"> 名前: </span>' |
+ '<span class="name_label"> 名前: </span>' |
| 874 |
+ '<a class="name_mail" href="mailto:' + Res.FMailTo + '">' |
+ '<a class="name_mail" href="mailto:' + Res.FMailTo + '">' |
| 875 |
+ '<b>' + Res.FName + '</b></a><span class="mail"> [' + Res.FMailTo + ']</span>' |
+ '<b>' + Res.FName + '</b></a><span class="mail"> [' + Res.FMailTo + ']</span>' |
| 876 |
+ '<span class="date_label"> 投稿日:</span>' |
+ '<span class="date_label"> 投稿日:</span>' |
| 877 |
+ '<span class="date"> ' + Res.FDateTime+ '</span></div>' |
+ '<span class="date"> ' + Res.FDateTime+ '</span></div>' |
| 878 |
+ '<div class="mes">' + Res.FBody + ' </div>' + #13#10) |
+ '<div class="mes">' + Res.FBody + ' </div>') |
| 879 |
else |
else |
| 880 |
doc.Write('<a name="' + No + '"></a>' |
html.Append('<a name="' + No + '"></a>' |
| 881 |
+ '<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>' |
| 882 |
+ '<span class="name_label"> 名前: </span>' |
+ '<span class="name_label"> 名前: </span>' |
| 883 |
+ '<a class="name_mail" href="mailto:' + Res.FMailTo + '">' |
+ '<a class="name_mail" href="mailto:' + Res.FMailTo + '">' |
| 884 |
+ '<b>' + Res.FName + '</b></a>' |
+ '<b>' + Res.FName + '</b></a>' |
| 885 |
+ '<span class="date_label"> 投稿日:</span>' |
+ '<span class="date_label"> 投稿日:</span>' |
| 886 |
+ '<span class="date"> ' + Res.FDateTime+ '</span></div>' |
+ '<span class="date"> ' + Res.FDateTime+ '</span></div>' |
| 887 |
+ '<div class="mes">' + Res.FBody + ' </div>' + #13#10); |
+ '<div class="mes">' + Res.FBody + ' </div>'); |
| 888 |
end; |
end; |
| 889 |
|
|
| 890 |
if ThreadItem.Kokomade = (i + 1) then begin |
if ThreadItem.Kokomade = (i + 1) then begin |
| 891 |
doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>' + #13#10); |
html.Append('<a name="koko"></a><div class="koko">ココまで読んだ</div>'); |
| 892 |
end; |
end; |
| 893 |
|
|
| 894 |
end; |
end; |
| 895 |
|
|
| 896 |
doc.Write('<a name="bottom"></a>' + #13#10); |
html.Append('<a name="bottom"></a>'); |
| 897 |
doc.Write('<a name="last"></a>' + #13#10); |
html.Append('<a name="last"></a>'); |
| 898 |
doc.Write('</body></html>' + #13#10); |
html.Append('</body></html>'); |
| 899 |
end; |
end; |
| 900 |
finally |
finally |
| 901 |
doc.Close; |
html.EndUpdate; |
| 902 |
|
//doc.Close; |
| 903 |
end; |
end; |
| 904 |
end; |
end; |
| 905 |
end; |
end; |
| 906 |
|
|
| 907 |
procedure THTMLCreate.CreateDefaultHTML (doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
procedure THTMLCreate.CreateDefaultHTML (html: TStringList; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string ); |
| 908 |
var |
var |
| 909 |
i: integer; |
i: integer; |
| 910 |
No: string; |
No: string; |
| 912 |
Res: TResRec; |
Res: TResRec; |
| 913 |
begin |
begin |
| 914 |
if ThreadItem <> nil then begin |
if ThreadItem <> nil then begin |
| 915 |
doc.open; |
//doc.open; |
| 916 |
|
html.BeginUpdate; |
| 917 |
try |
try |
| 918 |
doc.charset := 'Shift_JIS'; |
//doc.charset := 'Shift_JIS'; |
| 919 |
NewReceiveNo := ThreadItem.NewReceive; |
NewReceiveNo := ThreadItem.NewReceive; |
| 920 |
doc.Write('<html><head>' + #13#10); |
html.Append('<html><head>'); |
| 921 |
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">'); |
| 922 |
doc.Write('<title>' + sTitle + '</title></head>' + #13#10); |
html.Append('<title>' + sTitle + '</title></head>'); |
| 923 |
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">'); |
| 924 |
doc.Write('<a name="top"></a>' + #13#10); |
html.Append('<a name="top"></a>'); |
| 925 |
doc.Write('<font size=+1 color="#FF0000">' + sTitle + '</font>' + #13#10); |
html.Append('<font size=+1 color="#FF0000">' + sTitle + '</font>'); |
| 926 |
doc.Write('<dl>' + #13#10); |
html.Append('<dl>'); |
| 927 |
doc.Write('<p id="idSearch"></p>' + #13#10); |
html.Append('<p id="idSearch"></p>'); |
| 928 |
for i := 0 to ReadList.Count - 1 do begin |
for i := 0 to ReadList.Count - 1 do begin |
| 929 |
// 1 は必ず表示 |
// 1 は必ず表示 |
| 930 |
if i <> 0 then begin |
if i <> 0 then begin |
| 943 |
end; |
end; |
| 944 |
|
|
| 945 |
if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin |
if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin |
| 946 |
doc.Write('</dl>' + #13#10); |
html.Append('</dl>'); |
| 947 |
doc.Write('<a name="new"></a>' + #13#10); |
html.Append('<a name="new"></a>'); |
| 948 |
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>'); |
| 949 |
doc.Write('<dl>' + #13#10); |
html.Append('<dl>'); |
| 950 |
end; |
end; |
| 951 |
|
|
| 952 |
if (Trim(ReadList[i]) <> '') then begin |
if (Trim(ReadList[i]) <> '') then begin |
| 955 |
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'); |
| 956 |
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
| 957 |
if Res.FMailTo = '' then |
if Res.FMailTo = '' then |
| 958 |
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>') |
| 959 |
else if GikoSys.Setting.ShowMail then |
else if GikoSys.Setting.ShowMail then |
| 960 |
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>') |
| 961 |
else |
else |
| 962 |
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>'); |
| 963 |
end; |
end; |
| 964 |
if ThreadItem.Kokomade = (i + 1) then begin |
if ThreadItem.Kokomade = (i + 1) then begin |
| 965 |
doc.Write('</dl>' + #13#10); |
html.Append('</dl>'); |
| 966 |
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>'); |
| 967 |
doc.Write('<dl>' + #13#10); |
html.Append('<dl>'); |
| 968 |
end; |
end; |
| 969 |
end; |
end; |
| 970 |
doc.Write('</dl>' + #13#10); |
html.Append('</dl>'); |
| 971 |
doc.Write('<a name="bottom"></a>' + #13#10); |
html.Append('<a name="bottom"></a>'); |
| 972 |
doc.Write('</body></html>' + #13#10); |
html.Append('</body></html>'); |
| 973 |
finally |
finally |
| 974 |
doc.Close; |
//doc.Close; |
| 975 |
|
html.EndUpdate; |
| 976 |
end; |
end; |
| 977 |
end; |
end; |
| 978 |
end; |
end; |
| 979 |
|
|
| 980 |
procedure THTMLCreate.CreateHTML2(doc: Variant; ThreadItem: TThreadItem; var sTitle: string); |
procedure THTMLCreate.CreateHTML2(doc: IDispatch; ThreadItem: TThreadItem; var sTitle: string); |
| 981 |
var |
var |
| 982 |
ReadList: TStringList; |
ReadList: TStringList; |
| 983 |
CSSFileName: string; |
CSSFileName: string; |
| 984 |
FileName: string; |
FileName: string; |
| 985 |
Res: TResRec; |
Res: TResRec; |
| 986 |
|
html: TStringList; |
| 987 |
|
mStream : TMemoryStream; |
| 988 |
{$IFDEF DEBUG} |
{$IFDEF DEBUG} |
| 989 |
st, rt: Cardinal; |
st, rt: Cardinal; |
| 990 |
{$ENDIF} |
{$ENDIF} |
| 994 |
st := GetTickCount; |
st := GetTickCount; |
| 995 |
{$ENDIF} |
{$ENDIF} |
| 996 |
if ThreadItem <> nil then begin |
if ThreadItem <> nil then begin |
| 997 |
if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin |
html := TStringList.Create; |
| 998 |
CreateUsePluginHTML(doc, ThreadItem, sTitle); |
try |
| 999 |
end else begin |
if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin |
| 1000 |
ShortDayNames[1] := '日'; ShortDayNames[2] := '月'; |
CreateUsePluginHTML(html, ThreadItem, sTitle); |
| 1001 |
ShortDayNames[3] := '火'; ShortDayNames[4] := '水'; |
end else begin |
| 1002 |
ShortDayNames[5] := '木'; ShortDayNames[6] := '金'; |
ShortDayNames[1] := '日'; ShortDayNames[2] := '月'; |
| 1003 |
ShortDayNames[7] := '土'; |
ShortDayNames[3] := '火'; ShortDayNames[4] := '水'; |
| 1004 |
|
ShortDayNames[5] := '木'; ShortDayNames[6] := '金'; |
| 1005 |
|
ShortDayNames[7] := '土'; |
| 1006 |
|
|
| 1007 |
ReadList := TStringList.Create; |
ReadList := TStringList.Create; |
| 1008 |
try |
try |
| 1009 |
if ThreadItem.IsLogFile then begin |
ReadList.BeginUpdate; |
| 1010 |
FileName := ThreadItem.GetThreadFileName; |
if ThreadItem.IsLogFile then begin |
| 1011 |
ReadList.LoadFromFile(FileName); |
FileName := ThreadItem.GetThreadFileName; |
| 1012 |
GikoSys.FAbon.IndividualAbon(ReadList, ChangeFileExt(FileName,'.NG')); |
ReadList.LoadFromFile(FileName); |
| 1013 |
GikoSys.FAbon.Execute(ReadList); // あぼ〜んして |
GikoSys.FAbon.IndividualAbon(ReadList, ChangeFileExt(FileName,'.NG')); |
| 1014 |
GikoSys.FSelectResFilter.Execute(ReadList); //レスのフィルタリングをする |
GikoSys.FAbon.Execute(ReadList); // あぼ〜んして |
| 1015 |
if ThreadItem.Title = '' then begin |
GikoSys.FSelectResFilter.Execute(ReadList); //レスのフィルタリングをする |
| 1016 |
Res := DivideStrLine(ReadList[0]); |
if ThreadItem.Title = '' then begin |
| 1017 |
sTitle := Res.FTitle; |
Res := DivideStrLine(ReadList[0]); |
| 1018 |
end else |
sTitle := Res.FTitle; |
| 1019 |
sTitle := ThreadItem.Title |
end else |
| 1020 |
end else begin |
sTitle := ThreadItem.Title |
| 1021 |
sTitle := CustomStringReplace(ThreadItem.Title, '@`', ','); |
end else begin |
| 1022 |
end; |
sTitle := CustomStringReplace(ThreadItem.Title, '@`', ','); |
| 1023 |
|
end; |
| 1024 |
|
|
| 1025 |
// フォントやサイズの設定 |
// フォントやサイズの設定 |
| 1026 |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
| 1027 |
if GikoSys.Setting.UseSkin then begin |
if GikoSys.Setting.UseSkin then begin |
| 1028 |
CreateUseSKINHTML(doc, ThreadItem, ReadList); |
CreateUseSKINHTML(html, ThreadItem, ReadList); |
| 1029 |
end else if GikoSys.Setting.UseCSS and FileExists(CSSFileName) then begin |
end else if GikoSys.Setting.UseCSS and FileExists(CSSFileName) then begin |
| 1030 |
CreateUseCSSHTML(doc, ThreadItem, ReadList, sTitle); |
CreateUseCSSHTML(html, ThreadItem, ReadList, sTitle); |
| 1031 |
end else begin |
end else begin |
| 1032 |
CreateDefaultHTML(doc, ThreadItem, ReadList, sTitle); |
CreateDefaultHTML(html, ThreadItem, ReadList, sTitle); |
| 1033 |
|
end; |
| 1034 |
|
finally |
| 1035 |
|
ReadList.EndUpdate; |
| 1036 |
|
ReadList.Free; |
| 1037 |
end; |
end; |
| 1038 |
|
end; |
| 1039 |
|
//WebBrowserに書き込み |
| 1040 |
|
mStream := TMemoryStream.Create; |
| 1041 |
|
try |
| 1042 |
|
html.SaveToStream(mStream); |
| 1043 |
|
mStream.Seek(soFromBeginning, 0); |
| 1044 |
|
(doc as IPersistStreamInit).Load(TStreamAdapter.Create(mStream)); |
| 1045 |
finally |
finally |
| 1046 |
ReadList.Free; |
mStream.Free; |
| 1047 |
end; |
end; |
| 1048 |
|
finally |
| 1049 |
|
html.Free; |
| 1050 |
end; |
end; |
| 1051 |
end; |
end; |
| 1052 |
{$IFDEF DEBUG} |
{$IFDEF DEBUG} |