OSDN Git Service

LogFolderPプロパティ追加による変更。
[gikonavigoeson/gikonavi.git] / BoardGroup.pas
index bd1d395..80a3a4b 100644 (file)
@@ -308,7 +308,9 @@ type
                procedure Init;
                function GetCreateDate: TDateTime;
        public
-               constructor Create( inPlugIn : TBoardPlugIn; inURL : string );
+               constructor Create( inPlugIn : TBoardPlugIn; inURL : string ); overload;
+        constructor Create( is2ch : Boolean; const inURL, inHost, inBBSID, inBBSKey : string ); overload;
+
                destructor Destroy; override;
 
                function GetDatURL: string;
@@ -841,11 +843,11 @@ begin
                GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
                if GikoSys.Is2chHost( host ) then
                        FilePath :=
-                               IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
+                               GikoSys.Setting.LogFolderP  +
                                BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
                else
                        FilePath :=
-                               IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
+                               GikoSys.Setting.LogFolderP +
                                EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME
        end else begin
                // \83v\83\89\83O\83C\83\93\82É TBoardItem \82ª\8dì\90¬\82³\82ê\82½\82±\82Æ\82ð\93`\82¦\82é
@@ -1011,7 +1013,7 @@ begin
        if Length( FilePath ) > 0 then
                FileName := ExtractFilePath( FilePath ) + FOLDER_INI_FILENAME
        else
-               FileName := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
+               FileName := GikoSys.Setting.LogFolderP
                                                        + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + FOLDER_INI_FILENAME;
 
        if not FileExists(FileName) then
@@ -1056,7 +1058,7 @@ begin
        if Length( FilePath ) > 0 then
                FileName := ExtractFilePath( FilePath )
        else
-               FileName := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
+               FileName := GikoSys.Setting.LogFolderP
                                                        + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM;
        if not GikoSys.DirectoryExistsEx(FileName) then
                GikoSys.ForceDirectoriesEx(FileName);
@@ -1161,7 +1163,7 @@ begin
        if Length( FilePath ) > 0 then
                Result := FilePath
        else
-               Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
+               Result := GikoSys.Setting.LogFolderP
                                                + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SUBJECT_FILENAME;
 end;
 
@@ -1171,7 +1173,7 @@ begin
        if Length( FilePath ) > 0 then
                Result := ExtractFilePath( FilePath ) + FOLDER_INDEX_FILENAME
        else
-               Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
+               Result := GikoSys.Setting.LogFolderP
                                                + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + FOLDER_INDEX_FILENAME;
 end;
 //SETTING.TXT\82Ì\83t\83@\83C\83\8b\96¼\8eæ\93¾
@@ -1180,7 +1182,7 @@ begin
        if Length( FilePath ) > 0 then
                Result := ExtractFilePath( FilePath ) + SETTINGTXT_FILENAME
        else
-               Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
+               Result := GikoSys.Setting.LogFolderP
                                                + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + SETTINGTXT_FILENAME;
 end;
 
@@ -1189,7 +1191,7 @@ begin
        if Length( FilePath ) > 0 then
                Result := ExtractFilePath( FilePath ) + HEADTXT_FILENAME
        else
-               Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
+               Result := GikoSys.Setting.LogFolderP
                                                + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + HEADTXT_FILENAME;
 end;
 function TBoard.GetTitlePictureFileName: string;
@@ -1203,15 +1205,23 @@ begin
                if Length( FilePath ) > 0 then
                        Result := ExtractFilePath( FilePath ) + tmpName
                else
-                       Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
+                       Result := GikoSys.Setting.LogFolderP
                                                        + BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + tmpName;
        end;
 end;
 
 // \83X\83\8c\97§\82Ä\91\97\90MURL
 function TBoard.GetSendURL: string;
+var
+       Protocol, Host, Path, Document, Port, Bookmark : string;
 begin
-       Result := GikoSys.UrlToServer(URL) + 'test/bbs.cgi';
+    Result := GikoSys.UrlToServer(URL);
+    GikoSys.ParseURI( URL, Protocol,Host, Path, Document, Port, Bookmark );
+    if GikoSys.Is2chHost(Host) then
+        Result := Result + 'test/bbs.cgi'
+    else
+        Result := Result + 'test/subbbs.cgi';
+
 end;
 
 procedure TBoard.SetRound(b: Boolean);
@@ -1518,11 +1528,11 @@ begin
                        GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
                        if GikoSys.Is2chHost( host ) then
                                FilePath :=
-                                       IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
+                                       GikoSys.Setting.LogFolderP +
                                        BBS2CH_LOG_FOLDER + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat'
                        else
                                FilePath :=
-                                       IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder ) +
+                                       GikoSys.Setting.LogFolderP +
                                        EXTERNAL_LOG_FOLDER + PATH_DELIM + host + PATH_DELIM + BBSID + PATH_DELIM + BBSKey + '.dat';
                        FileName        := BBSKey + '.dat';
                        IsLogFile       := FileExists( FilePath );
@@ -1536,6 +1546,43 @@ begin
 end;
 
 // *************************************************************************
+// \83v\83\89\83O\83C\83\93\82ð\97\98\97p\82µ\82È\82¢\83R\83\93\83X\83g\83\89\83N\83^
+// *************************************************************************
+constructor TThreadItem.Create(
+       is2ch : Boolean;
+    const inURL, inHost, inBBSID, inBBSKey : string
+);
+var
+       foundPos                        : Integer;
+const
+       READ_PATH                                                       = '/test/read.cgi';
+begin
+
+       inherited Create;
+       Init;
+
+       FBoardPlugIn    := nil;
+
+    foundPos := Pos( READ_PATH, inURL );
+    if foundPos > 0 then begin
+        // dat \82Ì\95Û\91\83p\83X\82ð\90Ý\92è
+        if is2ch then
+            FilePath :=
+
+                GikoSys.Setting.LogFolderP +
+                BBS2CH_LOG_FOLDER + PATH_DELIM + inBBSID + PATH_DELIM + inBBSKey + '.dat'
+        else
+            FilePath :=
+                GikoSys.Setting.LogFolderP +
+                EXTERNAL_LOG_FOLDER + PATH_DELIM + inHost + PATH_DELIM + inBBSID + PATH_DELIM + inBBSKey + '.dat';
+        FileName       := inBBSKey + '.dat';
+        IsLogFile      := FileExists( FilePath );
+        URL                            := GikoSys.Get2chBrowsableThreadURL( inURL );
+    end else
+       URL                             := inURL;
+
+end;
+// *************************************************************************
 // \83f\83X\83g\83\89\83N\83^
 // *************************************************************************
 destructor TThreadItem.Destroy;
@@ -1716,7 +1763,7 @@ begin
        if Length( FilePath ) > 0 then
                Result := FilePath
        else
-               Result := IncludeTrailingPathDelimiter( GikoSys.Setting.LogFolder )
+               Result := GikoSys.Setting.LogFolderP
                                                + BBS2CH_LOG_FOLDER + PATH_DELIM + ParentBoard.BBSID + PATH_DELIM + FileName;
 end;