home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / WCPOST.ZIP / WCPOST_X.WCC < prev    next >
Text File  |  1994-10-11  |  8KB  |  204 lines

  1. Dim wcPv As String
  2. Dim uRec As UserRecord
  3. Dim Msg As MessageHeader
  4. Dim Selection As String*1
  5. Dim SendOk As Integer
  6. Dim t As Integer
  7. Dim MsgToUsers As String
  8. Dim MsgToUsersOnly As String*10
  9. Dim MsgToUsersNot1 As String*10
  10. Dim MsgToUsersNot2 As String*10
  11. Dim MsgToAll As String
  12. Dim First As String
  13. Dim TodayNow As DateTime
  14. CurrentDateTime(TodayNow)
  15. wcPv = "1.01"
  16. First = ""
  17.  
  18. Open "wcpost.log" For Append As #1
  19. Open "wcpost.err" For Append As #2
  20.  
  21. Function StartLog
  22.    Print #1, "------------------------------------------------------------------------------"
  23.    Print #1, FormatDate(TodayNow.d, "mm/dd/yy") + " " ;
  24.    Print #1, FormatTime(TodayNow.t, "hh:mm:ss") + " " ;
  25.    Print #1, " wcPost v" + wcPv + " Log File, the GREAT Message Poster!"
  26. End Function
  27.  
  28. Function SendUser(MsgHd As MessageHeader) As Integer
  29.    SendUser = False
  30.    Dim Ok As Integer
  31.    Do
  32.      MsgHd.From = "wcPOST v" + wcPv
  33.      MsgHd.To = uRec.Name
  34.      MsgHd.Flags = 1
  35.      MsgHd.Subject = "Auto-Posting from wcPOST"
  36.        Ok = Trim(MsgHd.From + MsgHd.To + MsgHd.Subject) > ""
  37.          If Not(Ok) Then
  38.             Print #2, "There wsa an Error creating the Message to the User!"
  39.          End If
  40.    Loop Until Ok
  41.    SendUser = True
  42. End Function
  43.  
  44. Join 0
  45. StartLog
  46. Do
  47.    CLS
  48.    Locate 4,1
  49.    Print "                  @0F@wcPOST @0E@v@0F@" + wcPv + "@0E@, the Simple Message Poster"
  50.    Print "                        written by, @0F@Stephen Barclay@0E@"
  51.    Print ""
  52.    Print "                   @0E@[@0F@A@0E@] - Send a Message to All Excluding"
  53.    Print "                         Two Different Security Profiles"
  54.    Print "                   @0E@[@0F@B@0E@] - Send a Message to All Excluding"
  55.    Print "                         One Different Security Profile"
  56.    Print "                   @0E@[@0F@C@0E@] - Send a Message to ONE Security Level"
  57.    Print "                   @0E@[@0F@D@0E@] - Send a Message to ALL Users"
  58.    Print "                   @0E@[@0F@E@0E@] - Drop/Shell to DOS"
  59.    Print "                   @0E@[@0F@Q@0E@] - Quit to @0F@" ; MakeWild.BBSName ; "@0E@"
  60.    Print ""
  61.    Print "                 Please Select @0E@[@0F@A,B,C,D,Q@0E@] : " ;
  62.    Input Selection
  63.       Select Case uCase(Selection)
  64.       Case "A"
  65.         CLS
  66.         Locate 2,1
  67.         Print "     wcPOST v" + wcPv + ", Send a Message to All Except TWO Security Levels"
  68.         Locate 5,1
  69.         Print "   This Selection will allow you to send any specified text file"
  70.         Print "to a selected User Security Profile(s).  You may either only send"
  71.         Print "the Message to one Security Level or you may exclude one Security"
  72.         Print "Level.  Please make sure that the Text file you are sending dose"
  73.         Print "exist, and is in a text readable format."
  74.         Print ""
  75.         Locate 12,1
  76.         MsgToUsers = InputMask("Please enter the text file name : ", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
  77.         MsgToUsersNot1 = InputMask("Please enter the first Security Level to exclude : ", "XXXXXXXXXX")
  78.         MsgToUsersNot2 = InputMask("@0F@Please enter the second Security Level to exclude : ", "XXXXXXXXXX")
  79.         SendOk = False
  80.         SendOk = InputYesNo("Do you wish to continue ? ")
  81.         If SendOk = True Then
  82.            If MsgToUsers <> "" And MsgToUsersNot1 <> ""  Then
  83.              If GetUser(uRec, First) Then
  84.                t = 0
  85.                Do While GetNextUser(uRec)
  86.                  If uRec.SecLevel <> MsgToUsersNot1 And uRec.SecLevel <> MsgToUsersNot2 Then
  87.                    If SendUser(Msg) Then
  88.                      AddMessage Msg, MsgToUsers
  89.                      t = t + 1
  90.                      Print #1, "          ! MSGTOUSERS1 sent to : " ; uRec.Name ; ", sucessfully"
  91.                    End If
  92.                  End If
  93.                Loop
  94.                Print ""
  95.                Print "A total of @0B@" ; t ; "@0E@ Message(s) were sent."
  96.                WaitEnter
  97.              End If
  98.            End If
  99.         End If
  100.       Case "B"
  101.         CLS
  102.         Locate 2,1
  103.         Print "    wcPOST v" + wcPv + ", Send a Message to All except One Security Level"
  104.         Locate 5,1
  105.         Print "  This selection will allow you to send a message to All Users except"
  106.         Print "ONE different Security Profile.  This might be hand to send a message"
  107.         Print "to All of your normal Users exculding the NewUsers. "
  108.         Print ""
  109.         Locate 10,1
  110.         MsgToUsers = InputMask("Please enter the text file name : ", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
  111.         MsgToUsersNot1 = InputMask("Please enter the first Security Level to exclude : ", "XXXXXXXXXX")
  112.         SendOk = False
  113.         SendOk = InputYesNo("Do you wish to continue ? ")
  114.         If SendOk = True Then
  115.            If MsgToUsers <> "" And MsgToUsersNot1 <> ""  Then
  116.              If GetUser(uRec, First) Then
  117.                t = 0
  118.                Do While GetNextUser(uRec)
  119.                  If uRec.SecLevel <> MsgToUsersNot1 Then
  120.                    If SendUser(Msg) Then
  121.                      AddMessage Msg, MsgToUsers
  122.                      t = t + 1
  123.                      Print #1, "          ! MSGTOUSERS1 sent to : " ; uRec.Name ; ", sucessfully"
  124.                    End If
  125.                  End If
  126.                Loop
  127.                Print ""
  128.                Print "A total of @0B@" ; t ; "@0E@ Message(s) were sent."
  129.                WaitEnter
  130.              End If
  131.            End If
  132.         End If
  133.       Case "C"
  134.         CLS
  135.         Locate 2,1
  136.         Print "     wcPOST v" + wcPv + ", Send a Message to ONE Security Level Option"
  137.         Locate 5,1
  138.         Print "  This selection will allow you to send a text file to any ONE"
  139.         Print "Security Level you wish.  Pretty simple."
  140.         Print ""
  141.         Locate 10,1
  142.         MsgToUsers = Trim(InputMask("Please enter the text file name : ", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))
  143.         MsgToUsersOnly = Trim(InputMask("Please enter the Security Level to Send the Message to : ", "XXXXXXXXXX"))
  144.         SendOk = False
  145.         SendOk = InputYesNo("Do you wish to continue ?")
  146.         If SendOk = True Then
  147.           If MsgToUsers <> "" And MsgToUsersOnly <> "" Then
  148.             If GetUser(uRec, First) Then
  149.               t = 0
  150.               Do While GetNextUser(uRec)
  151.                 If uRec.SecLevel = MsgToUsersOnly Then
  152.                   If SendUser(Msg) Then
  153.                     AddMessage Msg, MsgToUsers
  154.                     t = t + 1
  155.                     Print #1, "          ! MSGTOALL sent to : " ; uRec.Name ; ", sucessfully"
  156.                   End If
  157.                 End If
  158.               Loop
  159.               Print ""
  160.               Print "A total of @0B@" ; t ; "@0E@ Message(s) were sent."
  161.               WaitEnter
  162.             End If
  163.           End If
  164.         End If
  165.       Case "D"
  166.         Locate 2,1
  167.         Print "      wcPOST v" + wcPv + ", Send a Message to ALL Users at once"
  168.         Locate 5,1
  169.         Print "  This selection allows you to send a message to ALL of your Users"
  170.         Print "at one time.  This is by far the easiest command to use to get more"
  171.         Print "information to ALL of your Users."
  172.         Locate 10,1
  173.         MsgToUsers = InputMask("Please enter the text file name : ", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
  174.         SendOk = False
  175.         SendOk = InputYesNo("Do you wish to continue ? ")
  176.         If SendOk = True Then
  177.            If MsgToUsers <> "" Then
  178.              If GetUser(uRec, First) Then
  179.                t = 0
  180.                Do While GetNextUser(uRec)
  181.                    If SendUser(Msg) Then
  182.                      AddMessage Msg, MsgToUsers
  183.                      t = t + 1
  184.                      Print #1, "          ! MSGTOUSERS1 sent to : " ; uRec.Name ; ", sucessfully"
  185.                    End If
  186.                Loop
  187.                Print ""
  188.                Print "A total of @0B@" ; t ; "@0E@ Message(s) were sent."
  189.                WaitEnter
  190.              End If
  191.            End If
  192.         End If
  193.       Case "E"
  194.         Shell
  195.       Case "Q"
  196.         Exit Do
  197.       Case Else
  198.         Print "Not a valid Selection, please try again."
  199.         Beep
  200.         WaitEnter
  201.       End Select
  202. Loop
  203. Close
  204.