OSDN Git Service

レスポップアップの修正。他の掲示板も対応していく過程でまた問題がでそう。
[gikonavigoeson/gikonavi.git] / Giko.pas
index 2e21d78..f3631cc 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -2411,6 +2411,7 @@ var
        ActiveFileName: string;
        e: IHTMLElement;
        Ext: string;
+    buf: string;
        PathRec: TPathRec;
 begin
        try
@@ -2486,14 +2487,28 @@ begin
                        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;
@@ -2539,8 +2554,7 @@ begin
                                        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