ActiveFileName: string;
e: IHTMLElement;
Ext: string;
+ buf: string;
PathRec: TPathRec;
begin
try
URL := Text;
if Pos('about:blank..', URL) = 1 then begin
- URL := StringReplace( URL, 'about:blank..', 'http://www.2ch.net', [] );
+ threadItem := GetActiveContent;
+ URL := Copy(threadItem.URL, 1, LastDelimiter('/',threadItem.URL));
+ buf := Copy(Text,LastDelimiter('/',Text)+1,Length(Text)-LastDelimiter('/',Text));
+ URL := URL + buf;
+ buf := CustomStringReplace(URL,'&','=');
+ //URL := StringReplace( URL, 'about:blank..', 'http://www.2ch.net', [] );
PathRec := Gikosys.Parse2chURL2(URL);
+ if (AnsiPos('=st=', buf ) <> 0) and ( AnsiPos( '=to=',buf) <> 0 ) then begin
+ try
+ PathRec.FSt := StrToInt( Copy( buf, AnsiPos('=st=', buf ) + 4, AnsiPos( '=to=',buf) - AnsiPos('=st=', buf ) - 4 ) );
+ PathRec.FTo := StrToInt( Copy( buf, AnsiPos('=to=', buf ) + 4, AnsiPos( '=nofirst=',buf) - AnsiPos('=to=', buf ) - 4) );
+ except
+ PathRec.FSt := 0;
+ PathRec.FTo := 0;
+ end;
+ end;
end else begin
PathRec := Gikosys.Parse2chURL2(URL);
- if (AnsiPos('=st=', Text ) <> 0) and ( AnsiPos( '=to=',Text) <> 0 ) then begin
+ if (AnsiPos('=st=', URL ) <> 0) and ( AnsiPos( '=to=',URL) <> 0 ) then begin
try
- PathRec.FSt := StrToInt( Copy( Text, AnsiPos('=st=', Text ) + 4, AnsiPos( '=to=',Text) - AnsiPos('=st=', Text ) - 4 ) );
- PathRec.FTo := StrToInt( Copy( Text, AnsiPos('=to=', Text ) + 4, AnsiPos( '=nofirst=',Text) - AnsiPos('=to=', Text ) - 4) );
+ PathRec.FSt := StrToInt( Copy( URL, AnsiPos('=st=', URL ) + 4, AnsiPos( '=to=',URL) - AnsiPos('=st=', URL ) - 4 ) );
+ PathRec.FTo := StrToInt( Copy( URL, AnsiPos('=to=', URL ) + 4, AnsiPos( '=nofirst=',URL) - AnsiPos('=to=', URL ) - 4) );
except
PathRec.FSt := 0;
PathRec.FTo := 0;
board := BBSs[ 0 ].FindBBSID( PathRec.FBBS );
if board <> nil then
threadItem := board.Find( PathRec.FKey + '.dat' );
- if threadItem = nil then
- threadItem := GetActiveContent;
+
end;
if threadItem <> nil then begin