From 88bcf6810a541bcb1b01e2b128885d7cb876fc63 Mon Sep 17 00:00:00 2001 From: sk5 Date: Sun, 21 Jul 2013 00:16:37 -0700 Subject: [PATCH 1/3] Updated BBSList, See UPGRADE/BBSLIST.SCR for new options Not Sure which new ascii is available, I'll check modified: BBSLIST.PAS modified: RECORDS.PAS new file: UPGRADE/BBSLIST.SCR new file: UPGRADE/FIXBBSL.PAS --- SOURCE/BBSLIST.PAS | 1333 +++++++++++++++++++++--------------- SOURCE/RECORDS.PAS | 49 +- SOURCE/UPGRADE/BBSLIST.SCR | 61 ++ SOURCE/UPGRADE/FIXBBSL.PAS | 217 ++++++ 4 files changed, 1080 insertions(+), 580 deletions(-) create mode 100644 SOURCE/UPGRADE/BBSLIST.SCR create mode 100644 SOURCE/UPGRADE/FIXBBSL.PAS diff --git a/SOURCE/BBSLIST.PAS b/SOURCE/BBSLIST.PAS index b7e3920..55d3cfd 100644 --- a/SOURCE/BBSLIST.PAS +++ b/SOURCE/BBSLIST.PAS @@ -1,561 +1,772 @@ -{$IFDEF WIN32} -{$I DEFINES.INC} -{$ENDIF} - -{$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} - -UNIT BBSList; - -INTERFACE - -PROCEDURE BBSList_Add; -PROCEDURE BBSList_Delete; -PROCEDURE BBSList_Edit; -PROCEDURE BBSList_View; -PROCEDURE BBSList_xView; - -IMPLEMENTATION - -USES - Common, - TimeFunc; - -FUNCTION BBSListMCI(CONST S: ASTR; Data1,Data2: Pointer): STRING; -VAR - BBSListPtr: ^BBSListRecordType; - User: UserRecordType; -BEGIN - BBSListPtr := Data1; - BBSListMCI := S; - CASE S[1] OF - 'X' : CASE S[2] OF - 'A' : BBSListMCI := BBSListPtr^.xA; - 'B' : BBSListMCI := BBSListPtr^.xB; - 'C' : BBSListMCI := BBSListPtr^.xC; - 'D' : BBSListMCI := BBSListPtr^.xD; - 'E' : BBSListMCI := BBSListPtr^.xE; - 'F' : BBSListMCI := BBSListPtr^.xF; - END; - 'B' : CASE S[2] OF - 'N' : BBSListMCI := BBSListPtr^.BBSName; - END; - 'D' : CASE S[2] OF - 'A' : BBSListMCI := Pd2Date(BBSListPtr^.DateAdded); - 'E' : BBSListMCI := Pd2Date(BBSListPtr^.DateEdited); - 'S' : BBSListMCI := BBSListPtr^.Description; - '2' : BBSListMCI := BBSListPtr^.Description2 - END; - 'P' : CASE S[2] OF - 'N' : BBSListMCI := BBSListPtr^.PhoneNumber; - END; - 'R' : CASE S[2] OF - 'N' : BBSListMCI := IntToStr(BBSListPtr^.RecordNum); - END; - 'S' : CASE S[2] OF - 'N' : BBSListMCI := BBSListPtr^.SysOpName; - 'P' : BBSListMCI := BBSListPtr^.Speed; - 'W' : BBSListMCI := AllCaps(BBSListPtr^.Software); - END; - 'T' : CASE S[2] OF - 'N' : BBSListMCI := BBSListPtr^.TelnetUrl; - END; - 'U' : CASE S[2] OF - 'N' : BEGIN - LoadURec(User,BBSListPtr^.UserID); - BBSListMCI := User.Name; - END; - END; - 'W' : CASE S[2] OF - 'S' : BBSListMCI := BBSListPtr^.WebSiteUrl; - END; - END; -END; - -PROCEDURE BBSListScriptFile(VAR BBSList: BBSListRecordType); -VAR - BBSScriptText: TEXT; - Question: STRING; - WhichOne: CHAR; -BEGIN - Assign(BBSScriptText,General.MiscPath+'BBSLIST.SCR'); - Reset(BBSScriptText); - WHILE NOT EOF(BBSScriptText) AND (NOT Abort) AND (NOT HangUp) DO - BEGIN - ReadLn(BBSScriptText,Question); - IF (Question[1] = '[') THEN - BEGIN - WhichOne := UpCase(Question[2]); - Question := Copy(Question,(Pos(':',Question) + 1),Length(Question)); - CASE WhichOne OF - '1' : BEGIN - NL; - PRT(Question+' '); - MPL(SizeOf(BBSList.BBSName) - 1); - InputMain(BBSList.BBSName,(SizeOf(BBSList.BBSName) - 1),[InterActiveEdit,ColorsAllowed]); - Abort := (BBSList.BBSName = ''); - END; - '2' : BEGIN - PRT(Question+' '); - MPL(SizeOf(BBSList.SysOpName) - 1); - InputMain(BBSList.SysOpName,(SizeOf(BBSList.SysOpName) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.SysOpName = ''); - END; - '3' : BEGIN - PrintACR(Question); - MPL(SizeOf(BBSList.TelnetUrl) - 1); - InputMain(BBSList.TelnetUrl,(SizeOf(BBSList.TelnetUrl) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.TelnetUrl = ''); - END; - '4' : BEGIN - PrintACR(Question); - MPL(SizeOf(BBSList.WebSiteUrl) - 1); - InputMain(BBSList.WebSiteUrl,(SizeOf(BBSList.WebSiteUrl) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.WebSiteUrl = ''); - END; - '5' : BEGIN - PRT(Question+' '); - MPL(SizeOf(BBSList.PhoneNumber) - 1); - InputMain(BBSList.PhoneNumber,(SizeOf(BBSList.PhoneNumber) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.PhoneNumber = ''); - END; - '6' : BEGIN - PRT(Question+' '); - MPL(SizeOf(BBSList.Software) - 1); - InputMain(BBSList.Software,(SizeOf(BBSList.Software) - 1),[ColorsAllowed,InterActiveEdit,UpperOnly]); - Abort := (BBSList.Software = ''); - END; - '7' : BEGIN - PRT(Question+' '); - MPL(SizeOf(BBSList.Speed) - 1); - InputMain(BBSList.Speed,(SizeOf(BBSList.Speed) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.Speed = ''); - END; - '8' : BEGIN - Print(Question); - MPL(SizeOf(BBSList.Description) - 1); - InputMain(BBSList.Description,(SizeOf(BBSList.Description) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.Description = ''); - END; - '9' : BEGIN - IF (Question <> 'þ') THEN - Print(Question); - MPL(SizeOf(BBSList.Description2) - 1); - InputMain(BBSList.Description2,(SizeOf(BBSList.Description2) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.Description2 = ''); - END; - 'A' : BEGIN - Print(Question); - MPL(SizeOf(BBSList.xA) - 1); - InputMain(BBSList.xA,(SizeOf(BBSList.xA) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.xA = ''); - END; - 'B' : BEGIN - Print(Question); - MPL(SizeOf(BBSList.xB) - 1); - InputMain(BBSList.xB,(SizeOf(BBSList.xB) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.xB = ''); - END; - 'C' : BEGIN - Print(Question); - MPL(SizeOf(BBSList.xC) - 1); - InputMain(BBSList.xC,(SizeOf(BBSList.xC) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.xC = ''); - END; - 'D' : BEGIN - Print(Question); - MPL(SizeOf(BBSList.xD) - 1); - InputMain(BBSList.xD,(SizeOf(BBSList.xD) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.xD = ''); - END; - 'E' : BEGIN - Print(Question); - MPL(SizeOf(BBSList.xE) - 1); - InputMain(BBSList.xE,(SizeOf(BBSList.xE) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.xE = ''); - END; - 'F' : BEGIN - Print(Question); - MPL(SizeOf(BBSList.xF) - 1); - InputMain(BBSList.xF,(SizeOf(BBSList.xF) - 1),[ColorsAllowed,InterActiveEdit]); - Abort := (BBSList.xF = ''); - END; - END; - END; - END; - Close(BBSScriptText); - LastError := IOResult; -END; - -FUNCTION BBSList_Exists: Boolean; -VAR - BBSListFile: FILE OF BBSListRecordType; - FSize: Longint; - FExist: Boolean; -BEGIN - FSize := 0; - FExist := Exist(General.DataPath+'BBSLIST.DAT'); - IF (FExist) THEN - BEGIN - Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); - Reset(BBSListFile); - FSize := FileSize(BBSListFile); - Close(BBSListFile); - END; - IF (NOT FExist) OR (FSize = 0) THEN - BEGIN - NL; - Print('There are currently no entries in the BBS List.'); - SysOpLog('The BBSLIST.DAT file is missing.'); - END; - BBSList_Exists := (FExist) AND (FSize <> 0); -END; - -PROCEDURE DisplayError(FName: ASTR; VAR FExists: Boolean); -BEGIN - NL; - PrintACR('|12ú |09The '+FName+'.* File is missing.'); - PrintACR('|12ú |09Please, inform the Sysop!'); - SysOpLog('The '+FName+'.* file is missing.'); - FExists := FALSE; -END; - -FUNCTION BBSListScript_Exists: Boolean; -VAR - FExists: Boolean; -BEGIN - FExists := Exist(General.MiscPath+'BBSLIST.SCR'); - IF (NOT FExists) THEN - DisplayError('BBSLIST.SCR',FExists); - BBSListScript_Exists := FExists; -END; - -FUNCTION BBSListAddScreens_Exists: Boolean; -VAR - FExistsH, - FExistsN, - FExistsT: Boolean; -BEGIN - FExistsH := TRUE; - FExistsN := TRUE; - FExistsT := TRUE; - IF (NOT ReadBuffer('BBSNH')) THEN - DisplayError('BBSNH',FExistsH); - IF (NOT ReadBuffer('BBSMN')) THEN - DisplayError('BBSMN',FExistsN); - IF (NOT ReadBuffer('BBSNT')) THEN - DisplayError('BBSNT',FExistsT); - BBSListAddScreens_Exists := (FExistsH) AND (FExistsN) AND (FExistsT); -END; - -FUNCTION BBSListEditScreens_Exists: Boolean; -VAR - FExistsT, - FExistsM: Boolean; -BEGIN - FExistsT := TRUE; - FExistsM := TRUE; - IF (NOT ReadBuffer('BBSLET')) THEN - DisplayError('BBSLET',FExistsT); - IF (NOT ReadBuffer('BBSLEM')) THEN - DisplayError('BBSLEM',FExistsM); - BBSListEditScreens_Exists := (FExistsT) AND (FExistsM); -END; - -PROCEDURE BBSList_Renumber; -VAR - BBSListFile: FILE OF BBSListRecordType; - BBSList: BBSListRecordType; - OnRec: Longint; -BEGIN - Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); - Reset(BBSListFile); - Abort := FALSE; - OnRec := 1; - WHILE (OnRec <= FileSize(BBSListFile)) DO - BEGIN - Seek(BBSListFile,(OnRec - 1)); - Read(BBSListFile,BBSList); - BBSList.RecordNum := OnRec; - Seek(BBSListFile,(OnRec - 1)); - Write(BBSListFile,BBSList); - Inc(OnRec); - END; - Close(BBSListFile); - LastError := IOResult; -END; - -PROCEDURE BBSList_Sort; -VAR - BBSListFile: FILE OF BBSListRecordType; - BBSList1, - BBSList2: BBSListRecordType; - S, - I, - J, - pl, - Gap: INTEGER; -BEGIN - IF (BBSList_Exists) THEN - BEGIN - Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); - Reset(BBSListFile); - pl := FileSize(BBSListFile); - Gap := pl; - REPEAT; - Gap := (Gap DIV 2); - IF (Gap = 0) THEN - Gap := 1; - s := 0; - FOR I := 1 TO (pl - Gap) DO - BEGIN - J := (I + Gap); - Seek(BBSListFile,(i - 1)); - Read(BBSListFile,BBSList1); - Seek(BBSListFile,(j - 1)); - Read(BBSListFile,BBSList2); - IF (BBSList1.BBSName > BBSList2.BBSName) THEN - BEGIN - Seek(BBSListFile,(i - 1)); - Write(BBSListFile,BBSList2); - Seek(BBSListFile,(j - 1)); - Write(BBSListFile,BBSList1); - Inc(s); - END; - END; - UNTIL (s = 0) AND (Gap = 1); - Close(BBSListFile); - LastError := IOResult; - IF (PL > 0) THEN - BEGIN - NL; - Print('Sorted '+IntToStr(pl)+' BBS List entries.'); - SysOpLog('Sorted the BBS Listing'); - END; - END; -END; - -PROCEDURE BBSList_Add; -VAR - Data2: Pointer; - BBSList: BBSListRecordType; -BEGIN - IF (BBSListScript_Exists) AND (BBSListAddScreens_Exists) THEN - BEGIN - NL; - IF PYNQ('Would you like to add an entry to the BBS List? ',0,FALSE) THEN - BEGIN - FillChar(BBSList,SizeOf(BBSList),0); - BBSListScriptFile(BBSList); - IF (NOT Abort) THEN - BEGIN - PrintF('BBSNH'); - ReadBuffer('BBSMN'); - DisplayBuffer(BBSListMCI,@BBSList,Data2); - PrintF('BBSNT'); - NL; - IF (PYNQ('Would you like to save this BBS Listing? ',0,TRUE)) THEN - BEGIN - Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); - IF (Exist(General.DataPath+'BBSLIST.DAT')) THEN - Reset(BBSListFile) - ELSE - Rewrite(BBSListFile); - Seek(BBSListFile,FileSize(BBSListFile)); - BBSList.UserID := UserNum; - BBSList.DateAdded := GetPackDateTime; - BBSList.DateEdited := BBSList.DateAdded; - BBSList.RecordNum := (FileSize(BBSListFile) + 1); - Write(BBSListFile,BBSList); - Close(BBSListFile); - LastError := IOResult; - BBSList_Sort; - BBSList_Renumber; - SysOpLog('Added BBS Listing: '+BBSList.BBSName+'.'); - END; - END; - END; - END; -END; - -PROCEDURE BBSList_Delete; -VAR - Data2: Pointer; - BBSList: BBSListRecordType; - OnRec, - RecNum: Longint; - Found: Boolean; -BEGIN - IF (BBSList_Exists) AND (BBSListEditScreens_Exists) THEN - BEGIN - AllowContinue := FALSE; - Found := FALSE; - Abort := FALSE; - Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); - Reset(BBSListFile); - OnRec := 1; - WHILE (OnRec <= FileSize(BBSListFile)) AND (NOT Abort) AND (NOT HangUp) DO - BEGIN - Seek(BBSListFile,(OnRec - 1)); - Read(BBSListFile,BBSList); - IF (BBSList.UserID = UserNum) OR (CoSysOp) THEN - BEGIN - PrintF('BBSLET'); - ReadBuffer('BBSLEM'); - DisplayBuffer(BBSListMCI,@BBSList,Data2); - NL; - IF (PYNQ('Would you like to delete this BBS Listing? ',0,FALSE)) THEN - BEGIN - SysOpLog('Deleted BBS Listing: '+BBSList.BBSName+'.'); - IF ((OnRec - 1) <= (FileSize(BBSListFile) - 2)) THEN - FOR RecNum := (OnRec - 1) TO (FileSize(BBSListFile) - 2) DO - BEGIN - Seek(BBSListFile,(RecNum + 1)); - Read(BBSListFile,BBSList); - Seek(BBSListFile,RecNum); - Write(BBSListFile,BBSList); - END; - Seek(BBSListFile,(FileSize(BBSListFile) - 1)); - Truncate(BBSListFile); - Dec(OnRec); - END; - Found := TRUE; - END; - Inc(OnRec); - END; - Close(BBSListFile); - LastError := IOResult; - BBSList_ReNumber; - IF (NOT Found) THEN - BEGIN - NL; - Print('You may only delete BBS Listing''s that you have entered.'); - SysOpLog('Tried to delete a BBS Listing.'); - END; - END; -END; - -PROCEDURE BBSList_Edit; -VAR - Data2: Pointer; - BBSList: BBSListRecordType; - OnRec: Longint; - Found: Boolean; -BEGIN - IF (BBSList_Exists) AND (BBSListEditScreens_Exists) AND (BBSListAddScreens_Exists) THEN - BEGIN - Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); - Reset(BBSListFile); - AllowContinue := FALSE; - Found := FALSE; - Abort := FALSE; - OnRec := 1; - WHILE (OnRec <= FileSize(BBSListFile)) AND (NOT Abort) AND (NOT HangUp) DO - BEGIN - Seek(BBSListFile,(OnRec - 1)); - Read(BBSListFile,BBSList); - IF (BBSList.UserID = UserNum) OR (CoSysOp) THEN - BEGIN - PrintF('BBSLET'); - ReadBuffer('BBSLEM'); - DisplayBuffer(BBSListMCI,@BBSList,Data2); - NL; - IF (PYNQ('Would you like to edit this BBS Listing? ',0,FALSE)) THEN - BEGIN - BBSListScriptFile(BBSList); - IF (NOT Abort) THEN - BEGIN - PrintF('BBSNH'); - ReadBuffer('BBSMN'); - DisplayBuffer(BBSListMCI,@BBSList,Data2); - PrintF('BBSNT'); - NL; - IF (PYNQ('Would you like to save this BBS Listing? ',0,TRUE)) THEN - BEGIN - Seek(BBSListFile,(OnRec - 1)); - BBSList.DateEdited := GetPackDateTime; - Write(BBSListFile,BBSList); - SysOpLog('Edited BBS Listing: '+BBSList.BBSName+'.'); - END; - END; - END; - Found := TRUE; - END; - Inc(OnRec); - END; - Close(BBSListFile); - LastError := IOResult; - IF (NOT Found) THEN - BEGIN - NL; - Print('You may only edit BBS Listing''s that you have entered.'); - SysOpLog('Tried to edit a BBS Listing.'); - END; - END; -END; - -PROCEDURE BBSList_View; -VAR - Data2: Pointer; - BBSList: BBSListRecordType; - OnRec: Longint; -BEGIN - IF (BBSList_Exists) AND (BBSListAddScreens_Exists) THEN - BEGIN - Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); - Reset(BBSListFile); - ReadBuffer('BBSMN'); - AllowContinue := TRUE; - Abort := FALSE; - PrintF('BBSNH'); - OnRec := 1; - WHILE (OnRec <= FileSize(BBSListFile)) AND (NOT Abort) AND (NOT HangUp) DO - BEGIN - Seek(BBSListFile,(OnRec - 1)); - Read(BBSListFile,BBSList); - DisplayBuffer(BBSListMCI,@BBSList,Data2); - Inc(OnRec); - END; - Close(BBSListFile); - LastError := IOResult; - IF (NOT Abort) THEN - PrintF('BBSNT'); - AllowContinue := FALSE; - SysOpLog('Viewed the BBS Listing.'); - END; -END; - -PROCEDURE BBSList_xView; (* Do we need xview *) -VAR - Data2: Pointer; - BBSList: BBSListRecordType; - OnRec: Longint; -BEGIN - IF (BBSList_Exists) THEN (* Add BBSME & BBSEH exist checking here *) - BEGIN - Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); - Reset(BBSListFile); - IF (ReadBuffer('BBSME')) THEN - BEGIN - AllowContinue := TRUE; - Abort := FALSE; - PrintF('BBSEH'); - OnRec := 1; - WHILE (OnRec <= FileSize(BBSListFile)) AND (NOT Abort) AND (NOT HangUp) DO - BEGIN - Seek(BBSListFile,(OnRec - 1)); - Read(BBSListFile,BBSList); - DisplayBuffer(BBSListMCI,@BBSList,Data2); - Inc(OnRec); - END; - IF (NOT Abort) THEN - PrintF('BBSET'); - AllowContinue := FALSE; - PauseScr(FALSE); - SysOpLog('Viewed the BBS Listing.'); - END; - Close(BBSListFile); - LastError := IOResult; - END; -END; - -END. +{$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S+,V-} + +UNIT BBSList; + +INTERFACE + +PROCEDURE BBSList_Add; +PROCEDURE BBSList_Delete; +PROCEDURE BBSList_Edit; +PROCEDURE BBSList_View; +PROCEDURE BBSList_xView; + +IMPLEMENTATION + +USES + Common, + TimeFunc; + +FUNCTION BBSListMCI(CONST S: ASTR; Data1,Data2: Pointer): STRING; +VAR + BBSListPtr: ^BBSListRecordType; + User: UserRecordType; + TmpStr : String; +BEGIN + BBSListPtr := Data1; + BBSListMCI := S; + CASE S[1] OF + 'X' : CASE S[2] OF + 'A' : BBSListMCI := BBSListPtr^.SDA; + 'B' : BBSListMCI := BBSListPtr^.SDB; + 'C' : BBSListMCI := BBSListPtr^.SDC; + 'D' : BBSListMCI := BBSListPtr^.SDD; + 'E' : BBSListMCI := BBSListPtr^.SDE; + 'F' : BBSListMCI := BBSListPtr^.SDF; + END; + 'A' : CASE S[2] OF + 'C' : + Begin + If (Length(BBSListPtr^.PhoneNumber) > 0) Then + Begin + TmpStr := BBSListPtr^.PhoneNumber; + Delete(TmpStr,4,Length(TmpStr)); + BBSListMCI := TmpStr; + End + Else + Begin + BBSListMCI := 'N/A'; + End; + End; + END; + 'B' : CASE S[2] OF + 'N' : BBSListMCI := BBSListPtr^.BBSName; + 'P' : BBSListMCI := IntToStr(BBSListPtr^.Port); + END; + 'D' : CASE S[2] OF + 'A' : BBSListMCI := Pd2Date(BBSListPtr^.DateAdded); + 'E' : BBSListMCI := Pd2Date(BBSListPtr^.DateEdited); + 'S' : BBSListMCI := BBSListPtr^.Description; + '2' : BBSListMCI := BBSListPtr^.Description2 + END; + 'L' : CASE S[2] OF + 'O' : BBSListMCI := BBSListPtr^.Location; + END; + 'H' : CASE S[2] OF + 'R' : BBSListMCI := BBSListPtr^.Hours; + END; + 'M' : CASE S[2] OF + 'N' : BBSListMCI := IntToStr(BBSListPtr^.MaxNodes); + END; + 'O' : CASE S[2] OF + 'S' : Begin + If (Length(BBSListPtr^.OS) > 0) Then + BBSListMCI := BBSListPtr^.OS + Else + BBSListMCI := 'Unknown'; + End; + END; + 'P' : CASE S[2] OF + 'N' : Begin + If (Length(BBSListPtr^.PhoneNumber) > 0) Then + BBSListMCI := BBSListPtr^.PhoneNumber + Else + BBSListMCI := 'None'; + End; + END; + 'R' : CASE S[2] OF + 'N' : BBSListMCI := IntToStr(BBSListPtr^.RecordNum); + END; + 'S' : CASE S[2] OF + 'A' : BBSListMCI := BBSListPtr^.SDA; + 'B' : BBSListMCI := BBSListPtr^.SDB; + 'C' : BBSListMCI := BBSListPtr^.SDC; + 'D' : BBSListMCI := BBSListPtr^.SDD; + 'E' : BBSListMCI := BBSListPtr^.SDE; + 'F' : BBSListMCI := BBSListPtr^.SDF; + 'G' : BBSListMCI := IntToStr(BBSListPtr^.SDG); + 'H' : BBSListMCI := ShowYesNo(BBSListPtr^.SDH); + 'I' : BBSListMCI := ShowYesNo(BBSListPtr^.SDI); + 'N' : BBSListMCI := BBSListPtr^.SysOpName; + 'P' : BBSListMCI := BBSListPtr^.Speed; + 'T' : Begin + IF (Length(BBSListPtr^.Birth) > 0) THEN + BBSListMCI := BBSListPtr^.Birth + ELSE + BBSListMCI := 'Unknown'; + End; + 'V' : Begin + If (Length(BBSListPtr^.SoftwareVersion) > 0) Then + Begin + BBSListMCI := BBSListPtr^.SoftwareVersion; + End + Else + Begin + BBSListMCI := 'Unknown'; + End; + End; + 'W' : BBSListMCI := BBSListPtr^.Software; + END; + 'T' : CASE S[2] OF + 'N' : BBSListMCI := BBSListPtr^.TelnetUrl; + END; + 'U' : CASE S[2] OF + 'N' : BEGIN + LoadURec(User,BBSListPtr^.UserID); + BBSListMCI := User.Name; + END; + END; + 'W' : CASE S[2] OF + 'S' : BBSListMCI := BBSListPtr^.WebSiteUrl; + END; + END; +END; + +PROCEDURE BBSListScriptFile(VAR BBSList: BBSListRecordType); +VAR + BBSScriptText: TEXT; + Question: STRING; + WhichOne: String; + TmpBirth: String[10]; +BEGIN + Assign(BBSScriptText,General.MiscPath+'BBSLIST.SCR'); + Reset(BBSScriptText); + WHILE NOT EOF(BBSScriptText) AND (NOT Abort) AND (NOT HangUp) DO + BEGIN + ReadLn(BBSScriptText,Question); + IF (Question[1] = '[') THEN + BEGIN + WhichOne := AllCaps(Copy(Question, Pos('[',Question)+1, Pos(']',Question)-2)); + Question := Copy(Question,(Pos(':',Question) + 1),Length(Question)); + + IF (WhichOne = 'BBSNAME') THEN + BEGIN + NL; + PRT(Question+' '); + MPL(SizeOf(BBSList.BBSName) - 1); + InputMain(BBSList.BBSName,(SizeOf(BBSList.BBSName) - 1),[InterActiveEdit,ColorsAllowed]); + Abort := (BBSList.BBSName = ''); + END + ELSE IF WhichOne = 'SYSOPNAME' THEN + BEGIN + PRT(Question+' '); + MPL(SizeOf(BBSList.SysOpName) - 1); + InputMain(BBSList.SysOpName,(SizeOf(BBSList.SysOpName) - 1),[ColorsAllowed,InterActiveEdit]); + Abort := (BBSList.SysOpName = ''); + END + ELSE IF WhichOne = 'TELNETURL' THEN + BEGIN + Prt(Question+' '); + MPL(SizeOf(BBSList.TelnetUrl) - 1); + InputMain(BBSList.TelnetUrl,(SizeOf(BBSList.TelnetUrl) - 1),[ColorsAllowed,InterActiveEdit]); + Abort := (BBSList.TelnetUrl = ''); + END + ELSE IF WhichOne = 'WEBSITEURL' THEN + BEGIN + Prt(Question+' '); + MPL(SizeOf(BBSList.WebSiteUrl) - 1); + InputMain(BBSList.WebSiteUrl,(SizeOf(BBSList.WebSiteUrl) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.WebSiteUrl = '');} + END + ELSE IF WhichOne = 'PHONENUMBER' THEN + BEGIN + PRT(Question+' '); + MPL(SizeOf(BBSList.PhoneNumber) - 1); + InputMain(BBSList.PhoneNumber,(SizeOf(BBSList.PhoneNumber) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.PhoneNumber = '');} + END + ELSE IF WhichOne = 'SOFTWARE' THEN + BEGIN + PRT(Question+' '); + MPL(SizeOf(BBSList.Software) - 1); + InputMain(BBSList.Software,(SizeOf(BBSList.Software) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.Software = '');} + END + ELSE IF WhichOne = 'SOFTWAREVERSION' THEN + BEGIN + Prt(Question+' '); + MPL(SizeOf(BBSList.SoftwareVersion) - 1); + InputMain(BBSList.SoftwareVersion,(SizeOf(BBSList.SoftwareVersion) - 1),[ColorsAllowed,InterActiveEdit]); + END + ELSE IF WhichOne = 'OS' THEN + BEGIN + Prt(Question+' '); + MPL(SizeOf(BBSList.OS) - 1); + InputMain(BBSList.OS,(SizeOf(BBSList.OS) - 1),[ColorsAllowed,InterActiveEdit]); + END + ELSE IF WhichOne = 'SPEED' THEN + BEGIN + PRT(Question+' '); + MPL(SizeOf(BBSList.Speed) - 1); + InputMain(BBSList.Speed,(SizeOf(BBSList.Speed) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.Speed = '');} + END + ELSE IF WhichOne = 'HOURS' THEN + BEGIN + PRT(Question+' '); + MPL(SizeOf(BBSList.Hours) - 1); + InputMain(BBSList.Hours,(SizeOf(BBSList.Hours) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.Speed = '');} + END + ELSE IF WhichOne = 'DESCRIPTION' THEN + BEGIN + Prt(Question); + MPL(SizeOf(BBSList.Description) - 1); + InputMain(BBSList.Description,(SizeOf(BBSList.Description) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.Description = '');} + END + ELSE IF WhichOne = 'DESCRIPTION2' THEN + BEGIN + Prt(Question); + MPL(SizeOf(BBSList.Description2) - 1); + InputMain(BBSList.Description2,(SizeOf(BBSList.Description2) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.Description2 = '');} + END + ELSE IF WhichOne = 'MAXNODES' THEN + BEGIN + + MPL(SizeOf(BBSList.MaxNodes) - 1); + IF (BBSList.MaxNodes = 0) THEN + BBSList.MaxNodes := 5; + InputLongIntWoc(Question,BBSList.MaxNodes,[NumbersOnly,InteractiveEdit],1,1000); + + END + ELSE IF WhichOne = 'PORT' THEN + BEGIN + IF (BBSList.Port = 0) THEN + BBSList.Port := 23; + MPL(SizeOf(BBSList.Port) - 1); + + InputWordWoc(Question,BBSList.Port,[NumbersOnly,InterActiveEdit],1,65535); + END + ELSE IF WhichOne = 'LOCATION' THEN + BEGIN + Prt(Question+' '); + MPL(SizeOf(BBSList.Location) - 1); + InputMain(BBSList.Location,(SizeOf(BBSList.Location) - 1),[ColorsAllowed,InterActiveEdit]); + END + ELSE IF WhichOne = 'BIRTH' THEN + BEGIN + TmpBirth := BBSList.Birth; + IF (Length(TmpBirth) < 10) THEN + TmpBirth := '12/31/1969'; + MPL(10); + InputFormatted(Question+' |08(|07'+TmpBirth+'|08) |15: ',BBSList.Birth,'##/##/####',TRUE); + IF (Length(BBSList.Birth) <= 0) THEN + BBSList.Birth := TmpBirth; + + END + ELSE IF WhichOne = 'SDA' THEN + BEGIN + Prt(Question+' '); + MPL(SizeOf(BBSList.SDA) - 1); + InputMain(BBSList.SDA,(SizeOf(BBSList.SDA) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.xA = '');} + END + ELSE IF WhichOne = 'SDB' THEN + BEGIN + Prt(Question+' '); + MPL(SizeOf(BBSList.SDB) - 1); + InputMain(BBSList.SDB,(SizeOf(BBSList.SDB) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.xB = '');} + END + ELSE IF WhichOne = 'SDC' THEN + BEGIN + Prt(Question+' '); + MPL(SizeOf(BBSList.SDC) - 1); + InputMain(BBSList.SDC,(SizeOf(BBSList.SDC) - 1),[ColorsAllowed,InterActiveEdit]); + { Abort := (BBSList.xC = ''); } + END + ELSE IF WhichOne = 'SDD' THEN BEGIN + Prt(Question+' '); + MPL(SizeOf(BBSList.SDD) - 1); + InputMain(BBSList.SDD,(SizeOf(BBSList.SDD) - 1),[ColorsAllowed,InterActiveEdit]); + { Abort := (BBSList.xD = '');} + END + ELSE IF WhichOne = 'SDE' THEN + BEGIN + Print(Question); + MPL(SizeOf(BBSList.SDE) - 1); + InputMain(BBSList.SDE,(SizeOf(BBSList.SDE) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.xE = '');} + END + ELSE IF WhichOne = 'SDF' THEN + BEGIN + Print(Question); + MPL(SizeOf(BBSList.SDF) - 1); + InputMain(BBSList.SDF,(SizeOf(BBSList.SDF) - 1),[ColorsAllowed,InterActiveEdit]); + {Abort := (BBSList.xF = '');} + END + ELSE IF WhichOne = 'SDG' THEN + BEGIN + + MPL(SizeOf(BBSList.SDG) - 1); + InputWordWoc(Question,BBSList.SDG,[NumbersOnly,InterActiveEdit],1,65535); + {Abort := (BBSList.xE = '');} + END + ELSE IF WhichOne = 'SDH' THEN + BEGIN + BBSList.SDH := PYNQ(Question+' ',0,TRUE); + END + ELSE IF WhichOne = 'SDI' THEN + BEGIN + BBSList.SDI := PYNQ(Question+' ',6,FALSE); + END; + END; + END; + Close(BBSScriptText); + LastError := IOResult; +END; + +FUNCTION BBSList_Exists: Boolean; +VAR + BBSListFile: FILE OF BBSListRecordType; + FSize: Longint; + FExist: Boolean; +BEGIN + FSize := 0; + FExist := Exist(General.DataPath+'BBSLIST.DAT'); + IF (FExist) THEN + BEGIN + Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); + Reset(BBSListFile); + FSize := FileSize(BBSListFile); + Close(BBSListFile); + END; + IF (NOT FExist) OR (FSize = 0) THEN + BEGIN + NL; + Print('There are currently no entries in the BBS List.'); + SysOpLog('The BBSLIST.DAT file is missing.'); + END; + BBSList_Exists := (FExist) AND (FSize <> 0); +END; + +PROCEDURE DisplayError(FName: ASTR; VAR FExists: Boolean); +BEGIN + NL; + PrintACR('|12ú |09The '+FName+'.* File is missing.'); + PrintACR('|12ú |09Please, inform the Sysop!'); + SysOpLog('The '+FName+'.* file is missing.'); + FExists := FALSE; +END; + +FUNCTION BBSListScript_Exists: Boolean; +VAR + FExists: Boolean; +BEGIN + FExists := Exist(General.MiscPath+'BBSLIST.SCR'); + IF (NOT FExists) THEN + DisplayError('BBSLIST.SCR',FExists); + BBSListScript_Exists := FExists; +END; + +FUNCTION BBSListAddScreens_Exists: Boolean; +VAR + FExistsH, + FExistsN, + FExistsT: Boolean; +BEGIN + FExistsH := TRUE; + FExistsN := TRUE; + FExistsT := TRUE; + IF (NOT ReadBuffer('BBSNH')) THEN + DisplayError('BBSNH',FExistsH); + IF (NOT ReadBuffer('BBSMN')) THEN + DisplayError('BBSMN',FExistsN); + IF (NOT ReadBuffer('BBSNT')) THEN + DisplayError('BBSNT',FExistsT); + BBSListAddScreens_Exists := (FExistsH) AND (FExistsN) AND (FExistsT); +END; + +FUNCTION BBSListEditScreens_Exists: Boolean; +VAR + FExistsT, + FExistsM: Boolean; +BEGIN + FExistsT := TRUE; + FExistsM := TRUE; + IF (NOT ReadBuffer('BBSLET')) THEN + DisplayError('BBSLET',FExistsT); + IF (NOT ReadBuffer('BBSLEM')) THEN + DisplayError('BBSLEM',FExistsM); + BBSListEditScreens_Exists := (FExistsT) AND (FExistsM); +END; + +PROCEDURE BBSList_Renumber; +VAR + BBSListFile: FILE OF BBSListRecordType; + BBSList: BBSListRecordType; + OnRec: Longint; +BEGIN + Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); + Reset(BBSListFile); + Abort := FALSE; + OnRec := 1; + WHILE (OnRec <= FileSize(BBSListFile)) DO + BEGIN + Seek(BBSListFile,(OnRec - 1)); + Read(BBSListFile,BBSList); + BBSList.RecordNum := OnRec; + Seek(BBSListFile,(OnRec - 1)); + Write(BBSListFile,BBSList); + Inc(OnRec); + END; + Close(BBSListFile); + LastError := IOResult; +END; + +PROCEDURE BBSList_Sort; +VAR + BBSListFile: FILE OF BBSListRecordType; + BBSList1, + BBSList2: BBSListRecordType; + S, + I, + J, + pl, + Gap: INTEGER; +BEGIN + IF (BBSList_Exists) THEN + BEGIN + Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); + Reset(BBSListFile); + pl := FileSize(BBSListFile); + Gap := pl; + REPEAT; + Gap := (Gap DIV 2); + IF (Gap = 0) THEN + Gap := 1; + s := 0; + FOR I := 1 TO (pl - Gap) DO + BEGIN + J := (I + Gap); + Seek(BBSListFile,(i - 1)); + Read(BBSListFile,BBSList1); + Seek(BBSListFile,(j - 1)); + Read(BBSListFile,BBSList2); + IF (BBSList1.BBSName > BBSList2.BBSName) THEN + BEGIN + Seek(BBSListFile,(i - 1)); + Write(BBSListFile,BBSList2); + Seek(BBSListFile,(j - 1)); + Write(BBSListFile,BBSList1); + Inc(s); + END; + END; + UNTIL (s = 0) AND (Gap = 1); + Close(BBSListFile); + LastError := IOResult; + IF (PL > 0) THEN + BEGIN + NL; + Print('Sorted '+IntToStr(pl)+' BBS List entries.'); + SysOpLog('Sorted the BBS Listing'); + END; + END; +END; + +PROCEDURE BBSList_Add; +VAR + Data2: Pointer; + BBSList: BBSListRecordType; +BEGIN + IF (BBSListScript_Exists) AND (BBSListAddScreens_Exists) THEN + BEGIN + NL; + IF PYNQ(' Add an entry to the BBS list? ',0,FALSE) THEN + BEGIN + FillChar(BBSList,SizeOf(BBSList),0); + BBSListScriptFile(BBSList); + IF (NOT Abort) THEN + BEGIN + PrintF('BBSNH'); + ReadBuffer('BBSMN'); + DisplayBuffer(BBSListMCI,@BBSList,Data2); + PrintF('BBSNT'); + NL; + IF (PYNQ(' Save '+BBSList.BBSName+'? ',0,TRUE)) THEN + BEGIN + Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); + IF (Exist(General.DataPath+'BBSLIST.DAT')) THEN + Reset(BBSListFile) + ELSE + Rewrite(BBSListFile); + Seek(BBSListFile,FileSize(BBSListFile)); + BBSList.UserID := UserNum; + BBSList.DateAdded := GetPackDateTime; + BBSList.DateEdited := BBSList.DateAdded; + BBSList.RecordNum := (FileSize(BBSListFile) + 1); + Write(BBSListFile,BBSList); + Close(BBSListFile); + LastError := IOResult; + BBSList_Sort; + BBSList_Renumber; + SysOpLog('Added BBS Listing: '+BBSList.BBSName+'.'); + END; + END; + END; + END; +END; + +PROCEDURE BBSList_Delete; +VAR + Data2: Pointer; + BBSList: BBSListRecordType; + OnRec, + RecNum: Longint; + Found: Boolean; +BEGIN + IF (BBSList_Exists) AND (BBSListEditScreens_Exists) THEN + BEGIN + AllowContinue := FALSE; + Found := FALSE; + Abort := FALSE; + Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); + Reset(BBSListFile); + OnRec := 1; + WHILE (OnRec <= FileSize(BBSListFile)) AND (NOT Abort) AND (NOT HangUp) DO + BEGIN + Seek(BBSListFile,(OnRec - 1)); + Read(BBSListFile,BBSList); + IF (BBSList.UserID = UserNum) OR (CoSysOp) THEN + BEGIN + PrintF('BBSLDT'); + ReadBuffer('BBSLEM'); + DisplayBuffer(BBSListMCI,@BBSList,Data2); + NL; + IF (PYNQ(' Delete '+BBSLIST.BBSName+'? ',0,FALSE)) THEN + BEGIN + SysOpLog('Deleted BBS Listing: '+BBSList.BBSName+'.'); + IF ((OnRec - 1) <= (FileSize(BBSListFile) - 2)) THEN + FOR RecNum := (OnRec - 1) TO (FileSize(BBSListFile) - 2) DO + BEGIN + Seek(BBSListFile,(RecNum + 1)); + Read(BBSListFile,BBSList); + Seek(BBSListFile,RecNum); + Write(BBSListFile,BBSList); + END; + Seek(BBSListFile,(FileSize(BBSListFile) - 1)); + Truncate(BBSListFile); + Dec(OnRec); + END; + Found := TRUE; + END; + Inc(OnRec); + END; + Close(BBSListFile); + LastError := IOResult; + BBSList_ReNumber; + IF (NOT Found) THEN + BEGIN + NL; + Print(' You may only delete BBS Listing''s that you have entered.'); + SysOpLog('Tried to delete a BBS Listing.'); + END; + END; +END; + +PROCEDURE BBSList_Edit; +VAR + Data2: Pointer; + BBSList: BBSListRecordType; + OnRec: Longint; + Found: Boolean; + Edit : LongInt; +BEGIN + IF (BBSList_Exists) AND (BBSListEditScreens_Exists) AND (BBSListAddScreens_Exists) THEN + BEGIN + Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); + Reset(BBSListFile); + AllowContinue := FALSE; + Found := FALSE; + Abort := FALSE; + OnRec := 1; + WHILE (NOT Abort) AND (NOT HangUp) DO + BEGIN + + PrintF('BBSLEDT'); + ReadBuffer('BBSLEM'); + While OnRec <= FileSize(BBSListFile) Do + Begin + Seek(BBSListFile, OnRec -1); + Read(BBSListFile,BBSList); + DisplayBuffer(BBSListMCI,@BBSList,Data2); + Inc(OnRec); + End; + + NL; + MPL(FileSize(BBSListFile)); + InputLongIntWOC(' Edit which BBS? :',Edit,[],1,FileSize(BBSListFile)); + + Abort := (Edit <> 0 ); + + IF (Edit <= FileSize(BBSListFile)) AND (Edit > 0) THEN + BEGIN + Seek(BBSListFile,(Edit -1)) + END + ELSE + BEGIN + Close(BBSListFile); + Exit; + END; + Read(BBSListFile,BBSList); + IF (BBSList.UserID = UserNum) OR (CoSysOp) OR (BBSList.SysopName = ThisUser.Name) THEN + BEGIN + PrintF('BBSLEH'); + ReadBuffer('BBSLEM'); + DisplayBuffer(BBSListMCI,@BBSList,Data2); + NL; + IF (PYNQ(' |03Would you like to edit this BBS Listing? |11',0,TRUE)) THEN + + BEGIN + BBSListScriptFile(BBSList); + IF (NOT Abort) THEN + BEGIN + PrintF('BBSNH'); + ReadBuffer('BBSMN'); + DisplayBuffer(BBSListMCI,@BBSList,Data2); + PrintF('BBSNT'); + NL; + IF (PYNQ(' |03Would you like to save this BBS Listing? |11',0,TRUE)) THEN + BEGIN + Seek(BBSListFile,(Edit -1)); + BBSList.DateEdited := GetPackDateTime; + Write(BBSListFile,BBSList); + SysOpLog('Edited BBS Listing: '+BBSList.BBSName+'.'); + END; + END; + END; + Found := TRUE; + END; + {Inc(OnRec);} + Exit; + END; + Close(BBSListFile); + LastError := IOResult; + IF (NOT Found) THEN + BEGIN + NL; + Print(' You may only edit BBS Listing''s that you have entered.'); + SysOpLog('Tried to edit a BBS Listing.'); + END; + END; +END; + +PROCEDURE BBSList_View; +VAR + Data2: Pointer; + BBSList: BBSListRecordType; + OnRec: Longint; + Cnt : Byte; +BEGIN + + IF (BBSList_Exists) AND (BBSListAddScreens_Exists) THEN + BEGIN + Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); + Reset(BBSListFile); + ReadBuffer('BBSMN'); + AllowContinue := TRUE; + Abort := FALSE; + PrintF('BBSNH'); + OnRec := 1; + Cnt := 1; + WHILE (OnRec <= FileSize(BBSListFile)) AND (NOT Abort) AND (NOT HangUp) DO + BEGIN + Seek(BBSListFile,(OnRec - 1)); + Read(BBSListFile,BBSList); + DisplayBuffer(BBSListMCI,@BBSList,Data2); + Inc(OnRec); + Inc(Cnt); + If Cnt = (23 - 4) Then + Begin + PauseScr(True); + Cnt := 1; + End + Else + Begin + Cnt := Cnt; + End; + END; + Close(BBSListFile); + LastError := IOResult; + IF (NOT Abort) THEN + PrintF('BBSNT'); + AllowContinue := FALSE; + SysOpLog('Viewed the BBS Listing.'); + END; +END; + +PROCEDURE BBSList_xView; (* Do we need xview *) {Yes -sk} +VAR + Data2: Pointer; + BBSList: BBSListRecordType; + OnRec: Longint; + Edit : Longint; +BEGIN + IF (BBSList_Exists) THEN (* Add BBSME & BBSEH exist checking here *) + BEGIN + Assign(BBSListFile,General.DataPath+'BBSLIST.DAT'); + Reset(BBSListFile); + + PrintF('BBSLEH'); + ReadBuffer('BBSLEM'); + OnRec := 1; + While OnRec <= FileSize(BBSListFile) Do + Begin + Seek(BBSListFile, OnRec -1); + Read(BBSListFile,BBSList); + DisplayBuffer(BBSListMCI,@BBSList,Data2); + Inc(OnRec); + End; + PrintF('BBSLET'); + NL; + MPL(FileSize(BBSListFile)); + InputLongIntWOC(' View which BBS? :',Edit,[],1,FileSize(BBSListFile)); + + Abort := (Edit <> 0 ); + + IF (Edit <= FileSize(BBSListFile)) AND (Edit > 0) THEN + BEGIN + Seek(BBSListFile,(Edit -1)); + Read(BBSListFile,BBSList); + Close(BBSListFile); + END + ELSE + BEGIN + Close(BBSListFile); + Exit; + END; + + IF (ReadBuffer('BBSME')) THEN + BEGIN + AllowContinue := TRUE; + Abort := FALSE; + PrintF('BBSEH'); + WHILE (NOT Abort) AND (NOT HangUp) DO + BEGIN + DisplayBuffer(BBSListMCI,@BBSList,Data2); + PrintF('BBSET'); + AllowContinue := FALSE; + {PauseScr(FALSE);} + SysOpLog('Viewed Extended BBS Listing of '+BBSList.BBSName+'.'); + Exit; + END; + + + END; + {Close(BBSListFile);} + LastError := IOResult; + END; +END; + +END. diff --git a/SOURCE/RECORDS.PAS b/SOURCE/RECORDS.PAS index 0490e34..10ec8e2 100644 --- a/SOURCE/RECORDS.PAS +++ b/SOURCE/RECORDS.PAS @@ -932,25 +932,36 @@ TYPE BBSListRecordType = { *.BBS file records } {$IFDEF WIN32} PACKED {$ENDIF} RECORD - RecordNum: LongInt; { Number OF the Record For Edit } - UserID: LongInt; { User ID OF person adding this } - BBSName: STRING[30]; { Name OF BBS } - SysOpName: STRING[30]; { SysOp OF BBS } - TelnetUrl: STRING[60]; { Telnet Urls } - WebSiteUrl: STRING[60]; { Web Site Url } - PhoneNumber: STRING[20]; { Phone number OF BBS } - Software: STRING[8]; { Software used by BBS } - Speed: STRING[8]; { Highest connect speed OF BBS } - Description: STRING[60]; { Description OF BBS } - Description2: STRING[60]; { Second line OF descrition } - DateAdded: UnixTime; { Date entry was added } - DateEdited: UnixTime; { Date entry was last edited } - XA: STRING[8]; { sysop definable A } - XB: STRING[30]; { sysop definable B } - XC: STRING[30]; { sysop definable C } - XD: STRING[40]; { sysop definable D } - XE: STRING[60]; { sysop definable E } - XF: STRING[60]; { sysop definable F } + RecordNum, { Number OF the Record For Edit } + UserID, { User ID OF person adding this } + MaxNodes : LongInt; { Maximum Number Of Nodes } + Port : Word; { Telnet Port } + BBSName : STRING[30]; { Name OF BBS } + SysOpName : STRING[30]; { SysOp OF BBS } + TelnetUrl : STRING[60]; { Telnet Urls } + WebSiteUrl : STRING[60]; { Web Site Url } + PhoneNumber : STRING[20]; { Phone number OF BBS } + Location : STRING[30]; { Location of BBS } + Software, { Software used by BBS } + SoftwareVersion : String[12]; { Software Version of BBS } + OS : STRING[20]; { Operating System of BBS } + Speed : STRING[8]; { Highest connect speed OF BBS } + Hours : STRING[20]; { Hours of Operation } + Birth : STRING[10]; { When the BBS Began } + Description : STRING[60]; { Description OF BBS } + Description2 : STRING[60]; { Second line OF descrition } + DateAdded : UnixTime; { Date entry was added } + DateEdited : UnixTime; { Date entry was last edited } + SDA : STRING[8]; { sysop definable A } + SDB : STRING[30]; { sysop definable B } + SDC : STRING[30]; { sysop definable C } + SDD : STRING[40]; { sysop definable D } + SDE : STRING[60]; { sysop definable E } + SDF : STRING[60]; { sysop definable F } + SDG : Word; { sysop definable G } + SDH, { sysop definable H } + SDI : Boolean; { sysop definable I } + END; MenuFlagType = diff --git a/SOURCE/UPGRADE/BBSLIST.SCR b/SOURCE/UPGRADE/BBSLIST.SCR new file mode 100644 index 0000000..c475c19 --- /dev/null +++ b/SOURCE/UPGRADE/BBSLIST.SCR @@ -0,0 +1,61 @@ +# +# This is an example of a bbslist template. +# +# Anything after a '#' is considered a comment and is ignored. +# Anything That doesn't begin with a [ is ignored. +# +# [BBSName]: BBS Name +# [SysOpName]: Sysop Name +# [MaxNodes]: Max Nodes +# [Port]: Telnet Port +# [TelnetUrl]: Telnet Url +# [WebSiteUrl]: Website +# [PhoneNumber]: BBS Phone Number +# [Location]: Location of BBS +# [Software]: BBS Software Used +# [SoftwareVersion]: BBS Software Version +# [OS]: Operating System of BBS +# [Speed]: Speed of the BBS +# [Hours]: Hours of Operation +# [Birth]: When the bbs started +# [Description]: Description +# [Description2]: Description 2 +# [SDA]: SysOp Definable String 8 +# [SDB]: SysOp Definable String 30 +# [SDC]: SysOp Definable String 30 +# [SDD]: SysOp Definable String 40 +# [SDE]: SysOp Definable String 60 +# [SDF]: SysOp Definable String 60 +# [SDG]: SysOp Definable Number +# [SDH]: SysOp Definable Yes/No (Default Yes) +# [SDI]: SysOp Definable Yes/No (Default No) + + + +# if you want to ask the questions in a certain order change the order. +# if you don't want to ask a question then leave it out. +# +# MCI and Pipe Color Codes are allowed in the question. +# +# Start BBS List Questions +# +[BBSName]:%DFAEBBS%%LF |03Enter the Name of BBS |15:|11 +[SysOpName]:%LF |03What is the Sysop of this BBS name? |15:|11 +[TelnetUrl]:%LF |03What is the Telnet Address of the BBS?%LF |15:|11 +[Port]:%LF |03What port can this BBS be reached at? |15:|08 +[WebSiteUrl]:%LF |03What is the web address of the BBS?%LF |15:|11 +[PhoneNumber]:%DFAEBBS%%LF |03BBS Phone Number |08(|07if any|08) |15:|11 +[Location]:%LF |03What is the location of this BBS? |15:|11 +[Software]:%LF |03What Software does this BBS use? |15:|11 +[SoftwareVersion]:%LF |03Software Version? |15:|11 +[OS]:%LF |03Operating System? |15:|11 +[MaxNodes]:%LF |03How Many Nodes? |15:|08 +[Speed]:%DFAEBBS%%LF |03What is the Speed of the BBS? |08(|072400, 56700, Telnet|08) |15:|11 +[Hours]:%LF |03What hours does this bbs run? |08(|0724/7 |08.. |076am-3pm|08) |15:|11 +[Birth]:%LF |03When did this bbs start? +[Description]:%LF |03Enter a small description of the BBS 60 Chars Max. 2 Lines%LF |15 : |11 +[Description2]: |15: |11 +#[SDG]:%LF |03Number Test? |15:|08 +#[SDH]:%LF |03BBS Is 24/7? |15:|11 +#[SDI]:%LF |03Private Nodes? |15:|11 + diff --git a/SOURCE/UPGRADE/FIXBBSL.PAS b/SOURCE/UPGRADE/FIXBBSL.PAS new file mode 100644 index 0000000..402be6d --- /dev/null +++ b/SOURCE/UPGRADE/FIXBBSL.PAS @@ -0,0 +1,217 @@ +Program FixBBSL; + +Uses + Dos, + Crt, + Common, + BBSList; + +Type + + UnixTime = Longint; + + OldBBSListRecordType = { *.BBS file records } + {$IFDEF WIN32} PACKED {$ENDIF} RECORD + RecordNum : LongInt; { Number OF the Record For Edit } + UserID : LongInt; { User ID OF person adding this } + BBSName : STRING[30]; { Name OF BBS } + SysOpName : STRING[30]; { SysOp OF BBS } + TelnetUrl : STRING[60]; { Telnet Urls } + WebSiteUrl : STRING[60]; { Web Site Url } + PhoneNumber : STRING[20]; { Phone number OF BBS } + Software : STRING[8]; { Software used by BBS } + Speed : STRING[8]; { Highest connect speed OF BBS } + Description : STRING[60]; { Description OF BBS } + Description2 : STRING[60]; { Second line OF descrition } + DateAdded : UnixTime; { Date entry was added } + DateEdited : UnixTime; { Date entry was last edited } + XA : STRING[8]; { sysop definable A } + XB : STRING[30]; { sysop definable B } + XC : STRING[30]; { sysop definable C } + XD : STRING[40]; { sysop definable D } + XE : STRING[60]; { sysop definable E } + XF : STRING[60]; { sysop definable F } + END; + + NewBBSListRecordType = { New *.BBS file records } + {$IFDEF WIN32} PACKED {$ENDIF} RECORD + RecordNum, { Number OF the Record For Edit } + UserID, { User ID OF person adding this } + MaxNodes : LongInt; { Maximum Number Of Nodes } + Port : Word; { Telnet Port } + BBSName : STRING[30]; { Name OF BBS } + SysOpName : STRING[30]; { SysOp OF BBS } + TelnetUrl : STRING[60]; { Telnet Urls } + WebSiteUrl : STRING[60]; { Web Site Url } + PhoneNumber : STRING[20]; { Phone number OF BBS } + Location : STRING[30]; { Location of BBS } + Software, { Software used by BBS } + SoftwareVersion : String[12]; { Software Version of BBS } + OS : STRING[20]; { Operating System of BBS } + Speed : STRING[8]; { Highest connect speed OF BBS } + Hours : STRING[20]; { Hours of Operation } + Birth : STRING[10]; { When The BBS Began } + Description : STRING[60]; { Description OF BBS } + Description2 : STRING[60]; { Second line OF descrition } + DateAdded : UnixTime; { Date entry was added } + DateEdited : UnixTime; { Date entry was last edited } + SDA : STRING[8]; { sysop definable A } + SDB : STRING[30]; { sysop definable B } + SDC : STRING[30]; { sysop definable C } + SDD : STRING[40]; { sysop definable D } + SDE : STRING[60]; { sysop definable E } + SDF : STRING[60]; { sysop definable F } + SDG : Word; { sysop definable G } + SDH, { sysop definable H } + SDI : Boolean; { sysop definable I } + END; + + +Var + + OldBBSFile : File Of OldBBSListRecordType; + OldBBSDat : OldBBSListRecordType; + + BBSFile : File Of NewBBSListRecordType; + BBSDat : NewBBSListRecordType; + + i : Integer; + + TempFile, + Dir, + BBSListDat : String; + + +Function GetDataFile : String; +Var + Old : String; +Begin + GetDir(0,BBSListDat); + BBSListDat := BBSListDat+'\DATA\BBSLIST.DAT'; + GetDir(0,Old); + Old := Old+'\DATA\BBSLIST.OLD'; + If Exist(Old) Then + Begin + WriteLn; + TextColor(12); + Write(' ', Old); + TextColor(4); + WriteLn(' exists. '); + TextColor(7); + WriteLn(' It seems you have already run this program. '); + TextColor(7); + WriteLn(' There is no need to run it again.'); + WriteLn; + Halt; + End + Else If Exist(BBSListDat) Then + Begin + GetDataFile := BBSListDat; + Exit; + End + Else + Begin + WriteLn; + TextColor(12); + Write(' ',BBSListDat); + TextColor(4); + WriteLn(' doesn''t exist'); + TextColor(7); + WriteLn(' Run this from inside your RENEGADE Home Dir.'); + WriteLn; + Halt; + End; +End; + +Begin { Main Program } + +BBSListDat := GetDataFile; { Get BBSLIST.DAT or Quit } + +TempFile := 'DATA\BBSTEMP.DAT'; + + Assign(OldBBSFile, BBSListDat); + Assign(BBSFile, TempFile); + Reset(OldBBSFile); + Rewrite(BBSFile); + Seek(OldBBSFile, 0); + Seek(BBSFile, 0); + WriteLn; + TextColor(3); + Write(' Converting Old BBS Records '); + +For i := 1 to FileSize(OldBBSFile) Do + Begin + Delay(200); + TextColor(11); + Write('.'); + Read(OldBBSFile, OldBBSDat); + + BBSDat.RecordNum := OldBBSDat.RecordNum; + BBSDat.UserID := OldBBSDat.UserID; + BBSDat.BBSName := OldBBSDat.BBSName; + BBSDat.SysOpName := OldBBSDat.SysOpName; + BBSDat.TelnetUrl := OldBBSDat.TelnetUrl; + BBSDat.WebSiteUrl := OldBBSDat.WebSiteUrl; + BBSDat.PhoneNumber := OldBBSDat.PhoneNumber; + BBSDat.Software := OldBBSDat.Software; + BBSDat.Speed := OldBBSDat.Speed; + BBSDat.Description := OldBBSDat.Description; + BBSDat.Description2 := OldBBSDat.Description2; + BBSDat.DateAdded := OldBBSDat.DateAdded; + BBSDat.DateEdited := OldBBSDat.DateEdited; + BBSDat.SDA := OldBBSDat.XA; + BBSDat.SDB := OldBBSDat.XB; + BBSDat.SDC := OldBBSDat.XC; + BBSDat.SDD := OldBBSDat.XD; + BBSDat.SDE := OldBBSDat.XE; + BBSDat.SDF := OldBBSDat.XF; + + Write(BBSFile, BBSDat); + + Seek(OldBBSFile, i); + Seek(BBSFile, i); + + End; +TextColor(3); +WriteLn(' Done!'); + +GetDir(0,Dir); + +WriteLn; +TextColor(3); +Write(' Copying '); +TextColor(11); +Write(Dir,'\DATA\BBSLIST.DAT '); +TextColor(3); +Write('to '); +TextColor(11); +Write(Dir,'\DATA\BBSLIST.OLD '); +TextColor(3); +Write('...'); + +Rename(OldBBSFile,Dir+'\DATA\BBSLIST.OLD'); + +TextColor(3); +WriteLn(' Done!'); + +TextColor(3); +Write(' Moving '); +TextColor(11); +Write(Dir,'\DATA\BBSTEMP.DAT '); +TextColor(3); +Write('to '); +TextColor(11); +Write(Dir,'\DATA\BBSLIST.DAT '); +TextColor(3); +Write('...'); + +Rename(BBSFile,Dir+'\DATA\BBSLIST.DAT'); + +TextColor(3); +WriteLn(' Done!'); +WriteLn; + +Close(OldBBSFile); +Close(BBSFile); + +End. From c7f6d50ba8358b0452facb7ae525c88f15e1c3bf Mon Sep 17 00:00:00 2001 From: sk-5 Date: Sun, 21 Jul 2013 00:47:56 -0700 Subject: [PATCH 2/3] Added BBSLEH.ASC and BBSLEM.ASC for Edit BBS Entry --- SOURCE/UPGRADE/BBSLEH.ASC | 4 ++++ SOURCE/UPGRADE/BBSLEM.ASC | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 SOURCE/UPGRADE/BBSLEH.ASC create mode 100644 SOURCE/UPGRADE/BBSLEM.ASC diff --git a/SOURCE/UPGRADE/BBSLEH.ASC b/SOURCE/UPGRADE/BBSLEH.ASC new file mode 100644 index 0000000..ef566cd --- /dev/null +++ b/SOURCE/UPGRADE/BBSLEH.ASC @@ -0,0 +1,4 @@ +%CL + |08ÚÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³|03 Num |08³|03 BBS Name Last Edited |08³ + ÀÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ diff --git a/SOURCE/UPGRADE/BBSLEM.ASC b/SOURCE/UPGRADE/BBSLEM.ASC new file mode 100644 index 0000000..c595c72 --- /dev/null +++ b/SOURCE/UPGRADE/BBSLEM.ASC @@ -0,0 +1,2 @@ + |12~RN |15~BN |16%LF + From 9afcab24584b429278c9d6cdd03fd3201b4091e3 Mon Sep 17 00:00:00 2001 From: sk-5 Date: Sun, 21 Jul 2013 01:09:13 -0700 Subject: [PATCH 3/3] modified: BBSLIST.PAS new file: UPGRADE/BBSLEDT.ASC modified: UPGRADE/BBSLEH.ASC --- SOURCE/BBSLIST.PAS | 6 +++--- SOURCE/UPGRADE/BBSLEDT.ASC | 4 ++++ SOURCE/UPGRADE/BBSLEH.ASC | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 SOURCE/UPGRADE/BBSLEDT.ASC diff --git a/SOURCE/BBSLIST.PAS b/SOURCE/BBSLIST.PAS index 55d3cfd..d12c084 100644 --- a/SOURCE/BBSLIST.PAS +++ b/SOURCE/BBSLIST.PAS @@ -626,7 +626,7 @@ BEGIN ReadBuffer('BBSLEM'); DisplayBuffer(BBSListMCI,@BBSList,Data2); NL; - IF (PYNQ(' |03Would you like to edit this BBS Listing? |11',0,TRUE)) THEN + IF (PYNQ(' Would you like to edit this BBS Listing? ',0,TRUE)) THEN BEGIN BBSListScriptFile(BBSList); @@ -637,7 +637,7 @@ BEGIN DisplayBuffer(BBSListMCI,@BBSList,Data2); PrintF('BBSNT'); NL; - IF (PYNQ(' |03Would you like to save this BBS Listing? |11',0,TRUE)) THEN + IF (PYNQ(' Would you like to save this BBS Listing? ',0,TRUE)) THEN BEGIN Seek(BBSListFile,(Edit -1)); BBSList.DateEdited := GetPackDateTime; @@ -731,7 +731,7 @@ BEGIN PrintF('BBSLET'); NL; MPL(FileSize(BBSListFile)); - InputLongIntWOC(' View which BBS? :',Edit,[],1,FileSize(BBSListFile)); + InputLongIntWOC(' View which BBS? ',Edit,[],1,FileSize(BBSListFile)); Abort := (Edit <> 0 ); diff --git a/SOURCE/UPGRADE/BBSLEDT.ASC b/SOURCE/UPGRADE/BBSLEDT.ASC new file mode 100644 index 0000000..c4cae12 --- /dev/null +++ b/SOURCE/UPGRADE/BBSLEDT.ASC @@ -0,0 +1,4 @@ +%CL + |03ÚÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³|17|15 Num |16|03³|17|15 BBS Name |11Last Edited |16|03³ + ÀÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ diff --git a/SOURCE/UPGRADE/BBSLEH.ASC b/SOURCE/UPGRADE/BBSLEH.ASC index ef566cd..c4cae12 100644 --- a/SOURCE/UPGRADE/BBSLEH.ASC +++ b/SOURCE/UPGRADE/BBSLEH.ASC @@ -1,4 +1,4 @@ %CL - |08ÚÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ - ³|03 Num |08³|03 BBS Name Last Edited |08³ + |03ÚÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ + ³|17|15 Num |16|03³|17|15 BBS Name |11Last Edited |16|03³ ÀÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ