@@ Taisch's simple Bulletin board system @@ 2 Apr 2007 @@ @@ NOTE: set the &list-admins attribute to your own DB #. @create Bulletin Board=10 @lock Bulletin Board=me @Desc Bulletin Board=This is a bulletin board%r(OOC note: Please use or in the subject line when posting.) @@ NOTE: set the &list-admins attribute to your own DB #. &LIST-ADMINS Bulletin Board= @Adesc Bulletin Board=@pemit %#=Type '+bhelp' for commands. &CMD-HELP Bulletin Board=$+bhelp:@pemit %#=[u(text-help)] &CMD-SCAN Bulletin Board=$+bscan:@pemit %#=[repeat(=,79)]%r[space(5)]Title:[space(34)]Author:[space(17)]Date:%r[repeat(-,79)]%r [iter(sort(lattr(me/post-*),n),[u(xformat,get(me/##),##)]%r)][repeat(-,79)]%r +bread to read a note., +bhelp for more info.%r[repeat(=,79)] &CMD-SCANFROM Bulletin Board=$+bscan/from *:@pemit %#=[repeat(=,79)]%r[space(5)]Title:[space(34)]Author:[space(17)]Date:%r[repeat(-,79)]%r [iter(cat(POST-%0,after(sort(lattr(me/post-*),n),POST-%0)),[u(xformat,get(me/##),##)]%r)][repeat(-,79)]%r +bread to read a note., +bhelp for more info.%r[repeat(=,79)] &CMD-READ Bulletin Board=$+bread *:@pemit %#=[switch(hasattr(me,post-%0),0,No such post,[repeat(=,79)]%r[rjust(%0,4)] |[ljust(mid(first(rest(rest(get(me/post-%0),|),|),|),0,39),40)] |[ljust(mid(name(first(get(me/post-%0),|)),0,20),22)][ljust(mid(first(rest(get(me/post-%0),|),|),0,6),8)]%r[repeat(-,79)]%r[rest(rest(rest(get(me/post-%0),|),|),|)]%r[repeat(=,79)])] &CMD-POST Bulletin Board=$+bpost *=*:[setq(0,add(1,last(last(sort(lattr(me/post-*),n)),-)))];&post-[max(1,%q0)] me=%#|[rest(time())]|%0|%1;@pemit %#=You post to the board. &CMD-EDIT Bulletin Board=$+bedit *=*/*:@switch %#=[first(get(me/post-%0),|)],{[setq(0,edit(rest(rest(rest(get(me/post-%0),|),|),|),%1,%2))];&post-%0 me=[extract(get(me/post-%0),1,3,|)]|%q0;@pemit %#=Post now reads:%r%q0;},{@pemit %#=You may only edit your own posts.} &CMD-DELETE Bulletin Board=$+brem *:@switch %#=[first(get(me/post-%0),|)],{&post-%0 me=;@pemit %#=Post deleted.},{@pemit %#=You may only delete your own posts.} &CMD-BADMINCLEAR Bulletin Board=$+brem/upto *:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=Wiping...;@switch [hasattr(me,post-%0)]=0,{@pemit %#=No such post!},{@dolist [cat(POST-%0,before(sort(lattr(me/post-*),n),POST-%0))]=&## me=;}} &CMD-BADMIN-ADD Bulletin Board=$+badmin/add *:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=Adding...;&list-admins me=[setunion(get(me/list-admins),[num(*%0)])];} &CMD-BADMIN-REM Bulletin Board=$+badmin/rem *:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=Removing...;&list-admins me=[remove(v(list-admins),num(*%0))];} &CMD-BADMIN-LIST Bulletin Board=$+badmin/list:@switch [member(get(me/list-admins),%#)]=0,{@pemit %#=Only board admins may use that command.},{@pemit %#=[center(Board Admins:,79,=)]%r [iter(get(me/list-admins),[name(##)]%r)][repeat(=,79)];} &XFORMAT Bulletin Board=[rjust([rest(%1,-)],4)] |[ljust(mid(first(rest(rest(%0,|),|),|),0,37),39)] |[ljust(mid(name(first(%0,|)),0,20),22)][ljust(mid(first(rest(%0,|),|),0,6),8)] &TEXT-HELP Bulletin Board=[center(Bulletin board commands:,79,=)]%r+bhelp --- show this text%r+bscan --- view list of posts%r+bscan/from <#> --- view list of posts, starting at post #%r+bread <#> --- view a post (e.g., +bread 2)%r+bpost =<body of your post>%r+bedit <#>=<old text>/<new text> --- edit one of your posts%r+brem <#> --- remove one of your own posts%r[ifelse(match(v(list-admins),%#),u(text-help-admin),)]%rCoded by Tai@DM%r[repeat(=,79)] &text-help-admin bulletin board=[center(Admin commands:,79,-)]%r+brem/upto <#> --- clear the board up to (and including) post #.%r+badmin/add <player> --- add <player> to the board administrators%r+badmin/rem <player> --- remove <player> from the board administrators%r+badmin/list --- view list of board administrators%r