• R/O
  • HTTP
  • SSH
  • HTTPS

gikonavi: Commit


Commit MetaInfo

Revisione53833b69aaa5c39af1ca9b7a5ba80e2b744a5be (tree)
Time2005-11-13 23:28:35
Authorcvs2git <cvs2git>
Commitercvs2git

Log Message

This commit was manufactured by cvs2svn to create tag 'v1_51_0_617'.

Change Summary

Incremental Difference

--- a/Giko.pas
+++ b/Giko.pas
@@ -9784,11 +9784,26 @@ begin
97849784 end;
97859785
97869786 procedure TGikoForm.FavoriteTreeViewDblClick(Sender: TObject);
9787+var
9788+ mousePoint : TPoint;
9789+ item : TTreeNode;
9790+ rect : TRect;
97879791 begin
9788-
9789- FClickNode := FavoriteTreeView.Selected;
9790- FavoriteTreeViewReloadActionExecute( Sender );
9791-
9792+ mousePoint := Mouse.CursorPos;
9793+ mousePoint := FavoriteTreeView.ScreenToClient(mousePoint);
9794+ item := FavoriteTreeView.GetNodeAt(mousePoint.X, mousePoint.Y);
9795+ //選択したアイテムと同じかチェック
9796+ if item = FavoriteTreeView.Selected then begin
9797+ //表示している範囲と同じところかチェック
9798+ rect := item.DisplayRect(true);
9799+ //イメージ分左に伸ばす
9800+ rect.Left := rect.Left - FavoriteTreeView.Images.Width;
9801+ if ((mousePoint.X >= rect.Left) and (mousePoint.X <= rect.Right)) and
9802+ ((mousePoint.Y >= rect.Top) and (mousePoint.Y <= rect.Bottom)) then begin
9803+ FClickNode := FavoriteTreeView.Selected;
9804+ FavoriteTreeViewReloadActionExecute( Sender );
9805+ end;
9806+ end;
97929807 end;
97939808
97949809 procedure TGikoForm.FavoriteTreeViewLogDeleteActionExecute(
@@ -10602,13 +10617,24 @@ end;
1060210617
1060310618 procedure TGikoForm.FavoriteTreeViewMouseUp(Sender: TObject;
1060410619 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
10620+var
10621+ item : TTreeNode;
10622+ rect : TRect;
1060510623 begin
10606-
1060710624 if (abs( X - FMouseDownPos.X ) < Mouse.DragThreshold) and
1060810625 (abs( Y - FMouseDownPos.Y ) < Mouse.DragThreshold) then begin
10609- FavoriteClick( TObject( FavoriteTreeView.Selected ) );
10626+ item := FavoriteTreeView.GetNodeAt(X, Y);
10627+ if item = FavoriteTreeView.Selected then begin
10628+ //イメージ範囲を取得
10629+ rect := FavoriteTreeView.Selected.DisplayRect(true);
10630+ //アイコン分左に伸ばす
10631+ rect.Left := rect.Left - FavoriteTreeView.Images.Width;
10632+ if ((X >= rect.Left) and (X <= rect.Right)) and
10633+ ((Y >= rect.Top) and (Y <= rect.Bottom)) then begin
10634+ FavoriteClick( TObject( FavoriteTreeView.Selected ) );
10635+ end;
10636+ end;
1061010637 end;
10611-
1061210638 end;
1061310639
1061410640 destructor TBrowserRecord.Destroy;
--- a/GikoSystem.pas
+++ b/GikoSystem.pas
@@ -188,8 +188,6 @@ type
188188 function DeleteLink(const s: string): string;
189189
190190 function GetShortName(const LongName: string; ALength: integer): string;
191- function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue : string; DatToHTML: boolean = false): string; overload;
192- function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue, FullURL : string): string; overload;
193191 function BoolToInt(b: Boolean): Integer;
194192 function IntToBool(i: Integer): Boolean;
195193 function GzipDecompress(ResStream: TStream; ContentEncoding: string): string;
@@ -1434,391 +1432,6 @@ begin
14341432 end;
14351433 end;
14361434
1437-(*************************************************************************
1438- *
1439- * from HotZonu
1440- *************************************************************************)
1441-function TGikoSys.ConvRes(const Body, Bbs, Key,
1442- ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue : string;
1443- DatToHTML: boolean = false): string;
1444-type
1445- PIndex = ^TIndex;
1446- TIndex = record
1447- FIndexFrom : integer;
1448- FIndexTo : integer;
1449- FNo : string;
1450- end;
1451-const
1452- GT = '&gt;';
1453- SN = '0123456789-';
1454- ZN = '0123456789−';
1455-var
1456- i : integer;
1457- s,r : string;
1458- b : TMbcsByteType;
1459- sw: boolean;
1460- sp: integer;
1461- No: string;
1462- sx: string;
1463- List: TList;
1464- oc : string;
1465- st, et: string;
1466- chk : boolean;
1467- al : boolean;
1468- procedure Add(IndexFrom, IndexTo: integer; const No: string);
1469- var
1470- FIndex : PIndex;
1471- begin
1472- New(FIndex);
1473- FIndex.FIndexFrom := IndexFrom;
1474- FIndex.FIndexTo := IndexTo;
1475- FIndex.FNo := No;
1476- List.Add(FIndex);
1477- end;
1478- function ChooseString(const Text, Separator: string; Index: integer): string;
1479- var
1480- S : string;
1481- i, p : integer;
1482- begin
1483- S := Text;
1484- for i := 0 to Index - 1 do begin
1485- if (AnsiPos(Separator, S) = 0) then S := ''
1486- else S := Copy(S, AnsiPos(Separator, S) + Length(Separator), Length(S));
1487- end;
1488- p := AnsiPos(Separator, S);
1489- if (p > 0) then Result := Copy(S, 1, p - 1) else Result := S;
1490- end;
1491-begin
1492- { v1.0 b2 - 03 }
1493- s := Body;
1494- r := Body;
1495- i := 1;
1496- sw := False;
1497- No := '';
1498- List:= TList.Create;
1499- oc := '';
1500- sp := 0;
1501- chk := False;
1502- al := False;
1503- while true do begin
1504- b := ByteType(s, i);
1505- case b of
1506- mbSingleByte : begin
1507- if (not sw) and (Copy(s,i,8) = GT + GT) then begin
1508- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin
1509- sw := True;
1510- sp := i;
1511- i := i + 7;
1512- oc:='';
1513- chk := True;
1514- end;
1515- end else
1516- if (not sw) and (Copy(s,i,8) = GT + GT) then begin
1517- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 1) then begin
1518- i := i + 7;
1519- oc:='';
1520- chk := True;
1521- end;
1522- end else
1523- if (not sw) and (Copy(s,i,4) = GT) then begin
1524- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin
1525- sw := True;
1526- sp := i;
1527- i := i + 3;
1528- oc:='';
1529- chk := True;
1530- end;
1531- end else
1532- if ((not sw) and (Copy(s,i,1) = ',')) or
1533- ((not sw) and (Copy(s,i,1) = '=')) then begin
1534- if ((not Chk) and (AnsiLowerCase(oc) = '</a>')) or
1535- ((Chk) and (oc = '')) or
1536- ((not Chk) and (al)) then
1537- begin
1538- sw := True;
1539- sp := i;
1540- //i := i + 1;
1541- oc:='';
1542- end;
1543- end else
1544- if (sw) then begin
1545- sx := Copy(s,i,1);
1546- if (AnsiPos(sx, SN) > 0) then begin
1547- No := No + sx;
1548- end else begin
1549- if (No <> '') and (No <> '-') then begin
1550- Add(sp, i, No);
1551- al := True;
1552- end;
1553- sw := False;
1554- //
1555- i := i - 1;
1556- //
1557- No := '';
1558- oc:='';
1559- //chk := False;
1560- end;
1561- end else begin
1562- if Copy(s,i,1) = '<' then oc := '';
1563- oc := oc + Copy(s,i,1);
1564- chk := False;
1565- al := False;
1566- end;
1567- end;
1568- mbLeadByte : begin
1569- if (not sw) and (Copy(s,i,4) = '>>') then begin
1570- sw := True;
1571- sp := i;
1572- i := i + 3;
1573- chk := True;
1574- end else
1575- if (not sw) and (Copy(s,i,2) = '>') then begin
1576- sw := True;
1577- sp := i;
1578- i := i + 1;
1579- chk := True;
1580- end else
1581- if (sw) then begin
1582- sx := Copy(s,i,2);
1583- if (AnsiPos(sx, ZN) > 0) then begin
1584- No := No + ZenToHan(sx);
1585- end else begin
1586- if (No <> '') and (No <> '-') and (No <> '−') then begin
1587- Add(sp, i, No);
1588- end;
1589- sw := False;
1590- i := i - 1;
1591- No := '';
1592- end;
1593- end else begin
1594- oc := '';
1595- chk := False;
1596- end;
1597- al := False;
1598- end;
1599- end;
1600- inc(i);
1601- if (i > Length(Body)) then begin
1602- if (sw) then begin
1603- if (No <> '') then Add(sp, i, No);
1604- end;
1605- Break;
1606- end;
1607- end;
1608- for i := List.Count - 1 downto 0 do begin
1609- if (AnsiPos('-', PIndex(List[i]).FNo) > 0) then begin
1610- st := ChooseString(PIndex(List[i]).FNo, '-', 0);
1611- et := ChooseString(PIndex(List[i]).FNo, '-', 1);
1612- end else begin
1613- st := PIndex(List[i]).FNo;
1614- et := PIndex(List[i]).FNo;
1615- end;
1616- if not DatToHTML then
1617- r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) +
1618- Format('<a href="../test/read.cgi?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s" target="_blank">',
1619- [ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) +
1620- Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' +
1621- Copy(r,PIndex(List[i]).FIndexTo,Length(r))
1622- else
1623- r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) +
1624- Format('<a href="#%s">', [st]) +
1625- Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' +
1626- Copy(r,PIndex(List[i]).FIndexTo,Length(r));
1627-
1628- Dispose(PIndex(List[i]));
1629- end;
1630- List.Free;
1631- Result := r;
1632-end;
1633-
1634-function TGikoSys.ConvRes(
1635- const Body, Bbs, Key, ParamBBS, ParamKey,
1636- ParamStart, ParamTo, ParamNoFirst,
1637- ParamTrue, FullURL : string
1638-): string;
1639-type
1640- PIndex = ^TIndex;
1641- TIndex = record
1642- FIndexFrom : integer;
1643- FIndexTo : integer;
1644- FNo : string;
1645- end;
1646-const
1647- GT = '&gt;';
1648- SN = '0123456789-';
1649- ZN = '0123456789−';
1650-var
1651- i : integer;
1652- s,r : string;
1653- b : TMbcsByteType;
1654- sw: boolean;
1655- sp: integer;
1656- No: string;
1657- sx: string;
1658- List: TList;
1659- oc : string;
1660- st, et: string;
1661- chk : boolean;
1662- al : boolean;
1663- procedure Add(IndexFrom, IndexTo: integer; const No: string);
1664- var
1665- FIndex : PIndex;
1666- begin
1667- New(FIndex);
1668- FIndex.FIndexFrom := IndexFrom;
1669- FIndex.FIndexTo := IndexTo;
1670- FIndex.FNo := No;
1671- List.Add(FIndex);
1672- end;
1673- function ChooseString(const Text, Separator: string; Index: integer): string;
1674- var
1675- S : string;
1676- i, p : integer;
1677- begin
1678- S := Text;
1679- for i := 0 to Index - 1 do begin
1680- if (AnsiPos(Separator, S) = 0) then S := ''
1681- else S := Copy(S, AnsiPos(Separator, S) + Length(Separator), Length(S));
1682- end;
1683- p := AnsiPos(Separator, S);
1684- if (p > 0) then Result := Copy(S, 1, p - 1) else Result := S;
1685- end;
1686-begin
1687- { v1.0 b2 - 03 }
1688- s := Body;
1689- r := Body;
1690- i := 1;
1691- sw := False;
1692- No := '';
1693- List:= TList.Create;
1694- oc := '';
1695- sp := 0;
1696- chk := False;
1697- al := False;
1698- while true do begin
1699- b := ByteType(s, i);
1700- case b of
1701- mbSingleByte : begin
1702- if (not sw) and (Copy(s,i,8) = GT + GT) then begin
1703- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin
1704- sw := True;
1705- sp := i;
1706- i := i + 7;
1707- oc:='';
1708- chk := True;
1709- end;
1710- end else
1711- if (not sw) and (Copy(s,i,8) = GT + GT) then begin
1712- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 1) then begin
1713- i := i + 7;
1714- oc:='';
1715- chk := True;
1716- end;
1717- end else
1718- if (not sw) and (Copy(s,i,4) = GT) then begin
1719- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin
1720- sw := True;
1721- sp := i;
1722- i := i + 3;
1723- oc:='';
1724- chk := True;
1725- end;
1726- end else
1727- if ((not sw) and (Copy(s,i,1) = ',')) or
1728- ((not sw) and (Copy(s,i,1) = '=')) then begin
1729- if ((not Chk) and (AnsiLowerCase(oc) = '</a>')) or
1730- ((Chk) and (oc = '')) or
1731- ((not Chk) and (al)) then
1732- begin
1733- sw := True;
1734- sp := i;
1735- //i := i + 1;
1736- oc:='';
1737- end;
1738- end else
1739- if (sw) then begin
1740- sx := Copy(s,i,1);
1741- if (AnsiPos(sx, SN) > 0) then begin
1742- No := No + sx;
1743- end else begin
1744- if (No <> '') and (No <> '-') then begin
1745- Add(sp, i, No);
1746- al := True;
1747- end;
1748- sw := False;
1749- //
1750- i := i - 1;
1751- //
1752- No := '';
1753- oc:='';
1754- //chk := False;
1755- end;
1756- end else begin
1757- if Copy(s,i,1) = '<' then oc := '';
1758- oc := oc + Copy(s,i,1);
1759- chk := False;
1760- al := False;
1761- end;
1762- end;
1763- mbLeadByte : begin
1764- if (not sw) and (Copy(s,i,4) = '>>') then begin
1765- sw := True;
1766- sp := i;
1767- i := i + 3;
1768- chk := True;
1769- end else
1770- if (not sw) and (Copy(s,i,2) = '>') then begin
1771- sw := True;
1772- sp := i;
1773- i := i + 1;
1774- chk := True;
1775- end else
1776- if (sw) then begin
1777- sx := Copy(s,i,2);
1778- if (AnsiPos(sx, ZN) > 0) then begin
1779- No := No + ZenToHan(sx);
1780- end else begin
1781- if (No <> '') and (No <> '-') and (No <> '−') then begin
1782- Add(sp, i, No);
1783- end;
1784- sw := False;
1785- i := i - 1;
1786- No := '';
1787- end;
1788- end else begin
1789- oc := '';
1790- chk := False;
1791- end;
1792- al := False;
1793- end;
1794- end;
1795- inc(i);
1796- if (i > Length(Body)) then begin
1797- if (sw) then begin
1798- if (No <> '') then Add(sp, i, No);
1799- end;
1800- Break;
1801- end;
1802- end;
1803- for i := List.Count - 1 downto 0 do begin
1804- //plName := Copy(PluginName, LastDelimiter('\',PluginName) + 1, Length(PluginName) - LastDelimiter('/',PluginName) -1 );
1805- if (AnsiPos('-', PIndex(List[i]).FNo) > 0) then begin
1806- st := ChooseString(PIndex(List[i]).FNo, '-', 0);
1807- et := ChooseString(PIndex(List[i]).FNo, '-', 1);
1808- end else begin
1809- st := PIndex(List[i]).FNo;
1810- et := PIndex(List[i]).FNo;
1811- end;
1812- r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) +
1813- Format('<a href="%s&%s=%s&%s=%s&%s=%s" target="_blank">',
1814- [FullURL, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) +
1815- Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' +
1816- Copy(r,PIndex(List[i]).FIndexTo,Length(r));
1817- Dispose(PIndex(List[i]));
1818- end;
1819- List.Free;
1820- Result := r;
1821-end;
18221435
18231436
18241437 function TGikoSys.BoolToInt(b: Boolean): Integer;
--- a/HTMLCreate.pas
+++ b/HTMLCreate.pas
@@ -36,13 +36,14 @@ type
3636 procedure CreateUseCSSHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string );
3737 procedure CreateDefaultHTML (doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string );
3838 function ConvertResAnchor(res: string): string;
39+ procedure separateNumber(var st: String; var et: String; const Text, Separator: String);
3940 public
4041 { Public 宣言 }
4142 function AddAnchorTag(s: string): string;
4243 function LoadFromSkin(fileName: string; ThreadItem: TThreadItem; SizeByte: Integer): string;
4344 function SkinedRes(skin: string; Res: TResRec; No: string): string;
4445 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;
46+// function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue, FullURL : string): string; overload;
4647 procedure CreateHTML2(doc: Variant; ThreadItem: TThreadItem; var sTitle: string);
4748 procedure CreateHTML3(var html: TStringList; ThreadItem: TThreadItem; var sTitle: string);
4849 end;
@@ -120,23 +121,25 @@ begin
120121
121122 //----- とりあえずかちゅ〜しゃ互換用。コメントアウトしてもよし
122123 // やりかたが苦しいけど、オプションダイアログのプレビュー用 try
123- try
124- if ThreadItem.ParentBoard <> nil then
125- if ThreadItem.ParentBoard.ParentCategory <> nil then
126- CustomStringReplace( Skin, '&BBSNAME', ThreadItem.ParentBoard.ParentCategory.ParenTBBS.Title);
127- CustomStringReplace( Skin, '&THREADURL', ThreadItem.URL);
128- except end;
129- CustomStringReplace( Skin, '&BOARDNAME', ThreadItem.ParentBoard.Title);
130- CustomStringReplace( Skin, '&BOARDURL', ThreadItem.ParentBoard.URL);
131- CustomStringReplace( Skin, '&THREADNAME', ThreadItem.Title);
132- CustomStringReplace( Skin, '&SKINPATH', GikoSys.Setting.CSSFileName);
133- CustomStringReplace( Skin, '&GETRESCOUNT', IntToStr( ThreadItem.NewReceive - 1 ));
134- CustomStringReplace( Skin, '&NEWRESCOUNT', IntToStr( ThreadItem.NewResCount ));
135- CustomStringReplace( Skin, '&ALLRESCOUNT', IntToStr( ThreadItem.AllResCount ));
136-
137- CustomStringReplace( Skin, '&NEWDATE', FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate));
138- CustomStringReplace( Skin, '&SIZEKB', IntToStr( Floor( SizeByte / 1024 ) ));
139- CustomStringReplace( Skin, '&SIZE', IntToStr( SizeByte ));
124+ if GikoSys.Setting.UseKatjushaType then begin
125+ try
126+ if ThreadItem.ParentBoard <> nil then
127+ if ThreadItem.ParentBoard.ParentCategory <> nil then
128+ CustomStringReplace( Skin, '&BBSNAME', ThreadItem.ParentBoard.ParentCategory.ParenTBBS.Title);
129+ CustomStringReplace( Skin, '&THREADURL', ThreadItem.URL);
130+ except end;
131+ CustomStringReplace( Skin, '&BOARDNAME', ThreadItem.ParentBoard.Title);
132+ CustomStringReplace( Skin, '&BOARDURL', ThreadItem.ParentBoard.URL);
133+ CustomStringReplace( Skin, '&THREADNAME', ThreadItem.Title);
134+ CustomStringReplace( Skin, '&SKINPATH', GikoSys.Setting.CSSFileName);
135+ CustomStringReplace( Skin, '&GETRESCOUNT', IntToStr( ThreadItem.NewReceive - 1 ));
136+ CustomStringReplace( Skin, '&NEWRESCOUNT', IntToStr( ThreadItem.NewResCount ));
137+ CustomStringReplace( Skin, '&ALLRESCOUNT', IntToStr( ThreadItem.AllResCount ));
138+
139+ CustomStringReplace( Skin, '&NEWDATE', FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate));
140+ CustomStringReplace( Skin, '&SIZEKB', IntToStr( Floor( SizeByte / 1024 ) ));
141+ CustomStringReplace( Skin, '&SIZE', IntToStr( SizeByte ));
142+ end
140143 //----- ここまで
141144 end;
142145 Result := Skin.Text;
@@ -174,17 +177,19 @@ begin
174177 Skin := CustomStringReplace( Skin, '<NONSPAMMINESS/>', FloatToStr( 100 - spamminess ) );
175178
176179 //----- かちゅ〜しゃ互換用。コメントアウトしてもよし
177- Skin := CustomStringReplace( Skin, '&NUMBER',
178- '<a href="menu:' + No + '" name="' + No + '">' + No + '</a>');
179- Skin := CustomStringReplace( Skin, '&PLAINNUMBER', No);
180- Skin := CustomStringReplace( Skin, '&NAME', '<b>' + Res.FName + '</b>');
181- Skin := CustomStringReplace( Skin, '&MAILNAME',
182- '<a href="mailto:' + Res.FMailTo + '"><b>' + Res.FName + '</b></a>');
183- Skin := CustomStringReplace( Skin, '&MAIL', Res.FMailTo);
184- Skin := CustomStringReplace( Skin, '&DATE', Res.FDateTime);
185- Skin := CustomStringReplace( Skin, '&MESSAGE', Res.FBody);
186- Skin := CustomStringReplace( Skin, '&SPAMMINESS', FloatToStr( spamminess ) );
187- Skin := CustomStringReplace( Skin, '&NONSPAMMINESS', FloatToStr( 100 - spamminess ) );
180+ if GikoSys.Setting.UseKatjushaType then begin
181+ Skin := CustomStringReplace( Skin, '&NUMBER',
182+ '<a href="menu:' + No + '" name="' + No + '">' + No + '</a>');
183+ Skin := CustomStringReplace( Skin, '&PLAINNUMBER', No);
184+ Skin := CustomStringReplace( Skin, '&NAME', '<b>' + Res.FName + '</b>');
185+ Skin := CustomStringReplace( Skin, '&MAILNAME',
186+ '<a href="mailto:' + Res.FMailTo + '"><b>' + Res.FName + '</b></a>');
187+ Skin := CustomStringReplace( Skin, '&MAIL', Res.FMailTo);
188+ Skin := CustomStringReplace( Skin, '&DATE', Res.FDateTime);
189+ Skin := CustomStringReplace( Skin, '&MESSAGE', Res.FBody);
190+ Skin := CustomStringReplace( Skin, '&SPAMMINESS', FloatToStr( spamminess ) );
191+ Skin := CustomStringReplace( Skin, '&NONSPAMMINESS', FloatToStr( 100 - spamminess ) );
192+ end;
188193 //----- ここまで
189194
190195 Result := Skin;
@@ -296,6 +301,19 @@ begin
296301 end else
297302 Result := AID;
298303 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;
299317 (*************************************************************************
300318 *
301319 * from HotZonu
@@ -303,383 +321,184 @@ end;
303321 function THTMLCreate.ConvRes(const Body, Bbs, Key,
304322 ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue : string;
305323 DatToHTML: boolean = false): string;
306-type
307- PIndex = ^TIndex;
308- TIndex = record
309- FIndexFrom : integer;
310- FIndexTo : integer;
311- FNo : string;
312- end;
313324 const
314325 GT = '&gt;';
315- SN = '0123456789-';
316- ZN = '0123456789−';
326+ SN = '0123456789';
327+ FORMAT_LINK = '<a href="../test/read.cgi?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s" target="_blank">';
317328 var
318329 i : integer;
319- s,r : string;
320- b : TMbcsByteType;
330+ s : string;
321331 sw: boolean;
322- sp: integer;
332+ cm: boolean;
323333 No: string;
324- sx: string;
325- List: TList;
326334 oc : string;
327- st, et: string;
328- chk : boolean;
329- al : boolean;
330- procedure Add(IndexFrom, IndexTo: integer; const No: string);
335+ pos, pmin : integer;
336+ j : integer;
337+ token : array[0..5] of string;
338+ ch : string;
339+ db : boolean;
340+ len : integer;
341+ rink : string;
342+ function addResAnchor(const Left :string) : string;
331343 var
332- FIndex : PIndex;
344+ st,et : string;
333345 begin
334- New(FIndex);
335- FIndex.FIndexFrom := IndexFrom;
336- FIndex.FIndexTo := IndexTo;
337- FIndex.FNo := No;
338- List.Add(FIndex);
339- end;
340- function ChooseString(const Text, Separator: string; Index: integer): string;
341- var
342- S : string;
343- i, p : integer;
344- begin
345- S := Text;
346- for i := 0 to Index - 1 do begin
347- if (AnsiPos(Separator, S) = 0) then S := ''
348- else S := Copy(S, AnsiPos(Separator, S) + Length(Separator), Length(S));
346+ //終端まで行っての終了かチェック
347+ if j <= len then begin
348+ if db then j := j - 2
349+ else j := j - 1;
349350 end;
350- p := AnsiPos(Separator, S);
351- if (p > 0) then Result := Copy(S, 1, p - 1) else Result := S;
352- end;
353-begin
354- { v1.0 b2 - 03 }
355- s := Body;
356- r := Body;
357- i := 1;
358- sw := False;
359- No := '';
360- List:= TList.Create;
361- oc := '';
362- sp := 0;
363- chk := False;
364- al := False;
365- while true do begin
366- b := ByteType(s, i);
367- case b of
368- mbSingleByte : begin
369- if (not sw) and (Copy(s,i,8) = GT + GT) then begin
370- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin
371- sw := True;
372- sp := i;
373- i := i + 7;
374- oc:='';
375- chk := True;
376- end;
377- end else
378- if (not sw) and (Copy(s,i,8) = GT + GT) then begin
379- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 1) then begin
380- i := i + 7;
381- oc:='';
382- chk := True;
383- end;
384- end else
385- if (not sw) and (Copy(s,i,4) = GT) then begin
386- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin
387- sw := True;
388- sp := i;
389- i := i + 3;
390- oc:='';
391- chk := True;
392- end;
393- end else
394- if ((not sw) and (Copy(s,i,1) = ',')) or
395- ((not sw) and (Copy(s,i,1) = '=')) then begin
396- if ((not Chk) and (AnsiLowerCase(oc) = '</a>')) or
397- ((Chk) and (oc = '')) or
398- ((not Chk) and (al)) then
399- begin
400- sw := True;
401- sp := i;
402- //i := i + 1;
403- oc:='';
404- end;
405- end else
406- if (sw) then begin
407- sx := Copy(s,i,1);
408- if (AnsiPos(sx, SN) > 0) then begin
409- No := No + sx;
410- end else begin
411- if (No <> '') and (No <> '-') then begin
412- Add(sp, i, No);
413- al := True;
414- end;
415- sw := False;
416- //
417- i := i - 1;
418- //
419- No := '';
420- oc:='';
421- //chk := False;
422- end;
423- end else begin
424- if Copy(s,i,1) = '<' then oc := '';
425- oc := oc + Copy(s,i,1);
426- chk := False;
427- al := False;
428- end;
429- end;
430- mbLeadByte : begin
431- if (not sw) and (Copy(s,i,4) = '>>') then begin
432- sw := True;
433- sp := i;
434- i := i + 3;
435- chk := True;
436- end else
437- if (not sw) and (Copy(s,i,2) = '>') then begin
438- sw := True;
439- sp := i;
440- i := i + 1;
441- chk := True;
442- end else
443- if (sw) then begin
444- sx := Copy(s,i,2);
445- if (AnsiPos(sx, ZN) > 0) then begin
446- No := No + ZenToHan(sx);
447- end else begin
448- if (No <> '') and (No <> '-') and (No <> '−') then begin
449- Add(sp, i, No);
450- end;
451- sw := False;
452- i := i - 1;
453- No := '';
454- end;
455- end else begin
456- oc := '';
457- chk := False;
458- end;
459- al := False;
460- end;
461- end;
462- inc(i);
463- if (i > Length(Body)) then begin
464- if (sw) then begin
465- if (No <> '') then Add(sp, i, No);
466- end;
467- Break;
468- end;
469- end;
470- for i := List.Count - 1 downto 0 do begin
471- if (AnsiPos('-', PIndex(List[i]).FNo) > 0) then begin
472- st := ChooseString(PIndex(List[i]).FNo, '-', 0);
473- et := ChooseString(PIndex(List[i]).FNo, '-', 1);
351+ //何も数字が見つからないとき
352+ if No = '' then begin
353+ Result := Left + Copy(s, 1, j - 1);
474354 end else begin
475- st := PIndex(List[i]).FNo;
476- et := PIndex(List[i]).FNo;
355+ separateNumber(st, et, No, '-');
356+
357+ if not DatToHTML then begin
358+ Result := Left + Format(FORMAT_LINK,
359+ [ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]);
360+ end else begin
361+ Result := Left + Format('<a href="#%s">', [st]);
362+ end;
363+ Result := Result + Copy(s, 1, j - 1) + '</a>';
477364 end;
478- if not DatToHTML then
479- r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) +
480- Format('<a href="../test/read.cgi?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s" target="_blank">',
481- [ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) +
482- Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' +
483- Copy(r,PIndex(List[i]).FIndexTo,Length(r))
484- else
485- r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) +
486- Format('<a href="#%s">', [st]) +
487- Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' +
488- Copy(r,PIndex(List[i]).FIndexTo,Length(r));
489-
490- Dispose(PIndex(List[i]));
365+ Delete(s, 1, j - 1);
491366 end;
492- List.Free;
493- Result := r;
494-end;
495367
496-function THTMLCreate.ConvRes(
497- const Body, Bbs, Key, ParamBBS, ParamKey,
498- ParamStart, ParamTo, ParamNoFirst,
499- ParamTrue, FullURL : string
500-): string;
501-type
502- PIndex = ^TIndex;
503- TIndex = record
504- FIndexFrom : integer;
505- FIndexTo : integer;
506- FNo : string;
507- end;
508-const
509- GT = '&gt;';
510- SN = '0123456789-';
511- ZN = '0123456789−';
512-var
513- i : integer;
514- s,r : string;
515- b : TMbcsByteType;
516- sw: boolean;
517- sp: integer;
518- No: string;
519- sx: string;
520- List: TList;
521- oc : string;
522- st, et: string;
523- chk : boolean;
524- al : boolean;
525- procedure Add(IndexFrom, IndexTo: integer; const No: string);
526- var
527- FIndex : PIndex;
368+ procedure getNumberString;
528369 begin
529- New(FIndex);
530- FIndex.FIndexFrom := IndexFrom;
531- FIndex.FIndexTo := IndexTo;
532- FIndex.FNo := No;
533- List.Add(FIndex);
370+ while (j <= len) do begin
371+ if (ByteType(s, j) = mbSingleByte) then begin
372+ //1byte文字
373+ ch := s[j];
374+ Inc(j);
375+ db := false;
376+ end else begin
377+ //2byte文字
378+ ch := ZenToHan(Copy(s, j, 2));
379+ Inc(j, 2);
380+ db := true;
381+ end;
382+
383+ if System.Pos(ch, SN) > 0 then begin
384+ No := No + ch;
385+ end else if (ch = '-') then begin
386+ if sw then break;
387+ if No = '' then break;
388+ No := No + ch;
389+ sw := true;
390+ end else begin
391+ break;
392+ end;
393+ end;
534394 end;
535- function ChooseString(const Text, Separator: string; Index: integer): string;
536- var
537- S : string;
538- i, p : integer;
395+
396+ function checkComma : boolean;
539397 begin
540- S := Text;
541- for i := 0 to Index - 1 do begin
542- if (AnsiPos(Separator, S) = 0) then S := ''
543- else S := Copy(S, AnsiPos(Separator, S) + Length(Separator), Length(S));
398+ j := 1;
399+ len := Length(s);
400+ if ((len > 0) and (s[j] = ',')) or ((len > 1) and (ZenToHan(Copy(s, j ,2)) = ',')) then begin
401+ Result := true;
402+ if (ByteType(s, j) = mbSingleByte) then
403+ Inc(j)
404+ else
405+ Inc(j, 2);
406+ No := '';
407+ end else begin
408+ Result := false;
544409 end;
545- p := AnsiPos(Separator, S);
546- if (p > 0) then Result := Copy(S, 1, p - 1) else Result := S;
547410 end;
548411 begin
549- { v1.0 b2 - 03 }
412+ //s に本文を全部入れる
550413 s := Body;
551- r := Body;
552- i := 1;
553- sw := False;
554- No := '';
555- List:= TList.Create;
556- oc := '';
557- sp := 0;
558- chk := False;
559- al := False;
560- while true do begin
561- b := ByteType(s, i);
562- case b of
563- mbSingleByte : begin
564- if (not sw) and (Copy(s,i,8) = GT + GT) then begin
565- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin
566- sw := True;
567- sp := i;
568- i := i + 7;
569- oc:='';
570- chk := True;
571- end;
572- end else
573- if (not sw) and (Copy(s,i,8) = GT + GT) then begin
574- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 1) then begin
575- i := i + 7;
576- oc:='';
577- chk := True;
578- end;
579- end else
580- if (not sw) and (Copy(s,i,4) = GT) then begin
581- if (AnsiPos('<A HREF', AnsiUpperCase(oc)) = 0) then begin
582- sw := True;
583- sp := i;
584- i := i + 3;
585- oc:='';
586- chk := True;
587- end;
588- end else
589- if ((not sw) and (Copy(s,i,1) = ',')) or
590- ((not sw) and (Copy(s,i,1) = '=')) then begin
591- if ((not Chk) and (AnsiLowerCase(oc) = '</a>')) or
592- ((Chk) and (oc = '')) or
593- ((not Chk) and (al)) then
594- begin
595- sw := True;
596- sp := i;
597- //i := i + 1;
598- oc:='';
599- end;
600- end else
601- if (sw) then begin
602- sx := Copy(s,i,1);
603- if (AnsiPos(sx, SN) > 0) then begin
604- No := No + sx;
605- end else begin
606- if (No <> '') and (No <> '-') then begin
607- Add(sp, i, No);
608- al := True;
609- end;
610- sw := False;
611- //
612- i := i - 1;
613- //
614- No := '';
615- oc:='';
616- //chk := False;
617- end;
618- end else begin
619- if Copy(s,i,1) = '<' then oc := '';
620- oc := oc + Copy(s,i,1);
621- chk := False;
622- al := False;
414+ //結果をクリア
415+ Result := '';
416+ //検索対象の文字列郡
417+ token[0] := GT + GT;
418+ token[1] := GT;
419+ token[2] := '>>';
420+ token[3] := '>';
421+ token[4] := '<a ';
422+ token[5] := '<A ';
423+
424+ //
425+ while Length(s) > 2 do begin
426+ pmin := Length(s) + 1;
427+ i := Length(token);
428+ for j := 0 to 5 do begin
429+ pos := AnsiPos(token[j], s);
430+ if pos <> 0 then begin
431+ if pos < pmin then begin
432+ //どれでヒットしたか保存
433+ i := j;
434+ //最小値を更新
435+ pmin := pos;
623436 end;
624437 end;
625- mbLeadByte : begin
626- if (not sw) and (Copy(s,i,4) = '>>') then begin
627- sw := True;
628- sp := i;
629- i := i + 3;
630- chk := True;
631- end else
632- if (not sw) and (Copy(s,i,2) = '>') then begin
633- sw := True;
634- sp := i;
635- i := i + 1;
636- chk := True;
637- end else
638- if (sw) then begin
639- sx := Copy(s,i,2);
640- if (AnsiPos(sx, ZN) > 0) then begin
641- No := No + ZenToHan(sx);
642- end else begin
643- if (No <> '') and (No <> '-') and (No <> '−') then begin
644- Add(sp, i, No);
645- end;
646- sw := False;
647- i := i - 1;
648- No := '';
438+ end;
439+
440+ //ヒットした文字列の一つ手前まで結果にコピー
441+ Result := Result + Copy(s, 1, pmin - 1);
442+ Delete(s, 1, pmin - 1);
443+
444+ if i = 6 then begin
445+ //ヒットなし
446+ end else if (i = 4) or (i = 5) then begin
447+ //'<a ' or '<A' でヒット '</a>' or '</A>' までコピー
448+ pmin := AnsiPos('</a>' , s);
449+ pos := AnsiPos('</A>' , s);
450+ if (pmin <> 0) and (pos <> 0) then begin
451+ if (pmin > pos) then begin
452+ pmin := pos;
453+ end;
454+ end else if (pos <> 0) then begin
455+ pmin := pos;
456+ end;
457+ rink := Copy(s, 1, pmin + 3);
458+ Result := Result + rink;
459+ Delete(s, 1, pmin + 3);
460+
461+ pmin := Length(rink);
462+ i := Length(token);
463+ for j := 0 to 3 do begin
464+ pos := AnsiPos(token[j], rink);
465+ if pos <> 0 then begin
466+ if pos < pmin then begin
467+ //どれでヒットしたか保存
468+ i := j;
469+ //最小値を更新
470+ pmin := pos;
649471 end;
650- end else begin
651- oc := '';
652- chk := False;
653472 end;
654- al := False;
655473 end;
656- end;
657- inc(i);
658- if (i > Length(Body)) then begin
659- if (sw) then begin
660- if (No <> '') then Add(sp, i, No);
474+ // レスアンカーが含まれていたら,が続く限りアンカーとして扱う
475+ if i <= 3 then begin
476+ No := '';
477+ cm := checkComma;
478+ len := Length(s);
479+ while cm do begin
480+ oc := '';
481+ No := '';
482+ sw := false;
483+ db := false;
484+ getNumberString;
485+ Result := addResAnchor(Result);
486+ cm := checkComma;
487+ end;
661488 end;
662- Break;
663- end;
664- end;
665- for i := List.Count - 1 downto 0 do begin
666- //plName := Copy(PluginName, LastDelimiter('\',PluginName) + 1, Length(PluginName) - LastDelimiter('/',PluginName) -1 );
667- if (AnsiPos('-', PIndex(List[i]).FNo) > 0) then begin
668- st := ChooseString(PIndex(List[i]).FNo, '-', 0);
669- et := ChooseString(PIndex(List[i]).FNo, '-', 1);
670489 end else begin
671- st := PIndex(List[i]).FNo;
672- et := PIndex(List[i]).FNo;
490+ //何かしら見つかったパターン
491+ j := Length(token[i]) + 1;
492+ oc := '';
493+ No := '';
494+ sw := false;
495+ db := false;
496+ len := Length(s);
497+ getNumberString;
498+ Result := addResAnchor(Result);
673499 end;
674- r := Copy(r,0, PIndex(List[i]).FIndexFrom - 1) +
675- Format('<a href="%s&%s=%s&%s=%s&%s=%s" target="_blank">',
676- [FullURL, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) +
677- Copy(r,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' +
678- Copy(r,PIndex(List[i]).FIndexTo,Length(r));
679- Dispose(PIndex(List[i]));
680500 end;
681- List.Free;
682- Result := r;
501+ Result := Result + s;
683502 end;
684503
685504 function THTMLCreate.ConvertResAnchor(res: string): string;
@@ -738,90 +557,85 @@ var
738557 boardPlugIn : TBoardPlugIn;
739558 UserOptionalStyle: string;
740559 begin
741- if ThreadItem <> nil then begin
742- if ThreadItem.ParentBoard.IsBoardPlugInAvailable then begin
743- //===== プラグインによる表示
744- boardPlugIn := ThreadItem.ParentBoard.BoardPlugIn;
745- NewReceiveNo := ThreadItem.NewReceive;
746- // フォントやサイズの設定
747- UserOptionalStyle := GikoSys.SetUserOptionalStyle;
748- try
749- doc.open;
750- // ヘッダ
751- doc.Write( boardPlugIn.GetHeader( DWORD( threadItem ),
752- '<style type="text/css">body {' + UserOptionalStyle + '}</style>' ) + #13#10 );
753- doc.Write('<p id="idSearch"></p>' + #13#10 );
754-
755- for i := 0 to threadItem.Count - 1 do begin
756- // 1 は必ず表示
757- if i <> 0 then begin
758- // 表示範囲を限定
759- case GikoSys.ResRange of
760- Ord( grrKoko ):
761- if ThreadItem.Kokomade > (i + 1) then
762- Continue;
763- Ord( grrNew ):
764- if NewReceiveNo > (i + 1) then
765- Continue;
766- 10..65535:
767- if (threadItem.Count - i) > GikoSys.ResRange then
768- Continue;
769- end;
770- end;
560+ //===== プラグインによる表示
561+ boardPlugIn := ThreadItem.ParentBoard.BoardPlugIn;
562+ NewReceiveNo := ThreadItem.NewReceive;
563+ // フォントやサイズの設定
564+ UserOptionalStyle := GikoSys.SetUserOptionalStyle;
565+ try
566+ doc.open;
567+ // ヘッダ
568+ doc.Write( boardPlugIn.GetHeader( DWORD( threadItem ),
569+ '<style type="text/css">body {' + UserOptionalStyle + '}</style>' ) + #13#10 );
570+ doc.Write('<p id="idSearch"></p>' + #13#10 );
571+
572+ for i := 0 to threadItem.Count - 1 do begin
573+ // 1 は必ず表示
574+ if i <> 0 then begin
575+ // 表示範囲を限定
576+ case GikoSys.ResRange of
577+ Ord( grrKoko ):
578+ if ThreadItem.Kokomade > (i + 1) then
579+ Continue;
580+ Ord( grrNew ):
581+ if NewReceiveNo > (i + 1) then
582+ Continue;
583+ 10..65535:
584+ if (threadItem.Count - i) > GikoSys.ResRange then
585+ Continue;
586+ end;
587+ end;
771588
772- // 新着マーク
773- if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
774- try
775- if GikoSys.Setting.UseSkin then begin
776- if FileExists( GikoSys.GetSkinNewmarkFileName ) then
777- doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 )
778- else
779- doc.Write( '<a name="new"></a>' + #13#10 );
780- end else if GikoSys.Setting.UseCSS then begin
781- 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);
782- end else begin
783- doc.Write('</dl>');
784- doc.Write('<a name="new"></a>');
785- 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>');
786- doc.Write('<dl> + #13#10');
787- end;
788- except
789- doc.Write( '<a name="new"></a>' + #13#10);
790- end;
589+ // 新着マーク
590+ if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
591+ try
592+ if GikoSys.Setting.UseSkin then begin
593+ if FileExists( GikoSys.GetSkinNewmarkFileName ) then
594+ doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 )
595+ else
596+ doc.Write( '<a name="new"></a>' + #13#10 );
597+ end else if GikoSys.Setting.UseCSS then begin
598+ 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);
599+ end else begin
600+ doc.Write('</dl>');
601+ doc.Write('<a name="new"></a>');
602+ 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>');
603+ doc.Write('<dl> + #13#10');
791604 end;
605+ except
606+ doc.Write( '<a name="new"></a>' + #13#10);
607+ end;
608+ end;
792609
793- // レス
794- doc.Write( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ) + #13#10 );
610+ // レス
611+ doc.Write( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ) + #13#10 );
795612
796- if ThreadItem.Kokomade = (i + 1) then begin
797- // ここまで読んだ
798- try
799- if GikoSys.Setting.UseSkin then begin
800- if FileExists( GikoSys.GetSkinBookmarkFileName ) then
801- doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 )
802- else
803- doc.Write( '<a name="koko"></a>' + #13#10 );
804- end else if GikoSys.Setting.UseCSS then begin
805- doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>' + #13#10 );
806- end else begin
807- doc.Write('</dl>');
808- 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>');
809- doc.Write('<dl>' + #13#10 );
810- end;
811- except
613+ if ThreadItem.Kokomade = (i + 1) then begin
614+ // ここまで読んだ
615+ try
616+ if GikoSys.Setting.UseSkin then begin
617+ if FileExists( GikoSys.GetSkinBookmarkFileName ) then
618+ doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 )
619+ else
812620 doc.Write( '<a name="koko"></a>' + #13#10 );
813- end;
621+ end else if GikoSys.Setting.UseCSS then begin
622+ doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>' + #13#10 );
623+ end else begin
624+ doc.Write('</dl>');
625+ 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>');
626+ doc.Write('<dl>' + #13#10 );
814627 end;
628+ except
629+ doc.Write( '<a name="koko"></a>' + #13#10 );
815630 end;
816-
817-
818- // スキン(フッタ)
819- doc.Write( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ) + #13#10 );
820- finally
821- doc.Close;
822631 end;
823-
824632 end;
633+
634+
635+ // スキン(フッタ)
636+ doc.Write( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ) + #13#10 );
637+ finally
638+ doc.Close;
825639 end;
826640 end;
827641
@@ -838,240 +652,147 @@ var
838652 SkinNewRes: string;
839653 SkinRes: string;
840654 strTmp : string;
655+ ThreadName : string;
841656 function ReplaceRes( skin: string ): string;
842657 begin
843658 Result := SkinedRes( skin, Res, No );
844659 end;
845660 begin
846- if ThreadItem <> nil then begin
847- // スキン使用
848- if GikoSys.Setting.UseSkin then begin
849- NewReceiveNo := ThreadItem.NewReceive;
850- // フォントやサイズの設定
851- UserOptionalStyle := GikoSys.SetUserOptionalStyle;
852- CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName;
853- doc.open;
854- try
855- doc.charset := 'Shift_JIS';
661+ NewReceiveNo := ThreadItem.NewReceive;
662+ // フォントやサイズの設定
663+ UserOptionalStyle := GikoSys.SetUserOptionalStyle;
664+ CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName;
665+ ThreadName := ChangeFileExt(ThreadItem.FileName, '');
856666
857- // スキンの設定
858- try
859- SkinHeader := LoadFromSkin( GikoSys.GetSkinHeaderFileName, ThreadItem, ThreadItem.Size);
860- if Length( UserOptionalStyle ) > 0 then
861- SkinHeader := CustomStringReplace( SkinHeader, '</head>',
862- '<style type="text/css">body {' + UserOptionalStyle + '}</style></head>');
863- doc.Write( SkinHeader + #13#10);
864- except
865- end;
667+ doc.open;
668+ try
669+ doc.charset := 'Shift_JIS';
866670
867- try
868- SkinNewRes := LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, ThreadItem.Size);
869- except
671+ // スキンの設定
672+ try
673+ SkinHeader := LoadFromSkin( GikoSys.GetSkinHeaderFileName, ThreadItem, ThreadItem.Size);
674+ if Length( UserOptionalStyle ) > 0 then
675+ SkinHeader := CustomStringReplace( SkinHeader, '</head>',
676+ '<style type="text/css">body {' + UserOptionalStyle + '}</style></head>');
677+ doc.Write( SkinHeader + #13#10);
678+ except
679+ end;
680+
681+ try
682+ SkinNewRes := LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, ThreadItem.Size);
683+ except
684+ end;
685+
686+ try
687+ SkinRes := LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, ThreadItem.Size );
688+ except
689+ end;
690+
691+ doc.Write('<p id="idSearch"></p>' + #13#10);
692+ doc.Write('<a name="top"></a>' + #13#10);
693+
694+ for i := 0 to ReadList.Count - 1 do begin
695+ // 1 は必ず表示
696+ if i <> 0 then begin
697+ // 表示範囲を限定
698+ case GikoSys.ResRange of
699+ Ord( grrKoko ):
700+ if ThreadItem.Kokomade > (i + 1) then
701+ Continue;
702+ Ord( grrNew ):
703+ if NewReceiveNo > (i + 1) then
704+ Continue;
705+ 10..65535:
706+ if (threadItem.Count - i) > GikoSys.ResRange then
707+ Continue;
870708 end;
709+ end;
871710
711+ // 新着マーク
712+ if (NewReceiveNo = i + 1) or ((NewReceiveNo = 0) and (i = 0)) then begin
872713 try
873- SkinRes := LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, ThreadItem.Size );
714+ if FileExists( GikoSys.GetSkinNewmarkFileName ) then
715+ doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10)
716+ else
717+ doc.Write( '<a name="new"></a>' + #13#10 );
874718 except
719+ doc.Write( '<a name="new"></a>' + #13#10 );
875720 end;
721+ end;
876722
877- doc.Write('<p id="idSearch"></p>' + #13#10);
878- doc.Write('<a name="top"></a>' + #13#10);
879-
880- for i := 0 to ReadList.Count - 1 do begin
881- // 1 は必ず表示
882- if i <> 0 then begin
883- // 表示範囲を限定
884- case GikoSys.ResRange of
885- Ord( grrKoko ):
886- if ThreadItem.Kokomade > (i + 1) then
887- Continue;
888- Ord( grrNew ):
889- if NewReceiveNo > (i + 1) then
890- Continue;
891- 10..65535:
892- if (threadItem.Count - i) > GikoSys.ResRange then
893- Continue;
894- end;
895- end;
896-
897- // 新着マーク
898- if (NewReceiveNo = i + 1) or ((NewReceiveNo = 0) and (i = 0)) then begin
899- try
900- if FileExists( GikoSys.GetSkinNewmarkFileName ) then
901- doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10)
902- else
903- doc.Write( '<a name="new"></a>' + #13#10 );
904- except
905- doc.Write( '<a name="new"></a>' + #13#10 );
906- end;
907- end;
908-
909- if (Trim(ReadList[i]) <> '') then begin
910- No := IntToStr(i + 1);
723+ if (Trim(ReadList[i]) <> '') then begin
724+ No := IntToStr(i + 1);
911725
912- Res := DivideStrLine(ReadList[i]);
913- Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true');
914- Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
726+ Res := DivideStrLine(ReadList[i]);
727+ Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ThreadName, 'bbs', 'key', 'st', 'to', 'nofirst', 'true');
728+ Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
915729
916- try
917- if NewReceiveNo <= (i + 1) then
918- // 新着レス
919- strTmp := ReplaceRes( SkinNewRes )
920- else
921- // 通常のレス
922- strTmp := ReplaceRes( SkinRes );
923-
924- doc.Write( strTmp + #13#10 );
925- except
926- end;
927- end;
730+ try
731+ if NewReceiveNo <= (i + 1) then
732+ // 新着レス
733+ strTmp := ReplaceRes( SkinNewRes )
734+ else
735+ // 通常のレス
736+ strTmp := ReplaceRes( SkinRes );
928737
929- if ThreadItem.Kokomade = (i + 1) then begin
930- // ここまで読んだ
931- try
932- if FileExists( GikoSys.GetSkinBookmarkFileName ) then
933- doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 )
934- else
935- doc.Write( '<a name="koko"></a>' + #13#10 );
936- except
937- doc.Write( '<a name="koko"></a>' + #13#10 );
938- end;
939- end;
738+ doc.Write( strTmp + #13#10 );
739+ except
940740 end;
741+ end;
941742
942- doc.Write('<a name="bottom"></a>' + #13#10);
943- // スキン(フッタ)
743+ if ThreadItem.Kokomade = (i + 1) then begin
744+ // ここまで読んだ
944745 try
945- doc.Write( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) + #13#10 );
746+ if FileExists( GikoSys.GetSkinBookmarkFileName ) then
747+ doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 )
748+ else
749+ doc.Write( '<a name="koko"></a>' + #13#10 );
946750 except
751+ doc.Write( '<a name="koko"></a>' + #13#10 );
947752 end;
948- finally
949- doc.close;
950753 end;
951754 end;
952- end;
953-end;
954755
955-procedure THTMLCreate.CreateUseCSSHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string );
956-var
957- i: integer;
958- No: string;
959- CSSFileName: string;
960- NewReceiveNo: Integer;
961- Res: TResRec;
962- UserOptionalStyle: string;
963-begin
964- if ThreadItem <> nil then begin
965- doc.open;
756+ doc.Write('<a name="bottom"></a>' + #13#10);
757+ // スキン(フッタ)
966758 try
967- doc.charset := 'Shift_JIS';
968- NewReceiveNo := ThreadItem.NewReceive;
969- // フォントやサイズの設定
970- UserOptionalStyle := GikoSys.SetUserOptionalStyle;
971- CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName;
972- if GikoSys.Setting.UseCSS and FileExists(CSSFileName) then begin
973- //CSS使用
974- doc.Write('<html><head>' + #13#10);
975- doc.Write('<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">' + #13#10);
976- doc.Write('<title>' + sTitle + '</title>' + #13#10);
977- doc.Write('<link rel="stylesheet" href="'+CSSFileName+'" type="text/css">' + #13#10);
978- if Length( UserOptionalStyle ) > 0 then
979- doc.Write('<style type="text/css">body {' + UserOptionalStyle + '}</style>' + #13#10);
980- doc.Write('</head>' + #13#10);
981- doc.Write('<body>' + #13#10);
982- doc.Write('<a name="top"></a>' + #13#10);
983- doc.Write('<p id="idSearch"></p>' + #13#10);
984- doc.Write('<div class="title">' + sTitle + '</div>' + #13#10);
985- for i := 0 to ReadList.Count - 1 do begin
986- // 1 は必ず表示
987- if i <> 0 then begin
988- // 表示範囲を限定
989- case GikoSys.ResRange of
990- Ord( grrKoko ):
991- if ThreadItem.Kokomade > (i + 1) then
992- Continue;
993- Ord( grrNew ):
994- if NewReceiveNo > (i + 1) then
995- Continue;
996- 10..65535:
997- if (threadItem.Count - i) > GikoSys.ResRange then
998- Continue;
999- end;
1000- end;
1001-
1002- if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
1003- 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);
1004- end;
1005-
1006- if (Trim(ReadList[i]) <> '') then begin
1007- No := IntToStr(i + 1);
1008- Res := DivideStrLine(ReadList[i]);
1009- Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true');
1010- Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
1011- if Res.FMailTo = '' then
1012- doc.Write('<a name="' + No + '"></a>'
1013- + '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span> '
1014- + '<span class="name_label">名前:</span> '
1015- + '<span class="name"><b>' + Res.FName + '</b></span> '
1016- + '<span class="date_label">投稿日:</span> '
1017- + '<span class="date">' + Res.FDateTime+ '</span></div>'
1018- + '<div class="mes">' + Res.FBody + ' </div>' + #13#10)
1019- else if GikoSys.Setting.ShowMail then
1020- doc.Write('<a name="' + No + '"></a>'
1021- + '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span>'
1022- + '<span class="name_label"> 名前: </span>'
1023- + '<a class="name_mail" href="mailto:' + Res.FMailTo + '">'
1024- + '<b>' + Res.FName + '</b></a><span class="mail"> [' + Res.FMailTo + ']</span>'
1025- + '<span class="date_label"> 投稿日:</span>'
1026- + '<span class="date"> ' + Res.FDateTime+ '</span></div>'
1027- + '<div class="mes">' + Res.FBody + ' </div>' + #13#10)
1028- else
1029- doc.Write('<a name="' + No + '"></a>'
1030- + '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span>'
1031- + '<span class="name_label"> 名前: </span>'
1032- + '<a class="name_mail" href="mailto:' + Res.FMailTo + '">'
1033- + '<b>' + Res.FName + '</b></a>'
1034- + '<span class="date_label"> 投稿日:</span>'
1035- + '<span class="date"> ' + Res.FDateTime+ '</span></div>'
1036- + '<div class="mes">' + Res.FBody + ' </div>' + #13#10);
1037- end;
1038-
1039- if ThreadItem.Kokomade = (i + 1) then begin
1040- doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>' + #13#10);
1041- end;
1042-
1043- end;
1044-
1045- doc.Write('<a name="bottom"></a>' + #13#10);
1046- doc.Write('<a name="last"></a>' + #13#10);
1047- doc.Write('</body></html>' + #13#10);
1048- end;
1049- finally
1050- doc.Close;
759+ doc.Write( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) + #13#10 );
760+ except
1051761 end;
762+ finally
763+ doc.close;
1052764 end;
1053765 end;
1054766
1055-procedure THTMLCreate.CreateDefaultHTML (doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string );
767+procedure THTMLCreate.CreateUseCSSHTML(doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string );
1056768 var
1057769 i: integer;
1058770 No: string;
771+ CSSFileName: string;
1059772 NewReceiveNo: Integer;
1060773 Res: TResRec;
774+ UserOptionalStyle: string;
1061775 begin
1062- if ThreadItem <> nil then begin
1063- doc.open;
1064- try
1065- doc.charset := 'Shift_JIS';
1066- NewReceiveNo := ThreadItem.NewReceive;
776+ doc.open;
777+ try
778+ doc.charset := 'Shift_JIS';
779+ NewReceiveNo := ThreadItem.NewReceive;
780+ // フォントやサイズの設定
781+ UserOptionalStyle := GikoSys.SetUserOptionalStyle;
782+ CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName;
783+ if GikoSys.Setting.UseCSS and FileExists(CSSFileName) then begin
784+ //CSS使用
1067785 doc.Write('<html><head>' + #13#10);
1068786 doc.Write('<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">' + #13#10);
1069- doc.Write('<title>' + sTitle + '</title></head>' + #13#10);
1070- doc.Write('<body TEXT="#000000" BGCOLOR="#EFEFEF" link="#0000FF" alink="#FF0000" vlink="#660099">' + #13#10);
787+ doc.Write('<title>' + sTitle + '</title>' + #13#10);
788+ doc.Write('<link rel="stylesheet" href="'+CSSFileName+'" type="text/css">' + #13#10);
789+ if Length( UserOptionalStyle ) > 0 then
790+ doc.Write('<style type="text/css">body {' + UserOptionalStyle + '}</style>' + #13#10);
791+ doc.Write('</head>' + #13#10);
792+ doc.Write('<body>' + #13#10);
1071793 doc.Write('<a name="top"></a>' + #13#10);
1072- doc.Write('<font size=+1 color="#FF0000">' + sTitle + '</font>' + #13#10);
1073- doc.Write('<dl>' + #13#10);
1074794 doc.Write('<p id="idSearch"></p>' + #13#10);
795+ doc.Write('<div class="title">' + sTitle + '</div>' + #13#10);
1075796 for i := 0 to ReadList.Count - 1 do begin
1076797 // 1 は必ず表示
1077798 if i <> 0 then begin
@@ -1090,10 +811,7 @@ begin
1090811 end;
1091812
1092813 if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
1093- doc.Write('</dl>' + #13#10);
1094- doc.Write('<a name="new"></a>' + #13#10);
1095- 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);
1096- doc.Write('<dl>' + #13#10);
814+ 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);
1097815 end;
1098816
1099817 if (Trim(ReadList[i]) <> '') then begin
@@ -1102,24 +820,114 @@ begin
1102820 Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true');
1103821 Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
1104822 if Res.FMailTo = '' then
1105- 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)
823+ doc.Write('<a name="' + No + '"></a>'
824+ + '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span> '
825+ + '<span class="name_label">名前:</span> '
826+ + '<span class="name"><b>' + Res.FName + '</b></span> '
827+ + '<span class="date_label">投稿日:</span> '
828+ + '<span class="date">' + Res.FDateTime+ '</span></div>'
829+ + '<div class="mes">' + Res.FBody + ' </div>' + #13#10)
1106830 else if GikoSys.Setting.ShowMail then
1107- 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)
831+ doc.Write('<a name="' + No + '"></a>'
832+ + '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span>'
833+ + '<span class="name_label"> 名前: </span>'
834+ + '<a class="name_mail" href="mailto:' + Res.FMailTo + '">'
835+ + '<b>' + Res.FName + '</b></a><span class="mail"> [' + Res.FMailTo + ']</span>'
836+ + '<span class="date_label"> 投稿日:</span>'
837+ + '<span class="date"> ' + Res.FDateTime+ '</span></div>'
838+ + '<div class="mes">' + Res.FBody + ' </div>' + #13#10)
1108839 else
1109- 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);
840+ doc.Write('<a name="' + No + '"></a>'
841+ + '<div class="header"><span class="no"><a href="menu:' + No + '">' + No + '</a></span>'
842+ + '<span class="name_label"> 名前: </span>'
843+ + '<a class="name_mail" href="mailto:' + Res.FMailTo + '">'
844+ + '<b>' + Res.FName + '</b></a>'
845+ + '<span class="date_label"> 投稿日:</span>'
846+ + '<span class="date"> ' + Res.FDateTime+ '</span></div>'
847+ + '<div class="mes">' + Res.FBody + ' </div>' + #13#10);
1110848 end;
849+
1111850 if ThreadItem.Kokomade = (i + 1) then begin
1112- doc.Write('</dl>' + #13#10);
1113- 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);
1114- doc.Write('<dl>' + #13#10);
851+ doc.Write('<a name="koko"></a><div class="koko">ココまで読んだ</div>' + #13#10);
1115852 end;
853+
1116854 end;
1117- doc.Write('</dl>' + #13#10);
855+
1118856 doc.Write('<a name="bottom"></a>' + #13#10);
857+ doc.Write('<a name="last"></a>' + #13#10);
1119858 doc.Write('</body></html>' + #13#10);
1120- finally
1121- doc.Close;
1122859 end;
860+ finally
861+ doc.Close;
862+ end;
863+end;
864+
865+procedure THTMLCreate.CreateDefaultHTML (doc: Variant; ThreadItem: TThreadItem; ReadList: TStringList; sTitle: string );
866+var
867+ i: integer;
868+ No: string;
869+ NewReceiveNo: Integer;
870+ Res: TResRec;
871+begin
872+ doc.open;
873+ try
874+ doc.charset := 'Shift_JIS';
875+ NewReceiveNo := ThreadItem.NewReceive;
876+ doc.Write('<html><head>' + #13#10);
877+ doc.Write('<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">' + #13#10);
878+ doc.Write('<title>' + sTitle + '</title></head>' + #13#10);
879+ doc.Write('<body TEXT="#000000" BGCOLOR="#EFEFEF" link="#0000FF" alink="#FF0000" vlink="#660099">' + #13#10);
880+ doc.Write('<a name="top"></a>' + #13#10);
881+ doc.Write('<font size=+1 color="#FF0000">' + sTitle + '</font>' + #13#10);
882+ doc.Write('<dl>' + #13#10);
883+ doc.Write('<p id="idSearch"></p>' + #13#10);
884+ for i := 0 to ReadList.Count - 1 do begin
885+ // 1 は必ず表示
886+ if i <> 0 then begin
887+ // 表示範囲を限定
888+ case GikoSys.ResRange of
889+ Ord( grrKoko ):
890+ if ThreadItem.Kokomade > (i + 1) then
891+ Continue;
892+ Ord( grrNew ):
893+ if NewReceiveNo > (i + 1) then
894+ Continue;
895+ 10..65535:
896+ if (threadItem.Count - i) > GikoSys.ResRange then
897+ Continue;
898+ end;
899+ end;
900+
901+ if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
902+ doc.Write('</dl>' + #13#10);
903+ doc.Write('<a name="new"></a>' + #13#10);
904+ 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);
905+ doc.Write('<dl>' + #13#10);
906+ end;
907+
908+ if (Trim(ReadList[i]) <> '') then begin
909+ No := IntToStr(i + 1);
910+ Res := DivideStrLine(ReadList[i]);
911+ Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true');
912+ Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1);
913+ if Res.FMailTo = '' then
914+ 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)
915+ else if GikoSys.Setting.ShowMail then
916+ 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)
917+ else
918+ 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);
919+ end;
920+ if ThreadItem.Kokomade = (i + 1) then begin
921+ doc.Write('</dl>' + #13#10);
922+ 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);
923+ doc.Write('<dl>' + #13#10);
924+ end;
925+ end;
926+ doc.Write('</dl>' + #13#10);
927+ doc.Write('<a name="bottom"></a>' + #13#10);
928+ doc.Write('</body></html>' + #13#10);
929+ finally
930+ doc.Close;
1123931 end;
1124932 end;
1125933
@@ -1162,7 +970,6 @@ begin
1162970 end else begin
1163971 sTitle := CustomStringReplace(ThreadItem.Title, '@`', ',');
1164972 end;
1165-
1166973 // フォントやサイズの設定
1167974 CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName;
1168975 if GikoSys.Setting.UseSkin then begin
--- a/Option.dfm
+++ b/Option.dfm
@@ -61,9 +61,9 @@ object OptionDialog: TOptionDialog
6161 Top = 4
6262 Width = 509
6363 Height = 389
64- ActivePage = NGwordSheet
64+ ActivePage = CSSTabSheet
6565 MultiLine = True
66- TabIndex = 10
66+ TabIndex = 2
6767 TabOrder = 3
6868 OnChange = OptionTabChange
6969 object ConnectSheet: TTabSheet
@@ -253,7 +253,7 @@ object OptionDialog: TOptionDialog
253253 Top = 43
254254 Width = 417
255255 Height = 20
256- ItemHeight = 0
256+ ItemHeight = 12
257257 TabOrder = 0
258258 Text = 'BoardURLComboBox'
259259 end
@@ -655,6 +655,14 @@ object OptionDialog: TOptionDialog
655655 TabOrder = 6
656656 OnClick = CSSBackColorButtonClick
657657 end
658+ object UseKatjuTypeSkinCheckBox: TCheckBox
659+ Left = 16
660+ Top = 272
661+ Width = 193
662+ Height = 17
663+ Caption = #12363#12385#12421#65374#12375#12419#12398#12473#12461#12531#12434#21033#29992#12377#12427
664+ TabOrder = 7
665+ end
658666 end
659667 end
660668 object TabSheet3: TTabSheet
--- a/Option.pas
+++ b/Option.pas
@@ -44,13 +44,13 @@ type
4444 WriteProxyCheck: TCheckBox;
4545 WriteProxyAddressEdit: TEdit;
4646 WritePortEdit: TEdit;
47- WriteProxyUserIDEdit: TEdit;
48- WriteProxyPasswordEdit: TEdit;
47+ WriteProxyUserIDEdit: TEdit;
48+ WriteProxyPasswordEdit: TEdit;
4949 Font1Sheet: TTabSheet;
5050 Bevel1: TBevel;
5151 Bevel2: TBevel;
5252 Label19: TLabel;
53- Bevel5: TBevel;
53+ Bevel5: TBevel;
5454 Label20: TLabel;
5555 Label21: TLabel;
5656 Label22: TLabel;
@@ -201,6 +201,7 @@ type
201201 Label18: TLabel;
202202 UnFocusedBoldCheckBox: TCheckBox;
203203 IgnoreKanaCheckBox: TCheckBox;
204+ UseKatjuTypeSkinCheckBox: TCheckBox;
204205 procedure FormCreate(Sender: TObject);
205206 procedure FormDestroy(Sender: TObject);
206207 procedure ApplyButtonClick(Sender: TObject);
@@ -615,6 +616,8 @@ begin
615616 EditorMemo.Color := GikoSys.Setting.EditorBackColor;
616617 //CSS表示
617618 CSSCheckBox.Checked := GikoSys.Setting.UseCSS;
619+ //かちゅスキン使用
620+ UseKatjuTypeSkinCheckBox.Checked := GikoSys.Setting.UseKatjushaType;
618621 if FCSSFont <> nil then
619622 FCSSFont.Free;
620623 FCSSFont := TFont.Create;
@@ -912,6 +915,7 @@ begin
912915 //CSS表示
913916 if GikoSys.Setting.UseCSS <> CSSCheckBox.Checked then FRepaintThread := true;
914917 GikoSys.Setting.UseCSS := CSSCheckBox.Checked;
918+ GikoSys.Setting.UseKatjushaType := UseKatjuTypeSkinCheckBox.Checked;
915919 //CSSファイル名
916920 tmp := GikoSys.Setting.CSSFileName;
917921 GikoSys.Setting.CSSFileName := 'default.css';
--- a/Round.pas
+++ b/Round.pas
@@ -272,13 +272,13 @@ procedure TRoundDialog.RoundNameComboBoxChange(Sender: TObject);
272272 begin
273273 //カラムのソート記号イメージを解除する
274274 if FColumnToSort > -1 then
275- (Sender as TCustomListView).Column[FColumnToSort].ImageIndex := -1;
275+ RoundListView.Column[FColumnToSort].ImageIndex := -1;
276276 FColumnToSort := -1;
277-
278277 if RoundNameComboBox.ItemIndex = 0 then
279278 SetRoundItem('')
280279 else
281280 SetRoundItem(RoundNameComboBox.Items[RoundNameComboBox.itemIndex]);
281+
282282 end;
283283
284284 procedure TRoundDialog.SetRoundItem(RoundName: string);
@@ -362,21 +362,24 @@ end;
362362 procedure TRoundDialog.RoundListViewColumnClick(Sender: TObject;
363363 Column: TListColumn);
364364 begin
365- if FColumnToSort > -1 then
366- (Sender as TCustomListView).Column[FColumnToSort].ImageIndex := -1;
365+ if (Sender is TCustomListView) then begin
367366
368- if FColumnToSort = Column.Index then
369- FSortOrder := not FSortOrder
370- else
371- FSortOrder := false;
367+ if FColumnToSort > -1 then
368+ (Sender as TCustomListView).Column[FColumnToSort].ImageIndex := -1;
372369
373- if FSortOrder then
374- Column.ImageIndex := 3
375- else
376- Column.ImageIndex := 2;
370+ if FColumnToSort = Column.Index then
371+ FSortOrder := not FSortOrder
372+ else
373+ FSortOrder := false;
374+
375+ if FSortOrder then
376+ Column.ImageIndex := 3
377+ else
378+ Column.ImageIndex := 2;
377379
378- FColumnToSort := Column.Index;
379- (Sender as TCustomListView).AlphaSort;
380+ FColumnToSort := Column.Index;
381+ (Sender as TCustomListView).AlphaSort;
382+ end;
380383 end;
381384
382385 procedure TRoundDialog.RoundListViewCompare(Sender: TObject; Item1,
--- a/Setting.pas
+++ b/Setting.pas
@@ -261,6 +261,8 @@ type
261261 FCSSFileName: string;
262262 // スキン表示(一時的なもので ini に保存はされない)
263263 FUseSkin: Boolean;
264+ //かちゅ〜しゃ用のSkinを利用するか
265+ FUseKatjushaType : Boolean;
264266 //mail欄表示
265267 FShowMail: Boolean;
266268 /// レス表示範囲
@@ -628,6 +630,7 @@ type
628630 property ListViewNo: Boolean read FListViewNo write FListViewNo;
629631 property UseCSS: Boolean read FUseCSS write SetUseCSS;
630632 property CSSFileName: string read FCSSFileName write SetCSSFileName;
633+ property UseKatjushaType : Boolean read FUseKatjushaType write FUseKatjushaType;
631634 property UseSkin: Boolean read FUseSkin;
632635
633636 property ShowMail: Boolean read FShowMail write FShowMail;
@@ -1183,6 +1186,8 @@ begin
11831186 UseCSS := ini.ReadBool('CSS', 'UseCSS', True);
11841187 //CSSファイル名
11851188 CSSFileName := ini.ReadString('CSS', 'FileName', 'default.css');
1189+ //かしゅ〜しゃのスキンを使うか
1190+ FUseKatjushaType := ini.ReadBool('CSS', 'UseKatjushaType', false);
11861191
11871192 //Mail欄表示
11881193 FShowMail := ini.ReadBool('Thread', 'ShowMail', True);
@@ -1521,6 +1526,8 @@ begin
15211526 ini.WriteBool('Function', 'ListViewNo', FListViewNo);
15221527 //CSS使用
15231528 ini.WriteBool('CSS', 'UseCSS', FUseCSS);
1529+ //かしゅ〜しゃのスキンを使うか
1530+ ini.WriteBool('CSS', 'UseKatjushaType', FUseKatjushaType);
15241531 //CSSファイル名
15251532 ini.WriteString('CSS', 'FileName', FCSSFileName);
15261533 //Mail欄表示
Binary files a/gikoNavi.res and b/gikoNavi.res differ
--- a/readme/Samba.default
+++ b/readme/Samba.default
@@ -1,7 +1,7 @@
11 [Setting]
22 2chplus=30
33 aa5=30
4-academy3=30
4+academy4=30
55 anime=45
66 book3=30
77 bubble4=120
@@ -11,7 +11,7 @@ etc3=30
1111 etc4=30
1212 ex9=20
1313 ex10=20
14-ex11=45
14+ex11=20
1515 ex12=20
1616 ex13=20
1717 food6=30
@@ -40,7 +40,7 @@ qa=30
4040 qb5=30
4141 qb6=30
4242 school5=30
43-science3=30
43+science4=30
4444 society3=30
4545 sports2=0
4646 sports9=30
@@ -48,9 +48,9 @@ that3=30
4848 tmp5=45
4949 travel2=30
5050 tv7=30
51-tv8=45
51+tv8=120
5252 idol=30
5353 pie=30
5454 sakura01=30
5555 sakura02=30
56-sakura03=30
56+sakura03=30
\ No newline at end of file
--- a/readme/readme.txt
+++ b/readme/readme.txt
@@ -1,4 +1,4 @@
1-■ギコナビ Version1.00 バタ50 Readme.txt
1+■ギコナビ Version1.00 バタ51 Readme.txt
22
33
44 ------------------------------
@@ -23,6 +23,15 @@
2323 そのまま上書きインストールすれば、以前の設定やログは引き続き使用できます。
2424 詳しくは、 http://gikonavi.sourceforge.jp/tips/tips001002.html を見てください。
2525
26+■バタ50リリース2以前からバタ50リリース3以降にアップグレードした場合■
27+板更新に使用されるURLが、2005年10月1日より新URLに移行されています。
28+以下のいずれかの方法で、板更新用URLの設定を変更してください。
29+(既に新URLへの設定変更を行ってある場合は、必要ありません)
30+・「ツール」→「オプション」→「接続」タブで、「2ちゃんねるボード一覧URL」の欄に
31+ http://menu.2ch.net/bbsmenu.html をコピー&ペーストしてから追加ボタンをクリックする
32+または
33+・ギコナビを終了した状態で、ギコナビのインストールフォルダにある url.ini を削除する
34+
2635 ------------------------------
2736 インストールの方法
2837 ------------------------------
@@ -98,6 +107,17 @@ LICENSE
98107 ------------------------------
99108 履歴
100109 ------------------------------
110+200X/XX/XX
111+ Version バタ51
112+
113+2005/10/10
114+ Version バタ50 リリース3
115+ 板更新先のアドレス変更に対する修正
116+ 板更新先の更新されていないアドレスを削除
117+ ヘルプ内にギコナビWikiへのリンクを追加
118+ 履歴消去等のメッセージを修正
119+ 巡回時に巡回リストが自動保存されない問題を修正
120+
101121 2005/08/20
102122 Version バタ50 リリース2
103123 レスエディタが表示されていると、pluginを利用するBBSのDLができない不具合の修正
Show on old repository browser