- Result := TRoundItem.Create;
- Result.RoundType := grtItem;
- for i := 0 to 4 do begin
- s := GikoSys.GetTokenIndex(Line, #1, i);
- try
- case i of
- 0: bbsID := s;
- 1: Result.BoardTitle := s;
- 2:
- begin
- Result.FileName := s;
- board := BBSs[ 0 ].FindBBSID(bbsID);
- if board <> nil then begin
- buf := Copy(board.GetSendURL,1,LastDelimiter('/', board.GetSendURL)-1);
- Result.URL := buf + '/read.cgi/'+ board.BBSID+ '/' +ChangeFileExt(s,'') + '/l50';
- end else begin
- raise Exception.Create('\82±\82Ì\8f\84\89ñ\82Í\93Ç\82Ý\8d\9e\82ß\82È\82¢\82æ');
- end;
- end;
- 3: Result.ThreadTitle := s;
- 4: Result.RoundName := s;
- end;
- except
- Result := nil;
- Exit;
- end;
- end;
+// Result := TRoundItem.Create;
+// Result.RoundType := grtItem;
+ threadItem := nil;
+ for i := 0 to 4 do begin
+ s := GikoSys.GetTokenIndex(Line, #1, i);
+ try
+ case i of
+ 0: bbsID := s;
+ //1: Result.BoardTitle := s;
+ 2:
+ begin
+ //Result.FileName := s;
+ board := BBSs[ 0 ].FindBBSID(bbsID);
+ if board <> nil then begin
+ buf := Copy(board.GetSendURL,1,LastDelimiter('/', board.GetSendURL)-1);
+ buf := buf + '/read.cgi/'+ board.BBSID+ '/' +ChangeFileExt(s,'') + '/l50';
+ threadItem := BBSsFindThreadFromURL(buf);
+ end else begin
+ raise Exception.Create('\82±\82Ì\8f\84\89ñ\82Í\93Ç\82Ý\8d\9e\82ß\82È\82¢\82æ');
+ end;
+ end;
+ //3: Result.ThreadTitle := s;
+ 4: roundname := s;
+ end;
+ except
+ Result := false;
+ Exit;
+ end;
+ end;
+ if( threadItem <> nil ) then begin
+ if not threadItem.Round then begin
+ threadItem.RoundName := roundname;
+ RoundNameList.Add(roundname);
+ //RoundNameList.Find(roundname, i);
+ //threadItem.RoundName := PChar(RoundNameList[i]);
+ threadItem.Round := true;
+ end;
+ Result := true;
+ end else begin
+ Result := false;
+ end;
+
+end;
+procedure TRoundList.URLReplace(oldURLs: TStringList; newURLs :TStringList);
+var
+ i: Integer;
+ j: Integer;
+ tempString: string;
+ tmpURL: string;
+ oldHost: string;
+ oldBoardName: string;
+ newHost: string;
+ newBoardName: string;
+begin
+ if oldURLs.Count <> newURLs.Count then
+ Exit;
+ //\82±\82±\82©\82ç\81ABoard\82ÌURL\82Ì\95Ï\8dX
+ for j :=0 to oldURLs.Count - 1 do begin
+ for i :=0 to FBoardList.Count - 1 do begin
+ if TRoundItem(FBoardList[i]).URL = oldURLs[j] then
+ TRoundItem(FBoardList[i]).TmpURL := newURLs[j];
+ end;
+ end;
+ //\82±\82±\82Ü\82Å\81ABoard\82ÌURL\82Ì\95Ï\8dX
+
+ //\82±\82±\82©\82ç\81AThread\82ÌURL\82Ì\95Ï\8dX
+ //\96Ê\93|\82¾\82¯\82Çthread\82Í\82»\82ê\82¼\82êURL\82ð\83`\83\83\83b\83N\82µ\82È\82ª\82ç\82â\82Á\82Ä\82©\82È\82«\82á\82¢\82¯\82È\82¢\81B
+ for i := 0 to oldURLs.Count - 1 do begin
+ tmpURL := Copy(oldURLs[i], 1, Length(oldURLs[i]) -1);
+ oldHost := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
+ oldBoardName := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
+ tmpURL := Copy(newURLs[i], 1, Length(newURLs[i]) -1);
+ newHost := Copy(tmpURL, 1, LastDelimiter('/', tmpURL) );
+ newBoardName := Copy(tmpURL, LastDelimiter('/', tmpURL), Length(tmpURL) ) + '/';
+
+ for j := 0 to FItemList.Count - 1 do begin
+ tempString := TRoundItem(FItemList[j]).URL;
+ if ( AnsiPos(oldBoardName, tempString) <> 0 ) and ( AnsiPos(oldHost, tempString ) <> 0 ) then begin
+ tempString := StringReplace(tempString, oldHost, newHost,[]);
+ TRoundItem(FItemList[j]).TmpURL := tempString;
+ end;
+ end;
+ end;
+ //\82±\82±\82Ü\82Å\81AThread\82ÌURL\82Ì\95Ï\8dX
+