home *** CD-ROM | disk | FTP | other *** search
- ;
- ; NEWS.PPS Display news file, allow editing if conference Sysop and
- ; conference NEWS file is not the same as the NEWS file in
- ; the main conference. "WizOp", sysops w/security of 110+,
- ; may change any NEWS file, main or conference.
-
- ; (C) Copyright 1993, Stan Spotts
- ; Philadelphia Area Computer Society IBM SIG BBS
-
- ; Version 1.0 - 93-08-16
-
- ; This program may be modified and used by anyone as long as credit is given
- ; to the author and the PACS IBM SIG in the source code and documentation.
- ; No fee is required, but it would be appreciated by the author if major
- ; improvements be forwarded to him at the PACS IBM SIG BBS.
-
- ;****************************************************************************
- ; Define variables *
- ;****************************************************************************
-
- INTEGER last, ln, i
- STRING pmt, instr, news(17), confnews, confname, mainnews, cnames, prevoper
- STRING spaces, padding
- ;****************************************************************************
- ; Start of Main PPE program *
- ;****************************************************************************
-
- If (CurSec() >= SysopSec()) Then
- Gosub NewsFile
- If (mainnews = confnews & CurSec() < 110 ) Then
- ; Skip update ability if using main conference news file if not "WizOp"
- KbdStuff "NEWS"+ Chr( 13)
- ElseIf (confnews <> "") Then
- ; If there is a news file specified for the conference,
- ; allow sysop option to update or display
- If (TokCount() > 0) Then
- instr = Upper( GetToken())
- If (instr <> "D" & instr <> "U") Then
- KbdStuff TokenStr()
- instr = ""
- EndIf
- Else
- instr = ""
- EndIf
- If (instr = "") Then
- pmt = "(@TIMELEFT@ min left), (U)pdate, (D)isplay (Enter=D)"
- InputStr pmt, instr, @X0E, 1, "DdUu", LFBEFORE+NEWLINE
- instr = Upper( instr)
- EndIf
- If (instr = "D"|instr = "") Then
- KbdStuff "NEWS"+ Chr( 13)
- ElseIf (instr = "U") Then
- Gosub Update
- Endif
- EndIf
- Else
- KbdStuff "NEWS"+ Chr( 13)
- EndIf
- End
-
- :Update
- RdUNet PCBNode()
- prevoper = UN_Oper()
- WrUNet PCBNode(), UN_Stat(), UN_Name(), UN_City(), "Editing Conference News", ""
- PrintLn
- PrintLn "@X0CNews files can be up to 18 lines of 72 characters each."
- PrintLn "Enter /Q to finish entering news."
- PrintLn
- ln = 0
- last = 18
- Gosub Editor
- instr = "L"
- pmt = "(@TIMELEFT@ min left), (A)bort, (C)ontinue, (L)ist, (S)ave, (Enter=S)"
- While (instr = "L") Do
- InputStr pmt, instr, @X0E, 1, "AaCcLlSs", LFBEFORE+NEWLINE
- instr = Upper( instr)
- If (instr = "S"|instr = "") Then
- Delete confnews
- Fcreate 1, confnews, O_WR, S_DB
- FputLn 1, "@X00@X0B▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄@X0F"
- Fput 1, "@X03█@X3E"
- ; fetch conference name
- confname = ReadLine( cnames, 1 + (curconf() * 33))
- If (curconf() = 0) Then
- confname = confname + " News"
- Else
- confname = confname + " Conference News"
- EndIf
- spaces = (70 - len( confname)) / 2
- padding = (70 - len( confname)) % 2
- Fput 1, space( spaces), confname, space( spaces), space( padding)
- FputLn 1, "@X03█@X0F"
- FputLn 1, "@X01▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀@XFF"
- dec last
- For i = 0 to last
- FputLn 1, news( i)
- Next
- ; Have news file reset to default color after last line
- FputLn 1, news( last+1), "@X", Right( "00" + String( DefColor()), 2)
- Fclose 1
- PrintLn confname, " updated."
- ElseIf (instr = "C") Then
- ln = last
- last = 18
- Gosub Editor
- instr = "L"
- ElseIf (instr = "D") Then
- news( ln) = ""
- ElseIf (instr = "L") Then
- ln = ""
- For i = 0 to last
- PrintLn Right( " "+ String( i+ 1), 2), ": ", news( i)
- Next
- PrintLn
- EndIf
- End While
- WrUNet PCBNode(), UN_Stat(), UN_Name(), UN_City(), prevoper, ""
-
- Return
-
- :Editor
- ; Line "editor"
- While (ln < 18) Do
- InputStr Left( "Ln #"+String( ln+1)+" ", 6) , news( ln), @X0E, 72, Mask_ASCII(),WORDWRAP+NEWLINE
- If (Upper( news( ln)) = "/Q") Then
- news( ln) = ""
- last = ln - 1
- ln = 18
- ElseIf (Upper( news( ln)) = "/D") Then
- news( ln) = ""
- If (ln > 0) Then
- Dec ln
- news( ln) = ""
- EndIf
- Else
- Inc ln
- EndIf
- End While
- Return
-
- :NewsFile
- ; fetch conference data file name
- cnames = ReadLine( PcbDat(), 31)
- ; fetch main news filename for comparison
- mainnews = ReadLine( cnames, 13)
- ; fetch conference news filename
- i = curconf()
- If ( i > 0) then
- confnews = ReadLine( cnames, 13 + (i * 33))
- Else
- confnews = mainnews
- EndIf
- Return
-