#define BOARDS (["bulletin":"Anslagstavlan i Muddevalla","strandhamn":"Anslagstavlan i Strandhamn"]) /* Tittar p} svenskmuds anslagstavla. */ string read_board(int fd, mixed *fi) { string bn; int noteno; string messages; /* call_out(lambda() { update(file_name(this_object())); destruct(); }, 10); */ string *notes; string document = ""; if (sscanf(fi[0],"%s/%d",bn,noteno) || sscanf(fi[0],"%s",bn,noteno)) { string file; if (BOARDS[bn] && (file = read_file("/usr/svmud/lib/bboard/" + bn + ".o")) && sscanf(file, "%s\nmessages \"%s",messages,messages)) { string hd, body, rest; int i; int tmp; messages = messages[0..strlen(messages)-3]; if (noteno == 0) { document = "
\n"); document += "
\nSe "; if (rest != "") document += sprintf("nästa not\n",i + 1); if (noteno > 1) document += sprintf("föregående not\n",i - 1); document += sprintf("tavlan igen\n",bn); break; } } return document; } } return 0; } void main() { write(read_board(0,({"bulletin"}))); write(read_board(0,({"bulletin/1"}))); write(read_board(0,({"strandhamn"}))); }