From 3cf92c691a657bb0fd8b45d4e236ce0893ae65ae Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Sun, 12 Aug 2012 05:26:29 -0400 Subject: [PATCH] Blah --- mystic/HISTORY.txt | 13 +++ mystic/bbs_cfg_useredit.pas | 4 +- mystic/bbs_filebase.pas | 174 +++++++++++++++++++++--------------- mystic/bbs_io.pas | 2 +- mystic/install.pas | 1 - mystic/mide.pas | 1 - mystic/mpl_compile.pas | 2 - mystic/mplc.pas | 1 - mystic/records.pas | 6 +- 9 files changed, 119 insertions(+), 85 deletions(-) diff --git a/mystic/HISTORY.txt b/mystic/HISTORY.txt index b0fb13c..43430cf 100644 --- a/mystic/HISTORY.txt +++ b/mystic/HISTORY.txt @@ -4551,3 +4551,16 @@ SyncTerm SEXYZ NetRunner + + + The file directory editor is now available in the standard file listing. + In the past it only worked in the lightbar file listing. Whoops. The + hotkey is E if you have SysOp access. + + ! File list downloader was not properly allowing a download after the list + was created. + + + File list compiler now only adds the filebase header/footer to the list + if the filebase has files listed. + + + File list compiler now uses megabytes instead of kilobytes in the file + base summary footer. diff --git a/mystic/bbs_cfg_useredit.pas b/mystic/bbs_cfg_useredit.pas index fca5c28..1a34a81 100644 --- a/mystic/bbs_cfg_useredit.pas +++ b/mystic/bbs_cfg_useredit.pas @@ -158,14 +158,14 @@ Begin Form.AddDate ('A', ' Last Call' , 7, 7, 23, 7, 14, @LastCall, Topic + 'Date of last call (MM/DD/YY)'); Form.AddLong ('C', ' Calls' , 7, 8, 23, 8, 14, 7, 0, 9999999, @U.Calls, Topic + 'Total number of calls to the BBS'); Form.AddWord ('L', ' Calls Today' , 7, 9, 23, 9, 14, 5, 0, 65000, @U.CallsToday, Topic + 'Total number of calls today'); - Form.AddLong ('D', ' Downloads' , 7, 10, 23, 10, 14, 7, 0, 9999999, @U.DLs, Topic + 'Total number of downloads'); + Form.AddWord ('D', ' Downloads' , 7, 10, 23, 10, 14, 7, 0, 65000, @U.DLs, Topic + 'Total number of downloads'); Form.AddWord ('T', ' DLs Today' , 7, 11, 23, 11, 14, 5, 0, 65000, @U.DLsToday, Topic + 'Total downloads today'); Form.AddLong ('W', ' DL KB' , 7, 12, 23, 12, 14, 10, 0, 2000000000, @U.DLk, Topic + 'Total downloads in kilobytes'); Form.AddLong ('K', ' DL KB Today' , 7, 13, 23, 13, 14, 10, 0, 2000000000, @U.DLkToday, Topic + 'Downloads in kilobytes today'); Form.AddLong ('U', ' Uploads' , 7, 14, 23, 14, 14, 10, 0, 2000000000, @U.ULs, Topic + 'Total number of uploads'); Form.AddLong ('B', ' Upload KB' , 7, 15, 23, 15, 14, 10, 0, 2000000000, @U.ULk, Topic + 'Total uploads in kilobytes'); Form.AddLong ('M', ' Msg Posts' , 7, 16, 23, 16, 14, 10, 0, 2000000000, @U.Posts, Topic + 'Total number of message posts'); - Form.AddWord ('E', ' E-Mails' , 7, 17, 23, 17, 14, 5, 0, 65000, @U.Emails, Topic + 'Number of e-mails sent'); + Form.AddLong ('E', ' E-Mails' , 7, 17, 23, 17, 14, 5, 0, 65000, @U.Emails, Topic + 'Number of e-mails sent'); Form.AddLong ('I', ' File Ratings' , 7, 18, 23, 18, 14, 10, 0, 2000000000, @U.FileRatings, Topic + 'Total file ratings'); Form.AddLong ('N', ' File Comments' , 7, 19, 23, 19, 14, 10, 0, 2000000000, @U.FileComment, Topic + 'Total file comments'); Form.AddDate ('P', ' Last PW Date' , 7, 20, 23, 20, 14, @U.LastPWChange, Topic + 'Date of last password change'); diff --git a/mystic/bbs_filebase.pas b/mystic/bbs_filebase.pas index d204db3..eb013c5 100644 --- a/mystic/bbs_filebase.pas +++ b/mystic/bbs_filebase.pas @@ -2,8 +2,6 @@ Unit bbs_FileBase; {$I M_OPS.PAS} -{$MODESWITCH NESTEDPROCVARS-} - Interface Uses @@ -619,18 +617,20 @@ Function TFileBase.ExportFileList (NewFiles : Boolean; Qwk: Boolean) : Boolean; Var TF : Text; DF : File; - A : Byte; + Count : Byte; Temp : String[mysMaxFileDescLen]; Str : String; - AreaFiles : Integer; - AreaSize : LongInt; + AreaFiles : LongInt; + AreaSize : Cardinal; TotalFiles : LongInt; Begin If NewFiles Then Begin If Qwk Then Temp := 'newfiles.dat' Else Temp := 'newfiles.txt'; + Session.io.OutFullLn (Session.GetPrompt(219)); End Else Begin Temp := 'allfiles.txt'; + Session.io.OutFullLn (Session.GetPrompt(220)); End; @@ -645,72 +645,79 @@ Begin While Not Eof(FBaseFile) Do Begin Read (FBaseFile, FBase); - If Session.User.Access(FBase.ListACS) Then Begin - Session.io.OutFull (Session.GetPrompt(222)); - GetFileScan; + If Not Session.User.Access(FBase.ListACS) Then Continue; - AreaFiles := 0; - AreaSize := 0; + Session.io.OutFull (Session.GetPrompt(222)); - WriteLn (TF, ''); - WriteLn (TF, '.-' + strRep('-', Length(strStripPipe(FBase.Name))) + '-.'); - WriteLn (TF, '| ' + strStripPipe(FBase.Name) + ' |'); - WriteLn (TF, '`-' + strRep('-', Length(strStripPipe(FBase.Name))) + '-'''); - WriteLn (TF, '.' + strRep('-', 77) + '.'); - WriteLn (TF, '| File Size Date Description |'); - WriteLn (TF, '`' + strRep('-', 77) + ''''); + GetFileScan; - Assign (FDirFile, Config.DataPath + FBase.FileName + '.dir'); - {$I-} Reset (FDirFile); {$I+} - If IoResult = 0 Then Begin - Assign (DF, Config.DataPath + FBase.FileName + '.des'); - {$I-} Reset (DF, 1); {$I+} + AreaFiles := 0; + AreaSize := 0; - If IoResult <> 0 Then ReWrite (DF, 1); + Assign (FDirFile, Config.DataPath + FBase.FileName + '.dir'); + {$I-} Reset (FDirFile); {$I+} + If IoResult = 0 Then Begin + Assign (DF, Config.DataPath + FBase.FileName + '.des'); + {$I-} Reset (DF, 1); {$I+} - While Not Eof(FDirFile) Do Begin - Read (FDirFile, FDir); + If IoResult <> 0 Then ReWrite (DF, 1); - If (NewFiles and (FDir.DateTime > FScan.LastNew)) or Not NewFiles Then - If FDir.Flags And FDirDeleted = 0 Then Begin - Inc (TotalFiles); - Inc (AreaFiles); - Inc (AreaSize, FDir.Size DIV 1024); + While Not Eof(FDirFile) Do Begin + Read (FDirFile, FDir); - WriteLn (TF, FDir.FileName); - Write (TF, ' `- ' + strPadL(strComma(FDir.Size), 11, ' ') + ' ' + DateDos2Str(FDir.DateTime, Session.User.ThisUser.DateType) + ' '); + If (NewFiles and (FDir.DateTime > FScan.LastNew)) or Not NewFiles Then + If FDir.Flags And FDirDeleted = 0 Then Begin + Inc (TotalFiles); + Inc (AreaFiles); + Inc (AreaSize, (FDir.Size DIV 1024) DIV 1024); - Seek (DF, FDir.DescPtr); - For A := 1 to FDir.DescLines Do Begin - BlockRead (DF, Temp[0], 1); - BlockRead (DF, Temp[1], Ord(Temp[0])); - If A = 1 Then WriteLn (TF, Temp) Else WriteLn (TF, strRep(' ', 27) + Temp); - End; + If AreaFiles = 1 Then Begin + WriteLn (TF, ''); + WriteLn (TF, '.-' + strRep('-', Length(strStripPipe(FBase.Name))) + '-.'); + WriteLn (TF, '| ' + strStripPipe(FBase.Name) + ' |'); + WriteLn (TF, '`-' + strRep('-', Length(strStripPipe(FBase.Name))) + '-'''); + WriteLn (TF, '.' + strRep('-', 77) + '.'); + WriteLn (TF, '| File Size Date Description |'); + WriteLn (TF, '`' + strRep('-', 77) + ''''); End; - End; - Session.io.PromptInfo[2] := strI2S(FileSize(FDirFile)); + WriteLn (TF, FDir.FileName); + Write (TF, ' `- ' + strPadL(strComma(FDir.Size), 11, ' ') + ' ' + DateDos2Str(FDir.DateTime, Session.User.ThisUser.DateType) + ' '); - Close (FDirFile); - Close (DF); + Seek (DF, FDir.DescPtr); - SetFileScan; + For Count := 1 to FDir.DescLines Do Begin + BlockRead (DF, Temp[0], 1); + BlockRead (DF, Temp[1], Ord(Temp[0])); - Str := 'Total files: ' + strI2S(AreaFiles) + ' (' + strI2S(AreaSize) + 'k)'; + If Count = 1 Then WriteLn (TF, Temp) Else WriteLn (TF, strRep(' ', 27) + Temp); + End; + End; + End; + + Session.io.PromptInfo[2] := strI2S(FileSize(FDirFile)); + + Close (FDirFile); + Close (DF); + + SetFileScan; + + If AreaFiles > 0 Then Begin + Str := 'Total files: ' + strI2S(AreaFiles) + ' (' + strI2S(AreaSize) + 'mb)'; WriteLn (TF, '.' + strRep('-', 77) + '.'); WriteLn (TF, '| ' + strPadR(Str, 76, ' ') + '|'); WriteLn (TF, '`' + strRep('-', 77) + ''''); - End Else - Session.io.PromptInfo[2] := '0'; + End; + End Else + Session.io.PromptInfo[2] := '0'; - Session.io.PromptInfo[1] := FBase.Name; - Session.io.PromptInfo[3] := strI2S(AreaFiles); + Session.io.PromptInfo[1] := FBase.Name; + Session.io.PromptInfo[3] := strI2S(AreaFiles); - Session.io.OutBS (Screen.CursorX, False); - Session.io.OutFullLn (Session.GetPrompt(223)); - End; + Session.io.OutBS (Screen.CursorX, False); + Session.io.OutFullLn (Session.GetPrompt(223)); End; Close (FBaseFile); @@ -1136,7 +1143,7 @@ Begin While Not Eof(ProtocolFile) Do Begin Read (ProtocolFile, Protocol); - If Protocol.Active And (Protocol.Batch = Batch) And (Protocol.OSType = OSTYpe) Then Begin + If Protocol.Active And (Protocol.Batch = Batch) And ((Protocol.OSType = OSTYpe) or (Protocol.OSType = 3)) Then Begin Keys := Keys + Protocol.Key; Session.io.PromptInfo[1] := Protocol.Key; @@ -2015,6 +2022,31 @@ Var End; End; + Procedure DoEditor; + Var + SavedPos : LongInt; + Begin + {$I-} SavedPos := FilePos(FBaseFile); {$I+} + + If IoResult = 0 Then + Close (FBaseFile) + Else + SavedPos := -1; + + Close (FDirFile); + Close (DataFile); + + DirectoryEditor(True, List[CurPos].FileName); + + If SavedPos <> -1 Then Begin + Reset (FBaseFile); + Seek (FBaseFile, SavedPos); + End; + + Reset (FDirFile); + Reset (DataFile, 1); + End; + Procedure DrawPage; Var OK : Boolean; @@ -2313,25 +2345,7 @@ Var End; End; 'E' : If Session.User.Access(FBase.SysopACS) Then Begin - { Save file POS if FBaseFile is open } - {$I-} B := FilePos(FBaseFile); {$I+} - If IoResult = 0 Then - Close (FBaseFile) - Else - B := -1; - - Close (FDirFile); - Close (DataFile); - - DirectoryEditor(True, List[CurPos].FileName); - - If B <> -1 Then Begin - Reset (FBaseFile); - Seek (FBaseFile, B); - End; - - Reset (FDirFile); - Reset (DataFile, 1); + DoEditor; FullReDraw; DrawPage; @@ -2366,9 +2380,10 @@ Var Procedure Ascii_List; Var - A : LongInt; - B : LongInt; + A : LongInt; + B : LongInt; okSave : Byte; + Keys : String[20]; Begin ListType := 0; @@ -2384,10 +2399,21 @@ Var Result := 2; + Keys := #13 + 'FNPQV'; + + If Session.User.Access(FBase.SysopACS) Then Keys := Keys + 'E'; + Repeat Session.io.OutFull (Session.GetPrompt(44)); - Case Session.io.OneKey(#13'FNPQV', True) of + Case Session.io.OneKey(Keys, True) of + 'E' : Begin + DoEditor; + + DrawPage; + + If CurPos > ListSize Then CurPos := ListSize; + End; #13, 'N' : If LastPage Then Break diff --git a/mystic/bbs_io.pas b/mystic/bbs_io.pas index 575fb40..29aa8ad 100644 --- a/mystic/bbs_io.pas +++ b/mystic/bbs_io.pas @@ -23,7 +23,7 @@ Const MaxPromptInfo = 15; Type - TGetKeyCallBack = Function (Forced: Boolean) : Boolean Is Nested; + TGetKeyCallBack = Function (Forced: Boolean) : Boolean;// Is Nested; TBBSIO = Class Core : Pointer; diff --git a/mystic/install.pas b/mystic/install.pas index eb98ce4..55b35e6 100644 --- a/mystic/install.pas +++ b/mystic/install.pas @@ -22,7 +22,6 @@ Program Install; {$I M_OPS.PAS} -{$MODESWITCH NESTEDPROCVARS-} Uses m_FileIO, diff --git a/mystic/mide.pas b/mystic/mide.pas index 29ee416..ec0a582 100644 --- a/mystic/mide.pas +++ b/mystic/mide.pas @@ -20,7 +20,6 @@ // ==================================================================== {$I M_OPS.PAS} -{$MODESWITCH NESTEDPROCVARS-} Program MIDE; diff --git a/mystic/mpl_compile.pas b/mystic/mpl_compile.pas index 533a52c..e2cc97b 100644 --- a/mystic/mpl_compile.pas +++ b/mystic/mpl_compile.pas @@ -2,8 +2,6 @@ Unit MPL_Compile; {$I M_OPS.PAS} -{$MODESWITCH NESTEDPROCVARS-} - Interface Uses diff --git a/mystic/mplc.pas b/mystic/mplc.pas index 497e858..9867748 100644 --- a/mystic/mplc.pas +++ b/mystic/mplc.pas @@ -22,7 +22,6 @@ Program MPLC; {$I M_OPS.PAS} -{$MODESWITCH NESTEDPROCVARS-} Uses DOS, diff --git a/mystic/records.pas b/mystic/records.pas index 22d5f68..ad8a539 100644 --- a/mystic/records.pas +++ b/mystic/records.pas @@ -307,9 +307,9 @@ Type FirstOn : LongInt; { Date/Time of First Call } LastOn : LongInt; { Date/Time of Last Call } Calls : LongInt; { Number of calls to BBS } - CallsToday : SmallInt; { Number of calls today } - DLs : SmallInt; { # of downloads } - DLsToday : SmallInt; { # of downloads today } + CallsToday : SmallWord; { Number of calls today } + DLs : SmallWord; { # of downloads } + DLsToday : SmallWord; { # of downloads today } DLk : LongInt; { # of downloads in K } DLkToday : LongInt; { # of downloaded K today } ULs : LongInt; { total number of uploads }