lots of changes and too lazy to comment on each one lol
This commit is contained in:
parent
bd48629e61
commit
c9f41a3fc5
|
@ -12,11 +12,72 @@ Uses
|
|||
m_DateTime,
|
||||
m_Strings,
|
||||
m_FileIO,
|
||||
m_QuickSort,
|
||||
bbs_Ansi_MenuBox,
|
||||
bbs_Ansi_MenuForm,
|
||||
bbs_Common,
|
||||
bbs_cfg_Common;
|
||||
|
||||
Type
|
||||
RecFileBaseFile = File of RecFileBase;
|
||||
|
||||
Procedure SortFileBases (Var List: TAnsiMenuList; Var FBaseFile: RecFileBaseFile);
|
||||
Var
|
||||
TempBase : RecFileBase;
|
||||
TempFile : File of RecFileBase;
|
||||
Sort : TQuickSort;
|
||||
SortFirst : Word;
|
||||
SortLast : Word;
|
||||
Count : Word;
|
||||
Begin
|
||||
If Not GetSortRange(List, SortFirst, SortLast) Then Exit;
|
||||
|
||||
ShowMsgBox (3, ' Sorting... ');
|
||||
|
||||
Sort := TQuickSort.Create;
|
||||
|
||||
For Count := SortFirst to SortLast Do Begin
|
||||
Seek (FBaseFile, Count - 1);
|
||||
Read (FBaseFile, TempBase);
|
||||
|
||||
Sort.Add (strUpper(strStripPipe(TempBase.Name)), Count - 1);
|
||||
End;
|
||||
|
||||
Sort.Sort (1, Sort.Total, qAscending);
|
||||
|
||||
Close (FBaseFile);
|
||||
ReName (FBaseFile, Config.DataPath + 'fbases.sortbak');
|
||||
|
||||
Assign (TempFile, Config.DataPath + 'fbases.sortbak');
|
||||
Reset (TempFile);
|
||||
|
||||
Assign (FBaseFile, Config.DataPath + 'fbases.dat');
|
||||
ReWrite (FBaseFile);
|
||||
|
||||
While FilePos(TempFile) < SortFirst - 1 Do Begin
|
||||
Read (TempFile, TempBase);
|
||||
Write (FBaseFile, TempBase);
|
||||
End;
|
||||
|
||||
For Count := 1 to Sort.Total Do Begin
|
||||
Seek (TempFile, Sort.Data[Count]^.Ptr);
|
||||
Read (TempFile, TempBase);
|
||||
Write (FBaseFile, TempBase);
|
||||
End;
|
||||
|
||||
Seek (TempFile, SortLast);
|
||||
|
||||
While Not Eof(TempFile) Do Begin
|
||||
Read (TempFile, TempBase);
|
||||
Write (FBaseFile, TempBase);
|
||||
End;
|
||||
|
||||
Close (TempFile);
|
||||
Erase (TempFile);
|
||||
|
||||
Sort.Free;
|
||||
End;
|
||||
|
||||
Procedure EditFileBase (Var FBase: RecFileBase);
|
||||
Var
|
||||
Box : TAnsiMenuBox;
|
||||
|
@ -164,7 +225,7 @@ Begin
|
|||
List.Close;
|
||||
|
||||
Case List.ExitCode of
|
||||
'/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of
|
||||
'/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|S-Sort|') of
|
||||
'I' : Begin
|
||||
InsertRecord;
|
||||
MakeList;
|
||||
|
@ -200,6 +261,7 @@ Begin
|
|||
|
||||
MakeList;
|
||||
End;
|
||||
'S' : SortFileBases (List, FBaseFile);
|
||||
End;
|
||||
#13 : If List.Picked < List.ListMax Then Begin
|
||||
Seek (FBaseFile, List.Picked - 1);
|
||||
|
|
|
@ -255,7 +255,7 @@ Begin
|
|||
End;
|
||||
End;
|
||||
3 : Begin
|
||||
BoxOpen (38, 4, 64, 18);
|
||||
BoxOpen (38, 4, 64, 17);
|
||||
CoolBoxOpen (39, 'Editors');
|
||||
|
||||
Form.AddNone ('U', ' U User Editor', 39, 5, 39, 5, 25, '');
|
||||
|
@ -270,7 +270,7 @@ Begin
|
|||
Form.AddNone ('P', ' P Protocol Editor', 39, 14, 39, 14, 25, '');
|
||||
Form.AddNone ('E', ' E Event Editor', 39, 15, 39, 15, 25, '');
|
||||
Form.AddNone ('V', ' V Voting Editor', 39, 16, 39, 16, 25, '');
|
||||
Form.AddNone ('L', ' L BBS List Editor', 39, 17, 39, 17, 25, '');
|
||||
// Form.AddNone ('L', ' L BBS List Editor', 39, 17, 39, 17, 25, '');
|
||||
|
||||
Res := Form.Execute;
|
||||
MenuPos[3] := Form.ItemPos;
|
||||
|
|
|
@ -496,7 +496,7 @@ Begin
|
|||
Form.Free;
|
||||
End;
|
||||
|
||||
Procedure EditMenu;
|
||||
Procedure EditMenu (Var Theme: RecTheme);
|
||||
Var
|
||||
Box : TAnsiMenuBox;
|
||||
List : TAnsiMenuList;
|
||||
|
@ -506,7 +506,7 @@ Var
|
|||
Begin
|
||||
Menu := TMenuData.Create;
|
||||
|
||||
Menu.Load (False, Session.Theme.MenuPath + MenuName + '.mnu');
|
||||
Menu.Load (False, Theme.MenuPath + MenuName + '.mnu');
|
||||
|
||||
Box := TAnsiMenuBox.Create;
|
||||
List := TAnsiMenuList.Create;
|
||||
|
@ -576,13 +576,13 @@ Begin
|
|||
|
||||
If Changed Then
|
||||
If ShowMsgBox(1, 'Save changes to ' + MenuName + '?') Then
|
||||
If Not Menu.Save(Session.Theme.MenuPath + MenuName + '.mnu') Then
|
||||
If Not Menu.Save(Theme.MenuPath + MenuName + '.mnu') Then
|
||||
ShowMsgBox(0, 'Unable to save menu');
|
||||
|
||||
Menu.Free;
|
||||
End;
|
||||
|
||||
Function GetMenuName (OldName: String) : String;
|
||||
Function GetMenuName (Var Theme: RecTheme; OldName: String) : String;
|
||||
Var
|
||||
Box : TAnsiMenuBox;
|
||||
List : TAnsiMenuList;
|
||||
|
@ -597,7 +597,7 @@ Var
|
|||
Begin
|
||||
Sort := TQuickSort.Create;
|
||||
|
||||
FindFirst (Session.Theme.MenuPath + '*.mnu', Archive, Dir);
|
||||
FindFirst (Theme.MenuPath + '*.mnu', Archive, Dir);
|
||||
|
||||
While DosError = 0 Do Begin
|
||||
Sort.Add(JustFileName(Dir.Name), 0);
|
||||
|
@ -611,7 +611,7 @@ Var
|
|||
List.Clear;
|
||||
|
||||
For Count := 1 to Sort.Total Do Begin
|
||||
Assign (MF, Session.Theme.MenuPath + Sort.Data[Count]^.Name + '.mnu');
|
||||
Assign (MF, Theme.MenuPath + Sort.Data[Count]^.Name + '.mnu');
|
||||
|
||||
{$I-} Reset (MF); {$I+}
|
||||
|
||||
|
@ -638,13 +638,13 @@ Var
|
|||
|
||||
If Str = '' Then Exit;
|
||||
|
||||
Str := Session.Theme.MenuPath + Str + '.mnu';
|
||||
Str := Theme.MenuPath + Str + '.mnu';
|
||||
|
||||
If FileExist(Str) Then
|
||||
If ShowMsgBox(1, JustFile(Str) + ' already exists. Overwrite?') Then
|
||||
FileErase(Str);
|
||||
|
||||
FileCopy(Session.Theme.MenuPath + Orig + '.mnu', Str);
|
||||
FileCopy(Theme.MenuPath + Orig + '.mnu', Str);
|
||||
End;
|
||||
|
||||
Procedure InsertMenu;
|
||||
|
@ -656,7 +656,7 @@ Var
|
|||
|
||||
If Str = '' Then Exit;
|
||||
|
||||
OK := Not FileExist(Session.Theme.MenuPath + Str + '.mnu');
|
||||
OK := Not FileExist(Theme.MenuPath + Str + '.mnu');
|
||||
|
||||
If Not OK Then
|
||||
OK := ShowMsgBox(1, Str + ' already exists. Overwrite?');
|
||||
|
@ -664,7 +664,7 @@ Var
|
|||
If OK Then Begin
|
||||
Menu := TMenuData.Create;
|
||||
|
||||
Menu.CreateNewMenu(Session.Theme.MenuPath + Str + '.mnu');
|
||||
Menu.CreateNewMenu(Theme.MenuPath + Str + '.mnu');
|
||||
|
||||
Menu.Free;
|
||||
End;
|
||||
|
@ -679,7 +679,7 @@ Begin
|
|||
List.NoWindow := True;
|
||||
List.LoChars := #13#27#47;
|
||||
List.SearchY := 21;
|
||||
Box.Header := ' Menu Editor (' + Session.Theme.Desc + ') ';
|
||||
Box.Header := ' Menu Editor (' + Theme.Desc + ') ';
|
||||
|
||||
Box.Open (12, 5, 68, 21);
|
||||
|
||||
|
@ -702,7 +702,7 @@ Begin
|
|||
'I' : InsertMenu;
|
||||
'D' : If List.ListMax > 0 Then
|
||||
If ShowMsgBox(1, 'Delete menu: ' + strWordGet(1, List.List[List.Picked]^.Name, ' ')) Then
|
||||
FileErase (Session.Theme.MenuPath + strWordGet(1, List.List[List.Picked]^.Name, ' ') + '.mnu');
|
||||
FileErase (Theme.MenuPath + strWordGet(1, List.List[List.Picked]^.Name, ' ') + '.mnu');
|
||||
End;
|
||||
#13 : Begin
|
||||
If List.ListMax <> 0 Then
|
||||
|
@ -722,19 +722,36 @@ End;
|
|||
Procedure Configuration_MenuEditor;
|
||||
Var
|
||||
Saved : String;
|
||||
Theme : RecTheme;
|
||||
Found : Boolean;
|
||||
Begin
|
||||
Saved := '';
|
||||
MenuName := Configuration_ThemeEditor(True);
|
||||
|
||||
If MenuName = '' Then Exit;
|
||||
|
||||
Reset (Session.ThemeFile);
|
||||
|
||||
While Not Eof(Session.ThemeFile) Do Begin
|
||||
Read (Session.ThemeFile, Theme);
|
||||
|
||||
If strUpper(Theme.FileName) = strUpper(MenuName) Then Begin
|
||||
Found := True;
|
||||
Break;
|
||||
End;
|
||||
End;
|
||||
|
||||
Close (Session.ThemeFile);
|
||||
|
||||
If Not Found Then Exit;
|
||||
|
||||
Repeat
|
||||
MenuName := GetMenuName(Saved);
|
||||
MenuName := GetMenuName(Theme, Saved);
|
||||
Saved := MenuName;
|
||||
|
||||
If MenuName = '' Then Exit;
|
||||
|
||||
EditMenu;
|
||||
EditMenu(Theme);
|
||||
Until False;
|
||||
End;
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ Var
|
|||
CurLine : Byte = 1;
|
||||
CurPageLines : Byte;
|
||||
TotalPrompt : Integer;
|
||||
SearchMask : String;
|
||||
SearchMask : String = '';
|
||||
CopyStr : String = '';
|
||||
|
||||
Procedure DisposeStringData;
|
||||
|
|
|
@ -928,6 +928,47 @@ Begin
|
|||
BufAddStr (#27 + '[K');
|
||||
End;
|
||||
|
||||
Function TBBSIO.Pipe2Ansi (Color: Byte) : String;
|
||||
Begin
|
||||
Result := '';
|
||||
|
||||
If Graphics = 0 Then Exit;
|
||||
|
||||
Case Color of
|
||||
00: Result := #27 + '[0;30m';
|
||||
01: Result := #27 + '[0;34m';
|
||||
02: Result := #27 + '[0;32m';
|
||||
03: Result := #27 + '[0;36m';
|
||||
04: Result := #27 + '[0;31m';
|
||||
05: Result := #27 + '[0;35m';
|
||||
06: Result := #27 + '[0;33m';
|
||||
07: Result := #27 + '[0;37m';
|
||||
08: Result := #27 + '[1;30m';
|
||||
09: Result := #27 + '[1;34m';
|
||||
10: Result := #27 + '[1;32m';
|
||||
11: Result := #27 + '[1;36m';
|
||||
12: Result := #27 + '[1;31m';
|
||||
13: Result := #27 + '[1;35m';
|
||||
14: Result := #27 + '[1;33m';
|
||||
15: Result := #27 + '[1;37m';
|
||||
End;
|
||||
|
||||
If Color in [00..07] Then
|
||||
Color := (Screen.TextAttr SHR 4) and 7 + 16;
|
||||
|
||||
Case Color of
|
||||
16: Result := Result + #27 + '[40m';
|
||||
17: Result := Result + #27 + '[44m';
|
||||
18: Result := Result + #27 + '[42m';
|
||||
19: Result := Result + #27 + '[46m';
|
||||
20: Result := Result + #27 + '[41m';
|
||||
21: Result := Result + #27 + '[45m';
|
||||
22: Result := Result + #27 + '[43m';
|
||||
23: Result := Result + #27 + '[47m';
|
||||
End;
|
||||
End;
|
||||
|
||||
(*
|
||||
Function TBBSIO.Pipe2Ansi (Color: Byte) : String;
|
||||
Var
|
||||
CurFG : Byte;
|
||||
|
@ -992,6 +1033,7 @@ Begin
|
|||
End;
|
||||
End;
|
||||
End;
|
||||
*)
|
||||
|
||||
Function TBBSIO.Attr2Ansi (Attr: Byte) : String;
|
||||
Begin
|
||||
|
|
|
@ -5,9 +5,8 @@ Unit BBS_MenuData;
|
|||
Interface
|
||||
|
||||
Uses
|
||||
m_Strings;
|
||||
|
||||
{$I RECORDS.PAS}
|
||||
m_Strings,
|
||||
BBS_Common;
|
||||
|
||||
Type
|
||||
TMenuData = Class
|
||||
|
|
|
@ -37,8 +37,10 @@ Type
|
|||
Procedure AppendMessageText (Var Msg: PMsgBaseABS; Lines: Integer; ReplyID: String);
|
||||
Procedure AssignMessageData (Var Msg: PMsgBaseABS);
|
||||
Function GetBaseByNum (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
|
||||
Function GetBaseCompressed (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
|
||||
Function GetBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
|
||||
Procedure GetMessageStats (Var TempBase: RecMessageBase; Var Total, New, Yours: LongInt);
|
||||
Function GetTotalBases (Compressed: Boolean) : LongInt;
|
||||
Function GetTotalMessages (Var TempBase: RecMessageBase) : LongInt;
|
||||
Procedure PostTextFile (Data: String; AllowCodes: Boolean);
|
||||
Function SaveMessage (mArea: RecMessageBase; mFrom, mTo, mSubj: String; mAddr: RecEchoMailAddr; mLines: Integer) : Boolean;
|
||||
|
@ -172,6 +174,35 @@ Begin
|
|||
Close (F);
|
||||
End;
|
||||
|
||||
Function TMsgBase.GetBaseCompressed (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
|
||||
Var
|
||||
F : File;
|
||||
Count : LongInt;
|
||||
Begin
|
||||
If Not Config.MCompress Then Begin
|
||||
Result := GetBaseByNum(Num, TempBase);
|
||||
Exit;
|
||||
End;
|
||||
|
||||
Result := False;
|
||||
|
||||
Assign (F, Config.DataPath + 'mbases.dat');
|
||||
|
||||
If Not ioReset(F, SizeOf(RecMessageBase), fmRWDN) Then Exit;
|
||||
|
||||
Count := 0;
|
||||
|
||||
While Not Eof(F) And (Count <> Num) Do Begin
|
||||
ioRead (F, TempBase);
|
||||
|
||||
If Session.User.Access(TempBase.ListACS) Then Inc(Count);
|
||||
End;
|
||||
|
||||
Close (F);
|
||||
|
||||
Result := Count = Num;
|
||||
End;
|
||||
|
||||
Function TMsgBase.GetBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
|
||||
Var
|
||||
F : File;
|
||||
|
@ -194,6 +225,31 @@ Begin
|
|||
Close (F);
|
||||
End;
|
||||
|
||||
Function TMsgBase.GetTotalBases (Compressed: Boolean) : LongInt;
|
||||
Var
|
||||
F : File;
|
||||
TempBase : RecMessageBase;
|
||||
Begin
|
||||
Result := 0;
|
||||
|
||||
Assign (F, Config.DataPath + 'mbases.dat');
|
||||
|
||||
If Not ioReset(F, SizeOf(RecMessageBase), fmRWDN) Then Exit;
|
||||
|
||||
If Not Compressed Then
|
||||
Result := FileSize(F)
|
||||
Else Begin
|
||||
While Not Eof(F) Do Begin
|
||||
ioRead (F, TempBase);
|
||||
|
||||
If Session.User.Access(TempBase.ListACS) Then
|
||||
Inc (Result);
|
||||
End;
|
||||
End;
|
||||
|
||||
Close (F);
|
||||
End;
|
||||
|
||||
Function TMsgBase.GetTotalMessages (Var TempBase: RecMessageBase) : LongInt;
|
||||
Var
|
||||
TempMsg : PMsgBaseABS;
|
||||
|
@ -387,21 +443,10 @@ Procedure TMsgBase.ChangeArea (Data: String);
|
|||
Var
|
||||
Count : LongInt;
|
||||
Total : Word;
|
||||
Old : RecMessageBase;
|
||||
Compress : Boolean;
|
||||
TempBase : RecMessageBase;
|
||||
Begin
|
||||
Compress := Config.MCompress;
|
||||
Old := MBase;
|
||||
|
||||
{$IFDEF LOGGING}
|
||||
Session.SystemLog('MsgAreaChange: ' + Data);
|
||||
Session.SystemLog(' CurArea: ' + strI2S(Session.User.ThisUser.LastMBase));
|
||||
{$ENDIF}
|
||||
|
||||
If (Data = '+') or (Data = '-') Then Begin
|
||||
Reset (MBaseFile);
|
||||
|
||||
Count := Session.User.ThisUser.LastMBase - 1;
|
||||
Count := Session.User.ThisUser.LastMBase;
|
||||
|
||||
Repeat
|
||||
Case Data[1] of
|
||||
|
@ -409,112 +454,59 @@ Begin
|
|||
'-' : Dec(Count);
|
||||
End;
|
||||
|
||||
{$I-}
|
||||
Seek (MBaseFile, Count);
|
||||
Read (MBaseFile, MBase);
|
||||
{$I+}
|
||||
If Not GetBaseByNum(Count, TempBase) Then Exit;
|
||||
|
||||
If IoResult <> 0 Then Break;
|
||||
If Session.User.Access(TempBase.ListACS) Then Begin
|
||||
Session.User.ThisUser.LastMBase := Count;
|
||||
MBase := TempBase;
|
||||
|
||||
If Session.User.Access(MBase.ListACS) Then Begin
|
||||
Session.User.ThisUser.LastMBase := FilePos(MBaseFile);
|
||||
Close (MBaseFile);
|
||||
Exit;
|
||||
End;
|
||||
Until False;
|
||||
|
||||
Close (MBaseFile);
|
||||
|
||||
MBase := Old;
|
||||
|
||||
Exit;
|
||||
End;
|
||||
|
||||
Count := strS2I(Data);
|
||||
|
||||
{$IFDEF LOGGING}
|
||||
Session.SystemLog('Numeric change converstion: ' + strI2S(Count));
|
||||
{$ENDIF}
|
||||
|
||||
If Count > 0 Then Begin
|
||||
Inc (Count);
|
||||
|
||||
Reset (MBaseFile);
|
||||
|
||||
If Count <= FileSize(MBaseFile) Then Begin
|
||||
Seek (MBaseFile, Count - 1);
|
||||
Read (MBaseFile, MBase);
|
||||
|
||||
If Session.User.Access(MBase.ListACS) Then Begin
|
||||
Session.User.ThisUser.LastMBase := FilePos(MBaseFile)
|
||||
End Else
|
||||
MBase := Old;
|
||||
End;
|
||||
|
||||
Close (MBaseFile);
|
||||
If GetBaseByNum (Count, TempBase) Then
|
||||
If Session.User.Access(TempBase.ListACS) Then Begin
|
||||
Session.User.ThisUser.LastMBase := Count;
|
||||
MBase := TempBase;
|
||||
End;
|
||||
|
||||
Exit;
|
||||
End;
|
||||
|
||||
If Pos('NOLIST', strUpper(Data)) > 0 Then Begin
|
||||
Reset (MBaseFile);
|
||||
Total := FileSize(MBaseFile);
|
||||
Close (MBaseFile);
|
||||
End Else
|
||||
Total := ListAreas(Compress);
|
||||
If Pos('NOLIST', strUpper(Data)) > 0 Then
|
||||
Total := GetTotalBases(Config.MCompress)
|
||||
Else
|
||||
Total := ListAreas(Config.MCompress);
|
||||
|
||||
If Total = 0 Then Begin
|
||||
Session.io.OutFullLn (Session.GetPrompt(94));
|
||||
MBase := Old;
|
||||
End Else Begin
|
||||
Repeat
|
||||
Session.io.OutFull (Session.GetPrompt(102));
|
||||
|
||||
Case Session.io.OneKeyRange(#13 + '?Q', 1, Total) of
|
||||
'?': Begin
|
||||
Compress := Config.MCompress;
|
||||
Total := ListAreas(Compress);
|
||||
End;
|
||||
Else
|
||||
Break;
|
||||
End;
|
||||
Until False;
|
||||
|
||||
Count := Session.io.RangeValue;
|
||||
|
||||
If (Count > 0) and (Count <= Total) Then Begin
|
||||
Reset (MBaseFile);
|
||||
|
||||
If Not Compress Then Begin
|
||||
Seek (MBaseFile, Count - 1);
|
||||
Read (MBaseFile, MBase);
|
||||
|
||||
If Not Session.User.Access(MBase.ListACS) Then Begin
|
||||
MBase := Old;
|
||||
Close (MBaseFile);
|
||||
Exit;
|
||||
End;
|
||||
End Else Begin
|
||||
Total := 0;
|
||||
|
||||
While Not Eof(MBaseFile) And (Count <> Total) Do Begin
|
||||
Read (MBaseFile, MBase);
|
||||
If Session.User.Access(MBase.ListACS) Then Inc(Total);
|
||||
End;
|
||||
|
||||
If Count <> Total Then Begin
|
||||
Close (MBaseFile);
|
||||
MBase := OLD;
|
||||
Exit;
|
||||
End;
|
||||
End;
|
||||
|
||||
Session.User.ThisUser.LastMBase := FilePos(MBaseFile);
|
||||
|
||||
Close (MBaseFile);
|
||||
End Else
|
||||
MBase := Old;
|
||||
Exit;
|
||||
End;
|
||||
|
||||
Repeat
|
||||
Session.io.OutFull (Session.GetPrompt(102));
|
||||
|
||||
Case Session.io.OneKeyRange(#13 + '?Q', 1, Total) of
|
||||
#13,
|
||||
'Q': Exit;
|
||||
'?': Total := ListAreas(Config.MCompress);
|
||||
Else
|
||||
Break;
|
||||
End;
|
||||
Until False;
|
||||
|
||||
Count := Session.io.RangeValue;
|
||||
|
||||
If GetBaseCompressed(Count, TempBase) Then
|
||||
If Session.User.Access(MBase.ListACS) Then Begin
|
||||
MBase := TempBase;
|
||||
Session.User.ThisUser.LastMBase := Count;
|
||||
End;
|
||||
End;
|
||||
|
||||
Procedure TMsgBase.ToggleNewScan (QWK: Boolean; Data: String);
|
||||
|
@ -837,17 +829,22 @@ End;
|
|||
|
||||
Function TMsgBase.ListAreas (Compress: Boolean) : Integer;
|
||||
Var
|
||||
Total : Word = 0;
|
||||
Listed : Word = 0;
|
||||
Total : LongInt = 0;
|
||||
Listed : LongInt = 0;
|
||||
TempBase : RecMessageBase;
|
||||
TempFile : File;
|
||||
Begin
|
||||
Reset (MBaseFile);
|
||||
Result := 1;
|
||||
|
||||
Assign (TempFile, Config.DataPath + 'mbases.dat');
|
||||
|
||||
If Not ioReset(TempFile, SizeOf(RecMessageBase), fmRWDN) Then Exit;
|
||||
|
||||
Session.io.PausePtr := 1;
|
||||
Session.io.AllowPause := True;
|
||||
|
||||
While Not Eof(MBaseFile) Do Begin
|
||||
Read (MBaseFile, TempBase);
|
||||
While Not Eof(TempFile) Do Begin
|
||||
ioRead (TempFile, TempBase);
|
||||
|
||||
If Session.User.Access(TempBase.ListACS) Then Begin
|
||||
Inc (Listed);
|
||||
|
@ -858,7 +855,7 @@ Begin
|
|||
If Compress Then
|
||||
Inc (Total)
|
||||
Else
|
||||
Total := FilePos(MBaseFile);
|
||||
Total := FilePos(TempFile);
|
||||
|
||||
Session.io.PromptInfo[1] := strI2S(Total);
|
||||
Session.io.PromptInfo[2] := TempBase.Name;
|
||||
|
@ -869,19 +866,19 @@ Begin
|
|||
If (Listed MOD Config.MColumns = 0) and (Listed > 0) Then Session.io.OutRawLn('');
|
||||
End;
|
||||
|
||||
If Eof(MBaseFile) and (Listed MOD Config.MColumns <> 0) Then Session.io.OutRawLn('');
|
||||
If Eof(TempFile) and (Listed MOD Config.MColumns <> 0) Then Session.io.OutRawLn('');
|
||||
|
||||
If (Session.io.PausePtr = Session.User.ThisUser.ScreenSize) and (Session.io.AllowPause) Then
|
||||
Case Session.io.MorePrompt of
|
||||
'N' : Begin
|
||||
Total := FileSize(MBaseFile);
|
||||
Total := FileSize(TempFile);
|
||||
Break;
|
||||
End;
|
||||
'C' : Session.io.AllowPause := False;
|
||||
End;
|
||||
End;
|
||||
|
||||
Close (MBaseFile);
|
||||
Close (TempFile);
|
||||
|
||||
Result := Total;
|
||||
End;
|
||||
|
@ -1230,92 +1227,83 @@ Var
|
|||
|
||||
Function MoveMessage (IsCopy: Boolean) : Boolean;
|
||||
Var
|
||||
Total : LongInt;
|
||||
TempBase : RecMessageBase;
|
||||
MsgNew : PMsgBaseABS;
|
||||
Str : String;
|
||||
TempBase : RecMessageBase;
|
||||
Area : Integer;
|
||||
Addr : RecEchoMailAddr;
|
||||
Begin
|
||||
Result := False;
|
||||
Result := False;
|
||||
Session.User.IgnoreGroup := True;
|
||||
|
||||
Repeat
|
||||
Total := ListAreas(Config.MCompress);
|
||||
|
||||
If IsCopy Then
|
||||
Session.io.OutFull (Session.GetPrompt(492))
|
||||
Else
|
||||
Session.io.OutFull (Session.GetPrompt(282));
|
||||
|
||||
Str := Session.io.GetInput(4, 4, 12, '');
|
||||
Case Session.io.OneKeyRange('Q?', 1, Total) of
|
||||
#00: If GetBaseCompressed(Session.io.RangeValue, TempBase) Then Begin
|
||||
If Not Session.User.Access(TempBase.PostACS) Then Begin
|
||||
Session.io.OutFullLn (Session.GetPrompt(105));
|
||||
Break;
|
||||
End;
|
||||
|
||||
If Str = '?' Then
|
||||
ListAreas(False)
|
||||
Else Begin
|
||||
Reset (MBaseFile);
|
||||
Session.io.PromptInfo[1] := TempBase.Name;
|
||||
|
||||
Area := strS2I(Str) - 1;
|
||||
Session.io.OutFullLn (Session.GetPrompt(318));
|
||||
|
||||
If (Area > 0) and (Area < FileSize(MBaseFile) - 1) Then Begin
|
||||
Seek (MBaseFile, Area);
|
||||
Read (MBaseFile, TempBase);
|
||||
Close (MBaseFile);
|
||||
If Not OpenCreateBase(MsgNew, TempBase) Then Break;
|
||||
|
||||
If Not Session.User.Access(TempBase.PostACS) Then Begin
|
||||
Session.io.OutFullLn (Session.GetPrompt(105));
|
||||
Break;
|
||||
End;
|
||||
MsgNew^.StartNewMsg;
|
||||
|
||||
Session.io.PromptInfo[1] := TempBase.Name;
|
||||
MsgNew^.SetFrom (MsgBase^.GetFrom);
|
||||
MsgNew^.SetLocal (True);
|
||||
|
||||
Session.io.OutFullLn (Session.GetPrompt(318));
|
||||
Case TempBase.NetType of
|
||||
0 : MsgNew^.SetMailType(mmtNormal);
|
||||
3 : MsgNew^.SetMailType(mmtNetMail);
|
||||
Else
|
||||
MsgNew^.SetMailType(mmtEchoMail);
|
||||
End;
|
||||
|
||||
If Not OpenCreateBase(MsgNew, TempBase) Then Break;
|
||||
MsgBase^.GetOrig (Addr);
|
||||
MsgNew^.SetOrig (Addr);
|
||||
MsgNew^.SetPriv (MsgBase^.IsPriv);
|
||||
MsgNew^.SetDate (MsgBase^.GetDate);
|
||||
MsgNew^.SetTime (MsgBase^.GetTime);
|
||||
MsgNew^.SetTo (MsgBase^.GetTo);
|
||||
MsgNew^.SetSubj (MsgBase^.GetSubj);
|
||||
|
||||
MsgNew^.StartNewMsg;
|
||||
MsgNew^.SetFrom (MsgBase^.GetFrom);
|
||||
MsgNew^.SetLocal (True);
|
||||
MsgBase^.MsgTxtStartUp;
|
||||
|
||||
Case TempBase.NetType of
|
||||
0 : MsgNew^.SetMailType(mmtNormal);
|
||||
3 : MsgNew^.SetMailType(mmtNetMail);
|
||||
Else
|
||||
MsgNew^.SetMailType(mmtEchoMail);
|
||||
End;
|
||||
While Not MsgBase^.EOM Do Begin
|
||||
Str := MsgBase^.GetString(79);
|
||||
|
||||
MsgBase^.GetOrig(Addr);
|
||||
MsgNew^.SetOrig(Addr);
|
||||
MsgNew^.SetPriv(MsgBase^.IsPriv);
|
||||
MsgNew^.SetDate(MsgBase^.GetDate);
|
||||
MsgNew^.SetTime(MsgBase^.GetTime);
|
||||
MsgNew^.SetTo(MsgBase^.GetTo);
|
||||
MsgNew^.SetSubj(MsgBase^.GetSubj);
|
||||
MsgNew^.DoStringLn(Str);
|
||||
End;
|
||||
|
||||
MsgBase^.MsgTxtStartUp;
|
||||
MsgNew^.WriteMsg;
|
||||
MsgNew^.CloseMsgBase;
|
||||
|
||||
While Not MsgBase^.EOM Do Begin
|
||||
Str := MsgBase^.GetString(79);
|
||||
MsgNew^.DoStringLn(Str);
|
||||
End;
|
||||
Dispose (MsgNew, Done);
|
||||
|
||||
MsgNew^.WriteMsg;
|
||||
If IsCopy Then
|
||||
Session.SystemLog('Forward msg to ' + strStripMCI(TempBase.Name))
|
||||
Else Begin
|
||||
Session.SystemLog('Moved msg to ' + strStripMCI(TempBase.Name));
|
||||
|
||||
MsgNew^.CloseMsgBase;
|
||||
MsgBase^.DeleteMsg;
|
||||
End;
|
||||
|
||||
Dispose (MsgNew, Done);
|
||||
Result := True;
|
||||
|
||||
If IsCopy Then
|
||||
Session.SystemLog('Forward msg to ' + strStripMCI(TempBase.Name))
|
||||
Else Begin
|
||||
Session.SystemLog('Moved msg to ' + strStripMCI(TempBase.Name));
|
||||
MsgBase^.DeleteMsg;
|
||||
End;
|
||||
|
||||
Result := True;
|
||||
|
||||
Break;
|
||||
End Else Begin
|
||||
Close (MBaseFile);
|
||||
Break;
|
||||
End;
|
||||
Break;
|
||||
End;
|
||||
#13,
|
||||
'Q': Break;
|
||||
End;
|
||||
Until False;
|
||||
|
||||
|
@ -2431,6 +2419,15 @@ Begin
|
|||
If Mode = 'F' Then Begin
|
||||
Session.io.PromptInfo[1] := strI2S(MsgBase^.GetHighMsgNum);
|
||||
|
||||
If Session.io.PromptInfo[1] = '0' Then Begin
|
||||
Session.io.OutFullLn(Session.GetPrompt(114));
|
||||
|
||||
MsgBase^.CloseMsgBase;
|
||||
Dispose (MsgBase, Done);
|
||||
|
||||
Exit;
|
||||
End;
|
||||
|
||||
Session.io.OutFull (Session.GetPrompt(338));
|
||||
|
||||
Session.io.OneKeyRange(#13, 1, MsgBase^.GetHighMsgNum);
|
||||
|
@ -2813,7 +2810,7 @@ Begin
|
|||
UpdateBase;
|
||||
End;
|
||||
|
||||
Procedure TMsgBase.MessageNewScan (Data : String);
|
||||
Procedure TMsgBase.MessageNewScan (Data: String);
|
||||
{ menu data commands: }
|
||||
{ /P : scan for personal mail in all bases }
|
||||
{ /M : scan only mandatory bases }
|
||||
|
@ -2874,7 +2871,7 @@ Begin
|
|||
Close (MBaseFile);
|
||||
|
||||
Session.User.IgnoreGroup := False;
|
||||
MBase := OLD;
|
||||
MBase := OLD;
|
||||
End;
|
||||
|
||||
Procedure TMsgBase.GlobalMessageSearch (Mode : Char);
|
||||
|
|
|
@ -240,8 +240,9 @@ Begin
|
|||
If Offset = 0 Then Offset := 1;
|
||||
|
||||
If CurX + Offset > 80 Then Begin
|
||||
NewPos := (CurX + Offset) - 80;
|
||||
Inc (CurY);
|
||||
NewPos := 80;
|
||||
// NewPos := (CurX + Offset) - 80;
|
||||
// Inc (CurY);
|
||||
End Else
|
||||
NewPos := CurX + Offset;
|
||||
|
||||
|
|
|
@ -1123,7 +1123,7 @@ Begin
|
|||
Session.Msgs.MessageGroupChange ('+', True, False);
|
||||
|
||||
If ThisUser.LastMBase > 0 Then
|
||||
Session.Msgs.ChangeArea(strI2S(ThisUser.LastMBase - 1))
|
||||
Session.Msgs.ChangeArea(strI2S(ThisUser.LastMBase))
|
||||
Else
|
||||
Session.Msgs.ChangeArea('+');
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@
|
|||
113 |15No messages found.
|
||||
114 |CR|12There are no messages in |MB.|DE|DE|DE
|
||||
; E-mail reader prompt
|
||||
115 |CR|09(A)gain, (P)revious, (N)ext, (R)eply, (D)elete, (J)ump, (Q)uit?
|
||||
115 |CR|09(A)gain, (P)revious, (N)ext, (R)eply, (D)elete, (J)ump, (Q)uit? |11
|
||||
; Message read prompt. &1 = Current Msg # &2 = Total Messages
|
||||
116 |CR (|&1 of |&2) Reading Messages (?/Help): |XX
|
||||
117 |CR|12Delete this mail? |11
|
||||
|
@ -599,9 +599,9 @@
|
|||
; UNUSED
|
||||
315 UNUSED
|
||||
; Lightbar Y/N: YES text
|
||||
316 |09|17 Y|15es |09|16 N|15o |16
|
||||
316 |09|17 Y|15es |09|16 N|15o |16
|
||||
; Lightbar Y/N: NO text
|
||||
317 |09 Y|15es |09|17 N|15o |16
|
||||
317 |09 Y|15es |09|17 N|15o |16
|
||||
; Moving message. &1=base name
|
||||
318 |CR|14Moving message to |15|&1|14...
|
||||
; nodechat broadcast text: &1 = user name
|
||||
|
@ -686,7 +686,7 @@
|
|||
; Add BBS: BBS already exists
|
||||
362 |CR|12BBS already exists in list!
|
||||
; Msg xport: local export path
|
||||
363 |CR|09Enter full path/filename to export to: |XX
|
||||
363 |CR|09Enter full path/filename to export to:|CR|XX
|
||||
; info edit: address
|
||||
364 |CR|03Enter your street address.|CR|09:
|
||||
; info edit: city/state
|
||||
|
@ -963,6 +963,6 @@
|
|||
; 1=offline 2=failed 3=unvalidated 4=GB 5=MB 6=KB 7=B
|
||||
491 OFFLINE FAILED UNVALID GB MB KB B
|
||||
; Forward msg: which base
|
||||
492 |CR|09Forward message to which base (?/List): |XX
|
||||
492 |CR|09Forward message to which base (|10?|09/|10List|09): |11
|
||||
; Sysop password prompt
|
||||
493 |CR|09Sysop Password: |XX
|
||||
|
|
|
@ -208,8 +208,7 @@ End;
|
|||
|
||||
Procedure InitializeUnix;
|
||||
Var
|
||||
Count : Word;
|
||||
Info : Stat;
|
||||
Info : Stat;
|
||||
Begin
|
||||
If fpStat('mystic', Info) = 0 Then Begin
|
||||
fpSetGID (Info.st_GID);
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
Const
|
||||
mysSoftwareID = 'Mystic'; // no idea
|
||||
mysCopyYear = '1997-2013'; // its been a long time!
|
||||
mysWebsite = 'sourceforge.net/projects/mysticbbs';
|
||||
mysVersion = '1.10 A26'; // current version
|
||||
mysDataChanged = '1.10 A11'; // version of last records change
|
||||
|
||||
|
@ -84,6 +83,52 @@ Type
|
|||
Point : Word;
|
||||
End;
|
||||
|
||||
RecEchoMailOpts = Record
|
||||
SysLocation : String[40];
|
||||
SysFlags : String[40];
|
||||
IncomingPath : String[mysMaxPathSize];
|
||||
SIncomingPath : String[mysMaxPathSize];
|
||||
OutboundPath : String[mysMaxPathSize];
|
||||
NodeListPath : String[mysMaxPathSize];
|
||||
ZoneMap : String[128];
|
||||
FTPPort : Word;
|
||||
BINKPPort : Word;
|
||||
Res : Array[1..485] of Char;
|
||||
End;
|
||||
|
||||
RecEchomailNodeFTP = Record
|
||||
Host : String[60];
|
||||
Login : String[30];
|
||||
Password : String[30];
|
||||
Directory : String[80];
|
||||
End;
|
||||
|
||||
RecEchomailNodeBINKP = Record
|
||||
Host : String[60];
|
||||
TimeOut : Word;
|
||||
BlockSize : Word;
|
||||
Res : Array[1..10] of Byte;
|
||||
End;
|
||||
|
||||
RecEchoMailNode = Record
|
||||
Description : String[40];
|
||||
Active : Boolean;
|
||||
AddrList : String[250];
|
||||
InType : Byte; // 0=Disabled 1=FTP 2=BINKP 3=EMAIL 4=DIRECTORY
|
||||
OutType : Byte; // 0=Disabled 1=FTP 2=BINKP 3=EMAIL 4=DIRECTORY
|
||||
FTPin : RecEchoMailNodeFTP;
|
||||
FTPout : RecEchoMailNodeFTP;
|
||||
BINKPin : RecEchoMailNodeBINKP;
|
||||
BINKPout : RecEchoMailNodeBINKP;
|
||||
LastRecv : LongInt;
|
||||
LastSent : LongInt;
|
||||
LastReset : LongInt;
|
||||
InFiles : Cardinal;
|
||||
InSize : Cardinal;
|
||||
OutFiles : Cardinal;
|
||||
OutSize : Cardinal;
|
||||
End;
|
||||
|
||||
RecSauceInfo = Packed Record
|
||||
Title : String[35];
|
||||
Author : String[20];
|
||||
|
@ -280,6 +325,13 @@ Type
|
|||
inetTNHidden : Boolean;
|
||||
ThemeOnStart : Boolean;
|
||||
StartCodePage : Byte;
|
||||
|
||||
//inetSMTPRelay : String[30];
|
||||
//inetSMTPLogin : String[30];
|
||||
//inetSMTPPW : String[30];
|
||||
//EmailValidationLevel
|
||||
//AllowEmailPWReset
|
||||
|
||||
Reserved : Array[1..843] of Char;
|
||||
End;
|
||||
|
||||
|
|
|
@ -211,3 +211,18 @@ FILE rating / comments system
|
|||
2. records already updated to allow for either
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
TANSILINEBUFFER:
|
||||
|
||||
LoadToBuffer (Ansi file)
|
||||
SaveToFile (Ansi file)
|
||||
SaveToBuffer (Linelength)
|
||||
|
||||
WrapLine (XPOS)
|
||||
InsertLine
|
||||
DeleteLine
|
||||
JoinLines
|
||||
InsertChar (XPOS, Ch, Attr)
|
||||
ReplaceChar (XPOS, Ch, Attr
|
||||
ReplaceLine
|
||||
|
||||
|
|
|
@ -2517,4 +2517,30 @@
|
|||
+ When selecting "Forward" reading, Mystic now uses the smart input
|
||||
function to prompt for the message start number.
|
||||
|
||||
+ Rewrote the message move and fowarding functions. Both now make use of
|
||||
compressed message base numbers when selecting the target message base,
|
||||
and they both now use smart input.
|
||||
|
||||
! Fixed a bug which could cause a crash after moving a message while doing
|
||||
a newscan of message bases.
|
||||
|
||||
+ Added sorting to the file bases configuration editor. Use TAB to mark
|
||||
and /S to sort just like message bases.
|
||||
|
||||
! Fixed a bug when editing prompts using the theme editor when performing
|
||||
a search.
|
||||
|
||||
! The Menu editor was not properly using the theme selected when it was
|
||||
started.
|
||||
|
||||
! According to a document I saw, the ANSI-BBS C function to move the cursor
|
||||
should hard stop at 80. Mystic's ANSI parser wraps to the next line which
|
||||
I think was added in a while back to increase ANSI compatibility. For
|
||||
now I changed it back to follow what this standard document is claiming,
|
||||
even if it is sort of against my better judgement.
|
||||
|
||||
+ If a message bases's data files actually exist, for but some reason the
|
||||
highest message number is 0 (ie everything has been deleted), Mystic will
|
||||
now display the "There are no messages in this base" prompt when reading.
|
||||
|
||||
<ALPHA 26 RELEASED>
|
||||
|
|
Loading…
Reference in New Issue