ギコナビ
リビジョン | f1a67a1812afab51bb214fc9a41d1628954f7da6 (tree) |
---|---|
日時 | 2004-10-03 03:37:55 |
作者 | cvs2git <cvs2git> |
コミッター | cvs2git |
This commit was manufactured by cvs2svn to create tag 'v1_49_0_547'.
@@ -2878,31 +2878,12 @@ begin | ||
2878 | 2878 | threadItem := GetActiveContent; |
2879 | 2879 | if Pos('about:blank..', Text) = 1 then begin |
2880 | 2880 | wkInt := LastDelimiter( '/', threadItem.URL ); |
2881 | - if Pos( '?', Copy( threadItem.URL, wkInt, MaxInt ) ) = 0 then begin | |
2882 | - // Thread.URL Í PATH_INFO nµ | |
2883 | - URL := Copy( threadItem.URL, 1, LastDelimiter( '/', threadItem.URL ) ); | |
2884 | - wkInt := LastDelimiter( '/', Text ); | |
2885 | - if Pos( '?', Copy( Text, wkInt, MaxInt ) ) = 0 then | |
2886 | - // Text à PATH_INFO nµ | |
2887 | - URL := URL + Copy( Text, LastDelimiter( '/', Text ) + 1, MaxInt ) | |
2888 | - else | |
2889 | - // Text Í QUERY_STRING nµ | |
2890 | - URL := URL + Copy( Text, LastDelimiter( '?', Text ) + 1, MaxInt ); | |
2891 | - end else begin | |
2892 | - // Thread.URL Í QUERY_STRING nµ | |
2893 | - URL := Copy( threadItem.URL, 1, LastDelimiter( '?', threadItem.URL ) ); | |
2894 | - wkInt := LastDelimiter( '/', Text ); | |
2895 | - if Pos( '?', Copy( Text, wkInt, MaxInt ) ) = 0 then begin | |
2896 | - // Text Í PATH_INFO nµ | |
2897 | - // URL ÉÂÆL[ª«çÈ¢ÌÅ Text ©ç¸Õ·é | |
2898 | - wkInt := LastDelimiter( '/', Copy( Text, 1, wkInt - 1 ) ); | |
2899 | - wkInt := LastDelimiter( '/', Copy( Text, 1, wkInt - 1 ) ); | |
2900 | - URL := Copy( URL, 1, Length( URL ) - 1 ) + Copy( Text, wkInt, MaxInt ); | |
2901 | - end else begin | |
2902 | - // Text à QUERY_STRING nµ | |
2903 | - URL := URL + Copy( Text, LastDelimiter( '?', Text ) + 1, MaxInt ) | |
2904 | - end; | |
2905 | - end; | |
2881 | + if Pos( '?', Copy( threadItem.URL, wkInt, MaxInt ) ) = 0 then | |
2882 | + URL := Copy( threadItem.URL, 1, LastDelimiter( '/', threadItem.URL ) ) + | |
2883 | + Copy( Text, LastDelimiter( '/', Text ) + 1, MaxInt ) | |
2884 | + else | |
2885 | + URL := Copy( threadItem.URL, 1, LastDelimiter( '?', threadItem.URL ) ) + | |
2886 | + Copy( Text, LastDelimiter( '?', Text ) + 1, MaxInt ) | |
2906 | 2887 | end else begin |
2907 | 2888 | URL := Text; |
2908 | 2889 | end; |
@@ -2911,9 +2892,8 @@ begin | ||
2911 | 2892 | if (PathRec.FNoParam) then begin |
2912 | 2893 | PathRec.FSt := 1; |
2913 | 2894 | PathRec.FTo := 1; |
2914 | - end else begin | |
2895 | + end else | |
2915 | 2896 | Gikosys.GetPopupResNumber(URL,PathRec.FSt,PathRec.FTo); |
2916 | - end; | |
2917 | 2897 | GikoSys.ParseURI( URL, Protocol, Host, Path, Document, Port, Bookmark ); |
2918 | 2898 | |
2919 | 2899 | if PathRec.FDone or (not GikoSys.Is2chHost( Host )) then begin |
@@ -2940,10 +2920,10 @@ begin | ||
2940 | 2920 | // wkIntTo := 1; |
2941 | 2921 | //if PathRec.FFirst then |
2942 | 2922 | // wkIntSt := 1; |
2943 | - //if PathRec.FStBegin then //http://````/-50Æ¢¤Æ« | |
2944 | - // wkIntSt := 1; // | |
2945 | - //if PathRec.FToEnd then //http://````/50-Æ¢¤Æ« | |
2946 | - // wkIntTo := 9999; // Ç¿çÌêàAGetPopupResNumberŤÜÔð²®·éÌÅÓæ¤B | |
2923 | + if PathRec.FStBegin then | |
2924 | + wkIntSt := 1; | |
2925 | + if PathRec.FToEnd then | |
2926 | + wkIntTo := 9999; | |
2947 | 2927 | |
2948 | 2928 | //ATitle := ActiveFileName <> PathRec.FKey; |
2949 | 2929 | if (FActiveContent <> nil) and (FActiveContent.Thread.URL = URL) then |
@@ -3671,7 +3651,7 @@ begin | ||
3671 | 3651 | for i := 0 to BrowserTab.Tabs.Count - 1 do begin |
3672 | 3652 | if TObject(BrowserTab.Tabs.Objects[i]) is TBrowserRecord then begin |
3673 | 3653 | if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin |
3674 | - Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] ); | |
3654 | + Result := TBrowserRecord( BrowserTab.Tabs.Objects[j] ); | |
3675 | 3655 | if TBrowserRecord(BrowserTab.Tabs.Objects[i]).FBrowser = nil then begin |
3676 | 3656 | for j := BrowserTab.Tabs.Count - 1 downto 0 do begin |
3677 | 3657 | if TBrowserRecord(BrowserTab.Tabs.Objects[j]).FBrowser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin |
@@ -3859,13 +3839,11 @@ begin | ||
3859 | 3839 | |
3860 | 3840 | |
3861 | 3841 | try |
3862 | - { | |
3863 | 3842 | if ThreadItem.UnRead then begin |
3864 | 3843 | ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1; |
3865 | 3844 | if ThreadItem.ParentBoard.UnRead < 0 then ThreadItem.ParentBoard.UnRead := 0; |
3866 | 3845 | TreeView.Refresh; |
3867 | 3846 | end; |
3868 | - } | |
3869 | 3847 | if(FActiveContent <> nil) and (FActiveContent <> Thread) then begin |
3870 | 3848 | if (FActiveContent.Browser <> BrowserNullTab.Browser) then |
3871 | 3849 | ShowWindow(FActiveContent.Browser.Handle, SW_HIDE); |
@@ -4008,16 +3986,12 @@ end; | ||
4008 | 3986 | procedure TGikoForm.SetListViewType(AViewType: TGikoViewType; SelectText: string; KubetsuChk: Boolean); |
4009 | 3987 | var |
4010 | 3988 | Board: TBoard; |
4011 | - i: Integer; | |
4012 | 3989 | begin |
4013 | 3990 | if ActiveList is TBoard then begin |
4014 | - for i := Length( BBSs ) - 1 downto 0 do begin | |
4015 | - BBSs[i].SelectText := SelectText; | |
4016 | - BBSs[i].KubetsuChk := KubetsuChk; | |
4017 | - end; | |
4018 | 3991 | Board := TBoard(ActiveList); |
4019 | -// Board.ParentCategory.ParenTBBS.SelectText := SelectText; | |
4020 | -// Board.ParentCategory.ParenTBBS.KubetsuChk := KubetsuChk; | |
3992 | + | |
3993 | + Board.ParentCategory.ParenTBBS.SelectText := SelectText; | |
3994 | + Board.ParentCategory.ParenTBBS.KubetsuChk := KubetsuChk; | |
4021 | 3995 | // Board.SelectText := SelectText; |
4022 | 3996 | // Board.KubetsuChk := KubetsuChk; |
4023 | 3997 | ViewType := AViewType; |
@@ -6695,20 +6669,10 @@ begin | ||
6695 | 6669 | threadItem := BrowserRecord.Thread; |
6696 | 6670 | |
6697 | 6671 | if (BrowserRecord <> nil) and (Length( BrowserRecord.Movement ) > 0) then begin |
6698 | - if threadItem.UnRead then begin | |
6699 | - threadItem.UnRead := False; | |
6700 | - threadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1; | |
6701 | - if threadItem.ParentBoard.UnRead < 0 then threadItem.ParentBoard.UnRead := 0; | |
6702 | - TreeView.Refresh; | |
6703 | - ListView.Refresh; | |
6704 | - end; | |
6705 | 6672 | BrowserMovement( BrowserRecord.Movement, BrowserRecord ); |
6706 | 6673 | BrowserRecord.Movement := ''; |
6707 | 6674 | end else if threadItem.UnRead then begin |
6708 | 6675 | threadItem.UnRead := False; |
6709 | - threadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1; | |
6710 | - if threadItem.ParentBoard.UnRead < 0 then threadItem.ParentBoard.UnRead := 0; | |
6711 | - TreeView.Refresh; | |
6712 | 6676 | BrowserMovement( 'new', BrowserRecord ); |
6713 | 6677 | ListView.Refresh; |
6714 | 6678 | end else if threadItem.ScrollTop <> 0 then begin |
@@ -7541,7 +7505,6 @@ begin | ||
7541 | 7505 | boardURL := tmpThread.BoardPlugIn.GetBoardURL( DWORD( tmpThread ) ); |
7542 | 7506 | Board := BBSsFindBoardFromURL( boardURL ); |
7543 | 7507 | if Board = nil then begin |
7544 | - //break; | |
7545 | 7508 | // ¦ìÁÄàÇÁ·éƱ몳¢Ìŵۯ |
7546 | 7509 | //GikoSys.OpenBrowser(inURL, gbtUserApp); |
7547 | 7510 | //Exit; |
@@ -7555,35 +7518,38 @@ begin | ||
7555 | 7518 | GikoSys.ReadSubjectFile( Board ); |
7556 | 7519 | Exit; |
7557 | 7520 | end; |
7558 | - ThreadItem := Board.FindThreadFromFileName( tmpThread.FileName ); | |
7559 | - if ThreadItem = nil then begin | |
7560 | - ThreadItem := tmpThread; | |
7561 | - Board.Insert( 0, ThreadItem ); | |
7562 | - if ActiveList is TBoard then begin | |
7563 | - if TBoard(ActiveList) = Board then | |
7564 | - ListView.Items.Count := ListView.Items.Count + 1; | |
7565 | - end; | |
7566 | - GikoSys.GetPopupResNumber( inURL, stRes, edRes ); | |
7567 | - browserRec := InsertBrowserTab( ThreadItem ); | |
7521 | + end; | |
7522 | + | |
7523 | + ThreadItem := Board.FindThreadFromFileName( tmpThread.FileName ); | |
7524 | + if ThreadItem = nil then begin | |
7525 | + ThreadItem := tmpThread; | |
7526 | + Board.Insert( 0, ThreadItem ); | |
7527 | + if ActiveList is TBoard then begin | |
7528 | + if TBoard(ActiveList) = Board then | |
7529 | + ListView.Items.Count := ListView.Items.Count + 1; | |
7530 | + end; | |
7531 | + GikoSys.GetPopupResNumber( inURL, stRes, edRes ); | |
7532 | + browserRec := InsertBrowserTab( ThreadItem ); | |
7533 | + if (browserRec <> nil) and (stRes > 0) then | |
7534 | + browserRec.Movement := IntToStr( stRes ); | |
7535 | + DownloadContent( ThreadItem ); | |
7536 | + Exit; | |
7537 | + end else begin | |
7538 | + tmpThread.Free; | |
7539 | + GikoSys.GetPopupResNumber( inURL, stRes, edRes ); | |
7540 | + browserRec := InsertBrowserTab( ThreadItem ); | |
7541 | + if ThreadItem.IsLogFile then begin | |
7542 | + if (browserRec <> nil) and (stRes > 0) then | |
7543 | + BrowserMovement( IntToStr( stRes ), browserRec ); | |
7544 | + end else begin | |
7568 | 7545 | if (browserRec <> nil) and (stRes > 0) then |
7569 | 7546 | browserRec.Movement := IntToStr( stRes ); |
7570 | 7547 | DownloadContent( ThreadItem ); |
7571 | - Exit; | |
7572 | - end else begin | |
7573 | - tmpThread.Free; | |
7574 | - GikoSys.GetPopupResNumber( inURL, stRes, edRes ); | |
7575 | - browserRec := InsertBrowserTab( ThreadItem ); | |
7576 | - if ThreadItem.IsLogFile then begin | |
7577 | - if (browserRec <> nil) and (stRes > 0) then | |
7578 | - BrowserMovement( IntToStr( stRes ), browserRec ); | |
7579 | - end else begin | |
7580 | - if (browserRec <> nil) and (stRes > 0) then | |
7581 | - browserRec.Movement := IntToStr( stRes ); | |
7582 | - DownloadContent( ThreadItem ); | |
7583 | - end; | |
7584 | - Exit; | |
7585 | 7548 | end; |
7549 | + Exit; | |
7586 | 7550 | end; |
7551 | + | |
7552 | + //Exit; | |
7587 | 7553 | end; |
7588 | 7554 | |
7589 | 7555 | atBoard: |
@@ -9010,10 +8976,9 @@ begin | ||
9010 | 8976 | ModifySelectList; |
9011 | 8977 | end else if Length( SelectComboBox.Text ) = 0 then |
9012 | 8978 | begin |
9013 | - {* SelectComboBox.TextªóÅàAüÍrÅEscµ½Æ© | |
9014 | - * óÌÆ«ÉDelL[ðµ½Æ©ÈÌÅAXÌiÝðÛ·éB | |
9015 | - * i±±ÅͽàµÈ¢j | |
9016 | - *} | |
8979 | + AllItemAction.Checked := True; | |
8980 | + LogItemAction.Checked := False; | |
8981 | + NewItemAction.Checked := False; | |
9017 | 8982 | end else begin |
9018 | 8983 | // `Âƾ©çAêµÄ éÆ«¾¯·é |
9019 | 8984 | if AllItemAction.Checked then |
@@ -11165,16 +11130,12 @@ begin | ||
11165 | 11130 | SelectListItem(List); |
11166 | 11131 | for i := 0 to List.Count - 1 do begin |
11167 | 11132 | if TObject(List[i]) is TThreadItem then begin |
11168 | - if (TThreadItem(List[i]).UnRead) then begin | |
11169 | - TThreadItem(List[i]).UnRead := false; | |
11170 | - TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead - 1; | |
11171 | - end; | |
11133 | + TThreadItem(List[i]).UnRead := false; | |
11134 | + TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead - 1; | |
11172 | 11135 | end; |
11173 | 11136 | end; |
11174 | 11137 | if TreeView.Visible then |
11175 | 11138 | TreeView.Refresh; |
11176 | - if ListView.Visible then | |
11177 | - ListView.Refresh; | |
11178 | 11139 | finally |
11179 | 11140 | List.Free; |
11180 | 11141 | end; |
@@ -11190,16 +11151,12 @@ begin | ||
11190 | 11151 | SelectListItem(List); |
11191 | 11152 | for i := 0 to List.Count - 1 do begin |
11192 | 11153 | if TObject(List[i]) is TThreadItem then begin |
11193 | - if (TThreadItem(List[i]).IsLogFile) and (not TThreadItem(List[i]).UnRead) then begin | |
11194 | - TThreadItem(List[i]).UnRead := true; | |
11195 | - TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead + 1; | |
11196 | - end; | |
11154 | + TThreadItem(List[i]).UnRead := true; | |
11155 | + TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead + 1; | |
11197 | 11156 | end; |
11198 | 11157 | end; |
11199 | 11158 | if TreeView.Visible then |
11200 | 11159 | TreeView.Refresh; |
11201 | - if ListView.Visible then | |
11202 | - ListView.Refresh; | |
11203 | 11160 | finally |
11204 | 11161 | List.Free; |
11205 | 11162 | end; |
@@ -1259,10 +1259,8 @@ begin | ||
1259 | 1259 | OldCnt := Body.IndexOf(oldBody.Strings[ LastIdx ]) + 1; |
1260 | 1260 | until ( OldCnt <> 0 ) or (LastIdx = 0); |
1261 | 1261 | |
1262 | - if OldCnt >= Body.Count then OldCnt := Body.Count - 1; | |
1263 | 1262 | NewRes := Body.Count - OldCnt; |
1264 | 1263 | |
1265 | - | |
1266 | 1264 | finally |
1267 | 1265 | oldBody.Free; |
1268 | 1266 | end; |
@@ -1299,10 +1297,8 @@ begin | ||
1299 | 1297 | ThreadItem.AllResCount := ThreadItem.Count; |
1300 | 1298 | ThreadItem.IsLogFile := True; |
1301 | 1299 | ThreadItem.RoundDate := Now; |
1302 | - if not ThreadItem.UnRead then begin | |
1303 | - ThreadItem.UnRead := True; | |
1304 | - ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead + 1; | |
1305 | - end; | |
1300 | + ThreadItem.UnRead := True; | |
1301 | + ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead + 1; | |
1306 | 1302 | // if ThreadItem.RoundNo = 6 then |
1307 | 1303 | // ThreadItem.RoundNo := 0; |
1308 | 1304 |
@@ -147,7 +147,6 @@ object KuroutOption: TKuroutOption | ||
147 | 147 | Height = 57 |
148 | 148 | Caption = #12395#12385#12419#12435#35486#26696#20869#27231#33021 |
149 | 149 | TabOrder = 2 |
150 | - Visible = False | |
151 | 150 | object Label5: TLabel |
152 | 151 | Left = 8 |
153 | 152 | Top = 16 |
@@ -1223,7 +1223,7 @@ begin | ||
1223 | 1223 | FDeleteSyria := ini.ReadBool('Abon','DeleteSyria',false); |
1224 | 1224 | |
1225 | 1225 | // GfB^ |
1226 | - FSpaceToNBSP := ini.ReadBool( 'Editor', 'SpaceToNBSP', False ); | |
1226 | + FSpaceToNBSP := ini.ReadBool( 'Editor', 'SpaceToNBSP', True ); | |
1227 | 1227 | FAmpToCharRef := ini.ReadBool( 'Editor', 'AmpToCharRef', False ); |
1228 | 1228 | |
1229 | 1229 | //Tab©®Û¶AÇÝÝ |
@@ -89,20 +89,16 @@ Windows Server 2003 Enterprise Edition IE6 | ||
89 | 89 | ------------------------------ |
90 | 90 | ð |
91 | 91 | ------------------------------ |
92 | -2004/10/XX | |
92 | +2004/XX/XX | |
93 | 93 | Version ÊÞÀ49 |
94 | 94 | ¨CÉüèÌÇÝÝ̬»ÉæéN®ÔÌZk |
95 | + XêÌ\¦JiñjðÝèÅ«éæ¤ÉÈÁ½ | |
95 | 96 | StatusBarÉNG[ht@C̼OªoÈ¢sïÌC³ |
96 | 97 | uwèµ½ÔÌXÉòÔv@\ÇÁiL[ÝèÅAXbhJeSÌêÔÅãj |
98 | + XAJ[ÅX|bvAbv·é`®Ìgåi`bg¿áñËéj | |
97 | 99 | Oðíµ½ÛÉ¢ÇXbh (UnRead) Ì\¦ªXV³êÈ¢oOðC³ |
98 | 100 | ±±ÉX¾ÆAXGfB^[ÌV[gJbgL[ªÝè³êÈ¢sïÌC³ |
99 | 101 | Ú[ñÉRRÜÅÇñ¾ÆV Xð²®·éÌÉsïª Á½ÌÅC³ |
100 | - XbhêÌ\¦JÌÝèªÅ«éæ¤ÉÈÁ½BuIvVv->uÚ×Ýèv->uÚ×Ýè2v | |
101 | - ftHgÅÌXAJ[|bvAbvªííÌ`®ÉÎ | |
102 | - R¿áñËéi8¿áñËéjðo^·éÆQ¿áñËé̪\¦³êésïÌðÁ | |
103 | - ¨CÉüèÅÒWÉXy[XL[üÍÌsïÌC³ | |
104 | - µ½çÎJBBSÌßOÉÖ·ésïÌC³ | |
105 | - XbhÌNÅXÔª éàÌð¥ñ¾Æ«ÉA»ÌXÔÜÅXN[·éæ¤Éµ½B | |
106 | 102 | |
107 | 103 | 2004/09/05 |
108 | 104 | Version ÊÞÀ48 |
@@ -3,7 +3,7 @@ library ShitarabaJBBSPlugIn; | ||
3 | 3 | { |
4 | 4 | ShitarabaJBBSPlugIn |
5 | 5 | µ½çÎjbg |
6 | - $Id: ShitarabaJBBSPlugIn.dpr,v 1.36 2004/09/30 11:49:44 h677 Exp $ | |
6 | + $Id: ShitarabaJBBSPlugIn.dpr,v 1.33 2004/09/28 12:10:20 h677 Exp $ | |
7 | 7 | } |
8 | 8 | |
9 | 9 | uses |
@@ -33,7 +33,7 @@ type | ||
33 | 33 | |
34 | 34 | private |
35 | 35 | function Download : TDownloadState; |
36 | - function StorageDownload(AURL : string) : TDownloadState; | |
36 | + function StorageDownload(Path, Document : string) : TDownloadState; | |
37 | 37 | function Write( inName : string; inMail : string; inMessage : string ) : TDownloadState; |
38 | 38 | function GetRes( inNo : Integer ) : string; |
39 | 39 | function GetDat( inNo : Integer ) : string; |
@@ -505,14 +505,22 @@ begin | ||
505 | 505 | uriList := TStringList.Create; |
506 | 506 | try |
507 | 507 | ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); |
508 | - if uriList[ 5 ] = 'l100' then begin | |
509 | - FileName := uriList[ 4 ] + '.dat'; | |
510 | - FilePath := MyLogFolder + uriList[ 2 ] + '\' + uriList[ 3 ] + '\' + uriList[ 4 ] + '.dat'; | |
511 | - IsLogFile := FileExists( FilePath ); | |
512 | - end else begin | |
513 | - FileName := uriList[ 5 ] + '.dat'; | |
514 | - FilePath := MyLogFolder + uriList[ 3 ] + '\' + uriList[ 4 ] + '\' + uriList[ 5 ] + '.dat'; | |
508 | + if (AnsiPos('.html', uri.Document) = 0) then begin //Êí | |
509 | + if uriList[ 5 ] = 'l100' then begin | |
510 | + FileName := uriList[ 4 ] + '.dat'; | |
511 | + FilePath := MyLogFolder + uriList[ 2 ] + '\' + uriList[ 3 ] + '\' + uriList[ 4 ] + '.dat'; | |
512 | + IsLogFile := FileExists( FilePath ); | |
513 | + end else begin | |
514 | + FileName := uriList[ 5 ] + '.dat'; | |
515 | + FilePath := MyLogFolder + uriList[ 3 ] + '\' + uriList[ 4 ] + '\' + uriList[ 5 ] + '.dat'; | |
516 | + IsLogFile := FileExists( FilePath ); | |
517 | + end; | |
518 | + end else begin //ßO | |
519 | + //http://jbbs.livedoor.com/game/1578/storage/1086710948.html | |
520 | + FileName := Copy(uri.Document, 1, Length(uri.Document) - 5) + '.dat'; | |
521 | + FilePath := MyLogFolder + CustomStringReplace(CustomStringReplace(uri.Path, '/storage', ''), '/', '\') + FileName; | |
515 | 522 | IsLogFile := FileExists( FilePath ); |
523 | + | |
516 | 524 | end; |
517 | 525 | finally |
518 | 526 | uri.Free; |
@@ -549,109 +557,115 @@ var | ||
549 | 557 | logStream : TFileStream; |
550 | 558 | uri : TIdURI; |
551 | 559 | uriList : TStringList; |
552 | - datURL, tmpURL : string; | |
553 | - tmpText: string; | |
560 | + datURL : string; | |
561 | + tmpText: string; | |
554 | 562 | begin |
555 | 563 | |
556 | 564 | Result := dsError; |
557 | 565 | |
558 | 566 | uri := TIdURI.Create( ReadURL ); |
559 | - uriList := TStringList.Create; | |
560 | - try | |
561 | - ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); | |
562 | - FileName := uriList[ 5 ] + '.dat'; | |
563 | - // http://jbbs.livedoor.com/bbs/rawmode.cgi/game/1578/1067968274/l100 | |
564 | - // protocol://host/1/2/3/4/5/uriList.Count - 1 | |
565 | - if MyLogFolder = '' then begin | |
566 | - // DZÉÛ¶µÄ¢¢Ì©ª©çÈ¢ÌÅêt@CÉÛ¶ | |
567 | - FilePath := TemporaryFile; | |
568 | - FIsTemporary := True; | |
569 | - end else begin | |
570 | - FilePath := MyLogFolder + uriList[ 3 ] + '\' + uriList[ 4 ] + '\' + uriList[ 5 ] + '.dat'; | |
571 | - FIsTemporary := False; | |
572 | - end; | |
573 | - finally | |
567 | + if(( AnsiPos('.html', uri.Document) >0 ) and ( AnsiPos('/storage/', uri.Path) > 0 )) then begin | |
568 | + //ßO | |
569 | + Result := StorageDownload(uri.Path, uri.Document); | |
574 | 570 | uri.Free; |
575 | - uriList.Free; | |
576 | - end; | |
571 | + end else begin | |
572 | + //»Ý¶«ÄéXbh | |
573 | + uriList := TStringList.Create; | |
574 | + try | |
575 | + ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); | |
576 | + FileName := uriList[ 5 ] + '.dat'; | |
577 | + // http://jbbs.livedoor.com/bbs/rawmode.cgi/game/1578/1067968274/l100 | |
578 | + // protocol://host/1/2/3/4/5/uriList.Count - 1 | |
579 | + if MyLogFolder = '' then begin | |
580 | + // DZÉÛ¶µÄ¢¢Ì©ª©çÈ¢ÌÅêt@CÉÛ¶ | |
581 | + FilePath := TemporaryFile; | |
582 | + FIsTemporary := True; | |
583 | + end else begin | |
584 | + FilePath := MyLogFolder + uriList[ 3 ] + '\' + uriList[ 4 ] + '\' + uriList[ 5 ] + '.dat'; | |
585 | + FIsTemporary := False; | |
586 | + end; | |
587 | + finally | |
588 | + uri.Free; | |
589 | + uriList.Free; | |
590 | + end; | |
577 | 591 | |
578 | - // Û¶pÌfBNgð@é | |
579 | - ForceDirectoriesEx( Copy( FilePath, 1, LastDelimiter( '\', FilePath ) ) ); | |
592 | + // Û¶pÌfBNgð@é | |
593 | + ForceDirectoriesEx( Copy( FilePath, 1, LastDelimiter( '\', FilePath ) ) ); | |
580 | 594 | |
581 | - // Æ©É_E[hâtB^OðsíÈ¢êÍ | |
582 | - // InternalDownload ÉC¹é±Æªoé | |
583 | - modified := LastModified; | |
584 | - datURL := ReadURL + IntToStr( Count + 1 ) + '-'; // V ÌÝ | |
585 | - responseCode := InternalDownload( PChar( datURL ), modified, tmp, 0 ); | |
595 | + // Æ©É_E[hâtB^OðsíÈ¢êÍ | |
596 | + // InternalDownload ÉC¹é±Æªoé | |
597 | + modified := LastModified; | |
598 | + datURL := ReadURL + IntToStr( Count + 1 ) + '-'; // V ÌÝ | |
599 | + responseCode := InternalDownload( PChar( datURL ), modified, tmp, 0 ); | |
586 | 600 | |
587 | - try | |
588 | - if (responseCode = 200) or (responseCode = 206) then begin | |
589 | - downResult := TStringList.Create; | |
590 | - try | |
591 | - tmpText := CustomStringReplace( string( tmp ), '¡÷¡®', ',' ); | |
592 | - downResult.Text := EUCtoSJIS( tmpText ); | |
593 | - ArrangeDownloadData(Count, downResult); | |
594 | - if downResult.Count > 0 then begin | |
595 | - if FileExists( FilePath ) then | |
596 | - logStream := TFileStream.Create( FilePath, fmOpenReadWrite or fmShareDenyWrite ) | |
597 | - else | |
598 | - logStream := TFileStream.Create( FilePath, fmCreate or fmShareDenyWrite ); | |
599 | - try | |
600 | - logStream.Position := logStream.Size; | |
601 | - logStream.Write( PChar( downResult.Text )^, Length( downResult.Text ) ); | |
602 | - finally | |
603 | - logStream.Free; | |
604 | - end; | |
601 | + try | |
602 | + if (responseCode = 200) or (responseCode = 206) then begin | |
603 | + downResult := TStringList.Create; | |
604 | + try | |
605 | + tmpText := CustomStringReplace( string( tmp ), '¡÷¡®', ',' ); | |
606 | + downResult.Text := EUCtoSJIS( tmpText ); | |
607 | + ArrangeDownloadData(Count, downResult); | |
608 | + if downResult.Count > 0 then begin | |
609 | + if FileExists( FilePath ) then | |
610 | + logStream := TFileStream.Create( FilePath, fmOpenReadWrite or fmShareDenyWrite ) | |
611 | + else | |
612 | + logStream := TFileStream.Create( FilePath, fmCreate or fmShareDenyWrite ); | |
613 | + try | |
614 | + logStream.Position := logStream.Size; | |
615 | + logStream.Write( PChar( downResult.Text )^, Length( downResult.Text ) ); | |
616 | + finally | |
617 | + logStream.Free; | |
618 | + end; | |
605 | 619 | |
606 | - if Count = 0 then | |
607 | - // VK | |
608 | - Result := dsComplete | |
609 | - else | |
610 | - // ÇL | |
611 | - Result := dsDiffComplete; | |
620 | + if Count = 0 then | |
621 | + // VK | |
622 | + Result := dsComplete | |
623 | + else | |
624 | + // ÇL | |
625 | + Result := dsDiffComplete; | |
612 | 626 | |
613 | - Size := Size + Length( downResult.Text ); | |
614 | - // CGI ©çͳµ¢útª¾çêÈ¢ÌÅ»ÝÉÝè | |
615 | - LastModified := Now; | |
627 | + Size := Size + Length( downResult.Text ); | |
628 | + // CGI ©çͳµ¢útª¾çêÈ¢ÌÅ»ÝÉÝè | |
629 | + LastModified := Now; | |
616 | 630 | |
617 | 631 | |
618 | 632 | |
619 | - NewReceive := Count + 1; | |
620 | - Count := Count + downResult.Count; | |
621 | - NewResCount := downResult.Count; | |
633 | + NewReceive := Count + 1; | |
634 | + Count := Count + downResult.Count; | |
635 | + NewResCount := downResult.Count; | |
622 | 636 | |
623 | 637 | |
624 | 638 | |
625 | - end else begin | |
626 | - Result := dsNotModify; | |
639 | + end else begin | |
640 | + Result := dsNotModify; | |
641 | + end; | |
642 | + finally | |
643 | + downResult.Free; | |
627 | 644 | end; |
628 | - finally | |
629 | - downResult.Free; | |
630 | - end; | |
631 | - end else if responseCode = 302 then begin | |
632 | - //http://jbbs.shitaraba.com/bbs/read.cgi/game/3477/1077473358/ | |
633 | - //http://jbbs.shitaraba.com/game/bbs/read.cgi?BBS=3477&KEY=1077473358 | |
634 | - //http://jbbs.shitaraba.com/game/3477/storage/1077473358.html | |
635 | - //ßO | |
636 | - //tmpURL := URL; | |
637 | - if Assigned( InternalPrint ) then | |
638 | - InternalPrint( 'ßOqÉüè' ); | |
639 | - uri := TIdURI.Create( ReadURL ); | |
640 | - uriList := TStringList.Create; | |
641 | - try | |
642 | - ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); | |
643 | - tmpURL := uri.Protocol + '://' + uri.Host + | |
644 | - '/' + uriList[3] + '/' + uriList[4] + '/storage/' + uriList[ 5 ] + '.html'; | |
645 | - finally | |
646 | - uriList.Free; | |
645 | + end else if responseCode = 302 then begin | |
646 | + //http://jbbs.shitaraba.com/bbs/read.cgi/game/3477/1077473358/ | |
647 | + //http://jbbs.shitaraba.com/game/bbs/read.cgi?BBS=3477&KEY=1077473358 | |
648 | + //http://jbbs.shitaraba.com/game/3477/storage/1077473358.html | |
649 | + //ßO | |
650 | + uri := TIdURI.Create( ReadURL ); | |
651 | + uriList := TStringList.Create; | |
652 | + try | |
653 | + ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); | |
654 | + URL := uri.Protocol + '://' + uri.Host + | |
655 | + '/' + uriList[3] + '/' + uriList[4] + '/storage/' + uriList[ 5 ] + '.html'; | |
656 | + finally | |
657 | + uriList.Free; | |
658 | + uri.Free; | |
659 | + end; | |
660 | + uri := TIdURI.Create( ReadURL ); | |
661 | + Result := StorageDownload(uri.Path, uri.Document); | |
647 | 662 | uri.Free; |
663 | + end else if responseCode = 304 then begin | |
664 | + Result := dsNotModify; | |
648 | 665 | end; |
649 | - Result := StorageDownload(tmpURL); | |
650 | - end else if responseCode = 304 then begin | |
651 | - Result := dsNotModify; | |
666 | + finally | |
667 | + DisposeResultString( tmp ); | |
652 | 668 | end; |
653 | - finally | |
654 | - DisposeResultString( tmp ); | |
655 | 669 | end; |
656 | 670 | |
657 | 671 | end; |
@@ -691,16 +705,17 @@ end; | ||
691 | 705 | // ßOpDownloadÖ |
692 | 706 | // ************************************************************************* |
693 | 707 | function TShitarabaThreadItem.StorageDownload( |
694 | - AURL : string | |
708 | + Path, Document : string | |
695 | 709 | ) : TDownloadState; |
696 | 710 | var |
697 | 711 | modified : Double; |
698 | 712 | tmp : PChar; |
699 | - uri : TIdURI; | |
700 | - uriList : TStringList; | |
701 | 713 | downResult : TStringList; |
702 | 714 | responseCode : Longint; |
703 | 715 | logStream : TFileStream; |
716 | + //uri : TIdURI; | |
717 | + //uriList : TStringList; | |
718 | + datURL : string; | |
704 | 719 | tmpText, tmpLine, tmpTitle: string; |
705 | 720 | tmpHTML: TStringList; |
706 | 721 |
@@ -709,24 +724,23 @@ var | ||
709 | 724 | begin |
710 | 725 | |
711 | 726 | Result := dsError; |
712 | - uri := TIdURI.Create( ReadURL ); | |
713 | - uriList := TStringList.Create; | |
727 | + | |
728 | + //uri := TIdURI.Create( ReadURL ); | |
714 | 729 | try |
715 | - ExtractHttpFields( ['/', '?'], [], uri.Path, uriList ); | |
716 | - FileName := uriList[ 5 ] + '.dat'; | |
717 | - // http://jbbs.livedoor.com/bbs/rawmode.cgi/game/1578/1067968274/l100 | |
718 | - // protocol://host/1/2/3/4/5/uriList.Count - 1 | |
730 | + FileName := Copy(Document, 1, Length(Document) - 5) + '.dat'; | |
719 | 731 | if MyLogFolder = '' then begin |
720 | 732 | // DZÉÛ¶µÄ¢¢Ì©ª©çÈ¢ÌÅêt@CÉÛ¶ |
721 | 733 | FilePath := TemporaryFile; |
722 | 734 | FIsTemporary := True; |
723 | 735 | end else begin |
724 | - FilePath := MyLogFolder + uriList[ 3 ] + '\' + uriList[ 4 ] + '\' + uriList[ 5 ] + '.dat'; | |
736 | + FilePath := MyLogFolder | |
737 | + + CustomStringReplace(CustomStringReplace(Path, '/storage', ''), '/', '\') | |
738 | + + FileName; | |
739 | + | |
725 | 740 | FIsTemporary := False; |
726 | 741 | end; |
727 | 742 | finally |
728 | - uri.Free; | |
729 | - uriList.Free; | |
743 | + //uri.Free; | |
730 | 744 | end; |
731 | 745 | |
732 | 746 | // Û¶pÌfBNgð@é |
@@ -738,7 +752,8 @@ begin | ||
738 | 752 | // InternalDownload ÉC¹é±Æªoé |
739 | 753 | modified := LastModified; |
740 | 754 | |
741 | - responseCode := InternalDownload( PChar( AURL ), modified, tmp, 0 ); | |
755 | + datURL := ReadURL; | |
756 | + responseCode := InternalDownload( PChar( datURL ), modified, tmp, 0 ); | |
742 | 757 | |
743 | 758 | try |
744 | 759 | if (responseCode = 200) or (responseCode = 206) then begin |
@@ -1163,12 +1178,19 @@ begin | ||
1163 | 1178 | if (tmphost = BBS_HOST_OLD) or (tmphost = BBS_HOST_OLD2) then |
1164 | 1179 | tmphost := BBS_HOST; |
1165 | 1180 | |
1166 | - FileName := uriList[ 5 ] + '.dat'; | |
1167 | - // http://jbbs.livedoor.com/bbs/read.cgi/computer/351/1090404452/l100 | |
1168 | - // http://jbbs.livedoor.com/bbs/read.cgi/game/1578/1067968274/l100 | |
1169 | - // http://jbbs.livedoor.com/game/1000/subject.txt | |
1170 | - Result := CreateResultString( | |
1171 | - uri.Protocol + '://' + tmphost + '/' + uriList[ 3 ] + '/' + uriList[ 4 ] + '/' ); | |
1181 | + if( AnsiPos('.html', uri.Document) = 0 ) then begin //Êí | |
1182 | + FileName := uriList[ 5 ] + '.dat'; | |
1183 | + // http://jbbs.livedoor.com/bbs/read.cgi/computer/351/1090404452/l100 | |
1184 | + // http://jbbs.livedoor.com/bbs/read.cgi/game/1578/1067968274/l100 | |
1185 | + // http://jbbs.livedoor.com/game/1000/subject.txt | |
1186 | + Result := CreateResultString( | |
1187 | + uri.Protocol + '://' + tmphost + '/' + uriList[ 3 ] + '/' + uriList[ 4 ] + '/' ); | |
1188 | + end else begin | |
1189 | + //http://jbbs.livedoor.com/game/1578/storage/1086710948.html | |
1190 | + Result := CreateResultString( | |
1191 | + uri.Protocol + '://' + tmphost + CustomStringReplace(uri.Path, '/storage', '')); | |
1192 | + end; | |
1193 | + | |
1172 | 1194 | finally |
1173 | 1195 | uri.Free; |
1174 | 1196 | uriList.Free; |
@@ -1265,8 +1287,7 @@ begin | ||
1265 | 1287 | end else if AnsiPos(THREAD_MARK, URL) = 0 then begin |
1266 | 1288 | //RRÅßO©Ç¤©`FbNH |
1267 | 1289 | if(AnsiPos('.html/', uri.Path) > 0) then begin |
1268 | - Result := uri.Protocol + '://' + tmphost + THREAD_MARK + | |
1269 | - CustomStringReplace(CustomStringReplace(uri.Path, '/storage', ''), '.html/', '/') + 'l100'; | |
1290 | + Result := uri.Protocol + '://' + tmphost + Copy(uri.Path, 1, Length(uri.Path) - 1); | |
1270 | 1291 | end else |
1271 | 1292 | Result := URL; |
1272 | 1293 | end; |
@@ -1334,6 +1355,12 @@ begin | ||
1334 | 1355 | Result := |
1335 | 1356 | uri.Protocol + '://' + tmphost + '/bbs/rawmode.cgi/' + |
1336 | 1357 | uriList[ 3 ] + '/' + uriList[ 4 ] + '/' + uriList[ 5 ] + '/'; |
1358 | + end else if AnsiPos(THREAD_MARK, URL) = 0 then begin | |
1359 | + //RRÅßO©Ç¤©`FbNH | |
1360 | + if(AnsiPos('.html/', uri.Path) > 0) then begin | |
1361 | + Result := uri.Protocol + '://' + tmphost + Copy(uri.Path, 1, Length(uri.Path) - 1); | |
1362 | + end else | |
1363 | + Result := URL; | |
1337 | 1364 | end; |
1338 | 1365 | finally |
1339 | 1366 | uri.Free; |