procedure CreateUseSKINHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList);
procedure CreateUseCSSHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string );
procedure CreateDefaultHTML (doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string );
- function ConvertResAnchor(res: string): string;
+ procedure ConvertResAnchor(PRes: PResRec);
procedure separateNumber(var st: String; var et: String; const Text, Separator: String);
public
{ Public \90é\8c¾ }
- function AddAnchorTag(s: string): string;
+ //function AddAnchorTag(s: string): string;
+ procedure AddAnchorTag(PRes: PResRec);
function LoadFromSkin(fileName: string; ThreadItem: TThreadItem; SizeByte: Integer): string;
function SkinedRes(const skin: string; PRes: PResRec; const No: string): string;
- function ConvRes(const Body, Bbs, Key: string; DatToHTML: boolean = false): string; overload;
+ procedure ConvRes( PRes : PResRec;const Bbs: string; const Key: string; DatToHTML: boolean = false); overload;
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, FullURL : string): string; overload;
procedure CreateHTML2(doc: Variant; ThreadItem: TThreadItem; var sTitle: string);
(*************************************************************************
*http://\82Ì\95¶\8e\9a\97ñ\82ðanchor\83^\83O\95t\82«\82É\82·\82é\81B
*************************************************************************)
-function THTMLCreate.AddAnchorTag(s: string): string;
+procedure THTMLCreate.AddAnchorTag(PRes: PResRec);
+const
+ _HEAD : array[0..9] of String =
+ ('', 'h', 'ht', '', 'htt', '', 'http://', '', '', '');
var
url: string;
href: string;
idx, idx2: Integer;
pos : PChar;
pp, pe : PChar;
+ s : String;
begin
- Result := '';
+ s := PRes^.FBody;
+ PRes^.FBody := '';
while True do begin
idx := MaxInt;
if idx = MaxInt then begin
//\83\8a\83\93\83N\82ª\96³\82¢\82æ\81B
- Result := Result + s;
+ PRes^.FBody := PRes^.FBody + s;
Break;
end;
else
b := pos - pp + 1;
- Result := Result + Copy(s, 1, idx + b);
+ PRes^.FBody := PRes^.FBody + Copy(s, 1, idx + b);
Delete(s, 1, idx + b);
Continue;
end;
- Result := Result + Copy(s, 1, idx - 1);
+ PRes^.FBody := PRes^.FBody + Copy(s, 1, idx - 1);
Delete(s, 1, idx - 1);
b := Length( s ) + 1;
pp := PChar(s);
if pe = nil then begin
//URL\82¶\82á\82È\82¢\95¶\8e\9a\94\8c©\81I\82Æ\82©\81A\95¶\8e\9a\82ª\82È\82\82È\82Á\82½\81B
url := Copy(s, 1, i - 1);
- case idx2 of
- 1 : href := 'h' + url;
- 2 : href := 'ht' + url;
- 4 : href := 'htt' + url;
- 6 : href := 'http://' + url;
- else
- href := url;
- end;
-
- Result := Result + '<a href="' + href + '" target="_blank">' + url + '</a>';
+ href := Format('%s%s', [_HEAD[idx2], url]);
+ PRes^.FBody
+ //:= PRes^.FBody + '<a href="' + href + '" target="_blank">' + url + '</a>';
+ := Format('%s<a href="%s" target="_blank">%s</a>', [PRes^.FBody, href, url]);
Delete(s, 1, i - 1);
Break;
end;
et := Text;
end;
end;
-function THTMLCreate.ConvRes(const Body, Bbs, Key : string; DatToHTML: boolean = false): string;
+procedure THTMLCreate.ConvRes( PRes : PResRec; const Bbs: string; const Key : string; DatToHTML: boolean = false);
const
ParamBBS = 'bbs';
ParamKey = 'key';
end;
begin
//s \82É\96{\95¶\82ð\91S\95\94\93ü\82ê\82é
- s := Body;
+ s := PRes^.FBody;
//\8c\8b\89Ê\82ð\83N\83\8a\83A
- Result := '';
+ PRes^.FBody := '';
//
while Length(s) > 2 do begin
end;
//\83q\83b\83g\82µ\82½\95¶\8e\9a\97ñ\82Ì\88ê\82Â\8eè\91O\82Ü\82Å\8c\8b\89Ê\82É\83R\83s\81[
- Result := Result + Copy(s, 1, pmin - 1);
+ PRes^.FBody := PRes^.FBody + Copy(s, 1, pmin - 1);
Delete(s, 1, pmin - 1);
if i = 6 then begin
pmin := pos;
end;
rink := Copy(s, 1, pmin + 3);
- Result := Result + rink;
+ PRes^.FBody := PRes^.FBody + rink;
Delete(s, 1, pmin + 3);
pmin := Length(rink);
sw := false;
db := false;
getNumberString;
- Result := addResAnchor(Result);
+ PRes^.FBody := addResAnchor(PRes^.FBody);
cm := checkComma;
end;
end;
db := false;
len := Length(s);
getNumberString;
- Result := addResAnchor(Result);
+ PRes^.FBody := addResAnchor(PRes^.FBody);
end;
end;
- Result := Result + s;
+ PRes^.FBody := PRes^.FBody + s;
end;
(*************************************************************************
Result := Result + s;
end;
-function THTMLCreate.ConvertResAnchor(res: string): string;
+procedure THTMLCreate.ConvertResAnchor(PRes: PResRec);
const
_HEAD : string = '<a href="../';
_TAIL : string = ' target="_blank">';
var
i, j, k: Integer;
tmp: string;
+ res: string;
begin
- Result := '';
+ res := PRes^.FBody;
+ PRes^.FBody := '';
i := AnsiPos(_HEAD, res);
while i <> 0 do begin
- Result := Result + Copy(res, 1, i -1);
+ PRes^.FBody := PRes^.FBody + Copy(res, 1, i -1);
Delete(res, 1, i - 1);
j := AnsiPos(_TAIL, res);
if j = 0 then begin
- Result := Result + res;
+ PRes^.FBody := PRes^.FBody + res;
Exit;
end;
tmp := Copy(res, 1, j - 1);
if (AnsiPos(_ST, tmp) <> 0) and (AnsiPos(_TO, tmp) <> 0) then begin
Delete(tmp, 1, AnsiPos(_ST, tmp) + 3);
Delete(tmp, AnsiPos(_TO, tmp), Length(tmp));
- Result := Result + '<a href="#' + tmp + '">';
+ PRes^.FBody := PRes^.FBody + '<a href="#' + tmp + '">';
end else if (AnsiPos(_STA, tmp) <> 0) and (AnsiPos(_END, tmp) <> 0) then begin
Delete(tmp, 1, AnsiPos(_STA, tmp) + 6);
Delete(tmp, AnsiPos(_END, tmp), Length(tmp));
- Result := Result + '<a href="#' + tmp + '">';
+ PRes^.FBody := PRes^.FBody + '<a href="#' + tmp + '">';
end else begin
k := LastDelimiter('/', tmp);
Delete(tmp, 1, k);
else
Delete(tmp, AnsiPos('"', tmp), Length(tmp));
- Result := Result + '<a href="#' + tmp + '">';
+ PRes^.FBody := PRes^.FBody + '<a href="#' + tmp + '">';
end;
i := AnsiPos(_HEAD, res);
end;
- Result := Result + res;
+ PRes^.FBody := PRes^.FBody + res;
end;
No := IntToStr(i + 1);
DivideStrLine(ReadList[i], @Res);
- Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ThreadName);
+ AddAnchorTag(@Res);
+ ConvRes(@Res, ThreadItem.ParentBoard.BBSID, ThreadName);
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
try
NewReceiveNo: Integer;
Res: TResRec;
UserOptionalStyle: string;
+ ThreadName :String;
begin
doc.open;
try
doc.charset := 'Shift_JIS';
NewReceiveNo := ThreadItem.NewReceive;
+ ThreadName := ChangeFileExt(ThreadItem.FileName, '');
// \83t\83H\83\93\83g\82â\83T\83C\83Y\82Ì\90Ý\92è
UserOptionalStyle := GikoSys.SetUserOptionalStyle;
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName;
if (Trim(ReadList[i]) <> '') then begin
No := IntToStr(i + 1);
DivideStrLine(ReadList[i], @Res);
- Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''));
+ AddAnchorTag(@Res);
+ ConvRes(@Res, ThreadItem.ParentBoard.BBSID, ThreadName);
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
if Res.FMailTo = '' then
doc.Write(Format(FORMAT_NOMAIL, [No, No, No, Res.FName, Res.FDateTime, Res.FBody]))
No: string;
NewReceiveNo: Integer;
Res: TResRec;
+ ThreadName: String;
begin
doc.open;
try
doc.charset := 'Shift_JIS';
NewReceiveNo := ThreadItem.NewReceive;
+ ThreadName := ChangeFileExt(ThreadItem.FileName, '');
doc.Write('<html><head>'#13#10);
doc.Write('<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">'#13#10);
doc.Write('<title>' + sTitle + '</title></head>'#13#10);
end;
if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
- doc.Write('</dl>'#13#10);
- doc.Write('<a name="new"></a>'#13#10);
- 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>\90V\92\85\83\8c\83X ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>'#13#10);
- doc.Write('<dl>'#13#10);
+ doc.Write('</dl>');
+ doc.Write('<a name="new"></a>');
+ 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>\90V\92\85\83\8c\83X ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>');
+ doc.Write('<dl>');
end;
if (Trim(ReadList[i]) <> '') then begin
No := IntToStr(i + 1);
DivideStrLine(ReadList[i], @Res);
- Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''));
+ AddAnchorTag(@Res);
+ ConvRes(@Res, ThreadItem.ParentBoard.BBSID, ThreadName);
Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
if Res.FMailTo = '' then
doc.Write('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> \96¼\91O\81F<font color="forestgreen"><b> ' + Res.FName + ' </b></font> \93\8a\8de\93ú\81F <span class="date">' + Res.FDateTime+ '</span><br><dd>' + Res.Fbody + ' <br><br><br>'#13#10)
doc.Write('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> \96¼\91O\81F<a href="mailto:' + Res.FMailTo + '"><b> ' + Res.FName + ' </B></a> \93\8a\8de\93ú\81F <span class="date">' + Res.FDateTime+ '</span><br><dd>' + Res.Fbody + ' <br><br><br>'#13#10);
end;
if ThreadItem.Kokomade = (i + 1) then begin
- 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>\83R\83R\82Ü\82Å\93Ç\82ñ\82¾</b></font></td></tr></table>'#13#10);
- doc.Write('<dl>'#13#10);
+ doc.Write('</dl>');
+ 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>\83R\83R\82Ü\82Å\93Ç\82ñ\82¾</b></font></td></tr></table>');
+ doc.Write('<dl>');
end;
end;
- doc.Write('</dl>'#13#10);
- doc.Write('<a name="bottom"></a>'#13#10);
- doc.Write('</body></html>'#13#10);
+ doc.Write('</dl>'#13#10'<a name="bottom"></a>'#13#10'</body></html>');
finally
doc.Close;
end;
SkinHeader: string;
SkinRes: string;
tmp, tmp1: string;
+ ThreadName: String;
function LoadSkin( fileName: string ): string;
begin
Result := LoadFromSkin( fileName, ThreadItem, ThreadItem.Size );
begin
if ThreadItem <> nil then begin
CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName;
+ ThreadName := ChangeFileExt(ThreadItem.FileName, '');
html.Clear;
html.BeginUpdate;
//if ThreadItem.IsBoardPlugInAvailable then begin
for i := 0 to threadItem.Count - 1 do begin
// \83\8c\83X
- html.Append( ConvertResAnchor(boardPlugIn.GetRes( DWORD( threadItem ), i + 1 )) );
+ Res.FBody := boardPlugIn.GetRes( DWORD( threadItem ), i + 1 );
+ ConvertResAnchor(@Res);
+ html.Append( Res.FBody );
end;
// \83X\83L\83\93(\83t\83b\83^)
No := IntToStr(i + 1);
DivideStrLine(ReadList[i], @Res);
- Res.FBody := AddAnchorTag(Res.FBody);
- Res.FBody := ConvertResAnchor(ConvRes(Res.FBody, ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), true));
+ AddAnchorTag(@Res);
+ ConvRes(@Res, ThreadItem.ParentBoard.BBSID, ThreadName, true);
+ ConvertResAnchor(@Res);
try
html.Append( ReplaceRes( SkinRes ) );
if (Trim(ReadList[i]) <> '') then begin
No := IntToStr(i + 1);
DivideStrLine(ReadList[i], @Res);
- Res.FBody := AddAnchorTag(Res.FBody);
- Res.FBody := ConvertResAnchor(ConvRes(Res.FBody, ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), true));
+ AddAnchorTag(@Res);
+ ConvRes(@Res, ThreadItem.ParentBoard.BBSID, ThreadName, true);
+ ConvertResAnchor(@Res);
if Res.FMailTo = '' then
html.Append('<a name="' + No + '"></a>'
+ '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span> '
if (Trim(ReadList[i]) <> '') then begin
No := IntToStr(i + 1);
DivideStrLine(ReadList[i], @Res);
- Res.FBody := AddAnchorTag(Res.FBody);
- Res.FBody := ConvertResAnchor(ConvRes(Res.FBody, ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), true));
+ AddAnchorTag(@Res);
+ ConvRes(@Res, ThreadItem.ParentBoard.BBSID, ThreadName, true);
+ ConvertResAnchor(@Res);
if Res.FMailTo = '' then
html.Append('<a name="' + No + '"></a><dt><a href="menu:' + No + '">' + No + '</a> \96¼\91O\81F<font color="forestgreen"><b> ' + Res.FName + ' </b></font> \93\8a\8de\93ú\81F ' + Res.FDateTime+ '<br><dd>' + Res.Fbody + ' <br><br><br>')
else if GikoSys.Setting.ShowMail then