home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / comms / bbs / bullchec.lha / BullCheck.trans next >
Encoding:
Text File  |  1992-03-06  |  5.5 KB  |  186 lines

  1. /* This procedure checks to see if any of the bulletins have been updated
  2.    since the user last called */
  3.  
  4. BullCheck: Procedure
  5. cls
  6. /* directory to the bulletins */
  7. bulletindir =   'bbs:bulletin/'     /* put path to your bulletins directory here */
  8. NoofBulls = 12                      /* Here, put the total number of bulletins you have */
  9. /* now fill in the actual file names of the bulletins (in the correct order
  10.    as you have them listed in your bulletin.cfg file */
  11. bull.1 = 'policies'
  12. bull.2 = 'bbs_listing'
  13. bull.3 = 'user_poll'
  14. bull.4 = 'scores1.txt'
  15. bull.5 = 'GiTAris.top'
  16. bull.6 = 'scores17b.txt'
  17. bull.7 = 'top-downloaders'
  18. bull.8 = 'top-uploaders'
  19. bull.9 = 'top-message-leavers'
  20. bull.10 = 'top-callers'
  21. bull.11 = 'sewinners'
  22. bull.12 = 'regbbs.txt'
  23. /* Here put the names of the bulletins that you have have listed in your
  24.    bulletin.cmds file */
  25. bullname1 = '1. Rules'
  26. bullname2 = '2. Moose Jaw BBS Listing'
  27. bullname3 = '3. User Poll'
  28. bullname4 = '4. Space Empire scores'
  29. bullname5 = '5. GiTAris Top Ten'
  30. bullname6 = '6. SE 1.7b scores'
  31. bullname7 = '7. Top Leaches'
  32. bullname8 = '8. Top Uploaders'
  33. bullname9 = '9. Top Message Leavers'
  34. bullname10 = '0. Top Callers'
  35. bullname11 = 'L. Lords of the Galaxy'
  36. bullname12 = 'B. Regina BBS List'
  37.  
  38. BCversion = 1.0
  39.  
  40.  
  41. /* check when the user was last on */
  42. userinfo 'f'
  43. userday = LEFT(result,2)
  44. usermonth = CENTRE(result,3)
  45. if usermonth='Jan' then usermonth=01
  46. if usermonth='Feb' then usermonth=02
  47. if usermonth='Mar' then usermonth=03
  48. if usermonth='Apr' then usermonth=04
  49. if usermonth='May' then usermonth=05
  50. if usermonth='Jun' then usermonth=06
  51. if usermonth='Jul' then usermonth=07
  52. if usermonth='Aug' then usermonth=08
  53. if usermonth='Sep' then usermonth=09
  54. if usermonth='Oct' then usermonth=10
  55. if usermonth='Nov' then usermonth=11
  56. if usermonth='Dec' then usermonth=12
  57.  
  58.  
  59. StartMonth = 5112   /* This is the # of days from 1978 to Dec.31, 1991 */
  60.                     /* i.e. Dec. 31, 1991 is 5113 days since sometime in 1978 */
  61.  
  62. transmit 'Bulletin Check, written by Todd Courtnage'
  63. transmit 'Version' BCversion'.  Released on Mar. 6, 1992'
  64. transmit
  65. transmit 'The following bulletins have been updated/added since your last'
  66. transmit 'call to the BBS.  Please read these bulletins, as they may'
  67. transmit 'contain very important, life and death material!!!!'
  68. transmit
  69.  
  70. /* The variables in the following mean:
  71.     d - the number of days that have elapsed since 1978 (sometime in 1978)
  72.         and when the bulletin has been changed.
  73.     Totalday - the total number of days that have elapsed since Jan. 1, 1992
  74.                and when the bulletin has been changed
  75.     Startmonth - this (as defined above) is the number of days between sometime
  76.                  in 1978 and Dec. 31, 1991 (note that this program will
  77.                  only work for this year ... I'm slowly learning ARexx, so
  78.                  a new version will come out that will make it work anytime)
  79.     bullmonth - the month that the bulletin was last changed
  80.     bullday - the date (i.e. the day number) that the bulletin was last changed
  81.     usermonth - the month the user last logged on
  82.     userday - the date the user last logged on
  83.     temp - just a counter */
  84.  
  85. DO temp = 1 TO noofbulls
  86.     PARSE VALUE STATEF(bulletindir||bull.temp) WITH . . . . d . . .
  87.     Totalday = d-startmonth
  88.     call DAYTOMONTH
  89.  
  90.     IF bullmonth > usermonth THEN
  91.         CALL PrintStuff
  92.     ELSE IF bullmonth = usermonth THEN
  93.         IF bullday => userday THEN
  94.             CALL PrintStuff
  95. END
  96.  
  97.  
  98. CONTINUE
  99. RETURN
  100.  
  101. PRINTSTUFF: Procedure expose temp bullname1 bullname2 bullname3 bullname4 bullname5 bullname6 bullname7 bullname8 bullname9 bullname10 bullname11 bullname12
  102.     IF temp = 1 THEN
  103.         transmit bullname1
  104.     If temp = 2 THEN
  105.         transmit bullname2
  106.     IF temp = 3 THEN
  107.         transmit bullname3
  108.     IF temp = 4 THEN
  109.         transmit bullname4
  110.     IF temp = 5 THEN
  111.         transmit bullname5
  112.     IF temp = 6 THEN
  113.         transmit bullname6
  114.     IF temp = 7 THEN
  115.         transmit bullname7
  116.     IF temp = 8 THEN
  117.         transmit bullname8
  118.     IF temp = 9 THEN
  119.         transmit bullname9
  120.     IF temp = 10 THEN
  121.         transmit bullname10
  122.     IF temp = 11 THEN
  123.         transmit bullname11
  124.     IF temp = 12 THEN
  125.         transmit bullname12
  126.  
  127. return
  128.  
  129. /* this procedure will take any number of days from Jan. 1 and calculate
  130.    which month it is in and the date of the month (very crude tho) */
  131.  
  132. DAYTOMONTH: procedure expose Totalday bullday bullmonth
  133.     IF Totalday<31 THEN DO
  134.         bullmonth=01
  135.         bullday=Totalday
  136.         END
  137.     ELSE IF Totalday<60 THEN DO
  138.         bullmonth=02
  139.         bullday=Totalday-31
  140.         END
  141.     ELSE IF Totalday<91 THEN DO
  142.         bullmonth=03
  143.         bullday=Totalday-60
  144.         END
  145.     ELSE IF Totalday<121 THEN DO
  146.         bullmonth=04
  147.         bullday=Totalday-91
  148.         END
  149.     ELSE IF Totalday<152 THEN DO
  150.         bullmonth=05
  151.         bullday=Totalday-121
  152.         END
  153.     ELSE IF Totalday<182 THEN DO
  154.         bullmonth=06
  155.         bullday=Totalday-152
  156.         END
  157.     ELSE IF Totalday<213 THEN DO
  158.         bullmonth=07
  159.         bullday=Totalday-182
  160.         END
  161.     ELSE IF Totalday<244 THEN DO
  162.         bullmonth=08
  163.         bullday=Totalday-213
  164.         END
  165.     ELSE IF Totalday<274 THEN DO
  166.         bullmonth=09
  167.         bullday=Totalday-213
  168.         END
  169.     ELSE IF Totalday<305 THEN DO
  170.         bullmonth=10
  171.         bullday=Totalday-274
  172.         END
  173.     ELSE IF Totalday<335 THEN DO
  174.         bullmonth=11
  175.         bullday=Totalday-305
  176.         END
  177.     ELSE IF Totalday<366 THEN DO
  178.         bullmonth=12
  179.         bullday=Totalday-335
  180.         END
  181.  
  182.         return
  183.  
  184.  
  185.  
  186.